- Home
- MCP servers
- CodeGraph
CodeGraph
- typescript
0
GitHub Stars
typescript
Language
7 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"nabiatech-codegraph-mcp": {
"command": "node",
"args": [
"/ABSOLUTE/PATH/TO/dist/mcp/server.js"
],
"env": {
"NABI_GRAPH_JSON": "/ABSOLUTE/PATH/TO/data/graph.json"
}
}
}
}You run a lightweight MCP server that builds a small code graph from TypeScript and Python sources and exposes practical querying tools for symbol resolution, references, and context snippets. This server is designed to be tiny, easy to extend, and quick to get running so you can empower agentic clients with fast, targeted code graph data.
How to use
You connect an MCP client to the code graph server to query symbol information and related data. Typical workflows include resolving a symbol by name, inspecting where a symbol is referenced or defined, exploring neighboring imports and calls, and obtaining 1‑hop context around changes. You can also request code snippets for context windows when forming responses.
How to install
Prerequisites you need before getting started are Node.js 20+ (recommended LTS) and Python 3.10+ (standard library only). Then follow these steps to set up and run the MCP server.
# 1) Install dependencies
npm install
# 2) Build a graph from the example code
npm run ingest -- --target ./example
# 3) Run the MCP server (stdio)
npm run dev:server
Configuration and usage notes
The server can be wired into an MCP client using a standard stdio configuration. The example below shows how Claude Desktop can register the MCP server so you can issue MCP tool requests directly from the chat session.
{
"mcpServers": {
"code_graph": {
"command": "node",
"args": ["/ABSOLUTE/PATH/TO/dist/mcp/server.js"],
"environment": {
"NABI_GRAPH_JSON": "/ABSOLUTE/PATH/TO/data/graph.json"
}
}
}
}
What you can do with the MCP server
Key endpoints exposed by the code graph MCP server include: resolving symbols by name, retrieving inbound references, exploring related neighbors (imports and calls), and calculating impact from a given patch. You also get a stream of code snippets for context when building responses.
Example commands you’ll use in practice
From a client, you typically perform actions like:
- Resolve a symbol by name to obtain its id, kind, and location.
- Ask for related neighbors of a symbol to understand its surrounding code graph.
- Request inbound references to see who calls or imports a symbol.
- Submit a patch to obtain a 1‑hop impact set and affected files.
- Stream code snippets via the code://file/{path}?s=..&e=.. resource for context windows.
Available tools
graph.resolve_symbol
Fuzzy lookup of symbols by name and return matching symbol records.
graph.references
Return inbound edges for a given symbol id to show who calls or imports it.
graph.related
Return k-neighbor symbols connected via imports or calls from a given symbol id.
graph.impact_from_diff
Compute changed files and 1-hop neighbor impact from a given patch.
graph.latest_snippet
Stream code snippets for context windows via the code://file resource.