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.
Prerequisites
Section titled “Prerequisites”- A running server, see Getting started. It listens on
http://127.0.0.1:8080by default. - A bearer token (
kbsk_…) or OAuth set up, see Authenticate MCP clients.
Claude Code
Section titled “Claude Code”-
Register the server. Put
--headerafter 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_…" -
Check the registration with
claude mcp list, then ask Claude Code to search your knowledge base. The tools appear under their MCP names, such askb_searchandkb_edit.
Grant the token kb:read,kb:write if Claude Code should also write notes.
Claude.ai
Section titled “Claude.ai”Claude.ai connects as a custom connector, which needs a public HTTPS URL and OAuth 2.1:
- Deploy sklad behind TLS, see Deploy with Docker Compose.
- Enable OAuth with an identity provider, see Enable OAuth 2.1.
- 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).
TOKEN="kbsk_…"BASE=http://127.0.0.1:8080/mcpH=(-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 headerscurl -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 initializationcurl -sS "$BASE" "${H[@]}" -H "Mcp-Session-Id: $SESSION" \ -d '{"jsonrpc":"2.0","method":"notifications/initialized"}'
# 3. List the toolscurl -sS "$BASE" "${H[@]}" -H "Mcp-Session-Id: $SESSION" \ -d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}'
# 4. Call kb_pingcurl -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.