MCP Setup
CodeGraphContext (CGC) implements the Model Context Protocol (MCP), allowing it to act as a powerful context provider for AI assistants like Claude Desktop, Cursor, and VS Code.
๐ Smart Setup (Recommended)
The easiest way to configure CGC for your AI assistant is to use the interactive setup wizard. This tool will automatically detect your installed IDEs and apps and offer to configure them for you.
Using uvx (No Installation Required)
If you have uv installed, run:
uvx codegraphcontext mcp setup
Using Local CLI
If you have already installed CGC, run:
codegraphcontext mcp setup
Manual Configuration
If the automated setup doesn't work for your environment, you can configure your client manually.
1. Claude Desktop
To use CGC with the Claude Desktop app, you need to add it to your configuration file.
Configuration Path
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
Add CGC to mcpServers
Add the following entry to the mcpServers object:
{
"mcpServers": {
"CodeGraphContext": {
"command": "codegraphcontext",
"args": ["mcp", "start"]
}
}
}
[!TIP] If you installed CGC via
uvx, you can use"command": "uvx", "args": ["codegraphcontext", "mcp", "start"]instead.
2. Cursor
Cursor supports MCP servers natively.
- Open Cursor Settings (
Cmd+,orCtrl+,). - Navigate to Features > MCP.
- Click + Add New MCP Server.
- Enter the following details:
- Name:
CodeGraphContext - Type:
command - Command:
codegraphcontext mcp
- Name:
3. VS Code (Windsurf / Kiro)
For VS Code extensions that support MCP, use the same command: codegraphcontext mcp. Ensure your terminal environment has access to the codegraphcontext command.
Verifying the Connection
Once configured, restart your AI assistant. You should see a list of tools provided by CodeGraphContext, such as:
find_codeanalyze_code_relationshipsload_bundle
You can now ask your AI things like:
"Who calls the
handle_requestfunction?" "Explain the class hierarchy of theBaseStorageclass."
Troubleshooting
If the tools do not appear:
1. Check that codegraphcontext mcp runs without errors in your terminal.
2. Verify the path to the codegraphcontext executable in your config file.
3. Consult the Troubleshooting Guide.