MCP Server for AI Code Intelligence

Semantic code analysis for Claude Code, Codex & OpenCode

Give your AI assistant deep semantic understanding of your codebase through call graph analysis, symbol search, and dependency tracking. Ask questions like "who calls this?", "where's this used?", or "how does data flow?" in natural language. No more manual grep or code archaeology.100% free, open-source (AGPL-3.0), privacy-first local execution.

MCP Server Setup Guide • 5 Minutes

Setup Guide

Install Code Pathfinder, configure your AI assistant, and start querying your codebase with natural language in under 5 minutes

1

Install Code Pathfinder MCP Server

Choose your preferred package manager to install the MCP server CLI tool. Supports Homebrew, pip, Chocolatey, and Docker.

brew install shivasurya/tap/pathfinder

macOS & Linux • v0.0.34+

2

Configure Your AI Assistant with MCP

Add Code Pathfinder as an MCP server to connect with your AI coding assistant.

Quick setup with CLI:

claude mcp add code-pathfinder -- pathfinder serve --project /absolute/path/to/your/project

Or edit configuration file directly:

~/.config/claude/mcp_config.json

{
  "mcpServers": {
    "code-pathfinder": {
      "command": "pathfinder",
      "args": [
        "serve",
        "--project",
        "/absolute/path/to/your/project"
      ]
    }
  }
}

macOS & Linux • JSON format

Using Docker? Connect via HTTP

If using Docker, the MCP server runs in HTTP mode on http://localhost:8080. Configure your AI assistant to connect via HTTP transport instead of stdio. Check the full documentation for HTTP configuration examples.

How MCP Server Enables AI Code Intelligence

Claude Code • Codex • OpenCode • Cline • Zed

Natural Language Code Queries with AI Assistants

Ask your AI assistant to find function callers, trace dependencies, locate symbols, generate call graphs, and understand code relationships. No manual grep or navigation required — just describe what you're looking for in plain English. The MCP server provides instant, accurate semantic code analysis.

Setup guide for AI assistants
Claude Code • MCP Connected
Find all functions that call validate_user
Using get_callers tool
Found 12 callers of app.auth.validate_user:
1
app.api.login_endpoint
app/api.py:82
2
app.api.register_endpoint
app/api.py:145
3
app.middleware.auth_middleware
app/middleware.py:34
+ 9 more callers
config.json
{
"mcpServers": {
"code-pathfinder": {
"command": "pathfinder",
"args": [
"serve",
"--project",
"/path/to/your/project"
]
}
}
}
Configuration valid
Edit your AI assistant's MCP config file
Restart your AI assistant to apply changes
Setup in 5 Minutes • Zero Cloud Dependencies

Simple MCP Server Configuration

Add a few lines of JSON configuration to your AI assistant's MCP config, restart the tool, and you're ready to go. The MCP server indexes your codebase automatically using AST-based analysis and responds to AI queries in real-time. Works with stdio and HTTP transport modes.

View configuration options
Six Powerful MCP Tools • JSON-RPC 2.0

Complete Semantic Code Intelligence Suite

Six specialized MCP tools give AI assistants deep understanding of your code: project statistics, symbol search, call graph analysis (forward & reverse), call site details, import resolution, and dataflow tracking. Powered by 5-pass static analysis and AST-based indexing for maximum accuracy.

Explore all 6 tools
MCP Tools Available
get_index_info
Project statistics & metadata
find_symbol
Locate functions & classes
get_callers
Reverse call graph
get_callees
Forward call graph
get_call_details
Call site analysis
resolve_import
Import path resolution

MCP Server vs grep vs ast-grep: Semantic Code Intelligence Comparison

Why traditional code search tools (grep, ripgrep, ast-grep) can't provide the semantic code intelligence that MCP servers deliver for AI assistants

$

grep / ripgrep

  • Text-based matching only
  • No code structure awareness
  • Can't trace call graphs
  • High false positive rate
AST

ast-grep

  • Syntax-aware matching
  • Single-file scope only
  • No cross-file analysis
  • No call graph construction
Recommended

MCP Server

  • Full code graph traversal
  • Bidirectional call graphs
  • Cross-file analysis
  • AI-powered queries

Real-World Example: Finding Function Callers with Semantic Analysis

Traditional grep tools return pattern matches with lots of noise - comments, docstrings, definitions, and false positives. The Code Pathfinder MCP server builds a comprehensive call graph through AST-based analysis and returns only actual function calls with precise file locations, line numbers, and code context. This is semantic code intelligence that AI assistants need for accurate code understanding.

grep: Pattern Matching

Returns 20+ matches including comments, docstrings, and variable names

MCP Server: Call Graph Analysis

Returns 3 actual function calls with file paths, line numbers, and context

MCP Server Call Graph Analysis ExampleCode graph generated by MCP server showing semantic relationships between functions, classes, APIs, and data operations with precise call paths and dependenciesfnclsapidbfnsinkiofn

Call graph visualization showing function relationships from entry point to sink

MCP Server for Code Intelligence: Frequently Asked Questions

Everything you need to know about the Code Pathfinder MCP server, Model Context Protocol, AI assistant integration, and semantic code analysis

Model Context Protocol (MCP) is an open standard introduced by Anthropic that enables AI coding assistants to connect with external tools and data sources in a standardized way. For code intelligence, MCP servers like Code Pathfinder provide deep semantic understanding of your codebase through structured APIs that AI assistants can query.

Instead of each AI tool having its own custom integration, MCP provides a universal way for AI coding tools to communicate with code intelligence servers. Code Pathfinder implements an MCP server that exposes code graph context, call graph analysis, symbol search, and dataflow tracking to any MCP-compatible AI assistant through JSON-RPC 2.0 protocol.

MCP is supported by a growing number of AI coding tools and development platforms:

  • Claude Code - Anthropic's CLI for AI-powered coding with MCP support
  • OpenAI Codex - AI code completion with MCP integration
  • OpenCode - Open-source AI coding assistant with MCP protocol
  • Cline - VS Code extension for AI coding with MCP servers
  • Zed - Next-generation code editor with native MCP support
  • Continue.dev - AI code assistant for VS Code and JetBrains with MCP
  • Any tool implementing the MCP specification

Code Pathfinder MCP server provides code graph context by building a comprehensive semantic model of your codebase through multi-pass analysis:

  • AST-based code indexing - Parses Python files into Abstract Syntax Trees for structural understanding
  • Call graph construction - 5-pass analysis builds bidirectional call graphs (callers & callees)
  • Type inference - Tracks types across function boundaries for accurate resolution
  • Import resolution - Maps module imports to actual file locations across packages
  • Symbol tables - Maintains fully qualified names (FQN) for functions, classes, methods
  • Dataflow tracking - Traces data movement from sources to sinks for taint analysis

This code graph context is exposed through 6 MCP tools that AI assistants query via natural language, enabling precise code navigation, dependency analysis, and impact assessment.

Traditional code search tools like grep, ripgrep, or ast-grep perform pattern matching on text or syntax trees. Code Pathfinder MCP provides semantic code intelligence through program analysis:

Traditional Search (grep/ast-grep):

  • Pattern matching on text
  • No understanding of code relationships
  • Can't answer "who calls this function?"
  • No type awareness or dataflow analysis
  • Returns file locations only

Code Pathfinder MCP (Code Intelligence):

  • Semantic understanding through program analysis
  • Bidirectional call graph traversal (forward & reverse)
  • Answers "who calls what" with precise locations
  • Type inference and dataflow tracking
  • Returns code graph context (relationships, dependencies, flows)
  • Natural language queries via AI assistants

Currently, the MCP server supports Python projects with comprehensive analysis capabilities including:

  • Full AST (Abstract Syntax Tree) parsing
  • Type inference and resolution
  • Import resolution across packages
  • Call graph construction with 5-pass analysis
  • Support for decorators, generators, and async functions

Support for additional languages (JavaScript, TypeScript, Go, Java) is planned for future releases.

Yes, it's completely secure. The MCP server runs locally on your machine. Your code never leaves your computer.

Here's what happens:

  • The server indexes your codebase locally
  • AI assistants send queries to your local server via stdio or HTTP
  • The server responds with relevant code structure information
  • No code or PII is sent to external servers
  • You control which directories the server can access

The MCP server is open source (AGPL-3.0) — you can audit the code yourself on GitHub.

Get Started with MCP Server for AI Code Intelligence

Install Code Pathfinder, configure your AI assistant (Claude Code, Codex, OpenCode), and unlock natural language code queries with semantic code intelligence in under 5 minutes. 100% free, open-source, privacy-first.

Free forever. Open source (AGPL-3.0). Your code stays on your machine.