Agent skill
kirby-headless-api
Exposes Kirby content to headless clients using the API, KQL, and JSON representations. Use when building API endpoints, KQL queries, or headless frontends.
Install this agent skill to your Project
npx add-skill https://github.com/bnomei/kirby-mcp/tree/main/skills/kirby-headless-api
SKILL.md
Kirby Headless API
KB entry points
kirby://kb/scenarios/44-headless-api-with-kqlkirby://kb/scenarios/02-json-content-representation-ajax-load-morekirby://kb/scenarios/45-headless-kiosk-applicationkirby://kb/scenarios/28-figma-auto-populate
Required inputs
- Consumers and auth requirements.
- Public vs private content boundaries.
- Response shape and caching policy.
- Preferred approach (KQL, representations, or routes).
Default delivery choices
- Use
.jsonrepresentations for page-backed responses. - Use KQL for cross-collection queries and filtered datasets.
- Use routes for non-page or composite endpoints.
Default response envelope
{
"status": "ok",
"data": {}
}
Caching rule
- Public endpoints: set
Cache-Controlwith a short max-age. - Authenticated endpoints: disable caching.
Common pitfalls
- Exposing private fields or drafts in JSON output.
- Caching authenticated responses.
Verification checklist
- Confirm auth requirements and public/private boundaries.
- Validate JSON output for required fields.
Workflow
- Clarify consumers, authentication, and which content is public vs private.
- Call
kirby:kirby_initand readkirby://config/apito confirm API settings. - Check plugin availability for KQL:
kirby:kirby_plugins_index. - If you need custom endpoints, inspect existing routes with
kirby:kirby_routes_index(install runtime if needed). - Search the KB with
kirby:kirby_search(examples: "headless api with kql", "json content representation", "figma auto populate", "headless kiosk"). - Use
kirby:kirby_onlineto fetch official API/KQL docs when KB coverage is insufficient. - Implement:
- enable API auth (
api.basicAuth) when required - create or update KQL queries for
/api/query - add
.jsonrepresentations for template-backed JSON
- enable API auth (
- Verify:
- request
/api/querywith Basic Auth - render
.jsonrepresentations withkirby:kirby_render_page(contentType: json)
- request
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
kirby-i18n-workflows
Manages Kirby multi-language workflows, translations, and localized labels. Use when dealing with languages, translation keys, placeholders, or importing/exporting translations.
kirby-security-and-auth
Secures Kirby sites with access restriction, user roles, permissions, and protected downloads. Use when implementing login/role-based access, permissions, or file protection.
kirby-performance-and-media
Improves Kirby performance and media delivery (cache tuning, CDN, responsive images, lazy loading). Use when optimizing page speed, caching, or image handling.
kirby-panel-and-blueprints
Designs Kirby blueprints and Panel UI, including blueprint reuse/extends, programmable blueprints, and custom Panel fields/sections/areas. Use when changing the Panel experience or schema.
kirby-upgrade-and-maintenance
Upgrades Kirby and maintains dependencies safely using composer audit, plugin compatibility checks, and official docs. Use when updating Kirby versions or making maintenance changes that affect runtime.
kirby-debugging-and-tracing
Diagnoses Kirby rendering/runtime issues using MCP runtime rendering, dump traces, and template/snippet/controller indexes. Use when outputs are wrong, errors occur, or tracing execution paths is required.
Didn't find tool you were looking for?