Skip to content

Connect MCP clients

sklad serves MCP over Streamable HTTP at /mcp. Any MCP client that speaks that transport can connect; this page covers Claude Code, Claude.ai, and a raw curl session for debugging.

  1. Register the server. Put --header after the name and URL: it takes several values and would otherwise swallow them.

    Terminal window
    claude mcp add --transport http sklad http://127.0.0.1:8080/mcp \
    --header "Authorization: Bearer kbsk_…"
  2. Check the registration with claude mcp list, then ask Claude Code to search your knowledge base. The tools appear under their MCP names, such as kb_search and kb_edit.

Grant the token kb:read,kb:write if Claude Code should also write notes.

Claude.ai connects as a custom connector, which needs a public HTTPS URL and OAuth 2.1:

  1. Deploy sklad behind TLS, see Deploy with Docker Compose.
  2. Enable OAuth with an identity provider, see Enable OAuth 2.1.
  3. In Claude.ai, add a custom connector with the URL https://kb.example.com/mcp. Claude.ai discovers the identity provider and runs the sign-in in your browser.

A raw session helps when a client fails and you need to see the server’s answers. Requests are JSON-RPC over POST; responses arrive as server-sent events, so every request needs Accept: application/json, text/event-stream (without it the server answers 406).

Terminal window
TOKEN="kbsk_…"
BASE=http://127.0.0.1:8080/mcp
H=(-H "Authorization: Bearer $TOKEN"
-H 'Content-Type: application/json'
-H 'Accept: application/json, text/event-stream')
# 1. Initialize, and keep the session ID from the response headers
curl -sS "$BASE" "${H[@]}" -D headers.txt -d '{"jsonrpc":"2.0","id":1,
"method":"initialize","params":{"protocolVersion":"2025-03-26",
"capabilities":{},"clientInfo":{"name":"curl","version":"0"}}}'
SESSION=$(grep -i '^Mcp-Session-Id:' headers.txt | tr -d '\r' | cut -d' ' -f2)
# 2. Confirm initialization
curl -sS "$BASE" "${H[@]}" -H "Mcp-Session-Id: $SESSION" \
-d '{"jsonrpc":"2.0","method":"notifications/initialized"}'
# 3. List the tools
curl -sS "$BASE" "${H[@]}" -H "Mcp-Session-Id: $SESSION" \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}'
# 4. Call kb_ping
curl -sS "$BASE" "${H[@]}" -H "Mcp-Session-Id: $SESSION" \
-d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"kb_ping"}}'

The initialize response carries "serverInfo":{"name":"sklad",…} and the server’s instructions, which describe the tools and the knowledge base’s conventions. kb_ping answers with ok, the server time, and the server version.

The tool list includes every tool whatever the token’s scopes; calling a tool outside them fails with error -32001. The MCP tools reference describes each tool.