AI agent

MCP server setup

`<vault>/.kition/mcp.json` configures stdio / SSE / HTTP servers; restart agent to apply.

What MCP is

Model Context Protocol (MCP) is an open protocol from Anthropic that lets AI agents reach external tools and data sources through a uniform interface — GitHub, Jira, Notion, your internal APIs.

Kition ships an MCP client, so any spec-compliant server slots in. Anything already on npm, on GitHub, or running inside your company plugs in directly — no Kition-specific adapter needed.

Three transports

  • stdio — spawn a subprocess and talk over stdin/stdout. Most common, ideal for local tools
  • sse — Server-Sent Events, for long-lived remote servers
  • http — plain HTTP request/response, fine for stateless servers

A full example config

{
  "mcpServers": {
    "github": {
      "transport": "stdio",
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": { "GITHUB_TOKEN": "$GITHUB_TOKEN" }
    },
    "postgres-readonly": {
      "transport": "stdio",
      "command": "uvx",
      "args": [
        "mcp-server-postgres",
        "postgres://reader@localhost:5432/analytics"
      ]
    },
    "internal-api": {
      "transport": "http",
      "url": "https://mcp.internal.example.com",
      "headers": {
        "Authorization": "Bearer $INTERNAL_MCP_TOKEN"
      }
    }
  }
}

How env vars are resolved

$NAME reads from your OS env; ${NAME:-fallback} provides defaults. For secrets, prefer Kition's Keychain integration: ${kition:secret:gh-token} pulls from the system keychain instead of landing in JSON.

After mounting

  • Restart the agent panel (or Settings → Agent → MCP → Reload)
  • Ask "what MCP tools do I have?" in chat to see the list
  • Tool names are prefixed by server — github:create_issue, postgres-readonly:query
  • Each server enters the permission model — allow / ask / deny independently

Debugging a broken server

Settings → Agent → MCP → Logs shows each server's startup log and protocol trace. stdio servers most often fail because PATH cannot find the command — use absolute paths or add PATH under env.

Remote-server 401 / 403 nearly always means token injection failed — run echo $TOKEN in the Bash tool to confirm the env propagated.

Related articles

Ready when you are.

Kition is a local-first AI workspace. Markdown documents, structured tables, and an AI agent — running on your own machine, against the model provider you choose.