Code Graph MCP Server
npm install mcp-code-graph
This MCP allows you to interact with the knowledge graphs available in your CodeGPT account or with public graphs from DeepGraph.
You'll be able to use these advanced graph-based queries across different MCP Hosts such as ChatGPT, Cursor, Windsurf, CodeGPT Extension, GitHub Copilot, Claude Desktop, Claude Code, Gemini CLI, and others.
- list-graphs: Lists available repository graphs with basic information.
- get-code: Retrieves the complete source code for a specific functionality from the graph.
- find-direct-connections: Explores the direct relationships of a functionality within the code graph.
- nodes-semantic-search: Semantically searches for code functionalities using natural language.
- docs-semantic-search: Semantically searches repository documentation.
- get-usage-dependency-links: Analyzes and lists functionalities affected by changes to a code entity.
- folder-tree-structure: Retrieves the tree structure of a folder in the repository.
1. Find any public repository on deepgraph.co
2. Use the repository reference (e.g., username/repository-name)
``json`
{
"mcpServers": {
"Deep Graph MCP": {
"command": "npx",
"args": ["-y" , "mcp-code-graph@latest",
"username/repository-name", // DeepGraph repository URL
"username2/repository-name2" // Add more repositories if needed
]
}
}
}
1. A CodeGPT account (sign up at app.codegpt.co)
2. Uploaded a repository to Code Graph
3. Get your API Key from CodeGPT API Keys page (required).
4. Get your Organization ID (optional) and Graph ID (optional).
`json`
{
"mcpServers": {
"Deep Graph MCP": {
"command": "npx",
"args": ["-y" , "mcp-code-graph@latest",
"CODEGPT_API_KEY", // Required
"CODEGPT_ORG_ID", // Optional
"CODEGPT_GRAPH_ID" // Optional
]
}
}
}
Add the JSON configuration to your settings.json file:
Gemini CLI uses settings.json files for persistent configuration. There are two locations for these files:
- User settings file:
Location: ~/.gemini/settings.json (where ~ is your home directory).
Scope: Applies to all Gemini CLI sessions for the current user.
- Project settings file:
Location: .gemini/settings.json within your project's root directory.
Scope: Applies only when running Gemini CLI from that specific project. Project settings override user settings.
Follow these steps to integrate Deep Graph MCP Server with Claude Code.
`bash`
claude mcp add "Deep Graph MCP" npx -- -y mcp-code-graph@latest CODEGPT_API_KEY
bash
claude mcp add "Deep Graph MCP" npx -- -y mcp-code-graph@latest username/repository-name
`For team sharing, add the
-s project flag:`bash
claude mcp add -s project "Deep Graph MCP" npx -- -y mcp-code-graph@latest CODEGPT_API_KEY
or for public graphs
claude mcp add -s project "Deep Graph MCP" npx -- -y mcp-code-graph@latest username/repository-name username2/repository-name
`Verification
`bash
Verify installation
claude mcp listGet server details
claude mcp get "Deep Graph MCP"
`Advanced Workflows with Claude Code Custom Commands
Claude Code supports custom slash commands that combine multiple MCP Code Graph tools for comprehensive analysis workflows.
$3
Copy the commands directory from this repository to your project root:
`bash
cp -r .claude/ /path/to/your/project/
`Commit to your project's git:
`bash
git add .claude/commands/
git commit -m "Add custom Claude Code commands for Deep Graph MCP"
`Available Commands
Repository-wide analysis commands (no parameters needed):`bash
/project:analyze-architecture # Complete architectural overview
/project:security-audit # Comprehensive security analysis
/project:test-coverage-analyzer # Test coverage and quality analysis
/project:technical-debt-analyzer # Technical debt assessment
/project:api-ecosystem-analyzer # Complete API ecosystem analysis
/project:repository-onboarding # Full repository onboarding guide
`Component-specific commands (require parameters):
`bash
/project:migration-planner [component/technology] # Smart migration planning
/project:performance-optimizer [component/function] # Performance optimization
/project:component-onboarding [component/feature] # Component-specific training
`Usage Examples
`bash
/project:analyze-architecture
/project:migration-planner React to Vue.js
/project:performance-optimizer DatabaseService.getUserData
/project:component-onboarding authentication system
``
For support and feedback:
- Email: support@codegpt.co
- Website: app.codegpt.co