MCP Directory

How to add CodeGraphContext to Windsurf

Index local code into a graph database to give AI assistants deep, queryable code context. Paste the config into ~/.codeium/windsurf/mcp_config.json and restart Windsurf.

Last updated June 14, 2026 · 3.8k · stdio · no auth

Windsurf config for CodeGraphContext

pip install codegraphcontext
{
  "mcpServers": {
    "codegraphcontext": {
      "command": "codegraphcontext",
      "args": [
        "mcp",
        "start"
      ],
      "env": {
        "NEO4J_URI": "YOUR_NEO4J_URI",
        "NEO4J_USERNAME": "YOUR_NEO4J_USERNAME",
        "NEO4J_PASSWORD": "YOUR_NEO4J_PASSWORD"
      }
    }
  }
}

Setup steps

  1. 1Open Windsurf → Cascade → the hammer/MCP icon → Configure (or edit ~/.codeium/windsurf/mcp_config.json).
  2. 2Paste the CodeGraphContext config below.
  3. 3Fill in placeholder secrets, then save.
  4. 4Click Refresh in the MCP panel.
  5. 5CodeGraphContext's tools become available to Cascade.

Before you start

  • Python 3.10 or later
  • pip package manager
  • Git (optional, for cloning repositories)
  • A graph database backend — embedded FalkorDB Lite / KuzuDB requires no setup; external Neo4j is optional via `codegraphcontext neo4j setup`

What CodeGraphContext can do in Windsurf

add_code_to_graph

Performs a one-time scan of a local folder to add its code to the graph. Ideal for indexing libraries, dependencies, or projects not being actively modified. Returns a job ID for background processing.

check_job_status

Check the status and progress of a background job.

list_jobs

List all background jobs and their current status.

find_code

Find relevant code snippets related to a keyword (e.g., function name, class name, or content).

analyze_code_relationships

Analyze code relationships like 'who calls this function' or 'class hierarchy'.

watch_directory

Continuously monitors a directory and keeps the graph updated.

execute_cypher_query

Run a read-only Cypher query against the code graph.

add_package_to_graph

Add a package to the graph.

Security

The MCP protocol connection itself requires no auth. The optional `env` block in the config supplies Neo4j credentials (NEO4J_URI / NEO4J_USERNAME / NEO4J_PASSWORD) only when using an external Neo4j backend; the default embedded database (FalkorDB Lite / KuzuDB) needs none. CGC stores database credentials in ~/.codegraphcontext/.env. The execute_cypher_query tool is documented as read-only.

CodeGraphContext + Windsurf FAQ

Where is the Windsurf config file?

Windsurf reads MCP servers from ~/.codeium/windsurf/mcp_config.json. Paste the CodeGraphContext config there under the "mcpServers" key and restart the client.

Is CodeGraphContext safe to use with Windsurf?

The MCP protocol connection itself requires no auth. The optional `env` block in the config supplies Neo4j credentials (NEO4J_URI / NEO4J_USERNAME / NEO4J_PASSWORD) only when using an external Neo4j backend; the default embedded database (FalkorDB Lite / KuzuDB) needs none. CGC stores database credentials in ~/.codegraphcontext/.env. The execute_cypher_query tool is documented as read-only.

Is a Neo4j server required?

No. CodeGraphContext uses an embedded graph database by default (FalkorDB Lite on Unix, or KuzuDB cross-platform), so no extra setup is needed for most users. Neo4j is an optional external backend configured via `codegraphcontext neo4j setup`, and its credentials go in the config's env block.

Which languages are supported?

23 languages including Python, JavaScript, TypeScript/TSX, Java, C, C++, C#, Go, Rust, Ruby, PHP, Swift, Kotlin, Dart, Perl, Lua, Scala, Haskell, Elixir, Emacs Lisp, HTML, and CSS. Each parser extracts functions, classes, methods, parameters, inheritance, calls, and imports.

How do I configure my AI IDE?

Run `codegraphcontext mcp setup` to auto-detect and configure VS Code, Cursor, Windsurf, Zed, Claude, Gemini CLI, ChatGPT Codex, Cline, RooCode, Amazon Q Developer, Kiro, Goose, or OpenCode. You can also configure manually by adding the mcpServers block to your client's settings, then start the server with `codegraphcontext mcp start`.

View repo Full CodeGraphContext page