home / mcp / codegraph mcp server
Generates and queries a graph of codebase entities and their relationships across languages.
Configuration
View docs{
"mcpServers": {
"cartographai-mcp-server-codegraph": {
"command": "npx",
"args": [
"-y",
"@cartographai/mcp-server-codegraph",
"/path/to/directory"
]
}
}
}You run a Codegraph MCP Server to automatically build and query a graph of your codebase. It detects entities like functions, classes, and imports, and maps how they relate through calls, inheritance, and implementations across languages such as Python, JavaScript, and Rust. This helps you understand dependencies, large code flows, and architecture at a glance.
Start the server locally by pointing it at the directory containing your codebase. The server exposes a graph of entities and the relationships between them, which you can query from your MCP client to explore code structure, calls, and inheritance without leaving your editor.
Run the server from your command line using the following command. It uses npx to execute the MCP server package directly without a global install.
npx @cartographai/mcp-server-codegraph /path/to/directory
`If you want to integrate with Claude Desktop, add an MCP server configuration that points to the same command.
{
"mcpServers": {
"codegraph": {
"command": "npx",
"args": [
"-y",
"@cartographai/mcp-server-codegraph",
"/path/to/directory",
]
}
}
}Indexes the codebase to create a graph of entities and relationships.
Provides a list of all entities within a specified file using a given path.
Lists the relationships of a specific entity by file path and entity name.