MCP server
local-cert's features are exposed to AI agents through an MCP server at POST /api/mcp (Streamable HTTP transport, stateless).
Authentication
Same as the API: Authorization: Bearer <API key or JWT>, with the same scopes. The console session cookie is not accepted there. See the API reference for keys and scopes.
claude mcp add --transport http local-cert https://certs.example.com/api/mcp \
--header "Authorization: Bearer lc_..."{
"mcpServers": {
"local-cert": {
"type": "http",
"url": "https://certs.example.com/api/mcp",
"headers": { "Authorization": "Bearer ${LOCAL_CERT_API_KEY}" }
}
}
}Tools
| Tool | REST equivalent | Required scope |
|---|---|---|
whoami | — | valid key |
list_certificates | GET /api/v1/certificates | grant on the domain |
request_certificate | POST /api/v1/certificates | cert:issue (+ dns:write for an A record) |
get_certificate | GET /api/v1/certificates/{id} | cert:read |
get_certificate_events | GET …/{id}/events | cert:read |
get_certificate_bundle | GET …/{id}/bundle | cert:read (+ cert:export for the key) |
renew_certificate | POST …/{id}/renew | cert:renew |
update_certificate_metadata | PATCH /api/v1/certificates/{id} | cert:issue |
revoke_certificate | DELETE /api/v1/certificates/{id} | cert:revoke |
check_subdomain | GET /api/v1/subdomains/{fqdn} | cert:read |
list_dns_records | GET /api/v1/dns/records | dns:read |
upsert_dns_record | PUT /api/v1/dns/records | dns:write |
delete_dns_record | DELETE /api/v1/dns/records | dns:write |
get_acme_account | GET /api/v1/acme/account | valid key |
admin_get_stats | GET /api/admin/stats | admin key |
admin_list_providers | GET /api/admin/providers | admin key |
admin_list_domains / admin_create_domain / admin_delete_domain | /api/admin/domains | admin key |
admin_list_api_keys / admin_create_api_key / admin_update_api_key / admin_delete_api_key | /api/admin/keys | admin key |
Non-admin tools call the matching REST handler in the same process, with the caller's Authorization header: authentication, scopes, validation and the audit log are the API's, by construction. A key can do nothing more over MCP than with curl.
Admin tools
The admin_* tools are listed and usable only for an admin key. This is the only difference from REST, where /api/admin/* only accepts the console session: here an admin key can manage domains and keys. Before each admin call the key is re-read from the database — so a JWT issued from an admin key that has since been revoked or downgraded is refused immediately, without waiting for it to expire.
Not exposed
/api/setup, /api/admin/session, /api/v1/auth/token, /api/healthz, /api/openapi.json (bootstrapping and transport, irrelevant to an agent) and the SSE event stream.
Skills
The server ships its own instructions for use, in SKILL.md format:
| Skill | Covers | Visible to |
|---|---|---|
local-cert-getting-started | permissions, errors, whoami, skills | everyone |
local-cert-certificates | a certificate's lifecycle | everyone |
local-cert-dns | subdomain availability, records | everyone |
local-cert-admin | domains, API keys, statistics | admin keys |
Two equivalent ways in: the list_skills / get_skill tools, and the MCP resources skill://local-cert/<name>. The text explains how calls chain together and the pitfalls; each tool's reference (purpose, scope, arguments) is generated from the tool catalog (src/lib/mcp/tools.ts), so it cannot diverge from what the server actually exposes.