Skip to content
local-cert
Browse the documentation

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 Code
claude mcp add --transport http local-cert https://certs.example.com/api/mcp \
  --header "Authorization: Bearer lc_..."
.mcp.json, or any MCP client that accepts an HTTP server
{
  "mcpServers": {
    "local-cert": {
      "type": "http",
      "url": "https://certs.example.com/api/mcp",
      "headers": { "Authorization": "Bearer ${LOCAL_CERT_API_KEY}" }
    }
  }
}

Tools

ToolREST equivalentRequired scope
whoami—valid key
list_certificatesGET /api/v1/certificatesgrant on the domain
request_certificatePOST /api/v1/certificatescert:issue (+ dns:write for an A record)
get_certificateGET /api/v1/certificates/{id}cert:read
get_certificate_eventsGET …/{id}/eventscert:read
get_certificate_bundleGET …/{id}/bundlecert:read (+ cert:export for the key)
renew_certificatePOST …/{id}/renewcert:renew
update_certificate_metadataPATCH /api/v1/certificates/{id}cert:issue
revoke_certificateDELETE /api/v1/certificates/{id}cert:revoke
check_subdomainGET /api/v1/subdomains/{fqdn}cert:read
list_dns_recordsGET /api/v1/dns/recordsdns:read
upsert_dns_recordPUT /api/v1/dns/recordsdns:write
delete_dns_recordDELETE /api/v1/dns/recordsdns:write
get_acme_accountGET /api/v1/acme/accountvalid key
admin_get_statsGET /api/admin/statsadmin key
admin_list_providersGET /api/admin/providersadmin key
admin_list_domains / admin_create_domain / admin_delete_domain/api/admin/domainsadmin key
admin_list_api_keys / admin_create_api_key / admin_update_api_key / admin_delete_api_key/api/admin/keysadmin 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:

SkillCoversVisible to
local-cert-getting-startedpermissions, errors, whoami, skillseveryone
local-cert-certificatesa certificate's lifecycleeveryone
local-cert-dnssubdomain availability, recordseveryone
local-cert-admindomains, API keys, statisticsadmin 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.