Skip to content

MCP Server

PieKBS exposes KB tools via the MCP protocol. Two transport modes are supported.

One PieKBS process shared by all agents — Claude Code, Cursor, VS Code (Copilot), Windsurf, and others.

Start PieKBS:

bash
export PIEKBS_KB=/path/to/piekbs-kb
piekbs serve

Configure each agent:

json
{
  "mcpServers": {
    "piekbs": {
      "type": "http",
      "url": "http://127.0.0.1:8766/mcp",
      "headers": {
        "x-api-key": "${PIEKBS_API_KEY}"
      }
    }
  }
}

x-api-key corresponds to server.api_key in config.yaml. Omit headers if no api_key is set.

stdio Mode

For hosted environments (Hermes, OpenClaw, etc.) where PieKBS runs as a subprocess.

json
{
  "mcpServers": {
    "piekbs": {
      "type": "stdio",
      "command": "/path/to/piekbs",
      "args": ["stdio"],
      "env": {
        "PIEKBS_KB": "/path/to/your-kb"
      }
    }
  }
}

The KB directory is created automatically on first launch. No manual init needed.

Available Tools

ToolDescription
kb_searchFTS keyword search, returns ranked results with related links
kb_pageFetch full page content by ID
kb_addAdd a text document to the KB; triggers incremental indexing and async distillation

Admin operations (status, reindex, lint) are available via the Web UI or CLI.

Released under the MIT License.