Get the FREE Ultimate OpenClaw Setup Guide →

personal-kg

Personal Knowledge Graph MCP Server - Decision intelligence for multi-agent workflows

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio tomschell-personal-kg-mcp node node_modules/@tomschell/personal-kg-mcp/dist/server.js \
  --env PKG_USE_ANN="true" \
  --env PKG_STORAGE_DIR=".kg" \
  --env PKG_MCP_CAPTURE_AUTO="true" \
  --env PKG_MCP_CAPTURE_TOOLS="github" \
  --env PKG_AUTO_BACKUP_MINUTES="0" \
  --env PKG_MCP_CAPTURE_ENABLED="true" \
  --env PKG_MCP_CAPTURE_EXCLUDE="" \
  --env PKG_GITHUB_INTEGRATION_ENABLED="true"

How to use

Personal KG as an MCP server enables automatic capture and retrieval of decision context within your multi-agent workflows. When enabled, the server auto-captures MCP tool calls, stores reasoning, alternatives, and constraints, and exposes commands to search, summarize, and link context across sessions. Essential tools include session warmup (kg_session_warmup), capture (kg_capture), session summaries (kg_capture_session), semantic search (kg_search), a project state overview (kg_get_project_state), context retrieval (kg_get_relevant_context), open questions tracking (kg_open_questions), and graph operations (kg_edges) for linking decisions. To use it, ensure the MCP configuration is declared in your client (e.g., .cursor/mcp.json) and restart your MCP client so the Personal KG tools become available at session startup. You can then begin capturing decisions and querying context to maintain a traceable reasoning trail across agents and tools.

How to install

Prerequisites:

  • Node.js (supported versions as per the package requirements)
  • npm or pnpm to install packages
  1. Install the MCP server package
npm install @tomschell/personal-kg-mcp
  1. Configure MCP Server in your project

Create or edit your MCP config file (e.g., .cursor/mcp.json) to register the server:

{
  "mcpServers": {
    "personal-kg-mcp": {
      "command": "node",
      "args": [
        "node_modules/@tomschell/personal-kg-mcp/dist/server.js"
      ],
      "cwd": "/path/to/your/project",
      "env": {
        "PKG_STORAGE_DIR": ".kg",
        "PKG_AUTO_BACKUP_MINUTES": "0",
        "PKG_USE_ANN": "true",
        "PKG_GITHUB_INTEGRATION_ENABLED": "true",
        "PKG_MCP_CAPTURE_ENABLED": "true",
        "PKG_MCP_CAPTURE_TOOLS": "github",
        "PKG_MCP_CAPTURE_EXCLUDE": "",
        "PKG_MCP_CAPTURE_AUTO": "true"
      }
    }
  }
}
  1. Optional: set up authentication and integration
  • Create a GitHub personal access token
  • Add to a .env file: PKG_GITHUB_TOKEN=your_token
  • Or export PKG_GITHUB_TOKEN in your environment
  1. Restart your MCP client
  • After adding or modifying the MCP configuration, restart the MCP client (Cursor, Claude Desktop, etc.) for the tools to be loaded at session startup.

Additional notes

Tips and caveats:

  • MCP servers are loaded at session startup; after config changes, you must restart the client to apply changes.
  • Environment variables control storage location, embedding, and integrations; configure PKG_STORAGE_DIR to your preferred path for the knowledge graph data.
  • If you use GitHub integration, ensure PKG_GITHUB_TOKEN is securely stored (e.g., in .env, not in version control).
  • The capture features can be tuned with PKG_MCP_CAPTURE_ENABLED, PKG_MCP_CAPTURE_TOOLS, and PKG_MCP_CAPTURE_AUTO to balance coverage and performance.
  • For security, limit exposure of tokens and consider using conductor/workspaces if you have 1Password managed env files.

Related MCP Servers

Sponsor this space

Reach thousands of developers ↗