Skip to main content
Glama

jarvis-graph-mcp

Local-first code intelligence MCP server for Python projects. Designed for any Model Context Protocol client — Claude Desktop, Claude Code, Cursor, Windsurf, Cline. No telemetry. No cloud. No API costs. Your source never leaves your machine.

Status: v0.1.0 initial release. Smoke-tested in-process via FastMCP (server loads, 18 tools register, a real backend call against a real repo returns structured data). Client-specific integration guides below were written against each client's documented MCP config format; field reports from real users are welcome in issues.


What it does

Exposes 18 code-intelligence tools to any MCP client so your LLM assistant can ask structural questions about your codebase and get structured answers — not fuzzy grep results.

Tool

Answers

refactor_priority

"What are the top 10 things to refactor right now?"

find_coverage_gaps

"Which public symbols have zero tests reaching them?"

generate_test_skeleton

"Give me a starter unittest file for this symbol"

health_report

"Give me a one-shot overview of this repo's debt"

detect_changes

"What changed since my last scan?"

summary

"File count, symbol count, complexity — deterministic"

query

"Where is validate_upload defined?"

context

"Who calls beat_match_edit and what does it call?"

impact

"If I change this function, what breaks?"

find_path

"How does main() eventually reach render_amv()?"

find_dead_code

"What's never called anywhere?"

find_unused_imports

"What can I delete from my import blocks?"

find_circular_deps

"Do I have any import cycles?"

find_complexity

"What's over cyclomatic 10?"

find_long_functions

"What's over 50 lines?"

find_god_files

"Which files carry too much responsibility?"

find_high_fan_out

"Which files couple too tightly to the rest?"

find_todo_comments

"Which TODOs are actually high-risk vs noise?"

Every tool is a wrapper around jarvis-graph-lite (distributed separately), a stdlib-only code index with 277 passing tests. No pip dependencies at all — only Python 3.11+ standard library.

Related MCP server: dsh-codebase-chat-mcp

Why local-first

  • Privacy: your source never uploads anywhere. The only network traffic is the MCP stdio channel between your editor and this server, both on localhost.

  • Cost: runs inside the Python interpreter you already have. No per-call API fee, no per-seat subscription, no monthly tool usage cap.

  • Speed: no round-trip to a hosted API. Queries hit an on-disk index that rebuilds only the files you actually changed.

  • Offline: works on a plane. Works on a train. Works in a SCIF.

Installation

Requirements

  • Python 3.10+

  • The mcp Python package (pip install mcp)

  • A clone of jarvis-graph-lite somewhere on disk

Install this package

PyPI distribution is planned for v0.2. For now, install from source:

git clone https://github.com/Zilli-on/jarvis-graph-mcp.git
cd jarvis-graph-mcp
pip install -e .

This puts jarvis-graph-mcp on your PATH and makes python -m jarvis_graph_mcp work.

Point it at jarvis-graph-lite

The MCP server needs to know where the lite package lives. Two options:

  1. Environment variable (recommended):

    set JARVIS_GRAPH_LITE_PATH=C:\path\to\jarvis-graph-lite\src
  2. Sibling checkout: clone jarvis-graph-lite next to this repo so the directory structure is .../some-parent/jarvis-graph-lite/src/ and .../some-parent/jarvis-graph-mcp/. The server auto-discovers it.

  3. Windows default: if you have C:\JARVIS\tools\jarvis-graph-lite\src\ on disk, the server finds it without any config.

Client setup

Claude Desktop

Edit your claude_desktop_config.json (%APPDATA%\Claude\claude_desktop_config.json on Windows, ~/Library/Application Support/Claude/claude_desktop_config.json on macOS) and add under mcpServers:

{
  "mcpServers": {
    "jarvis-graph": {
      "command": "python",
      "args": ["-m", "jarvis_graph_mcp"],
      "env": {
        "JARVIS_GRAPH_LITE_PATH": "C:\\path\\to\\jarvis-graph-lite\\src"
      }
    }
  }
}

Restart Claude Desktop. The jarvis-graph server should appear in the tool list.

Claude Code

claude mcp add jarvis-graph python -m jarvis_graph_mcp

Or manually in your project's .claude/settings.json:

{
  "mcpServers": {
    "jarvis-graph": {
      "command": "python",
      "args": ["-m", "jarvis_graph_mcp"]
    }
  }
}

Cursor / Windsurf / Cline

Add the same config block under their respective MCP settings. The command and args are identical across clients because MCP is transport-agnostic.

Usage examples

Once connected, ask your LLM assistant questions like:

"Use jarvis-graph to rank the top 5 refactor priorities in C:\code\my-project."

"Find the top 10 coverage gaps in this repo and write test skeletons for the three most complex ones."

"What's the call chain from main to render_amv in the lyrc-local repo?"

"Run a full health report against C:\code\current-project and summarise the biggest risks."

The LLM picks the right tool, passes your repo path, and gets back structured data it can reason about.

Architecture

┌────────────────────────┐
│    MCP Client          │   Claude Desktop / Cursor /
│    (your editor)       │   Claude Code / Windsurf / ...
└──────────┬─────────────┘
           │ stdio (JSON-RPC)
┌──────────▼─────────────┐
│  jarvis-graph-mcp      │   this package
│  FastMCP server, 18    │
│  @mcp.tool decorators  │
└──────────┬─────────────┘
           │ subprocess + PYTHONPATH
┌──────────▼─────────────┐
│  jarvis-graph-lite     │   stdlib-only Python
│  CLI with --json flag  │   code index + query engine
└──────────┬─────────────┘
           │ read-only filesystem access
┌──────────▼─────────────┐
│  your source tree      │
└────────────────────────┘

All tools are read-only. This server cannot modify your code. The worst it can do is read a file that shouldn't be indexed — and even that is controlled by standard .gitignore-style exclusions in jarvis-graph-lite.

Development

# clone
git clone https://github.com/Zilli-on/jarvis-graph-mcp.git
cd jarvis-graph-mcp

# install in editable mode
pip install -e .

# verify the server starts and lists tools
python -c "
from jarvis_graph_mcp.server import mcp
import asyncio
tools = asyncio.run(mcp.list_tools())
print(f'{len(tools)} tools registered')
"

Roadmap

  • V0.1: 18 tools, MCP stdio, subprocess backend, local-first, 6 smoke tests, E2E verified against a real repo

  • V0.2: PyPI distribution (pip install jarvis-graph-mcp), CI with GitHub Actions, verified screenshots against at least one real MCP client

  • V0.3: in-process jarvis-graph-lite integration (no subprocess fork per call, ~3x speedup for small queries)

  • V0.4: resources:// entries for health reports so clients can subscribe to "is my repo healthy?" as a live resource

  • V0.5: TypeScript / JavaScript support (current: Python only)

  • V0.6: Multi-repo mode — scan a whole workspace in one call

License

MIT. See LICENSE.

Credits

Built on top of jarvis-graph-lite, which does the actual static analysis. This package is the MCP transport adapter.

If you find this useful, consider sponsoring.

Available Tools

18 tools
contextA

Explain a symbol's role in the codebase: what it calls, what calls it, what file it lives in, how complex it is. Use this after query to drill into a specific symbol.

Inputs: symbol (required), repo_path (required). Returns: object

detect_changesB

Diff the current filesystem against the last cached index. Shows which files were added, modified, or removed since the last index run. Use this to know what changed between sessions.

Inputs: repo_path (required). Returns: object

find_circular_depsB

Detect import cycles between modules. A cycle is almost always a refactoring smell; use this to catch them before they calcify.

Inputs: repo_path (required). Returns: object

find_complexityC

List functions and methods with cyclomatic complexity above a threshold. Higher complexity = harder to test, more likely to hide bugs.

Inputs: repo_path (required), limit, threshold. Returns: object

find_coverage_gapsB

List public symbols in a repo that no test entry point can reach via the call graph. Use this to find where to add tests next.

Inputs: repo_path (required), limit, min_complexity. Returns: object

find_dead_codeB

List functions, classes, and methods that have no callers anywhere in the repo. Has built-in false-positive filters for test classes, dispatch dicts, and module-level convention names.

Inputs: repo_path (required), limit. Returns: object

find_god_filesB

Rank files by symbols × LOC × fan-in. God files concentrate too much responsibility and become refactoring bottlenecks.

Inputs: repo_path (required), limit. Returns: object

find_high_fan_outB

List files that import many other in-repo files. High fan-out indicates coupling risk — changing a high-fan-out file ripples through more of the codebase.

Inputs: repo_path (required), limit. Returns: object

find_long_functionsC

List functions and methods over a line-count threshold. Long functions are a proxy for scope creep and often correlate with high complexity.

Inputs: repo_path (required), limit, min_lines. Returns: object

find_pathB

Find a shortest resolved call chain between two symbols. Answers 'how does foo eventually end up calling bar?' in a single hop.

Inputs: source (required), target (required), repo_path (required). Returns: object

find_todo_commentsA

Rank TODO/FIXME/HACK/BUG/XXX comments by composite risk (tag severity + complexity + line count of the enclosing symbol). Use this to find the author-annotated debt that actually matters instead of every stray 'TODO' in the codebase.

Inputs: repo_path (required), limit. Returns: object

find_unused_importsB

List unused import statements in a Python repo. Honours # noqa: F401 annotations to skip intentional re-exports.

Inputs: repo_path (required), limit. Returns: object

generate_test_skeletonA

Emit a unittest.TestCase skeleton for a given symbol. Pairs with find_coverage_gaps to close the 'what's untested → write a stub' loop: find the gap, then call this tool with the symbol name to get a starter file.

Inputs: symbol (required), repo_path (required). Returns: object

health_reportA

Full-repo health scan combining every signal: complexity, coverage, dead code, cycles, unused imports, god files, TODO density, and fan-out coupling. Use at the start of a session to get a one-shot overview of the codebase state.

Inputs: repo_path (required). Returns: object

impactA

Estimate the blast radius of modifying a symbol. Returns the transitive set of callers that would be affected by a change. Use this before refactoring to know what you're touching.

Inputs: symbol (required), repo_path (required). Returns: object

queryA

Locate where a concept lives in the repo. Pass a keyword or partial symbol name and get back the files and symbols that match. Use this as the entry point to 'where is X implemented?'

Inputs: term (required), repo_path (required), limit. Returns: object

refactor_priorityA

Rank the top N untested complexity hotspots in a Python repo. Combines cyclomatic complexity, line count, caller count, and test coverage into one composite score. Use this to answer 'what should I refactor first?'

Inputs: repo_path (required), limit, min_priority. Returns: object

summaryA

Deterministic per-repo summary: file count, symbol count, import count, call count, indexed size. Stable across runs on the same commit.

Inputs: repo_path (required). Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 18 tools

    Disambiguation4/5

    Most tools have clearly distinct purposes and the descriptions explicitly chain them (query→context→impact, find_coverage_gaps→generate_test_skeleton). The only mild overlaps are refactor_priority vs find_complexity/find_long_functions and health_report vs the individual find_* signals, but each is framed as composite vs atomic so an agent can still choose correctly.

    Naming Consistency3/5

    A large find_* group (find_dead_code, find_path, find_complexity, etc.) is very consistent, but the set mixes conventions: verb_noun (generate_test_skeleton, detect_changes), noun phrases (refactor_priority, health_report), and bare single-word nouns/verbs (summary, query, context, impact). Readable but not a single predictable pattern.

    Tool Count4/5

    18 tools is on the heavier side but each maps to a distinct code-analysis signal, so they largely earn their place. It is slightly over the comfortable 3-15 band, but the scope (graph analysis + quality heuristics) justifies most of the surface.

    Completeness5/5

    The surface covers the full analysis lifecycle: discovery (query/context/impact/find_path), quality signals (complexity, long functions, god files, fan-out, dead code, unused imports, cycles, todos), coverage gaps with test generation, plus health_report, summary, and change detection. No obvious dead ends for a read-only code-graph analysis domain.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Provides structural, queryable understanding of a Python codebase via MCP tools, enabling direct lookups for callers, dependencies, and class hierarchies without repeated grep/read cycles.
      6
      Apache 2.0
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables AI IDEs to chat with, search, explain, refactor, and audit a local codebase without uploading source code, returning answers backed by file-and-line source citations, confidence scores, and severity labels, plus audit and board-ready strategic reports. Runs locally and standalone as an MCP server compatible with Claude, Cursor, Windsurf, and DeepSeek Harness.
      629 npm
      2
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      Indexes a Python/JS/TS repository into a local SQLite knowledge graph so agents can trace callers, callees, imports, subclasses and covering tests, measure impact radius, rank diff risk, and summarize architecture without grepping files. Exposes these queries as MCP tools alongside an equivalent CLI, with no daemon, embeddings, or network access.
      10
      MIT
    • F
      license
      Not graded
      quality
      Not graded
      maintenance
      Enables coding agents and developers to parse Python source into ASTs and compute complexity metrics that pinpoint refactoring hotspots, dead code, and breaking API diffs. It returns decomposition plans and dependency-graph telemetry over MCP, keeping token usage low with zero external dependencies.
      -