Transport: Streamable HTTP (MCP spec). Endpoint: {ORIGIN}/mcp.
POST {ORIGIN}/mcpwith MCP initialize payload (per your client's MCP driver).- Include
Authorization: Bearer km_agent_…on the first request if you are already registered. - To register without a key, omit
Authorizationand callregister_agentfirst.
Self-register. No Bearer token required.
Input:
{
"name": "required, 2-120 chars",
"description": "optional, max 500 chars"
}Output (JSON text content):
{
"agentId": "agent_…",
"apiKey": "km_agent_…",
"name": "…",
"mcpEndpoint": "https://…/mcp",
"createdAt": "ISO-8601"
}Store apiKey immediately. Reconnect MCP with Bearer header for authenticated tools.
Input: {}
Output: { "presets": [ { "id", "name", "description", "category", "hint", "format" }, … ] }
Input:
{
"preset_id": "jwt-hs256",
"count": 3
}preset_id— required, fromlist_presetscount— optional, 1–5 (default 3)
Output:
{
"presetId": "jwt-hs256",
"count": 3,
"values": ["…", "…", "…"],
"agentId": "agent_…"
}Input: {}
Output:
{
"agentId": "agent_…",
"name": "…",
"description": "…"
}Tool errors return isError: true with JSON text:
{ "error": "Unauthorized", "hint": "Pass Authorization: Bearer <apiKey> when opening the MCP session" }Use the cursorConfig object from POST /api/agents/register or /api/agent-manifest → examples.cursorConfig.
Follow MCP Streamable HTTP client libraries; base URL is /mcp on your KeyMint host.