MCP.so
ログイン
C

CodeGraphContext

@Shashankss1205

CodeGraphContext について

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

基本情報

カテゴリ

その他

トランスポート

stdio

公開者

Shashankss1205

投稿者

Shashank Shekhar Singh

設定

以下の設定を使って、このサーバーを 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": []
    }
  }
}

ツール

ツールは検出されませんでした

ツールは 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

FAQ from CodeGraphContext

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).

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.

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.

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.

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.

コメント

「その他」の他のコンテンツ