PENDINGAWAITING LINK
--:--:--

MCP Integration Reference

MCP · AGENT INTEGRATIONS
OAUTH

Kannaka Command Center exposes a Model Context Protocol (MCP) server so external AI clients (ChatGPT, Claude, Cursor, Codex) can inspect the canonical NATS subject space and sample live telemetry as the signed-in operator.

Endpointhttps://nats.ninja-portal.com/mcp
TransportStreamable HTTP (POST + SSE)
AuthOAuth 2.1 (Supabase issuer)
Toolslist_subjects · whoami · capture_messages
AGENT AUTH DIAGNOSTICS
IDLE

Paste a provisioned client_id and client_secret to run the full agent → JWT → JWKS → MCP handshake. Every step reports what failed and how to fix it, so you can distinguish a wrong secret from a JWKS mismatch from an audience mismatch.

Credentials are used only in this browser to make the same HTTPS calls an external agent would make. They are never sent to Kannaka's own servers except as the standard OAuth Basic header on the token request.

·1. Request agent token (client_credentials)PENDING
·2. Decode JWT claimsPENDING
·3. Fetch merged JWKSPENDING
·4. Verify token kid is published in JWKSPENDING
·5. Verify audience binds to /mcpPENDING
·6. MCP initialize handshakePENDING
·7. MCP tools/listPENDING
CONNECT

Add the server URL in your client's connectors panel:

https://nats.ninja-portal.com/mcp

You'll be redirected to Kannaka to sign in and approve access. Tools then run as your operator identity — capture_messagessubscribes using your kannaka_internal NATS session.

TOOL · list_subjects
read-onlyidempotent
List canonical NATS subjects

Return the Kannaka NATS subject allowlist (consciousness, presence, memory, radio, OODA, etc.) used by this command center. Read-only, idempotent.

Input schema
{}  // no arguments
Example request (JSON-RPC)
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": { "name": "list_subjects", "arguments": {} }
}
Example response
{
  "content": [
    { "type": "text", "text": "[\n  \"KANNAKA.consciousness\",\n  \"KANNAKA.hemi.L\",\n  \"KANNAKA.hemi.R\",\n  \"QUEEN.phase.observe\",\n  \"KANNAKA.events.memory.>\"\n]" }
  ],
  "structuredContent": {
    "subjects": [
      "KANNAKA.consciousness",
      "KANNAKA.hemi.L",
      "KANNAKA.hemi.R",
      "QUEEN.phase.observe",
      "KANNAKA.events.memory.>"
    ]
  }
}
TOOL · whoami
read-onlyidempotent
Identify signed-in operator

Return the OAuth-authenticated operator's Supabase user id, email, and OAuth client id as seen by this MCP server. Useful to confirm the connected session.

Input schema
{}  // no arguments
Example request (JSON-RPC)
{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": { "name": "whoami", "arguments": {} }
}
Example response
{
  "content": [
    { "type": "text", "text": "{\n  \"userId\": \"3f0c…\",\n  \"email\": \"operator@kannaka.dev\",\n  \"clientId\": \"claude-desktop\"\n}" }
  ],
  "structuredContent": {
    "userId": "3f0c8b12-…",
    "email": "operator@kannaka.dev",
    "clientId": "claude-desktop"
  }
}
TOOL · capture_messages
liveboundedopen-world
Capture NATS messages

Open a short-lived NATS connection using the operator's kannaka_internal credentials, subscribe to a subject pattern (NATS wildcards * and > supported), collect messages for a bounded time window, and return them.

Input schema
{
  "subject":     string   // e.g. "KANNAKA.consciousness" or "QUEEN.phase.*"
  "durationMs":  integer  // 100 – 5000, default 2000
  "maxMessages": integer  // 1 – 200,   default 50
}
Example request (JSON-RPC)
{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "tools/call",
  "params": {
    "name": "capture_messages",
    "arguments": {
      "subject": "KANNAKA.hemi.>",
      "durationMs": 2000,
      "maxMessages": 20
    }
  }
}
Example response
{
  "content": [
    { "type": "text", "text": "{ \"subject\": \"KANNAKA.hemi.>\", \"count\": 3, … }" }
  ],
  "structuredContent": {
    "subject": "KANNAKA.hemi.>",
    "durationMs": 2000,
    "count": 3,
    "messages": [
      {
        "subject": "KANNAKA.hemi.L",
        "ts": 1780000000123,
        "size": 42,
        "payload": { "coherence": 0.81, "arousal": 0.44 }
      },
      {
        "subject": "KANNAKA.hemi.R",
        "ts": 1780000000456,
        "size": 40,
        "payload": { "coherence": 0.79, "arousal": 0.47 }
      },
      {
        "subject": "KANNAKA.hemi.L",
        "ts": 1780000001100,
        "size": 42,
        "payload": { "coherence": 0.83, "arousal": 0.45 }
      }
    ]
  }
}
ERRORS
401 · Not authenticatedSign in again from the client's connector panel.
NATS_WS_URL not configuredServer env missing — contact operator.
NATS error: …Connection or subscription failed; try a narrower subject.