Skip to content
RAGRAF

Connecting an agent

Ready-made configurations for Claude Code, DeepSeek Harness, AutoClaw, Cline, Cursor and any MCP client — what to enter, where the file lives, how to verify the connection and which errors are typical.

Updated: 2026-11-10

The general rule #

An agent gets RAGRAF in two ways: MCP (tools inside the session) and CLI (a command the agent runs itself). Both reach the same code and give the same answer. MCP is more convenient in a dialogue, CLI — when you need exact JSON, a return code or work without an agent.

The MCP server is started by your agent as an ordinary process over stdio. Common to all clients:

FieldValue
commandthe interpreter from the RAGRAF installation's .venv (Windows: .venv\Scripts\python.exe)
argumentstools/ragraf-mcp.py --project <corpus config> --agent <name> --agent-kind <kind>
environmentPYTHONIOENCODING=utf-8, PYTHONUTF8=1 — if the client does not pass UTF-8 itself

Paths to the corpus config are absolute: most clients cannot set the working directory of the process, and a relative path will resolve somewhere else. If the config is unknown, --project may be omitted in clients that have the ragraf_use_project tool — but then the corpus is chosen by hand.

Claude Code #

Two paths, both work.

Plugin (the simplest, installed from the repository):

Text
/plugin marketplace add paulmann/RAGRAF
/plugin install ragraf@ragraf

Installer (when the hook, the skill and the rules are needed in one step):

PowerShell
python tools/install_claude_code.py            # install and verify
python tools/install_claude_code.py --check    # state only
python tools/install_claude_code.py --dry-run  # show what will be done
python tools/install_claude_code.py --remove   # remove (with backups)

The installer writes to four places, and each one is checkable: the MCP server in ~/.claude.json (scope user, added by the claude mcp add-json command rather than by editing the file), hooks in ~/.claude/settings.json (SessionStart, UserPromptSubmit, PreToolUse, Stop), rules in ~/.claude/CLAUDE.md, the skill in ~/.claude/skills/ragraf-core/. It widens permissions only for mcp__ragraf__*; it does not touch file editing or command execution.

Verification. claude mcp get ragraf → Connected. In the session: ask for ragraf_ensure (it should answer with status), then ragraf_search (it should return hits with path:line). The SessionStart hook adds a line with the corpus and the revision to the start of the session — if the line is missing, the hook was not picked up.

Typical errors. python is not found in PATH — the installer and the plugin look for the interpreter themselves, but a non-standard installation needs RAGRAF_PYTHON. The plugin is installed but RAGRAF is not — the plugin ships the wrapper, not the indexer: ragraf_launcher.py where will show what was found.

DeepSeek Harness (DSH) #

Connecting is done with the ragraf-dsh plugin, not by editing the profile:

PowerShell
python tools/install_dsh_plugin.py install --profile desktop
python tools/install_dsh_plugin.py check   --profile desktop   # state and instruction budget
python tools/install_dsh_plugin.py remove  --profile desktop   # rollback

The installer assembles $DSH_HOME\ragraf\hooks.json, installs the package into the profile with the native dsh plugin add command, removes the obsolete mcp-ragraf and hooks-shared entries and verifies the result with the same oracle as the client: dsh --profile desktop --dump-config.

Two constraints worth knowing in advance:

  • the hook configuration and the plugin layers are read once at start-up — after installation the

application must be restarted, otherwise there will be no hooks;

  • the profile's AGENTS.md is limited by the instruction budget (65 536 bytes): an oversized file is

discarded whole, and the rules never reach the model. install_dsh_plugin.py check prints the effective budget and the current size.

Verification. check should say that the entries are present, that the paths resolved into existing files and that the budget was raised. In the session — ragraf_ensure and ragraf_search, as in any client.

AutoClaw #

AutoClaw has two independent channels, and this matters: the CLI works immediately, MCP is added in the interface.

CLI channel (no configuration needed). The agent runs the command in a shell:

PowerShell
.venv\Scripts\python.exe tools\ragraf.py -p config\ragraf.yaml --json query symbol "Locale"

MCP channel (product interface: Settings → MCP servers → add a local program):

Interface fieldWhat to enter
NameRAGRAF (the identifier ragraf is derived from it)
TypeLocal program
Launch command.venv\Scripts\python.exe
Argumentstools/ragraf-mcp.py --project config\ragraf.yaml --agent AutoClaw --agent-kind autoclaw
Environment variablesempty

After saving — the Test button: expect Connected · N tools, where N is the number of tools in your build (currently 94). The tool names look like source_ragraf_ragraf_search to the model — that is normal, the source_ prefix is added by the host itself.

Why the environment is left empty. The host passes only an allow-list of variables to the child process (PATH, HOME, TEMP, SystemRoot, USERPROFILE and their relatives), and PYTHONUTF8 and PYTHONUSERBASE are not on it. RAGRAF enables UTF-8 for its own stdio, so there is no need to add the variables; a superfluous variable is one more reason for a start-up failure.

Typical errors (by the reason code in the caption): stdio_executable_not_found — the path to the interpreter is wrong; stdio_mcp_command_required — the command is empty; connected_source_slug_exists — a server with that name has already been added. The working directory cannot be set through the interface, so --project is mandatory.

Cline and Cursor #

Both clients accept the same mcpServers block.

  • Cursor: Settings → MCP → Add new MCP server, or the .cursor/mcp.json file in the project root.
  • Cline (VS Code extension): MCP Servers → Edit MCP Settings, the cline_mcp_settings.json file.
JSON
{
  "mcpServers": {
    "ragraf": {
      "type": "stdio",
      "command": "<RAGRAF directory>\\.venv\\Scripts\\python.exe",
      "args": [
        "<RAGRAF directory>\\tools\\ragraf-mcp.py",
        "--project", "<path to the corpus config>",
        "--agent", "cline",
        "--agent-kind", "external"
      ],
      "env": { "PYTHONIOENCODING": "utf-8", "PYTHONUTF8": "1" }
    }
  }
}

Verification. In the MCP server list the client shows the number of tools; in the session — a call to ragraf_ensure, then ragraf_search. If the server is marked as “starts and crashes”, look at the process stderr: most often it is the path to the interpreter or a missing --project.

Any MCP client and working without an agent #

A client that supports the stdio transport is connected with the same block: the command is the interpreter, the arguments are tools/ragraf-mcp.py, env holds the two UTF-8 variables.

Without an agent RAGRAF works as an ordinary command: ragraf ensure, ragraf query <operation> --json, ragraf index, ragraf status. This is convenient for scripts and CI: a return code and JSON instead of a dialogue.

Verifying the connection in any client #

Three steps, each one observable:

  1. The server has started — the client interface shows a connection status, and the log has no process crash.
  2. The tools are visible — the tool list contains ragraf_ (for AutoClaw — source_ragraf_).
  3. An answer arrives — ragraf_ensure returns status, ragraf_search returns hits with path:line

and index_rev.

If step 3 answers with a refusal, that is not a broken connection: the kind of refusal (no_index, stale_index, …) names the next step. The analysis is on the Errors and the next step page.