Skip to main content
Glama
scipq-mcp
by gdressino

scipq-mcp

An MCP server for navigating Java code — find symbols, references, definitions, implementations, supertypes, outlines, callers and callees — that reads the per-file SCIP shards javac writes at compile time, without loading an index into memory.

Language servers and index-backed tools keep the whole project in the heap: on a 10,000-file multi-module project that is gigabytes per checkout, multiplied by every worktree you have open. scipq-mcp keeps nothing between calls. Each call:

  1. greps the shards for the exact bytes the answer must contain (in parallel, PCRE when available),

  2. decodes only the matching protobuf messages of those few shards, with a small stdlib-only decoder,

  3. answers in compact text: paths relative to the project root, 1-based lines, the line of code.

On that 10,000-file project: 0.1–0.3 s per query, ~65 MB resident (≈17 MB for scipq-mcp itself, the rest is the MCP SDK), one server for any number of checkouts.

Read-only by design

scipq-mcp reads shards, sources and git metadata (git diff, git ls-files). It never compiles, never runs tests and never writes to your repository; the only thing it writes is its own cache. The index is produced by the build you already run; scipq-mcp consumes it. When the index is not enough (stale shards, files that never compiled, a checkout that was never built) it says so and tells you what to build, without running it.

Related MCP server: Android Source Explorer MCP Server

How the index is produced

The scip-javac compiler plugin writes one shard per source file while javac runs:

<root>/build/scip-targetroot/<module>/<task>/META-INF/scip/<source path from the root>.scip

Gradle compiles incrementally, so after an edit only the shards of what was recompiled are rewritten — the index is as fresh as your last build, at no extra cost.

Gradle

The package ships an init script that adds the plugin to every JavaCompile task:

scipq-mcp gradle-init > ~/.gradle/init.d/scip-shards.init.gradle
# edit PROJECTS in that file to limit it to your projects (empty = every build)
./gradlew compileJava compileTestJava

Or for a single build: ./gradlew build --init-script scip-shards.init.gradle. Turn it off for one run with -Pscip=false. It only affects local builds that load the script (CI does not see ~/.gradle/init.d). It works with Lombok and other annotation processors, and with the Gradle build cache (the shards are declared as task outputs).

Maven

Add the plugin configuration that setup prints (also in src/scipq_mcp/templates/maven-compiler-plugin.xml) to maven-compiler-plugin, and keep any other annotation processors (e.g. Lombok) listed in annotationProcessorPaths. Shards land in build/scip-targetroot/<artifactId>/<compile|testCompile>/ under the directory that holds .mvn/ (create an empty .mvn/ at the repository root if there is none).

Other builds

Any build that runs javac can produce the same layout: put org.scip-code:scip-javac on the annotation processor path and pass -Xplugin:scip -sourceroot:<project root> -targetroot:<root>/build/scip-targetroot/<module>/<task>.

First use from an agent

An agent that has the server installed but a project without shards gets an answer that says so and points to the setup tool. setup inspects the build (Gradle or Maven, the root project name, the wrapper, init scripts already in ~/.gradle/init.d and whether they apply) and returns the exact steps with the init script or pom snippet to add. The server instructions tell the agent to ask the user before changing the build. In Claude Code, the setup prompt (/mcp__scipq__setup) does the same on demand.

Install

Requirements: Python ≥ 3.11, Linux or macOS. GNU grep and GNU find are used when present (much faster on large projects); otherwise scipq-mcp falls back to pure Python. On macOS, brew install grep findutils provides them (ggrep is picked up automatically).

uvx scipq-mcp --help            # run without installing
pipx install scipq-mcp          # or install it

Claude Code

claude mcp add scipq -- uvx scipq-mcp

Other MCP clients

{
  "mcpServers": {
    "scipq": { "command": "uvx", "args": ["scipq-mcp"] }
  }
}

The server serves the project it is started in (any directory inside it). Every tool also takes project_root, so one server can answer for several checkouts or git worktrees.

Installed for every project (user scope), it stays out of the way where it does not apply: when the directory it starts in is not a Java project (no Gradle or Maven build files, no shards, no .java sources), it exposes no tools and a one-line instruction, so it costs no context. A Java project that was never compiled does get the tools (setup explains what to do). Start it with --always to expose the tools anyway, e.g. to query other checkouts through project_root.

Server options: --root DIR (default project), --shards-dir (default build/scip-targetroot), --freshness full|results|off (see below), --always, --cache-dir DIR, --index-external all|methods|none, --config FILE, --tools all|core|name,name… (fewer tools, less context; core keeps the navigation basics), --build-workers N (index build; default min(4, CPUs/4), always at low CPU/IO priority).

Tools

Tool

What it answers

Like

setup

how this project produces shards, whether they are fresh, the steps to enable them

—

find_symbols(name, match)

definitions by name or part of it (exact, prefix, contains, camel humps; case-insensitive)

workspace/symbol

references(symbol, exclude_imports, by_name)

every use, grouped by file, with the line of code and the enclosing method (imports left out for types; large results open with a summary); optionally possible uses by name in strings

findReferences

definition(symbol)

location, kind, signature, javadoc, what it overrides or extends

definition + hover

source(symbol)

the exact source of a definition, with line numbers

—

implementations(symbol, direct_only)

subtypes of a type or overrides of a method, at any depth; anonymous classes included

implementation

supertypes(symbol)

supertypes of a type, or the methods a method overrides, direct first

type hierarchy

members(symbol, inherited)

own and inherited members of a type, marking overrides and generated ones

—

family(symbol)

a method's override family (ancestors, descendants, siblings) and the uses of each

—

overloads(symbol)

every overload of a method and the uses of each

—

outline(file)

definitions in a file, nested, with signatures; takes a path or a type name

documentSymbol

callers(symbol, depth, include_overridden)

incoming calls grouped by enclosing method

incomingCalls

callees(symbol, include_fields, include_types)

methods called from a body

outgoingCalls

annotated(annotation)

definitions carrying an annotation, with its line (attribute values)

—

typed(symbol, categories)

where a type is used: fields, parameters, return types, locals, supertypes, bodies, imports

—

tests(symbol)

test classes that use a symbol directly, with a ready --tests / -Dtest filter

—

index_status()

shards per task, stale and uncompiled files, tracked files without a shard, what to recompile

—

batch(queries)

several of the above in one call

—

All tools are read-only and take an optional project_root. Lists take offset/limit and say next offset N when there is more.

Library and JDK symbols

definition, source and members also answer for symbols the project only uses — the JDK and its dependencies — from the -sources.jar files in the Gradle (~/.gradle/caches) and Maven (~/.m2/repository) caches and the JDK's lib/src.zip: declaration, javadoc, overloads, the body, the members a project type inherits from library supertypes (nearest first), members of a library type itself, and typed(subtypes=true) through library hierarchies. Which version the build uses is not in the shards: with several cached, the highest is used and the answer says which. JDK sources follow the build's target version when a matching JDK is installed. A class → jar map is kept in the user cache (libraries.sqlite), built the first time it is needed (it lists every cached sources jar once, ~10–20 s) and refreshed incrementally. Gradle downloads sources jars when an IDE asks for them; without one, the answer says so.

Whole-project tools (auxiliary index)

Questions that follow call chains or look at everything use an on-disk index, built from the shards the first time one of these tools runs (~15 s and ~170 MB for 10,000 files, in a child process so the server stays small) and updated incrementally afterwards (unchanged: ~0.1 s).

Tool

What it answers

impact(symbol, depth, include_overridden, group_by)

transitive callers by depth, grouped by module or package, tests marked

tests(symbol, transitive=true)

test classes that reach a symbol through callers, with the command to run them

path(source, target)

shortest call chains between two symbols, with the lines

changed(base, staged, paths)

from git diff to the definitions whose lines changed, their callers and the tests to run

deps(level, scope, target, sites)

dependencies between modules or packages, cycles, or every call site from one scope to another

dead_code(scope, public_is_api)

candidates nobody references, leaving out framework entry points, overrides, accessors in use and names used in strings

census(category)

annotations in use, or entities and their tables

cache_status()

where the index of this checkout is and how big

The index lives in the user cache — $XDG_CACHE_HOME/scipq (~/.cache/scipq), or ~/Library/Caches/scipq on macOS — one directory per checkout (worktrees get their own), private (0700, owner and symlink checked). --cache-dir DIR moves it. It is disposable: deleted, it is rebuilt. scipq-mcp cache status|prune|clear manages it; the server prunes the entries of checkouts that no longer exist when it starts. --index-external methods|none keeps fewer references to JDK and library symbols (smaller, slower to build).

Profiles and project configuration

Framework knowledge is declarative. Built-in profiles — junit, spring, jaxrs, vaadin, cucumber, jpa, jdo — list entry points (annotations, supertypes, type names) and the persistence model; with no configuration, the profiles whose annotations appear in the project are used. A configuration file (--config FILE, default $XDG_CONFIG_HOME/scipq/config.toml) picks profiles and project settings per checkout:

[[project]]
match = { root_project = "shop" }   # or { path = "~/src/shop*" } (worktrees), { git_remote = "…" }
profiles = ["jpa", "spring", "junit"]

[project.tests]
filter = "./run-tests.sh {task} {tests}"   # {module} {task}; {tests} {classes} per module,
                                           # or {fqcn} {simple} for one line per class

[project.by_name]
globs = ["*.java", "*.xml"]

[[project.entry_points]]
type_names = ["*Screen"]

When several entries match, path beats root_project, which beats git_remote. Your own profiles go in $XDG_CONFIG_HOME/scipq/profiles/*.toml (same format as src/scipq_mcp/profiles/). index_status shows which entry and profiles apply.

Naming symbols

Pass a name or an exact SCIP symbol:

Input

Means

Account

a type (or member) named Account

Account#setState, Account.setState

member setState of Account

com.example.model.Account

qualified; /, . and # are all accepted as separators

setState()

methods only, any overload

setState(+1)

the second overload (SCIP numbers overloads (), (+1), (+2)…)

Account#<init>

constructors

com/example/model/Account#setState().

the exact symbol, as printed by find_symbols

PersistenceManager#evict

JDK and library symbols, found among the references

A name that matches one symbol is resolved, and the answer starts with -- Account#setState → com/example/model/Account#setState().. An ambiguous name returns the candidates with their signatures instead.

Freshness

What scipq-mcp sees is the last compilation. Every answer ends with a warning when:

  • a source was edited after its shard was written (its results may be off), naming those that appear in the answer;

  • a .java file was created after the last compilation of its module and has no shard yet.

--freshness full (default) checks every shard against its source in parallel with the query (~0.1 s on 10,000 files, mostly hidden behind the query); results checks only the files in the answer; off disables it.

Semantics and limits

  • Only compiled code is visible. Shards of deleted sources are ignored.

  • Occurrences only distinguish definitions from references: scip-javac does not record read/write access.

  • Symbols from the JDK or dependencies have references but no definition.

  • implementations reports every level: scip-javac records the whole chain of supertypes on each type and method. A result is direct unless it also implements another result.

  • Callers: uses inside lambdas and anonymous classes count for the enclosing method; field initializers for the field; initializer blocks (static or instance) for the class.

  • Lombok: generated members are located at the node that generates them (the field, or a class-level @Getter/@Setter) and marked generated; the references inside generated bodies are left out.

  • references(by_name=true) lists, separately, lines where the name (or its bean property name) appears inside string literals or other files: map keys, query strings, templates. The index cannot see those; check them by hand.

Command line

Besides serve (the default) and gradle-init, scipq-mcp query runs any tool from the shell, for debugging or scripts:

scipq-mcp query --root ~/src/project refs 'Account#setState'
scipq-mcp query impl Entity --direct
scipq-mcp query callers 'Entity#setState()' --depth 2

Development

uv venv && uv pip install -e . pytest
.venv/bin/python -m pytest

tests/fixtures/sample is a small two-module Java project; its shards are checked in, so the tests need no JDK. To regenerate them (JDK 17+): tests/fixtures/build-sample.sh.

Design notes and the roadmap: docs/design.md.

Releasing

Releases are published by GitHub Actions with PyPI Trusted Publishing: no API token exists in the repository, its secrets, or anyone's machine.

  1. Describe the changes under ## Unreleased in CHANGELOG.md and commit.

  2. scripts/release.sh [VERSION] — sets the version, dates the changelog, runs the tests, commits and tags vVERSION.

  3. git push origin main vVERSION — the release workflow tests, builds and publishes.

License

MIT

Available Tools

25 tools
annotatedB
Read-onlyIdempotent

Classes, methods, fields and parameters carrying an annotation, with the annotation's line (which holds its attribute values).

Inputs: annotation (required), limit, scope, offset, +1 more.

batchA
Read-onlyIdempotent

Run several queries on the same checkout in one call (one freshness check).

Inputs: queries (required), project_root.

cache_statusB
Read-onlyIdempotent

Where the auxiliary index of this checkout is, its size and row counts.

Inputs: project_root.

calleesB
Read-onlyIdempotent

Methods and constructors referenced from the body of a definition (like outgoingCalls), with the lines; optionally fields and types too.

Inputs: symbol (required), limit, offset, project_root, +2 more.

callersA
Read-onlyIdempotent

Incoming calls / uses grouped by the enclosing method (like incomingCalls). Exact: only this symbol, not same-named members of other types. Calls in lambdas and anonymous classes count for the enclosing method; field initializers for the field; initializer blocks for the class. offset/limit page the direct callers.

Inputs: symbol (required), depth, limit, scope, +4 more.

censusC
Read-onlyIdempotent

Censuses over the project: annotations in use, or entities with their tables.

Inputs: limit, scope, offset, category, +1 more.

changedA
Read-onlyIdempotent

From git diff (read-only) to the definitions whose lines changed, their callers and the tests to run. Hunks that only delete code cannot be mapped and are listed; files edited after their last compilation are refused until recompiled.

Inputs: base, depth, paths, staged, +1 more.

dead_codeA
Read-onlyIdempotent

Candidates for dead code: definitions nobody references, leaving out overrides, framework-managed members (non-JDK annotations), main and serialization hooks, no-arg constructors, Lombok accessors in use and names found in string literals. Candidates, not verdicts: reflection can still reach them.

Inputs: limit, scope, offset, project_root, +2 more.

definitionA
Read-onlyIdempotent

Where a symbol is defined, with kind, signature, javadoc and what it overrides or extends (like goToDefinition + hover). Lombok members point at what generates them. JDK and library symbols come from the JDK's src.zip and the -sources.jar files in the Gradle/Maven caches, saying which version.

Inputs: symbol (required), project_root.

depsB
Read-onlyIdempotent

Dependencies between modules or packages (reference counts) and their cycles; with sites, every place where scope uses target.

Inputs: level, limit, scope, sites, +4 more.

familyA
Read-onlyIdempotent

The override family of a method — what it overrides, its overrides, and the other overrides of its ancestors — with the uses of each. references on an abstract method does not see calls through the overrides; this does.

Inputs: symbol (required), limit, offset, show_uses, +1 more.

find_symbolsA
Read-onlyIdempotent

Definitions in the project by name or part of a name (like workspace/symbol). Each row: path:line kind exact symbol — signature.

Inputs: name (required), limit, match, offset, +1 more.

impactA
Read-onlyIdempotent

Transitive callers of a symbol, by depth, grouped by module or package, marking tests: what a change can affect. Uses the auxiliary index (built once per checkout, then updated incrementally).

Inputs: symbol (required), depth, limit, offset, +3 more.

implementationsA
Read-onlyIdempotent

Subtypes of a class or interface, or overrides of a method, at any depth; indirect ones say which result they go through. Anonymous classes are included.

Inputs: symbol (required), limit, offset, direct_only, +1 more.

index_statusA
Read-onlyIdempotent

The state of the index: shards per compile task, stale and not-yet-compiled sources, git-tracked .java files without a shard, and what to recompile.

Inputs: project_root.

membersA
Read-onlyIdempotent

Members of a type: its own, then those inherited from each supertype (not private, not constructors, not overridden), marking overrides and generated (Lombok) ones; library supertypes are listed from their sources jars, nearest first, without what a nearer type overrides. Library types themselves work too (e.g. VerticalLayout).

Inputs: symbol (required), limit, offset, inherited, +1 more.

outlineC
Read-onlyIdempotent

Definitions in a file (like documentSymbol), nested, with line and signature.

Inputs: file (required), limit, offset, project_root.

overloadsC
Read-onlyIdempotent

Every overload of a method in its type, with the uses of each.

Inputs: symbol (required), limit, offset, project_root.

pathB
Read-onlyIdempotent

Shortest call chains from one symbol to another, with the lines of each call.

Inputs: source (required), target (required), limit, max_depth, +1 more.

referencesA
Read-onlyIdempotent

Every use of a symbol (like findReferences), grouped by file, with the line of code and [the enclosing method]. Exact: only this symbol, not same-named members of other types. Overrides are separate symbols: see family / callers. Large results open with a summary.

Inputs: symbol (required), limit, scope, offset, +5 more.

setupA
Read-onlyIdempotent

How this project produces the SCIP shards the other tools need, and whether they are there and fresh. When they are missing it returns the exact steps for its build (Gradle init script or Maven compiler configuration). It changes nothing itself.

Inputs: project_root, include_template.

sourceA
Read-onlyIdempotent

The exact source of a definition (method, field, class) with line numbers, so you do not have to read the whole file; also for JDK and library symbols (from their sources jars).

Inputs: symbol (required), max_lines, project_root.

supertypesB
Read-onlyIdempotent

Supertypes of a type, or the methods a method overrides, direct ones first.

Inputs: symbol (required), project_root.

testsA
Read-onlyIdempotent

Test classes (in test compile tasks or src/test/) that use a symbol, directly or (transitive) through callers, with a ready filter: --tests for Gradle (./gradlew when present), -Dtest for Maven. It does not run them.

Inputs: symbol (required), depth, transitive, project_root.

typedC
Read-onlyIdempotent

Where a type is used, by kind: fields, parameters, return types, local variables, try-with-resources, supertype clauses, method bodies (new, casts, static calls) and imports.

Inputs: symbol (required), limit, scope, offset, +4 more.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 25 tools

    Disambiguation4/5

    Most tools target clearly distinct code-intelligence queries, and the descriptions explicitly differentiate close pairs such as references vs. callers vs. impact, or family vs. overloads vs. implementations. A few boundaries still require careful reading, especially among the several status/readiness tools and the override/call-graph query family.

    Naming Consistency3/5

    All names are lowercase snake_case, which keeps them readable, but the convention is mixed: some are bare nouns (definition, source, family), some are adjective/noun compounds (dead_code, changed, annotated), and only one uses a clear verb_noun form (find_symbols). The set is predictable enough to scan but does not follow a single naming pattern.

    Tool Count3/5

    At 25 tools this is at the heavy end for a single MCP server, even for a rich SCIP code-intelligence domain. Most tools earn their place, but the surface is broad enough that several advanced queries could likely be composed from a smaller core set.

    Completeness5/5

    The surface covers setup, indexing status, symbol lookup, definitions, references, call graphs, type hierarchies, overrides, tests, change impact, module dependencies, and batching. For a read-only code-intelligence server, there are no obvious dead ends in the query lifecycle.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI assistants to query the actual AOSP and AndroidX source code locally, searching classes, extracting method bodies and Javadoc, listing class members, resolving inheritance hierarchies, and (via optional LSP) finding cross-file definitions and references. This gives precise, offline access to framework internals like the Activity lifecycle or Compose internals instead of relying on outdated training data.
      -
    • A
      license
      A
      quality
      C
      maintenance
      Enables Claude Code and other MCP clients to query a local, explainable knowledge graph of a codebase: answering questions, explaining symbols, tracing paths between them, and computing blast-radius impact, with every edge backed by file:line evidence. Read-only and fully offline — no network calls, telemetry, or runtime dependencies.
      5
      1
      MIT
    • A
      license
      C
      quality
      A
      maintenance
      Local search over your code and documents for AI agents. Hybrid search and a code graph over your code and documents (PDF, Word, PowerPoint, Excel, EPUB), served over MCP with file and line spans, from one Rust binary on your machine.
      8
      12
      Apache 2.0