MCP Server

Expose Waystone's tools directly inside your AI editor via the Model Context Protocol.

Overview

The Waystone MCP server runs locally and exposes four tools to any MCP-compatible client:

  • waystone_query — retrieve facts from a project most relevant to a task description
  • waystone_extract — extract structured facts from a text snippet and merge them into a project
  • waystone_stats — return node counts and graph statistics for a project
  • waystone_list_projects — list all available projects

Your editor calls these tools automatically as context, or you can invoke them explicitly during a session. No API keys are required — the server reads your local ~/.waystone/config.yaml directly.

Starting the server

Run the MCP server from your terminal:

waystone mcp-serve

Or use the dedicated entry point (useful for process managers and editor launch configs):

waystone-mcp

The server communicates over stdio by default, which is the mode all major editors expect. It stays running in the foreground — open a new terminal for other work, or configure your editor to launch it automatically (recommended).

Project detection: When no project is specified, Waystone auto-detects the project from the current working directory passed by the editor. If you always work in one project, scope it explicitly with --project to skip detection.

Claude Code

Add Waystone to your Claude Code MCP config. Open or create ~/.claude/settings.json:

{
  "mcpServers": {
    "waystone": {
      "command": "waystone",
      "args": ["mcp-serve"],
      "env": {}
    }
  }
}

Restart Claude Code. You'll see waystone_query, waystone_extract, waystone_stats, and waystone_list_projects listed in the available tools. Claude will call waystone_query automatically at the start of sessions where memory is relevant.

Per-project config

To scope the server to a specific project, set it in the project-level .claude/settings.json:

{
  "mcpServers": {
    "waystone": {
      "command": "waystone",
      "args": ["mcp-serve", "--project", "my-project"]
    }
  }
}

Zero-friction hooks

Add hooks to ~/.claude/settings.json so Waystone context is automatically injected before every prompt — no manual tool calls required.

{
  "mcpServers": {
    "waystone": {
      "command": "waystone",
      "args": ["mcp-serve"]
    }
  },
  "hooks": {
    "UserPromptSubmit": [
      {
        "matcher": "",
        "hooks": [{
          "type": "command",
          "command": "waystone last-context --raw"
        }]
      }
    ],
    "Stop": [
      {
        "matcher": "",
        "hooks": [{
          "type": "command",
          "command": "waystone extract --from-session --delta"
        }]
      }
    ]
  }
}

UserPromptSubmit — injects the last queried Waystone context before each prompt. Stop — automatically extracts facts from the session when Claude finishes responding. Together these give you full automatic memory with no manual intervention.

Agent instructions (CLAUDE.md)

Add to your project's CLAUDE.md or system prompt so Claude knows to actively use memory:

## Memory (Waystone)
At the start of each session, call waystone_query with a description of the current task.
After completing significant work or before ending a session, call waystone_extract with
a summary of what was built, decided, or changed.
Do not write to MEMORY.md — use Waystone tools instead.

Cursor

Open Cursor → Settings → MCP or create ~/.cursor/mcp.json:

{
  "mcpServers": {
    "waystone": {
      "command": "waystone",
      "args": ["mcp-serve"]
    }
  }
}

Reload Cursor. The tools appear in the Model Context panel and are available to the Cursor AI in Composer and Chat.

Windsurf

Open Windsurf → Settings → Extensions → MCP and add:

{
  "waystone": {
    "command": "waystone",
    "args": ["mcp-serve"]
  }
}

Save and restart the AI engine. Waystone tools will be available to Cascade.

Continue.dev

Open or create ~/.continue/config.yaml (global) or .continue/config.yaml in your project root:

mcpServers:
  - name: waystone
    command: waystone
    args:
      - mcp-serve

If you're using the JSON format (~/.continue/config.json), add an mcpServers array:

{
  "mcpServers": [
    {
      "name": "waystone",
      "command": "waystone",
      "args": ["mcp-serve"]
    }
  ]
}

Reload the Continue extension. The tools appear in the context panel and are available in Chat and Edit modes.

OpenClaw

Add to your openclaw.json configuration file:

{
  "mcpServers": {
    "waystone": {
      "command": "waystone",
      "args": ["mcp-serve"],
      "env": {
        "WAYSTONE_PROJECT": "my-project"
      }
    }
  }
}

OpenClaw uses a MEMORY.md convention by default. Waystone replaces this with a persistent structured graph. To migrate:

  1. Import your existing MEMORY.md into Waystone: waystone extract my-project MEMORY.md
  2. Update your agent instructions: replace "write to MEMORY.md" with "call waystone_extract"
  3. Add session-start instruction: "call waystone_query with a description of the current task"

See the full OpenClaw integration guide for a complete agent instructions template and MEMORY.md migration walkthrough.

Cline

Cline stores MCP config in VS Code's extension storage. Open or create:

~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

On Windows: %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json

{
  "mcpServers": {
    "waystone": {
      "command": "waystone",
      "args": ["mcp-serve"],
      "env": {
        "WAYSTONE_PROJECT": "my-project"
      }
    }
  }
}

Restart Cline. The MCP tools appear in the Cline panel. Cline will call waystone_query automatically when you describe a task that references prior context.

Zed

Open your Zed settings (Zed → Settings → Open Settings or Cmd ,) and add a context_servers block:

{
  "context_servers": {
    "waystone": {
      "command": "waystone",
      "args": ["mcp-serve"]
    }
  }
}

Save the settings file. Zed will start the Waystone context server automatically and make its tools available in the Assistant panel.

Codex

OpenAI Codex CLI stores its MCP config at ~/.codex/config.yaml. Add an mcpServers block:

mcpServers:
  waystone:
    command: waystone
    args:
      - mcp-serve
    env:
      WAYSTONE_PROJECT: my-project

Save the file and restart Codex. The waystone_query, waystone_extract, waystone_stats, and waystone_list_projects tools will appear in the Codex tool list.

To use the hosted API, add the optional env vars:

mcpServers:
  waystone:
    command: waystone
    args:
      - mcp-serve
    env:
      WAYSTONE_PROJECT: my-project
      WAYSTONE_API_KEY: your-api-key
      WAYSTONE_REMOTE_URL: https://api.waystone.unbidden.ai

Recommended agent instructions to add to your Codex system prompt or AGENTS.md:

## Memory (Waystone)
At the start of each session, call waystone_query with a description of the
current task to retrieve relevant context from prior sessions.

After completing significant work, call waystone_extract with a summary of
what was built, decided, or changed. Waystone will structure and store the
facts automatically.

Aider

Create or edit ~/.aider/mcp.json (global) or .aider/mcp.json in your project root:

{
  "mcpServers": {
    "waystone": {
      "command": "waystone",
      "args": ["mcp-serve"],
      "env": {
        "WAYSTONE_PROJECT": "my-project"
      }
    }
  }
}

Launch Aider with the config:

aider --mcp-config ~/.aider/mcp.json

Or add to .aider.conf.yml to apply automatically in the project:

mcp-config: .aider/mcp.json

See the full Aider integration guide for system prompt instructions and project initialization.

Gemini CLI

Open or create ~/.gemini/settings.json and add an mcpServers block:

{
  "mcpServers": {
    "waystone": {
      "command": "waystone",
      "args": ["mcp-serve"],
      "env": {
        "WAYSTONE_PROJECT": "my-project"
      }
    }
  }
}

Restart Gemini CLI. The Waystone tools will appear in the available tool list.

See the full Gemini CLI integration guide for system prompt instructions and GEMINI.md migration.

Tool reference

waystone_query

Retrieve facts relevant to a task description. This is the primary tool — call it at the start of a session or whenever you need to recall past decisions.

waystone_query(task, project?, cwd?, hops?, top_k?)
Param Type Default Description
task string required Natural-language task description or question
project string auto-detect Project name to query. Auto-detected from cwd if omitted.
cwd string null Working directory for project auto-detection
hops number 3 BFS traversal depth for graph expansion
top_k number 25 Maximum number of facts to return

waystone_extract

Extract structured facts from a text snippet and store them in the project graph. Use this at the end of a session to persist what was decided or learned.

waystone_extract(text, project?, cwd?, source_name?, verify?)
Param Type Default Description
text string required Raw text to extract facts from (transcript, notes, etc.)
project string auto-detect Project to store facts in. Auto-detected from cwd if omitted.
cwd string null Working directory for project auto-detection
source_name string "mcp_extract" Label for the source (e.g. "session-2026-04-24")
verify boolean false Run a second verification pass to catch missed facts

waystone_stats

Return node counts and graph statistics for a project. Useful for confirming extraction succeeded or understanding what's in memory.

waystone_stats(project?, cwd?)
Param Type Default Description
project string auto-detect Project name. Auto-detected from cwd if omitted.
cwd string null Working directory for project auto-detection

waystone_list_projects

List all projects in ~/.waystone/projects/. Takes no parameters.

waystone_list_projects()

Troubleshooting

Tools don't appear in my editor

Make sure waystone is on your PATH. Run which waystone in a terminal. If it's not found, reinstall with python3.13 -m # CLI in early access — request at unbidden.ai and confirm your Python bin directory is in PATH. Also make sure you are using Python 3.13 — Waystone will not install correctly on 3.14+.

waystone_query returns no results

The project may be empty or not yet initialized. Run waystone list in a terminal to see what projects exist and how many nodes they contain. If the project is empty, run waystone extract <project> <file> or waystone onboard <project> to populate it.

waystone_extract fails with model errors

Check that ~/.waystone/config.yaml has a valid API key for your configured model. Gemini Flash requires a GEMINI_API_KEY env var or an api_key under the llm: section in config. See the configuration reference for details.

Project auto-detection picks the wrong project

Auto-detection matches the current working directory to a project name by path fragment. Pass project explicitly to override it, or use waystone mcp-serve --project my-project to pin a single project for the entire server session.