curl --request POST \
--url https://{host}/v2/workspaces/slug:storage/webhooks/v1/knowledge_bases/{knowledgeBaseId}/mcp \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "tools/list"
}
'{
"jsonrpc": "2.0",
"id": "<string>",
"result": {},
"error": {
"code": 123,
"message": "<string>"
}
}MCP endpoint (agentic filesystem access)
Per-knowledge-base Model Context Protocol endpoint (JSON-RPC 2.0, MCP spec
2025-06-18). Gives agents deterministic, filesystem-style access to this
base’s content, complementary to semantic /search. The knowledge_base_id
is fixed by the URL and injected into every tool call, so an agent connected
here can only read THIS base and never passes the id itself. Access control
reuses the same middleware as the REST routes; content returned by the tools
is redacted from execution events.
Nine tools are exposed via tools/list and tools/call: kb_search
(semantic top-k), kb_ls (list documents), kb_find (find by name),
kb_cat (read a full document, chunks reassembled and de-duplicated),
kb_grep (pattern search with line numbers, literal by default), kb_head
and kb_tail (first and last N lines), kb_sed (output-only substitution,
never persisted) and kb_source_url (resolve a citation link).
Transport: POST only. A GET (SSE stream probe) returns 405; this endpoint does not offer server-streaming.
curl --request POST \
--url https://{host}/v2/workspaces/slug:storage/webhooks/v1/knowledge_bases/{knowledgeBaseId}/mcp \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "tools/list"
}
'{
"jsonrpc": "2.0",
"id": "<string>",
"result": {},
"error": {
"code": 123,
"message": "<string>"
}
}Authorizations
User session JWT or instance API key (iak_*). Send as Authorization: Bearer <token>.
Path Parameters
Knowledge base id. Legacy physical prefix vs_ (the kb_ rename is deferred).
128^vs_[A-Za-z0-9-]+$Body
A single JSON-RPC 2.0 request (initialize, tools/list, or tools/call).
2.0 initialize, notifications/initialized, tools/list, tools/call Request id echoed back in the response. Omit for notifications.
For tools/call: { name, arguments } where name is one of the
nine tools and arguments carries that tool's parameters. The
knowledge_base_id is injected from the path and must not be sent.
Response
JSON-RPC 2.0 response envelope. Tool results follow the MCP
CallToolResult shape (content[], structuredContent, isError).
Was this page helpful?