icon for mcp server

CodeGPT Code Graph

STDIO

MCP server for interacting with Code Graphs from CodeGPT

CodeGPT- Code Graph MCP Server

A Model Context Protocol server that enables seamless interaction with Code Graphs by CodeGPT

Screenshot 2025-06-11 at 14 17 47

How this works

This MCP allows you to interact with the knowledge graphs available in your CodeGPT account.

Screenshot 2025-06-11 at 14 01 15

You’ll be able to use these advanced graph-based queries across different MCP Hosts such as ChatGPT, Cursor, Windsurf, GitHub Copilot, Claude Desktop, and others.

Available Tools

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.

Prerequisites

Before using the CodeGPT MCP Server, ensure you have:

  1. A CodeGPT account (sign up at app.codegpt.co)
  2. Uploaded a repository to Code Graph
  3. An API key from CodeGPT API Keys page
  4. Your Organization ID (optional)

Installation

Using npx

  1. Add the following to your MCP client configuration:
{ "mcpServers": { "Deep Graph MCP - CodeGPT": { "command": "npx", "args": ["-y", "mcp-code-graph@latest"], "env": { "CODEGPT_API_KEY": "your-api-key", "CODEGPT_GRAPH_ID": "your-graph-id", // optional "CODEGPT_ORG_ID": "your-org-id" // optional } } } }

Or clone and run the Server (STDIO mode)

This is the recommended way to run the server locally. (stdio mode is the default mode for MCP servers)

  1. Clone the repository:
git clone https://github.com/JudiniLabs/mcp-code-graph.git cd mcp-code-graph
  1. Install dependencies:
pnpm install
  1. Build the project:
pnpm build

Set up your environment variables, or you could add them to your MCP client configuration.

Environment Variables in .env file

  1. Copy the example environment file:
cp .env.example .env
  1. Configure the required environment variables:
CODEGPT_API_KEY=your-api-key
CODEGPT_ORG_ID=your-org-id  # Optional
CODEGPT_GRAPH_ID=your-graph-id  # Optional

Integration with MCP Client

Add the following configuration to your MCP client (Cursor, Claude Desktop, Windsurf, etc.)

{ "mcpServers": { "Code Graph MCP Server": { "command": "node", "args": ["/path/to/build/directory", "/index.js"] } } }

Error Handling

The server handles various error scenarios:

  • Missing API key validation
  • HTTP communication errors
  • Request timeout handling

Project Structure

├── src/
│   └── index.ts      # Main server implementation
├── build/            # Compiled JavaScript files
├── .env             # Environment configuration(not included in version control)
├── .gitignore       # Git ignore rules
└── package.json    # Project metadata and dependencies

Support

For support and feedback:

License

MIT License

Be the First to Experience MCP Now