tier-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
TIER v1.0.0 — Tiered Information for Efficient Retrieval
A 4-layer context format, codebase graph indexer, and zero-dependency MCP server that cuts AI agent token usage by 86%–97%.
Quickstart · See it in action · Benchmarks · Architecture · Format spec
TIER keeps AI agents from loading whole repositories and documents into context. It gives every document an always-loadable L0 index, one-line L1 abstracts, L2 signatures and dependency edges, and surgical L3 source-line slices. A hybrid retriever, incremental repository map, reverse-dependency impact graph, and write-back memory keep context small and current.
The core is 100% Python standard library — no runtime dependencies, no API calls, no telemetry. Optional extras add terminal styling and the official MCP SDK adapter.
30-Second Quickstart
From a checkout:
python3 -m pip install . # or: python3 -m pip install -e .
# isolated CLI: uv tool install . / pipx install .Then run the two commands that configure and verify everything:
tier install # interactive wizard: Claude Code, Claude Desktop, Cursor, VS Code, Windsurf
tier doctor # environment, configs, repo.tier, lint, and sync checkstier install writes safe .bak backups, preserves other MCP servers, and is idempotent. Use --clients, --yes, --dry-run, or --uninstall for scripts and CI. tier setup is an alias.
Related MCP server: parecode
See It in Action
$ tier from-repo . -o repo.tier
wrote repo.tier
$ tier index repo.tier | head -4
tier repository map - 24 source files; languages: javascript 1, python 23; entrypoints: ...
! Read the repo.tier module map before opening source files; fetch only the listed line ranges.
! Use tier_get with follow=true to pull a module and its direct local dependencies.
! Use tier_slice for exact L3 source slices instead of reading whole files.
$ tier find repo.tier "parse TIER document" -k 1
@src-tier-parser.py 46.75 src/tier/parser.py (python module); symbols: wrap_untrusted, parse, nodes, ...
$ tier slice repo.tier src/tier/parser.py parse
@src-tier-parser.py#parse [L43-L111]
def parse(text: str) -> Doc:
doc = Doc()
...
$ tier impact repo.tier src/tier/parser.py
Impact target: @src-tier-parser.py
Direct dependents: @src-tier-__init__.py, @src-tier-cli.py, @src-tier-converter.py, ...
Dependencies: @src-tier-models.pyMeasured on this repository: 49,725 raw src/tier tokens → 695-token L0 → 1,460-token L0 + one-hop. The complete five-step workflow costs 4,441 tokens (−91.1%) while retrieving 3/3 exact slices and 10/10 dependents.
Core Capabilities
Capability | What it does |
4-Layer Progressive Disclosure | L0 index, L1 abstracts, L2 signatures and |
Polyglot Repo Maps | Python AST plus JS/TS/Go/Rust symbol extractors, exact line ranges, fingerprints, and local import edges. Verified 203/203 symbols and 75 edges on this repo. |
Hybrid Search | Identifier splitting, BM25-style field weights, synonyms, trigrams, table boosts, and navigation priors. 15/15 hit@1 on a 197-section blind corpus. |
Collision-Free Untrusted Guards |
|
Stateful Write-Back Memory |
|
Stream & Hook Compression |
|
Safe Interactive Installer |
|
Verified Benchmarks
All numbers below are from benchmarks/BENCH.txt, produced by benchmarks/bench.py with the o200k_base tokenizer. TIER measures tokens and retrieval identifiers, not LLM answer accuracy.
Track | What it measures | Verified result |
A | 60 uniform records × 6 fields | TIER table 1,331 tokens, −61% vs pretty JSON; same as CSV |
B | Nested config, 4 levels | TIER key/value 143 tokens, −39% vs pretty JSON, −13% vs YAML |
C | Payments runbook retrieval | 8/8 hit@1, 8/8 hit@2; 352-token L0; mean top-1 fetch 124 tokens |
D | 5 real GitHub Markdown docs | +2% to +15% vs Markdown; 99.2–100% word recall; 0 lint errors |
E | Paraphrase retrieval | 10/10 hit@1 (v0.2 exact-prefix: 7/10) |
F | Repository map ( | 49,725 raw → 7,200 full map (−86%); 695 L0; 1,460 L0 + 1-hop (−97%); 203/203 symbols, 75 edges, 0 lint errors |
G | End-to-end 4-layer workflow | 4,441 tokens (−91.1%); 3/3 exact slices; 10/10 expected dependents |
H | Polyglot fixture (Python/TS/Go/Rust) | 116/116 symbols, 116/116 ranges, 10/10 edges; surgical context 2,854 vs 8,249 (−65%) |
I | 197-section blind retrieval | 15/15 hit@1, 15/15 hit@2; mean top-1 134 tokens; 6,039 vs 52,275 (−88%) |
The checked-in self-index repo.tier maps 24 source files in 11,034 tokens with an 893-token L0 (8%). Reproduce the full suite:
./benchmarks/fetch_corpus.sh # optional: Tracks D and I corpus
python3 benchmarks/bench.py # writes benchmarks/BENCH.txttier install / tier setup detects and configures:
Client | Config paths |
Claude Code (project) |
|
Claude Code (user) |
|
Claude Desktop | macOS |
Cursor | project |
VS Code (Copilot MCP) | project |
Windsurf |
|
tier install # interactive
tier install --clients claude-code,cursor --yes # scripted
tier install --clients all --dry-run # preview diffs only
tier install --uninstall --clients all # remove TIER entries only
tier install --no-repo --no-hook --instructions noneEvery existing JSON config is backed up to <file>.bak before an atomic merge. Existing servers, hooks, and keys are preserved. The installer prefers an absolute tier-mcp executable, falling back to the absolute current interpreter with -m tier.mcp, so GUI hosts do not depend on shell PATH.
The default pip install tier runtime is stdlib-only, with dependencies = [].
pip install "tier[ui]" # rich terminal rendering for installer/doctor
pip install "tier[mcp]" # official mcp v2 SDK adapter
pip install "tier[all]" # both[ui]addsrichstyling. Without it, the installer and doctor use ANSI colors and box drawing with a clean non-TTY fallback.[mcp]adds the officialmcp>=2.0SDK and thetier-mcp-sdkcommand /python -m tier.mcp.sdk_servermodule. It wraps all 11 tools with MCP v2MCPServer(v1FastMCPfallback), supportsmcp devfor MCP Inspector, and serves Streamable HTTP:
tier-mcp-sdk /path/to/docs
python3 -m tier.mcp.sdk_server /path/to/docs --transport streamable-http --host 127.0.0.1 --port 8000
mcp dev src/tier/mcp/sdk_server.pyWithout the extra, tier-mcp-sdk prints the exact pip install "tier[mcp]" command and exits cleanly. The default tier-mcp / python -m tier.mcp server remains the zero-dependency stdlib JSON-RPC implementation.
CLI
Command | Purpose |
| Interactive/non-interactive MCP client installer |
| Environment, config, repo, and sync diagnostics |
| L0 + L1 index with token and rule counts |
| Hybrid identifier/synonym/trigram search |
| Fetch sections; |
| Exact L3 source lines |
| Forward/reverse dependency and Git blast radius |
| Build a polyglot repository map |
| Incremental fingerprint-based refresh |
| Atomic write-back memory |
| Compress stdin JSON/Markdown/logs with an optional budget |
| Claude Code-style |
| Structural validation |
| Format conversion |
| Legacy one-command MCP + repo + hook setup |
| Token cost per layer/section |
MCP tools
tier_list, tier_index, tier_find, tier_get, tier_slice, tier_impact, tier_sync, tier_lint, tier_ingest, tier_repo, tier_remember.
Start the default server with tier-mcp /path/to/root or python3 -m tier.mcp /path/to/root. All paths are confined to the configured root; live repository edits auto-sync before reads.
Privacy, Zero Telemetry & Contributing
TIER runs entirely on your machine. There are no telemetry, analytics, API keys, or network calls in the core runtime. The MCP server is path-sandboxed, repository scans reject symlinks escaping the root, and memory writes are validated before an atomic replace. The optional [mcp] Streamable HTTP transport is the only network listener, and only when you explicitly start it.
Format and safety rules: SPEC.md
Module boundaries, layer flow, and contributor guide: ARCHITECTURE.md
Examples: examples/
Full benchmark output: benchmarks/BENCH.txt
python3 -m unittest discover -s tests -q # 88 tests
tier doctor . # 10 checks: 0 failed, 0 warnings
python3 benchmarks/bench.py # Tracks A-I; writes benchmarks/BENCH.txt
tier from-repo . -o repo.tier # refresh the checked-in self-index
tier lint repo.tier && tier lint SPEC.tierLimits. Only token counts, retrieval identifiers, and exact-slice coverage are measured — not LLM answer accuracy. Claude's tokenizer is not public; counts use OpenAI o200k (or a character estimate when Node is unavailable). JS/TS/Go/Rust symbol extraction is heuristic, not a full parser. A --max-tokens budget below the saved artifact-path cost is best-effort.
License
MIT © 2026 000jd. See LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Team memory for AI coding agents and code reviews, reviewed by humans and served over MCP.
An MCP server that gives your AI access to the source code and docs of all public github repos
Cloud or self-hosted knowledge for AI agents: hybrid search, reranking, GraphRAG, scoped MCP tools.
Related MCP Servers
- AlicenseCqualityAmaintenanceAn MCP server that provides structural codebase indexing and surgical query tools to drastically reduce token usage through symbol-level searches and transitive impact analysis. It supports multiple languages and integrates with git to help AI agents understand code dependencies and the impact of changes in sub-millisecond time.72486 PyPI1,217MIT
- AlicenseAqualityCmaintenanceAn MCP server giving coding agents context-window-aware code search and safe, atomic multi-file edits — built to cut token usage on large codebases without sacrificing correctness.368 npm5MIT
- AlicenseNot gradedqualityDmaintenanceServes structured code context via MCP, enabling AI agents to understand codebases with dependency graphs and significantly reduce token usage.13 npm1MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server that indexes codebases into a local graph and provides on-demand context retrieval for AI coding agents, reducing token usage by tracking session history and delivering only relevant code subgraphs.4 npmMIT