topos-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| TOPOS_MCP_FILE_ROOT | No | Absolute path to the repository root. If not set, Topos auto-detects by walking up for .git or pyproject.toml. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {} |
| prompts | {} |
| resources | {} |
| extensions | {
"io.modelcontextprotocol/tasks": {}
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| topos_assess_changesetA | Assess a multi-file changeset against a git baseline and roll the
per-file verdicts into a project before/after (read-only).
Use for a module split or any edit spanning several files. Each file
is compared to |
| topos_assess_improvementA | Compare a baseline to a side-by-side proposed variant (read-only).
For normal edit-in-place loops, use |
| topos_assess_snapshotA | Assess the current file against a baseline captured by
topos_begin_refactor.
Loads the stored baseline by |
| topos_assess_worktree_changeA | Assess an in-place edit against a git revision — the common refactor
loop.
Stateless: the baseline is read from git ( |
| topos_begin_refactorA | Persist the file's current source as a baseline snapshot before you
edit it (writes a snapshot record — its only side effect).
Returns a |
| topos_calculate_coverageA | Measure how well a test suite exercises its program-under-test, via
structural (UAST) coverage (read-only).
A standalone signal, separate from the four-pillar quality lattice;
for a quality verdict use |
| topos_compare_codeA | Compute the AST (tree-edit) distance between two source-code
strings.
Read-only and idempotent; parses both snippets in memory, never
writes or scores. Use for clone detection or to measure refactor
impact; the |
| topos_compare_filesA | Compute the AST (tree-edit) distance between two source files on
disk.
Read-only; parses both files, never writes or scores. Both files are
parsed in the language their suffix names, the same way
|
| topos_depgraph_statusA | Report |
| topos_evaluate_codeA | Score a raw code string on the SIMPLE / SECURE / NAVIGABLE quality
lattice (read-only; never writes or runs the code).
Use for a snippet not yet on disk. SIMPLE, SECURE, and NAVIGABLE are
reachable here (CFG/CPG/UAST); COMPOSABLE needs a module dependency
graph, so for it use |
| topos_evaluate_fileA | Score a file on disk on the SIMPLE / COMPOSABLE / SECURE / NAVIGABLE
lattice — the only evaluate tool that can reach COMPOSABLE
(side-effecting).
Unless |
| topos_evaluate_projectA | Recursively score every supported source file in a directory on the
SIMPLE / COMPOSABLE / SECURE / NAVIGABLE lattice, with a project
rollup (side-effecting).
Autodetects all supported languages in one walk. Returns a summary
by default: the rollup ( |
| topos_generate_depgraphA | Generate the |
| topos_get_docA | Return a Topos documentation page as Markdown.
Use when your MCP client does not expose resource fetching to the
agent. Clients that do surface resources should prefer the
equivalent resource URI for efficiency: |
| topos_inspect_codeA | Full metric breakdown for a single code unit (inline string or
file).
Provide exactly one of |
| topos_pr_recapB | Structural PR or commit-range recap: gate readiness, blocking findings, files needing attention. Summary by default; |
| topos_preference_walkA | Turn a generator ranking into a preference-ordered relaxation walk.
Pure and read-only (lattice math only; no files, no scoring). Call
after an evaluation to pick the next verdict to aim for, or to relax
the goal gracefully under a token/time budget. Returns a
PreferenceWalkResult: |
| topos_refactorA | Rank structural refactor hotspots for one file (read-only, advisory).
Does not score the four pillars — use |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| topos_refactor_until_ideal | Scaffolds the canonical Topos refactor loop (review → plan → refactor → re-measure) with a concrete target, tool call sequence, and termination criteria. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| topos_agent_contract | Compact outcome-first contract for agent loops: targets, gates, risks, and next-tool fields. |
| topos_lattice | The 16-element H(G_qual) over {SIMPLE, COMPOSABLE, SECURE, NAVIGABLE}; bottom = SLOP, top = IDEAL (all four). |
| topos_metrics | Every metric key, good ranges, and how they roll up into dimension scores. |
| topos_priority | Priority profiles (simple / composable / secure / navigable) and when to use each. |
| topos_preferences | User preferences over G_qual: induced total order on Ω and the targeted relaxation walk toward the ideal intersection. |
| topos_workflows | The canonical agent refactor loop: review → plan → refactor → re-measure. Read first. |
| topos_build | Which binary is serving you: version + build time, executable path, file root, pid, and whether the binary on disk has been rebuilt since this process started. |
TDQS
Scored across 18 tools
The set contains several near-sibling families — four assess_* variants, three evaluate_* variants, and a compare_code/compare_files pair — which is inherently risky, but each description explicitly states when to use it and, unusually, when NOT to (e.g. 'do not call this for one file', 'use topos_assess_worktree_change for in-place edits'). The remaining tools (coverage, depgraph, docs, preference_walk, pr_recap, inspect_code) are clearly separate concerns. A careless agent could still pick the wrong assess_* variant, but the guidance resolves most ambiguity.
All names use a uniform topos_ prefix plus snake_case, and nearly all follow a verb_noun shape (evaluate_file, assess_changeset, begin_refactor, calculate_coverage, generate_depgraph). A few are bare verbs or noun phrases (topos_refactor, topos_pr_recap, topos_preference_walk, topos_depgraph_status), which breaks the pattern slightly but remains readable and predictable.
At 18 tools this sits in the heavy/borderline band for a single analysis domain, and a chunk of the count comes from input-shape variants of the same operation (evaluate_code/file/project, compare_code/compare_files, four assess_* tools). The surface is coherent and each tool has a defensible role, but consolidation could cut the count meaningfully without losing capability.
The refactor lifecycle is well covered end to end: snapshot creation (begin_refactor), evaluation at snippet/file/project granularity, four diff/assessment modes, hotspot ranking, AST comparison, dependency-graph status/generation, coverage, and doc lookup. Gaps are minor — no way to list or delete stored snapshots, and no explicit configuration/preference-setting tool (preferences are only documented, not applied).