# callgraph

> callgraph is an open-source MCP server for developer tools. Show agents a file's structure, callers and impact in eight languages, unread. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, macOS, Linux, Windows
- **Website:** https://callgraph.eu
- **Repository:** https://github.com/geriy/callgraph
- **MCP Registry name:** io.github.GeRiY/callgraph
- **Categories:** developer tools
- **Listing updated:** 2026-11-14

## About

The output is built from syntax trees, so a class is a few dozen lines instead of the whole file. A sample shows a PHP model: constants, then each method with calls labelled external_call, global_helper, internal_helper or orm_relation. `--grep` finds callers, `--depth N` follows callers of callers for impact analysis, and `file::method --body` prints one method.

Two commands start a task: `locate` ranks files from the names in a task, and `profile` describes architecture and layers. Laravel and Yii views cover routes, middleware, jobs and events. Dynamic calls are marked dynamic_call or name-only matches instead of silently missing.

It ships as one static binary for macOS, Linux and Windows, as a CLI or MCP server, and the docs say to prefer grep for exact strings.

## Features

- **Categorised calls:** Native, ORM, helper, framework and more.
- **Caller search:** --grep with --depth.
- **Single-method reads:** Print a method or line range.
- **Project profile:** Architecture and layers.
- **Framework views:** Laravel and Yii aware.
- **Self-updating binary:** One binary, incremental cache.

## Good for

- Find who calls a method before changing it
- Orient in an unfamiliar PHP codebase
- Cut tokens when exploring a repo
- Read one method body

## Install

### Claude Code (Terminal)

```sh
claude mcp add callgraph -- npx -y https://github.com/GeRiY/callgraph/releases/download/v1.0.2/callgraph.mcpb
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "callgraph": {
      "command": "npx",
      "args": [
        "-y",
        "https://github.com/GeRiY/callgraph/releases/download/v1.0.2/callgraph.mcpb"
      ]
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "callgraph": {
      "command": "npx",
      "args": [
        "-y",
        "https://github.com/GeRiY/callgraph/releases/download/v1.0.2/callgraph.mcpb"
      ]
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "callgraph": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "https://github.com/GeRiY/callgraph/releases/download/v1.0.2/callgraph.mcpb"
      ]
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "callgraph": {
      "command": "npx",
      "args": [
        "-y",
        "https://github.com/GeRiY/callgraph/releases/download/v1.0.2/callgraph.mcpb"
      ]
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "callgraph": {
      "command": "npx",
      "args": [
        "-y",
        "https://github.com/GeRiY/callgraph/releases/download/v1.0.2/callgraph.mcpb"
      ]
    }
  }
}
```

## FAQ

### Which languages?

PHP, JS/TS, Vue, Rust, Swift, Python and Go.

### Licence?

MIT, and free.

### Does it replace grep?

No, grep is better for exact strings.

### What about dynamic calls?

Shown as name-only matches with --guess, or not at all.

### Is callgraph free?

Yes. callgraph is open source, so you can use and self-host it for free.

### How do I add callgraph to Claude Code?

Run this command in your terminal: claude mcp add callgraph -- npx -y https://github.com/GeRiY/callgraph/releases/download/v1.0.2/callgraph.mcpb

### What are the best alternatives to callgraph?

The closest alternatives to callgraph are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [Ouroboros](https://ai-powered.com/mcp/ouroboros): Ouroboros is an open-source MCP server for developer tools.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.
- [Concord MCP](https://ai-powered.com/mcp/concord-mcp): Concord MCP is a freemium MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/callgraph
