repo-context
The server provides a single tool, explore_repository(query, repo_root?, max_turns?, citation?), for read-only exploration of a code repository to gather evidence for coding questions.
Parameters:
query(required): A natural language question or search intent (e.g., "Find the request validation logic").repo_root(optional): Path to the target repository root; defaults to the current directory if not provided.max_turns(optional): Limits the number of model/tool turns to control latency and cost.citation(optional): When enabled, output is restricted to controller-validatedpath:start-endfile/line citations (orNO_CITATIONS_FOUND), suppressing raw prose.
Key behaviors:
Internally uses
read_file,repo_glob, andrepo_grepto gather information — all operations are read-only.Executes independent local tool calls concurrently within the same turn.
For exact path or uniquely defined symbol queries, can resolve deterministically without hitting a model endpoint.
Uses an OpenAI-compatible chat-completion loop backed by a FastContext-style model endpoint for more complex queries.
Integrates with OpenAI-compatible chat completion APIs to enable repository exploration through natural language queries, providing read-only tools like file reading, glob, and grep.
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-contextFind the request validation logic in the repository"
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-context
Read-only repository context explorer for coding agents.
The canonical architecture is a local CLI-first exploration core that talks to an OpenAI-compatible FastContext-style model endpoint. MCP is an adapter around the same core, not the primary abstraction.
Current Status
This repository has the initial Python 3.13+ implementation for spec 001:
CLI, shared exploration core, read-only repository tools, OpenAI-compatible
chat-completions client, optional trajectory logging, and a thin MCP adapter.
It also includes spec 002 hardening for deterministic controller-owned
finalization and citation-mode rendering, plus spec 003 latency controls for
bounded endpoint prompt growth, and spec 004 same-turn parallel local tool
execution. Spec 005 adds a deterministic exact path/symbol fast path for
trivial evidence lookups. Spec 006 fixes configuration ownership to
project-root config.yaml plus .env/environment overrides. Spec 007 adds
raw source snippets for validated, merged citation ranges.
Primary planning artifacts:
Related MCP server: repogrammar_context
FastContext Alignment
This project intentionally follows Microsoft FastContext's explorer shape:
Delegated repository exploration: CLI/MCP call a focused explorer core that returns evidence for a downstream coding agent.
Read-only tools: the only model-callable repository tools are
read_file,repo_glob, andrepo_grep, corresponding to FastContext'sRead,Glob, andGrep.Same-turn parallel tool calling: independent local tool calls from one model message execute concurrently, while model endpoint requests remain serial.
Compact evidence: citation mode renders controller-validated
path:start-endlines, with the model prompted toward a<final_answer>block.
Primary references: Microsoft FastContext README, FastContext model card, and FastContext paper.
Usage
Use the CLI first for local debugging, scripts, CI checks, and one-off questions. It has the smallest moving parts and exposes the exact core result.
Use MCP when an MCP-capable editor or agent should call repository exploration as a tool during its workflow. MCP delegates to the same core as the CLI.
Configure
The default config lives in the repo-context project root:
cp config.yaml.example config.yamlThe inspected repository's config files are not loaded implicitly. This keeps the explorer's operator config independent of whatever target folder is being read.
Relative paths in config.yaml, including explorer.traj_dir, resolve from
the repo-context project root. Environment path overrides are used as
provided.
Use project-root .env or process environment variables for local overrides,
CI, or secrets:
cp .env.example .envConfigure at least:
FASTCONTEXT_BASE_URL=http://localhost:8000/v1
FASTCONTEXT_MODEL=your-model-nameEndpoint requests use a 120 second default timeout. The harness also caps
model-observation payloads, model-requested read spans, completion tokens, and
temperature to reduce latency variance. Independent same-turn local tool calls
execute concurrently with a default worker cap of 4; model endpoint requests
remain serial.
Exact path or uniquely defined symbol queries can complete locally without an endpoint when the controller can validate the citation deterministically.
Configuration precedence:
defaults < project-root config.yaml < project-root .env < process environment < CLI overridesCLI
Text output:
uv run repo-context explore \
--query "Find the request validation logic" \
--repo . \
--max-turns 6 \
--citationIn citation mode, repo-context validates and normalizes citations in the
controller. Text output is only repository-relative path:start-end labels, or
NO_CITATIONS_FOUND; model prose is not emitted. The model is prompted to use a
FastContext-style <final_answer> block, but the public text output is rendered
from controller-validated citations.
JSON output:
uv run repo-context explore \
--query "Find the request validation logic" \
--repo . \
--format jsonMCP
Install optional MCP dependencies:
uv sync --extra mcpDevelopment server command:
uv run repo-context mcp \
--transport stdioTool: explore_repository(query, repo_root?, max_turns?, citation?)
Generic MCP client config shape:
{
"mcpServers": {
"repo-context": {
"command": "uv",
"args": [
"run",
"--project",
"/path/to/repo-context",
"--extra",
"mcp",
"repo-context",
"mcp",
"--transport",
"stdio"
],
"env": {
"FASTCONTEXT_BASE_URL": "http://localhost:8000/v1",
"FASTCONTEXT_MODEL": "your-model-name"
}
}
}
}Validate
uv run pytest
uv run ruff check .
uv run mypyEndpoint-backed e2e tests are opt-in and use this repository as the target repo:
REPO_CONTEXT_RUN_E2E=1 \
FASTCONTEXT_BASE_URL=http://localhost:8000/v1 \
FASTCONTEXT_MODEL=your-model-name \
uv run pytest tests/e2eTo print per-prompt timing for the current-repo multi-prompt e2e:
REPO_CONTEXT_RUN_E2E=1 \
FASTCONTEXT_BASE_URL=http://localhost:8000/v1 \
FASTCONTEXT_MODEL=your-model-name \
uv run pytest tests/e2e/test_current_repo_multi_prompt_timing.py -sScope
In scope:
Local, read-only repository exploration.
Root-scoped
read_file,repo_glob, andrepo_greptools.OpenAI-compatible chat completion loop with bounded tool observations.
Same-turn concurrent execution for independent local tool calls.
CLI output with file paths and line-range citations.
MCP adapter that delegates to the CLI/core implementation.
Out of scope for the MVP:
Repository mutation.
Vector database ownership or embedding/model serving.
MCP-first
context_search,context_pack, andcontext_gettools.OKF bundle output.
Available Tools
1 toolexplore_repositoryD
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| repo_root | No | ||
| max_turns | No | ||
| citation | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Tool has no description.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Tool has no description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Tool has no description.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Tool has no description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Tool has no description.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Tool has no description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
v0.1.0- First observed
explore_repository
TDQS
Scored across 1 tool
Only one tool exists, so there is no possibility of ambiguity between tools.
With a single tool, naming consistency is inherently perfect; no pattern deviations exist.
A single tool is far too few for a server presumably focused on repository context, suggesting an underdeveloped or trivial surface.
A single generic 'explore' tool without any specialized operations (e.g., get commits, list branches) is severely incomplete for repository exploration.
Maintenance
Related MCP Connectors
Repo intel for AI coding agents: overview, PRs, contributors, hot files, CI, deps. Remote MCP.
Repository knowledge graph MCP server for codebase understanding and debugging.
Turn a GitHub repo or docs site into agent-ready context: pack it or search it, over MCP.
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceProvides autonomous codebase exploration through a plan-execute-reflect-report pipeline, generating onboarding reports with file:line references. Exposes both a high-level investigation tool and low-level read-only file access tools via MCP.MIT
- AlicenseNot gradedqualityAmaintenanceA read-only MCP tool that provides local-first, source-backed repository context for coding agents, returning metadata and a bounded read plan without requiring full file reads.3MIT
- AlicenseAqualityBmaintenanceMCP server that inspects local codebases and generates source-grounded context packs for coding agents, with tools for repository search, symbols, dependencies, Git analysis, and context generation.6MIT
- FlicenseNot gradedqualityAmaintenanceLocal-first MCP toolkit that provides coding agents focused repository context via read_file, search_files, and edit_file tools, reducing token usage and task cost.1-