MCP.so
登录
C

CodeGraphContext MCP Server

@Shashankss1205

基本信息

分类

其他

传输方式

stdio

作者

Shashankss1205

提交者

Shashank Shekhar Singh

关于 CodeGraphContext MCP Server

An MCP server that indexes local code into a graph database to provide context to AI assistants.

CodeGraphContext MCP Server 配置

使用下面的配置,将此服务器添加到你的 MCP 客户端。

{
  "mcpServers": {
    "CodeGraphContext": {
      "command": "cgc",
      "args": [
        "start"
      ],
      "env": {
        "NEO4J_URI": "YOUR_NEO4J_URI",
        "NEO4J_USERNAME": "YOUR_NEO4J_USERNAME",
        "NEO4J_PASSWORD": "YOUR_NEO4J_PASSWORD"
      },
      "tools": {
        "alwaysAllow": [
          "add_code_to_graph",
          "add_package_to_graph",
          "check_job_status",
          "list_jobs",
          "find_code",
          "analyze_code_relationships",
          "watch_directory",
          "find_dead_code",
          "execute_cypher_query",
          "calculate_cyclomatic_complexity",
          "find_most_complex_functions",
          "list_indexed_repositories",
          "delete_repository",
          "visualize_graph_query",
          "list_watched_paths",
          "unwatch_directory"
        ],
        "disabled": false
      },
      "disabled": false,
      "alwaysAllow": []
    }
  }
}

CodeGraphContext MCP Server 工具

工具列表暂未提供

当前收录暂时没有可展示的工具列表,不代表服务没有工具。请查阅项目文档了解支持的能力。

工具是从 README 中自动提取的。维护者可以在 ## Tools 标题下列出工具,即可填充这部分内容。

概览

What is CodeGraphContext?

CodeGraphContext is an MCP server that indexes local source code into a Neo4j graph database to provide structured code context to AI assistants. It is designed for developers who want to enable their AI tools to understand code relationships, dependencies, and call chains across a codebase.

How to use CodeGraphContext?

Install with pip install codegraphcontext, then run cgc setup for an interactive wizard that configures the Neo4j database connection and optionally sets up supported IDEs (VS Code, Cursor, Claude, etc.). After setup, start the server with cgc start. The server is then ready to accept natural language commands from an MCP client (e.g., Claude, VS Code) to index, query, and analyze code.

Key features of CodeGraphContext

  • Code Indexing: Analyzes code and builds a knowledge graph of its components.
  • Relationship Analysis: Query for callers, callees, class hierarchies, and call chains.
  • Live Updates: Watches local files for changes and automatically updates the graph.
  • Interactive Setup: A user-friendly command-line wizard for easy configuration.
  • File Ignoring: Supports .cgcignore files to exclude specific files and directories.

Use cases of CodeGraphContext

  • Static code analysis in AI assistants
  • Graph-based visualization of projects
  • Dead code and complexity detection
  • Impact analysis before making code changes
  • Debugging by tracing execution paths across hundreds of files

常见问题

1

What dependencies does CodeGraphContext require?

The server requires Python packages including neo4j, watchdog, tree-sitter, tree-sitter-languages, typer, rich, and others. It also needs a running Neo4j database (local via Docker, Linux binary, or remote hosted instance).

2

How do I ignore certain files or directories?

Create a `.cgcignore` file in the root of your project using the same syntax as `.gitignore`. Example: `/build/`, `/node_modules/`, `*.log`.

3

Does the server support live file watching?

Yes. When you tell the AI assistant to watch a directory, the server performs an initial full index and then continuously monitors the directory for changes, automatically updating the graph.

4

What transports or authentication does it use?

The server communicates via the MCP (Model Context Protocol) using Neo4j credentials (URI, username, password) stored in `~/.codegraphcontext/.env`. It does not expose other transports or authentication methods.

5

What are the known limitations?

The README does not list explicit limitations, but it notes that the `cgc setup` command may fail on some systems requiring a PATH fix script, and that the tool requires a working Neo4j instance.

评论

其他 分类下的更多 MCP 服务器