Deep Graph MCP Server

Query CodeGPT and DeepGraph code graphs of a repository: code lookup, call links, semantic search

Official · Diffbot TypeScript Local · stdio Developer tools

31 popularity score ★ 401 ↓ 644/wk

Connect your client

Local (npm)

Add in one click

Opens the app, which asks before it adds the server. Then replace each <NAME> in its settings with your value.

Or add it by command or config

Claude CodeTerminal
claude mcp add deep-graph -- npx -y mcp-code-graph@latest '<OWNER>/<REPO>'
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "deep-graph": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-code-graph@latest",
        "<OWNER>/<REPO>"
      ]
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "deep-graph": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-code-graph@latest",
        "<OWNER>/<REPO>"
      ]
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "deep-graph": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "mcp-code-graph@latest",
        "<OWNER>/<REPO>"
      ]
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.deep-graph]
command = "npx"
args = ["-y", "mcp-code-graph@latest", "<OWNER>/<REPO>"]
Gemini CLITerminal
gemini mcp add --scope user deep-graph npx -- -y mcp-code-graph@latest '<OWNER>/<REPO>'

Settings 4

CODEGPT_API_KEY Optional: CodeGPT API key for private graphs; not needed for public deepgraph.co repositories. It can also be passed as an argument starting with sk-.
CODEGPT_ORG_ID Optional: CodeGPT organization ID, sent with each request; optional.
CODEGPT_GRAPH_ID Optional: Default graph ID for private graphs; without it, tools need a graphId parameter.
CODEGPT_REPO_URL Optional: Public repository as owner/repo, as an alternative to the command-line argument.

What it does

Deep Graph MCP Server (npm package mcp-code-graph) is CodeGPT's connector to the code graphs its service builds from repositories. A graph splits a codebase into nodes such as functions, classes and files, with the links between them. The server does not parse code on your machine: each tool sends a request to CodeGPT's API at api-mcp.codegpt.co and hands back the JSON answer.

It works in two modes. With public graphs you pass one or more owner/repo names from deepgraph.co as arguments, and no account is needed (DeepGraph builds a graph for a GitHub repository when you swap github.com for deepgraph.co in its address). With private graphs you supply a CodeGPT API key and can reach the graphs in your own account. With two or more repositories, every tool gains a repository parameter for picking one.

The tools fetch the source of a named function or class, list what it calls and what calls it, find code that may be affected by changing something, search code and docs by meaning, and show a folder's tree. In the published 1.1.2 code, list-graphs is only registered when no repository argument and no CODEGPT_GRAPH_ID are given, so in public-graph mode there are six tools, not seven (src/index.ts). The repository also ships Claude Code slash commands (architecture review, security audit and similar) built on these tools; you copy them into a project yourself.

What it needs

RuntimeNode.js

Node.js with npx. Network access to api-mcp.codegpt.co. Public graphs: the repository must be available on deepgraph.co, and no account is needed. Private graphs: a CodeGPT account (app.codegpt.co), a repository uploaded to Code Graph there, and an API key from the CodeGPT API keys page. The organization ID and graph ID are optional and are set as the CODEGPT_ORG_ID and CODEGPT_GRAPH_ID environment variables.

Limits

It reads graphs hosted by CodeGPT/DeepGraph only; it cannot index a local folder or code that has not been uploaded there. In the 1.1.2 code a command-line argument counts as an API key only if it starts with "sk-", and as a repository only if it contains "/". Any other argument is dropped. So the README's private example, which passes the org ID and graph ID as extra arguments, does nothing for those two; set them as environment variables instead (src/index.ts, src/config.ts). Without a repository argument, a graph ID or a graphId parameter, the graph tools return an error asking for a graph ID (src/utils.ts). The server exits at start if it has neither an API key nor a repository.

Who it suits

Suits developers who want an assistant to explore a large or unfamiliar repository through a prebuilt graph: finding implementations, tracing callers, checking what a change touches. It suits most when the repository is public on deepgraph.co (no sign-up) or is already in a CodeGPT account. Since the code goes to and is answered from CodeGPT's service, it is a poor fit for code that must not leave your machine, or for a working copy with unpushed changes. For those, a server that reads local files or runs a local language server is the better choice. All tools only read.

Tools 7

list-graphs
Lists the graphs your CodeGPT account can reach, with IDs and repository names; only present when no repository or graph ID is set
get-code
Returns the source of a named function, class or method from the graph, optionally narrowed by file path
find-direct-connections
Shows the first-level links of a code entity: what it calls, what calls it, declarations
nodes-semantic-search
Finds code entities that match a plain-language description
docs-semantic-search
Searches the repository's documentation files by meaning
get-usage-dependency-links
Lists the code entities that may be affected by changing a given one
folder-tree-structure
Returns the files and subfolders under a folder path in the repository

Similar servers