repo-ctx
Click on "Install 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., "@repo-ctxCheck cached context for myrepo"
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.
repo-ctx
A unified context layer for LLMs. Stores both in-repo context (what this repo is) and cross-repo patterns (shared knowledge across projects) in a global SQLite database. Any MCP-compatible IDE (Cursor, Claude Desktop) gets instant context without re-exploring.
Install
cd ~/repo-ctx
npm install
npm run build
npm install -g .Related MCP server: engram
Quick Start
# Initialize the database
repo-ctx init
# Import existing context from ~/.context_store/
repo-ctx import --legacy
# List cached repos
repo-ctx list
# Get full context for a repo (pipe-friendly)
repo-ctx get myrepo
repo-ctx get myrepo --json | pbcopy
# Search across all repos
repo-ctx search "fastapi"
# List cross-repo patterns
repo-ctx patterns
# Export entire DB as JSON (for backup or sharing)
repo-ctx export > context-backup.json
# Import on another machine
repo-ctx import context-backup.jsonCursor Integration
Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"repo-ctx": {
"command": "node",
"args": ["/path/to/repo-ctx/dist/index.js", "serve"]
}
}
}The LLM is then instructed (via AGENTS.md or Cursor rules) to:
Before exploring any repo: check for cached context via
get_contextAfter exploring: save context via
save_contextAfter significant tasks: call
auto_update_contextto auto-detect changesWhen
get_contextreports drift: callauto_update_contextto refreshWhen noticing patterns: save them via
save_pattern
MCP Tools
Tool | Description |
| Retrieve context for a repo + automatic freshness/drift check |
| Save full repo context (creates new version) |
| Partial update (only changed fields) |
| Scan repo on disk, auto-detect changes, merge additively |
| List all cached repos |
| Full-text search across repos |
| Version history for a repo |
| Remove a repo and its history |
| Save a cross-repo pattern |
| Get patterns by tech stack or tags |
| Search across patterns |
How It Works
In-Repo Context
Each repo gets a structured context entry: overview, tech stack, file tree, key files, architecture, and notes. Context is versioned — every update creates a new version, old ones are preserved.
Cross-Repo Patterns
When the LLM notices a pattern used across repos (e.g. "JWT auth middleware"), it saves it as a pattern tagged with the repos where it was seen. When working in any repo, relevant patterns are surfaced based on the tech stack.
Automatic Staleness Detection
On every get_context call, the server compares stored fingerprints (git hash, dependency file hash, file tree hash) against the current state. If drift is detected, the response includes an action_hint telling the agent to call auto_update_context.
Auto-Update
auto_update_context scans the repo on disk using convention-based heuristics (file names, extensions, directory structure) to detect key files, tech stack, sub-projects, and patterns. It merges additively — never overwrites manually-set fields like overview, architecture, or notes.
Database
Everything lives in ~/.repo-context/context.db — a single portable SQLite file. Copy it to another machine, install repo-ctx, and every LLM has your full knowledge base.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ankkitraj4/repo-ctx'
If you have feedback or need assistance with the MCP directory API, please join our Discord server