Knowledge MCP¶
Agents use the organization’s knowledge base through MCP
(ADR-0005: Knowledge as a Separate Service with an MCP Interface):
streamable HTTP at /mcp on the Knowledge service.
Authentication¶
Authorization: Bearer <run token> with audience knowledge. The
token’s organization selects the knowledge space; knowledge.read allows
the read tools, knowledge.write the write tools. Requests without a
valid token get 401; tool calls outside the token’s capabilities fail
with a tool error. Entries are recorded with the run’s subject as author.
Configuring an agent¶
For Claude Code (.mcp.json in the run’s workspace — the agent writes
it):
{"mcpServers": {"ballet-knowledge": {
"type": "http", "url": "http://knowledge:8081/mcp",
"headers": {"Authorization": "Bearer ${BALLET_RUN_TOKEN}"}}}}
Tools¶
Tool |
Input |
Result |
|---|---|---|
|
|
|
|
|
|
|
|
The full entry with |
|
|
The created entry |
|
|
The updated entry; a stale |
Trying it¶
TOKEN=$(bin/devtoken -keys data/token-keys.json -organization acme -project WEB \
-ticket WEB-1 -aud knowledge -caps knowledge.read,knowledge.write)
curl localhost:8081/mcp -H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call",
"params":{"name":"knowledge_search","arguments":{"query":"invoice export"}}}'