trace-mcp
Local code graph of a repository, queried over MCP for impact, call paths and context
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
Opens the app, which asks before it adds the server. Then replace each <NAME> in its settings with your value.
claude mcp add deep-graph -- npx -y mcp-code-graph@latest '<OWNER>/<REPO>'{
"mcpServers": {
"deep-graph": {
"command": "npx",
"args": [
"-y",
"mcp-code-graph@latest",
"<OWNER>/<REPO>"
]
}
}
}{
"mcpServers": {
"deep-graph": {
"command": "npx",
"args": [
"-y",
"mcp-code-graph@latest",
"<OWNER>/<REPO>"
]
}
}
}{
"servers": {
"deep-graph": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"mcp-code-graph@latest",
"<OWNER>/<REPO>"
]
}
}
}[mcp_servers.deep-graph]
command = "npx"
args = ["-y", "mcp-code-graph@latest", "<OWNER>/<REPO>"]gemini mcp add --scope user deep-graph npx -- -y mcp-code-graph@latest '<OWNER>/<REPO>'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. |
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.
| Runtime | Node.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.
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.
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.
list-graphsget-codefind-direct-connectionsnodes-semantic-searchdocs-semantic-searchget-usage-dependency-linksfolder-tree-structure