jarvis-graph-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@jarvis-graph-mcp what should I refactor first in this Python repo?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 |
| "What are the top 10 things to refactor right now?" |
| "Which public symbols have zero tests reaching them?" |
| "Give me a starter unittest file for this symbol" |
| "Give me a one-shot overview of this repo's debt" |
| "What changed since my last scan?" |
| "File count, symbol count, complexity — deterministic" |
| "Where is |
| "Who calls |
| "If I change this function, what breaks?" |
| "How does |
| "What's never called anywhere?" |
| "What can I delete from my import blocks?" |
| "Do I have any import cycles?" |
| "What's over cyclomatic 10?" |
| "What's over 50 lines?" |
| "Which files carry too much responsibility?" |
| "Which files couple too tightly to the rest?" |
| "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
mcpPython 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:
Environment variable (recommended):
set JARVIS_GRAPH_LITE_PATH=C:\path\to\jarvis-graph-lite\srcSibling checkout: clone
jarvis-graph-litenext 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.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_mcpOr 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
maintorender_amvin the lyrc-local repo?"
"Run a full health report against
C:\code\current-projectand 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 clientV0.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 resourceV0.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 toolscontextA
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
Scored across 18 tools
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.
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.
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.
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
Related MCP Connectors
Evidence-backed architecture-quality analysis for Python agent applications.
Repository knowledge graph MCP server for codebase understanding and debugging.
The Cortex MCP server provides read-only access to real-time engineering context from the Cortex developer portal, allowing AI coding assistants to answer natural language questions about your organization's catalog (microservices, libraries, domains, teams, infrastructure), scorecards (engineering standards and best practices), initiatives (goals and deadlines), and Engineering Intelligence metrics. It includes tools for querying documentation, tracking personal entities, and accessing AI-assisted insights across the entire Cortex ecosystem.
Shared context for your codebase: a hosted code knowledge graph over MCP. Free plan, OAuth sign-up.
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides structural, queryable understanding of a Python codebase via MCP tools, enabling direct lookups for callers, dependencies, and class hierarchies without repeated grep/read cycles.6Apache 2.0
- AlicenseNot gradedqualityAmaintenanceEnables 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 npm2MIT
- AlicenseBqualityBmaintenanceIndexes 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.10MIT
- FlicenseNot gradedqualityNot gradedmaintenanceEnables 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.-