gctrl — Claude Code MCP server: what it does, how to install
gctrl gives AI agents access to a governed knowledge graph, hybrid retrieval, and code analysis tools. It fits projects that need reusable context.
claude mcp add --env GCTRL_GATEWAY_URL=<GCTRL_GATEWAY_URL> --env GCTRL_API_URL=<GCTRL_API_URL> --env GCTRL_API_TOKEN=<GCTRL_API_TOKEN> --transport stdio mcp -- npx -y gctrl-mcpWhat gctrl does
gctrl exposes tools for turning text into Neo4j entities and Qdrant vectors, asking questions through hybrid retrieval, finding entities, merging extraction jobs, and storing notes with knowledge extraction. Agents can also inspect graph schemas, ontologies, compilations, and recent extraction jobs.
Direct mode adds local repository indexing plus symbol lookup, call tracing, change-impact checks, and architecture data. The gctrl_code_index tool needs the optional gctrl-code-indexer package; the other tools keep working without it. Authentication uses GCTRL_API_TOKEN, while GCTRL_GATEWAY_URL or GCTRL_API_URL selects the connection path.
A running GCTRL harness is required for the server to operate through the gateway. Legacy borghive_* names remain aliases for existing configurations, emit a deprecation warning on each call, and are scheduled for removal in v2.0.
What it helps with
- extract entities and relations from text
- query a project knowledge graph
- locate entities by name or type
- merge several extraction jobs
- index a local repository and trace symbols
Example prompts for the agent
- Extract the entities and relations from
architecture.md, then store the result in the knowledge graph. - Query the graph for the payment service and explain the dependencies connected to it.
- Index the current repository, find
UserService, and show its callers.
How to install gctrl
Platform CLI
claude mcp add --env GCTRL_GATEWAY_URL=<GCTRL_GATEWAY_URL> --env GCTRL_API_URL=<GCTRL_API_URL> --env GCTRL_API_TOKEN=<GCTRL_API_TOKEN> --transport stdio mcp -- npx -y gctrl-mcpReplace <…> with your own values
Platform CLI
codex mcp add mcp --env GCTRL_GATEWAY_URL=<GCTRL_GATEWAY_URL> --env GCTRL_API_URL=<GCTRL_API_URL> --env GCTRL_API_TOKEN=<GCTRL_API_TOKEN> -- npx -y gctrl-mcpReplace <…> with your own values
Config file
{
"mcpServers": {
"mcp": {
"command": "npx",
"args": [
"-y",
"gctrl-mcp"
],
"env": {
"GCTRL_GATEWAY_URL": "<GCTRL_GATEWAY_URL>",
"GCTRL_API_URL": "<GCTRL_API_URL>",
"GCTRL_API_TOKEN": "<GCTRL_API_TOKEN>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"gctrl-mcp"
],
"env": {
"GCTRL_GATEWAY_URL": "<GCTRL_GATEWAY_URL>",
"GCTRL_API_URL": "<GCTRL_API_URL>",
"GCTRL_API_TOKEN": "<GCTRL_API_TOKEN>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e GCTRL_GATEWAY_URL=<GCTRL_GATEWAY_URL> -e GCTRL_API_URL=<GCTRL_API_URL> -e GCTRL_API_TOKEN=<GCTRL_API_TOKEN> mcp npx -y gctrl-mcpReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about gctrl
How do I install gctrl in Claude Code?
Run claude mcp add gctrl -e GCTRL_API_TOKEN=<GCTRL_API_TOKEN> -- npx -y gctrl-mcp. The server also requires a running GCTRL harness.
What does gctrl do?
It gives an agent MCP tools for knowledge extraction, graph queries, entity search, graph fusion, and knowledge storage. Direct mode also exposes repository indexing and code analysis.
What does gctrl_code_index require?
It runs in direct mode and requires the optional gctrl-code-indexer package. Without that package, this tool returns an installation hint while the remaining tools continue to work.