datagraph-mcp
v1.0.1
Published
CodeGraph MCP server for semantic code intelligence
Downloads
226
Readme
Datagraph MCP
Datagraph MCP is a CodeGraph-first MCP server for semantic code intelligence. It publishes a stdio CLI that can be launched by any MCP client with:
npx datagraph-mcpIt also supports local project initialization:
npx datagraph-mcp init -iThat initializes CodeGraph in the current project and runs the first index pass.
For implementation and runtime notes, see codegraph.md.
What this project does
The server exposes CodeGraph tools that help agents understand codebases faster:
- symbol search
- contextual code exploration
- caller and callee discovery
- impact analysis
- node detail lookups
- deep file-grouped exploration
- index status checks
- indexed file tree inspection
Published CLI usage
Local project init
datagraph-mcp init -iUse -i to index after initialization. You can also pass a project path:
datagraph-mcp init C:/path/to/project -iClaude Desktop example
{
"mcpServers": {
"datagraph-mcp": {
"command": "npx",
"args": ["datagraph-mcp"],
"env": {
"CODEGRAPH_ENABLED": "true",
"CODEGRAPH_AUTO_BOOTSTRAP": "true",
"CODEGRAPH_PROJECT_PATH": "C:/path/to/project",
"CODEGRAPH_ALLOWED_ROOTS": "C:/path/to"
}
}
}
}If you run it from a shell instead of an MCP client, set the same environment variables first.
Tool catalog
codegraph_searchcodegraph_contextcodegraph_callerscodegraph_calleescodegraph_impactcodegraph_nodecodegraph_explorecodegraph_statuscodegraph_files
Environment variables
CODEGRAPH_ENABLED=true
CODEGRAPH_AUTO_BOOTSTRAP=true
CODEGRAPH_PROJECT_PATH=C:\path\to\indexed\project
CODEGRAPH_ALLOWED_ROOTS=C:\path\to
CODEGRAPH_MAX_SEARCH_LIMIT=20
CODEGRAPH_MAX_CONTEXT_NODES=30
CODEGRAPH_MAX_CALL_LIMIT=30
CODEGRAPH_MAX_IMPACT_DEPTH=4
CODEGRAPH_MAX_EXPLORE_FILES=12
CODEGRAPH_MAX_FILES_DEPTH=10
MCP_UI_ORIGIN=https://your-allowed-ui.example.comNotes:
CODEGRAPH_ENABLED=falsedisables allcodegraph_*tools.CODEGRAPH_AUTO_BOOTSTRAP=trueinitializes and indexes a target repository on first tool call if.codegraph/is missing.CODEGRAPH_ALLOWED_ROOTSis a comma-separated allowlist for optionalprojectPathinputs.
Local development
- Install dependencies:
npm install
- Copy
.env.exampleto.env - Set your
CODEGRAPH_*variables - Run local app:
npm run dev
- Build stdio bundle:
npm run mcp:stdio:build
- Run stdio MCP server:
npm run mcp:stdio
Publish to npm
- Ensure npm auth:
npm adduser
- Verify package contents:
npm pack --dry-run
- Publish:
npm publish --access public
Build commands
npm run devnpm run buildnpm run startnpm run mcp:stdio:buildnpm run mcp:stdionpm run lint
