Ops Codegraph Tool

v1.0.0Developer Toolsstable

Code intelligence CLI — function-level dependency graph across 11 languages, 30-tool MCP server for AI agents, complexity metrics, architecture boundary enforcement, CI quality gates, git diff impact with co-change analysis, hybrid semantic search. F

ai-agentsarchitectureci-cdclicode-analysis
Share:
56
Stars
0
Downloads
0
Weekly
0/5

What is Ops Codegraph Tool?

Ops Codegraph Tool is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to code intelligence cli — function-level dependency graph across 11 languages, 30-tool mcp server for ai agents, complexity metrics, architecture boundary enforcement, ci quality gates, git diff impact ...

Code intelligence CLI — function-level dependency graph across 11 languages, 30-tool MCP server for AI agents, complexity metrics, architecture boundary enforcement, CI quality gates, git diff impact with co-change analysis, hybrid semantic search. F

This server falls under the Developer Tools and Coding Agents categories on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Code intelligence CLI — function-level dependency graph acro

Use Cases

Analyze function-level dependencies across 11 languages with complexity metrics. Enforce architecture boundaries and assess git diff impact with co-change analysis.
Generate 30 MCP tools for AI agents to understand codebases deeply.
optave

Maintainer

LicenseApache-2.0
Languagetypescript
Versionv1.0.0
UpdatedMay 21, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx ops-codegraph-tool

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Ops Codegraph Tool

Ops Codegraph Tool (codegraph) is a code intelligence CLI and 34-tool MCP server that builds a function-level dependency graph across 34 programming languages and exposes it to AI agents for deep codebase understanding. It provides capabilities including symbol location, call chain tracing, blast radius analysis for proposed changes, cyclomatic and cognitive complexity metrics, circular dependency detection, architecture boundary enforcement via manifesto rules, hybrid BM25 and semantic search, and git co-change analysis — all with sub-second incremental rebuilds at 4.4 ms per file using a native Rust engine. Developers use it to give AI coding agents reliable, structured context before and after making changes, dramatically reducing hallucination and missed dependencies.

Prerequisites

  • Node.js 22.6 or higher installed
  • npm for global installation
  • A codebase in one of the 34 supported languages (JavaScript, TypeScript, Python, Go, Rust, Java, C#, and more)
  • Claude Desktop, Claude Code, or another MCP-compatible AI assistant
  • Optional: an LLM API key (OpenAI-compatible) for semantic search features, set via CODEGRAPH_LLM_API_KEY
1

Install codegraph globally

Install the @optave/codegraph package globally via npm. Node.js 22.6 or higher is required.

npm install -g @optave/codegraph
2

Build the dependency graph for your project

Navigate to your project root and run codegraph build to parse the codebase and create the function-level dependency graph. This is required before the MCP server or CLI queries will work.

cd /path/to/your/project
codegraph build
3

Create an optional .codegraphrc.json for project configuration

For projects with path aliases, custom include/exclude patterns, or architecture rules, create a .codegraphrc.json in your project root. This file is optional for basic usage.

{
  "include": ["src/**"],
  "exclude": ["**/*.test.js", "**/*.spec.ts"],
  "ignoreDirs": ["node_modules", ".git", "dist"],
  "aliases": { "@/": "./src/" },
  "build": { "incremental": true }
}
4

Start the MCP server

Launch codegraph in MCP server mode. Use --multi-repo if you want the server to provide access to multiple registered repositories.

# Single-repo mode (default)
codegraph mcp

# Multi-repo mode
codegraph mcp --multi-repo
5

Register in your MCP client configuration

Add codegraph to your claude_desktop_config.json or Claude Code configuration. The server is launched as a stdio process pointing at your project.

{
  "mcpServers": {
    "codegraph": {
      "command": "codegraph",
      "args": ["mcp"],
      "env": {
        "CODEGRAPH_LLM_API_KEY": "your-openai-api-key-for-semantic-search"
      }
    }
  }
}

Ops Codegraph Tool Examples

Client configuration

Claude Desktop configuration entry for the codegraph MCP server. The LLM API key is optional and only required for semantic search features.

{
  "mcpServers": {
    "codegraph": {
      "command": "codegraph",
      "args": ["mcp"],
      "env": {
        "CODEGRAPH_LLM_API_KEY": "sk-your-openai-api-key"
      }
    }
  }
}

Prompts to try

Use these prompts to leverage codegraph's dependency intelligence when working with Claude on your codebase.

- "Find where handleAuth is defined and show me all its callers before I modify it"
- "What is the blast radius of changing the UserRepository.findById function?"
- "Show me the shortest call path between the API gateway and the database connection pool"
- "Detect all circular dependencies in the src/modules directory"
- "Analyze the cognitive complexity of my top 10 most complex functions and suggest refactoring priorities"
- "Show me which files are most historically co-changed with auth/login.ts in git history"

Troubleshooting Ops Codegraph Tool

codegraph build fails or produces an empty graph

Verify that your project's language files are not excluded by the default ignoreDirs (node_modules, .git). Check that Node.js is version 22.6 or higher with 'node --version'. For projects with path aliases (e.g. @/components), add an aliases entry to .codegraphrc.json matching your tsconfig.json paths.

Semantic search returns no results or generic matches

Semantic search requires an LLM API key. Set CODEGRAPH_LLM_API_KEY to a valid OpenAI-compatible API key in your environment or in the MCP server config. BM25 keyword search works without an API key and can be used as a fallback.

MCP server starts but Claude cannot call codegraph tools

Run 'codegraph build' in the project directory before starting the MCP server — the graph must exist for tools to return results. If using multi-repo mode, ensure all repositories are registered and built. Restart the MCP client after fixing configuration issues.

Frequently Asked Questions about Ops Codegraph Tool

What is Ops Codegraph Tool?

Ops Codegraph Tool is a Model Context Protocol (MCP) server that code intelligence cli — function-level dependency graph across 11 languages, 30-tool mcp server for ai agents, complexity metrics, architecture boundary enforcement, ci quality gates, git diff impact with co-change analysis, hybrid semantic search. f It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Ops Codegraph Tool?

Follow the installation instructions on the Ops Codegraph Tool GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Ops Codegraph Tool?

Ops Codegraph Tool works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Ops Codegraph Tool free to use?

Yes, Ops Codegraph Tool is open source and available under the Apache-2.0 license. You can use it freely in both personal and commercial projects.

Browse More Developer Tools MCP Servers

Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "ops-codegraph-tool": { "command": "npx", "args": ["-y", "ops-codegraph-tool"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Ops Codegraph Tool?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides