Skip to main content
KiwiFS ships a built-in MCP server. Agents get the same operations as the REST API and web UI — read, write, search, query, restructure — as typed tools, and every write goes through the same pipeline (git commit, index update, live events).

Choose a mode

The MCP server runs with one of two backends and one of two transports.
  • In-process opens the directory directly. Use it for a single local agent.
  • Proxy talks to a running KiwiFS server over REST, so the agent shares the server’s index, live events, and auth. Use it when the web UI or other agents work on the same knowledge base.
  • kiwifs serve always mounts Streamable HTTP MCP at /mcp on the main port, next to the REST API. No extra process or flag is needed.
Terminal
--root and --remote are mutually exclusive, and exactly one is required. --space only applies with --remote. --port (default 8181) requires --http. See kiwifs mcp for every flag.

Authentication

  • Proxy mode sends --api-key to the server as Authorization: Bearer <key>.
  • HTTP transport requires Authorization: Bearer <key> when the knowledge base’s .kiwi/config.toml sets [auth] type = "apikey". The key is [auth] api_key. Without API-key auth, the HTTP endpoint is open.
Put remote HTTP MCP behind TLS, and enable API-key auth before exposing it beyond localhost. MCP tools can write, delete, and restructure pages.

Connect a client

Terminal
To share the setup with your team, commit a .mcp.json at the project root with the same mcpServers block shown in the Cursor tab.
For KiwiFS Cloud workspaces, kiwifs connect <workspace> prints or writes this config for you. See KiwiFS Cloud.

First calls

A good session starts with kiwi_context. It returns the schema, agent playbook, index, and rules in one call. From there:
  1. Find pages with kiwi_brief (one token-budgeted context pack) or kiwi_search_hybrid.
  2. Skim with kiwi_peek before paying for a full kiwi_read.
  3. Write with kiwi_write, passing if_match (the ETag from kiwi_read) so you never overwrite someone else’s edit.
  4. Verify with kiwi_lint.
Write tools accept an optional actor (default mcp-agent) that is recorded in the git commit.

Tool reference

The server registers 78 tools. Every name is invoked exactly as listed. Parameters marked with * are required.
Move, merge, split, retag, and edit many pages in one reviewed commit without breaking links. See Restructuring.
Canvas generate, patch, query, and auto-layout are REST-only. See Canvas API.

Resources

Read-only MCP resources:

Restructuring

Move and merge pages without breaking links.

Agent interface

How MCP fits next to REST and filesystem mounts.

Agent playbook

What kiwi_context returns and how to steer agents.

CLI: kiwifs mcp

Every flag for the MCP server command.
Last modified on October 19, 2026