Tea Rags MCP
Enriches code chunks with authorship, timestamps, churn metrics, and task IDs extracted from commit history and git blame data.
Supports extracting GitHub task IDs from commit messages to provide context and linking between code and project issues.
Enables extraction of JIRA task IDs from commit messages to associate indexed code chunks with specific project tickets.
Integrates with Ollama for local, privacy-first embedding generation and semantic codebase search.
Supports OpenAI embedding models for semantic vectorization and high-performance code search.
Provides specialized Ruby AST-aware chunking to improve the accuracy and relevance of semantic search in Ruby codebases.
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., "@Tea Rags MCPsearch for where user authentication is implemented"
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.
Your coding agent copies the first code it finds β not the right one.
TeaRAGs is a Codebase Intelligence layer your agent queries over MCP. It indexes the repository on your machine and returns every piece of code with three views of it:
π What it does β semantic and hybrid search over AST-aware chunks
πΈοΈ How it is connected β callers, callees, fan-in, transitive impact
𧬠How it has lived β churn, bug-fix rate, ownership, age
β¦and ships agent skills that know which view a task needs. The agent stops guessing which code is safe to copy, what is critical, and what a change will break β it reads the dossier instead.
π Documentation Β· π 15-minute quickstart Β· π§ Core concepts
π See It
Three questions an agent asks before touching code, answered by TeaRAGs on its own repository. Every number below is a real response, trimmed.
1. "Find retry logic I can reuse"
semantic_search { query: "retry a failed request with exponential backoff", rerank: "hotspots" }
Similarity alone puts OllamaEmbeddings#retryWithBackoff first. The dossiers of
the top two candidates tell different stories:
π₯ | π₯ | |
Similarity rank | #1 | #2 ( |
Commits to the file | 28 | 1 |
Share that were bug fixes | 54% Β· π΄ concerning | 0% Β· π’ healthy |
Last changed | 2 days ago Β· recent | 86 days ago Β· old |
Callers | 2 | 1 |
The closest match keeps getting fixed. The agent copies the quiet helper's shape β or learns why the first one keeps breaking before it repeats the mistake.
{
"symbolId": "OllamaEmbeddings#retryWithBackoff",
"relativePath": "src/core/adapters/embeddings/ollama.ts",
"startLine": 290,
"endLine": 378,
"preset": "hotspots",
"git": {
"file": {
"commitCount": 28,
"ageDays": { "value": 2, "label": "recent" },
"bugFixRate": { "value": 54, "label": "concerning" },
"relativeChurn": { "value": 2.55, "label": "normal" }
},
"chunk": {
"commitCount": { "value": 11, "label": "extreme" },
"relativeChurn": { "value": 9.09, "label": "high" }
}
},
"codegraph": { "symbols": { "chunk": { "fanIn": 2, "fanOut": 6 } } }
}Labels are computed from this repository's own percentiles, so extreme means extreme for this codebase, not for some global average.
2. "What is risky to touch around vector writes?"
semantic_search { query: "write points to the vector database in batches", rerank: "dangerous" }
Similarity alone ranks PointsAccumulator#flushBatch,
QdrantPointStore#addPointsOptimized and QdrantPointStore#addPoints first.
The dangerous preset reorders by risk and says why:
# | Ranked by risk | Why it moved up |
1 |
| 16 outgoing calls, 77 lines, 5 commits Β· high |
2 |
| file with 45 commits, relative churn 8.09 Β· π΄ high, 4 authors |
3 |
| one author owns 100% of the live lines Β· π deep-silo, 158 days untouched |
3. "Who calls it before I change it?"
get_callers { symbolId: "QdrantManager#addPointsWithSparse" }
Ten exact call sites across eight files β method fan-in 10 Β· central, file transitive impact 47 Β· regional:
ChunkPipeline#createBatchHandler ingest/pipeline/chunk-pipeline.ts
createQdrantPipeline ingest/pipeline/pipeline-manager.ts
storeIndexingMarker (2 sites) ingest/pipeline/indexing-marker.ts
DocumentOps#add api/internal/ops/document-ops.ts
SchemaManager#storeSchemaMetadata adapters/qdrant/schema-manager.ts
EmbeddingModelGuard#readOrCreateMarker adapters/qdrant/embedding-model-guard.ts
IndexStoreAdapter#storeSchemaVersion maintenance/migration/adapters/index-store-adapter.ts
SparseStoreAdapter#rebuildSparseVectors maintenance/migration/adapters/sparse-store-adapter.ts
SparseStoreAdapter#storeSparseVersion maintenance/migration/adapters/sparse-store-adapter.tsNeed the whole chain from an entry point to this call? trace_path enumerates
every AβB path and, with a rerank preset, sorts them by how dangerous each step
is.
Related MCP server: codesteer-atlas
β What It Answers
Ask in plain language. The plugin picks the skill, tools and rerank presets
for every question automatically β it ships a decision table that maps intent
to the right call, so nobody has to know a preset name. Other MCP clients get
the same routing guide as an MCP resource (tea-rags://schema/search-guide).
The right column shows what runs under the hood.
πΊοΈ Understand
Ask your agent | What runs |
"Where do we charge a bill with a saved card, and what will it touch?" |
|
"Onboard me into billing β where are the entry points?" |
|
"Which modules is this whole app built around?" |
|
"What was done under ticket #4521?" |
|
β»οΈ Reuse and generate
Ask your agent | What runs |
"Add partial payments to bill payment β in our style, no duplicates." |
|
"We have four payment-gateway retries. Which one should I copy?" |
|
"Is there already a helper that rounds money amounts?" |
|
π― Change safely
Ask your agent | What runs |
"What should I not touch in this task, and where is it safer to build a parallel implementation?" |
|
"Who calls bill payment, and how does a request get from the API to the card charge?" |
|
"Which code here should never change without a second reviewer?" |
|
"Which tests cover the behaviour I'm about to change?" |
|
π Find problems
Ask your agent | What runs |
"Where are the most dangerous modules in the payments domain?" |
|
"After a retry, a bill gets marked as paid twice. What is most likely to blame?" |
|
"Map the tech debt in invoicing." |
|
"Which files in this domain changed most this month?" |
|
"What here is dead or abandoned?" |
|
π₯ Review, ownership and audit
Ask your agent | What runs |
"What in this merge request should I look at first?" |
|
"Whose code is this, and where is the bus factor one?" |
|
"Which old security-critical code is overdue for an audit?" |
|
β¨ Features
π Git- and codegraph-aware ranking β 23 rerank presets blend churn, bug-fix rate, ownership and age with fan-in, PageRank and transitive impact (
proven,hotspots,techDebt,blastRadius,criticalPath, β¦), plus 12 filter presetsπΈοΈ Call graph β callers, callees, cycles and AβB paths (
get_callers,get_callees,find_cycles,trace_path) for TypeScript, JavaScript, Python and Ruby at a high tierπ§ Agent skills β the plugin routes every question to the right tools and presets on its own; 14 ready-made workflows (
explore,bug-hunt,risk-assessment,data-driven-generation,mr-review, β¦) plusdinopowers, 10 wrappers that feed index signals intosuperpowersπ 100% local β embedded Qdrant and DuckDB, no Docker; embeddings through Ollama, with OpenAI, Cohere and Voyage optional
π Always fresh β incremental reindex, auto-update on a target branch, per-worktree index clones, and a drift report that names the exact command to run
π’ Built for enterprise monorepos β AST chunking for 9 languages, parallel pipelines, validated on a 3.5M-line production monolith
π¦ Installation
π» System requirements
Requirement | |
OS | macOS (arm64, x64) Β· Linux (x64, arm64) Β· Windows (x64) |
Node.js | 22+ supported, 24+ recommended |
git | Required β churn, ownership and bug-fix signals come from the repository's history |
Embeddings | Ollama with the code-embedding model (322 MB), or an OpenAI, Cohere or Voyage key |
Disk | 66 MB for the Qdrant binary, plus the per-project indexes below |
Disk taken by real indexes (turbo quantization, dense + sparse vectors):
Codebase | Indexed | Vector index (Qdrant) | Call graph (DuckDB) |
Production monolith (Ruby + TypeScript) | 3M+ LoC + 118K lines of docs Β· ~33k files Β· 140k chunks | 1.3 GB | 1.1 GB |
TeaRAGs itself (TypeScript) | 433K LoC + 36K lines of docs Β· ~2.4k files Β· 25k chunks | 1.2 GB | 42 MB |
The call graph grows with the code; the vector index barely does β a codebase seven times smaller still takes 1.2 GB.
Pull the code-embedding model:
ollama pull unclemusclez/jina-embeddings-v2-base-code:latestClaude Code β plugins plus a setup wizard that detects your hardware and tunes the pipeline:
/plugin marketplace add artk0de/TeaRAGs-MCP
/plugin install tea-rags-setup@tea-rags
/tea-rags-setup:install
/plugin install tea-rags@tea-ragsAny MCP client (Cursor, Roo Code, Continue, β¦):
npm install -g tea-rags{
"mcpServers": {
"tea-rags": {
"command": "tea-rags",
"args": ["server"],
"env": { "CODEGRAPH_ENABLED": "true" }
}
}
}Qdrant downloads and starts on first use. Cloud embeddings (OpenAI, Cohere, Voyage), an external Qdrant, and the built-in ONNX provider (beta) are covered in the installation guide.
πΈοΈ Enable the call graph
The call graph is off by default while it is in beta. Turn it on with
CODEGRAPH_ENABLED=true in the MCP server's environment β the JSON above
already does β or, in Claude Code:
claude mcp add tea-rags -s user -e CODEGRAPH_ENABLED=true -- tea-rags serverThen reindex. The flag is recorded per project, so later runs from the CLI or auto-update keep the graph on. Details: Codegraph Enrichments.
π Quick Start
tea-rags index-codebase /path/to/repo --name myrepo # first index: register + index
tea-rags prime /path/to/repo # index state, drift, signal thresholdsIn Claude Code, /tea-rags:index does the same. Then ask your agent:
"How does auth work in this project?"
"Find stable examples of retry logic I can copy."
"What breaks if I change the payment module?"
π€ Why TeaRAGs?
| Embedding search | TeaRAGs | |
Finds | Exact text | Similar code | Similar code, ranked by evidence |
Knows history | β | β | Churn, bug fixes, owners, age |
Knows callers | β | β | Fan-in, transitive impact, call paths |
Ranks for the task | β | Similarity only | 23 presets β see What It Answers |
Cost on a large monorepo | Many agent turns | One query | One query |
βοΈ How It Works
%%{init: {"theme": "base", "themeVariables": {"primaryColor": "#fdf8e7", "primaryTextColor": "#2d2d2d", "primaryBorderColor": "#d4af37", "lineColor": "#c4941f", "secondaryColor": "#f5f5dc", "tertiaryColor": "#fafafa", "mainBkg": "#fdf8e7", "secondBkg": "#f5f5dc", "nodeBorder": "#d4af37", "clusterBkg": "#fffdf6", "clusterBorder": "#d4af37", "titleColor": "#2d2d2d", "edgeLabelBackground": "#ffffff", "fontSize": "15px"}}}%%
flowchart LR
User([π€ You])
Agent[π€ Coding agent<br/>+ TeaRAGs skills]
subgraph pkg["π΅ tea-rags"]
MCP[π MCP server<br/>23 tools]
CLI[β¨οΈ CLI<br/>index Β· prime Β· projects Β· auto-update]
Core[βοΈ Core<br/>chunk Β· enrich Β· search Β· rerank]
MCP --> Core
CLI --> Core
end
subgraph storage["π» Local storage"]
Qdrant[(ποΈ Qdrant<br/>embedded Β· vectors + signals)]
DuckDB[(π¦ DuckDB<br/>embedded Β· call graph)]
end
Embeddings[β¨ Embeddings<br/>Ollama Β· OpenAI Β· Cohere Β· Voyage]
Repo[π Your repo<br/>code + git history]
User <--> Agent
Agent <--> MCP
User --> CLI
Core <--> Qdrant
Core <--> DuckDB
Core --> Embeddings
Core --> RepoYour agent calls TeaRAGs over MCP; you run the CLI to index and maintain. Both
drive one core: it chunks code on AST boundaries, embeds each chunk, attaches
git and call-graph signals, and ranks results by the preset the task asks for.
Qdrant and DuckDB run embedded under ~/.tea-rags β no Docker, no servers to
manage.
π Measured
Call-graph quality is checked against independent oracles, not eyeballed.
What | Result | Corpus |
π Python call graph vs. jedi + pyright (pyright tie-break) | recall 0.92β1.00 Β· wrong edges β€ 0.29% | flask, httpx, netbox, polar |
π Ruby call graph, YARD-annotated | in-project recall 1.00 Β· 0 fabricated | octokit.rb |
π Ruby call graph, un-annotated Rails | bare-call recall 0.93 | mastodon |
π Ruby call graph, production Rails | in-project recall 87.7% | 3.5M-line production monolith |
π¦ TypeScript call graph vs. the TypeScript type checker | phantom edges 0.32% Β· agreement 72.8%ΒΉ | 17k-file production React frontend |
π¦ TypeScript call graph on TeaRAGs' own source | fabricated edges 93 β 0 | tea-rags |
π§ | +71 pp mean pass rate | 136 eval cases, 10 wrappers |
π©Ή Healing a drifted index instead of recomputing it | 113 ms | 134k-point production index |
ΒΉ About two thirds of the TypeScript gap is callbacks passed through props and dependency injection β the type checker names a function type there, not an implementation, so no static resolver can pin those edges.
The Python oracle harness ships in the repo
(scripts/py-codegraph-jedi-oracle.ts), so those numbers can be reproduced on
your own corpus.
Languages Compatibilities
Support: π maximum Β· π full Β· π high Β· π medium Β· π moderate Β· π partial/low Β· π minimal Β· π none
What tea-rags supports per language and at what level. AST chunking is how
source is split into searchable chunks; Test chunking is how faithfully test
structure is preserved; Codegraph is the call-graph resolution ceiling (the
realized per-project number lives in the tea-rags prime digest, not here).
Rows are ordered by overall capability, richest support first.
Language | AST chunking | Test chunking | Codegraph |
TypeScript | π full Β· tree-sitter (comment attachment, method-body splitting, describe/it scopes) | π high Β· testScopeChunker (describe/it scopes) | π high β 14-strategy chain (10 tree-sitter + 4 ts.Program/typeChecker) + cone dispatch + typeChecker-backed union-receiver fan-out |
JavaScript | π full Β· tree-sitter (assignment chunking, module/class split) | π high Β· testScopeChunker (describe/it scopes) | π high β 6-strategy; CommonJS/ESM require resolution (dynamic gaps) |
Ruby | π full Β· tree-sitter (RSpec block grouping, comment attachment, spec scope splitting, method-body splitting) | π high Β· RSpec scope chunker (parent setup injected) | untyped π high Β· YARD π maximum Β· RBS/Sorbet π TBD β 15-strategy chain + 4 dispatch components + 20-grammar DSL catalogue + YARD type-source + db/schema.rb column accessors |
Python | π full Β· tree-sitter | π medium Β· generic AST | π high β 9-strategy chain + C3 MRO + CHA cone dispatch + re-export-aware import mapping + annotation, docstring and return-type facts |
Go | π full Β· tree-sitter (func/type split) | π medium Β· generic AST | π moderate β 6-strategy; explicit interfaces (no poly dispatch) |
Java | π full Β· tree-sitter | π medium Β· generic AST | π moderate β 6-strategy + java.lang stdlib whitelist + overload disambiguation |
Rust | π full Β· tree-sitter (named-item extraction) | π medium Β· generic AST (#[test] attrs not preserved) | π moderate β 6-strategy; trait-based dispatch |
Bash | π full Β· tree-sitter | π low Β· generic AST (bats/shunit not recognized) | π minimal β function-call extraction only, no dispatch |
Markdown | π full Β· MarkdownChunker (ToC + smart chunking) | π N/A Β· doc-only | π none β no call graph |
sql | π none Β· CharacterChunker | π N/A | π none |
jsonc | π none Β· CharacterChunker | π N/A | π none |
json | π none Β· CharacterChunker | π N/A | π none |
β¨οΈ CLI
Command | What it does |
| Index or incrementally update a codebase, with live progress |
| Markdown digest of index state, drift and signal thresholds |
| Manage the project registry: |
| Keep a project's index fresh on its target branch |
| Per-worktree index clones for parallel branches |
| Infrastructure and registry health |
| Auto-tune performance parameters for your hardware |
| Check for and install a newer version |
| Start the MCP server |
π Documentation
I want to⦠| Start here |
Get it running | Quickstart β install, index, first query |
Understand the concept | Core Concepts β vectorization, trajectory enrichment, reranking |
See what my agent can do | Skills β the agent workflows and when each one fires |
Keep the index fresh | |
Look under the hood | Architecture β pipelines, data model, reranker internals |
Learn the theory | Knowledge Base β RAG, code search, software evolution |
π From the Blog
Engineering notes behind the releases, each with the corpus it was measured on β all posts Β· RSS.
π€ Contributing
See CONTRIBUTING.md for workflow and conventions.
π Acknowledgments
Started as a fork of mhalder/qdrant-mcp-server β clean architecture, solid tests, open-source spirit β and its ancestor qdrant/mcp-server-qdrant. Code vectorization inspired by claude-context (Zilliz).
Feel free to fork this fork. It's forks all the way down. π’
βοΈ License
This server cannot be deployed
Maintenance
Related MCP Connectors
An MCP server that gives your AI access to the source code and docs of all public github repos
Capability registry for the agentic economy. Semantic search over verified MCP server listings.
Repository knowledge graph MCP server for codebase understanding and debugging.
Related MCP Servers
- AlicenseAqualityDmaintenanceMCP server with local vector search for your codebase. Smart indexing, semantic search, Git history β all offline.731 PyPI49MIT
- AlicenseAqualityAmaintenanceLocal MCP server for semantic code search using Tree-sitter AST parsing, local embeddings, and hybrid search; enables indexing and querying codebases entirely offline.5MIT
- AlicenseNot gradedqualityCmaintenanceMCP server for semantic code search and dependency graph analysis. Indexes codebases into a knowledge graph with vector embeddings for AI-powered code understanding.5 npmMIT
- AlicenseAqualityFmaintenanceMCP server for semantic code search that indexes your codebase and allows AI editors to search using natural language queries.953 npm53MIT