scythe-context-mcp
Integrates with Google's Gemini API for generating embeddings used in semantic search and context packing within code repositories.
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., "@scythe-context-mcpfind where auth token validation is handled"
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.
Scythe Context MCP
Scythe Context MCP helps Codex find code when the file location is unknown. It indexes a repository locally and returns file paths, line ranges, and related files. Optional Gemini embeddings add semantic search.
When to use it
Use it for unfamiliar repositories, conceptual code lookup, and tracing symbols or imports across files.
Use
rgor direct file reads when you already know the path or exact string.Local keyword search needs no API key. Semantic search requires a Gemini-compatible endpoint.
The project has retrieval benchmarks and integration tests. These do not establish that MCP improves GPT‑6.1 Sol task completion, speed, or total token use. See the benchmark and task A/B protocol (Traditional Chinese).
Related MCP server: agent-history-mcp
Quick start: local search
Requires Node.js 24.11+ within the supported range >=24.11.0 <27; Node.js 24 is the tested baseline. Run Node and npm in the same environment as the MCP server.
For Codex CLI on Linux, macOS, or WSL, add this to ~/.codex/config.toml (or your configured Codex home). A trusted project can use .codex/config.toml:
[mcp_servers.scythe_context]
command = "npx"
args = ["-y", "scythe-context-mcp"]Global installation is optional: npx downloads the package on first use. For native Windows or Windows Codex App with a WSL repository, follow the platform setup guide instead.
Restart Codex after changing the configuration. In the CLI, /mcp shows connected servers. In the App, confirm that Scythe tools are available.
Ask Codex to run the following MCP tool calls, not shell commands. Replace the repository path with its absolute path in the server's environment:
repo_index_status({ "project_path": "/absolute/path/to/your/repo" })
repo_reindex({ "project_path": "/absolute/path/to/your/repo", "dry_run": false, "index_embeddings": false })
repo_context_pack({ "project_path": "/absolute/path/to/your/repo", "query": "where is auth token validation handled?", "mode": "keyword" })Run repo_reindex only when the index is missing or stale. It writes metadata to .scythe-context/; index_embeddings=false avoids sending chunks to an embedding endpoint.
A successful lookup returns primaryResults containing paths and line ranges. repo_context_pack defaults to response_mode="paths_only"; let Codex read the matching file ranges next. Request response_mode="compact" for short snippets. If setup fails, start with repo_doctor and the troubleshooting guide.
Optional semantic search and privacy
Keep GEMINI_API_KEY in the environment that starts Codex and forward it to the existing server configuration. Do not commit the key. Then build vectors and use hybrid search:
# Add this field to the existing [mcp_servers.scythe_context] table.
env_vars = ["GEMINI_API_KEY"]repo_reindex({ "project_path": "/absolute/path/to/your/repo", "dry_run": false, "index_embeddings": true })
repo_context_pack({ "project_path": "/absolute/path/to/your/repo", "query": "where is auth token validation handled?", "mode": "hybrid" })These calls send repository chunks and query text to the configured endpoint, which may incur provider charges. Defaults are https://generativelanguage.googleapis.com/v1beta, model gemini-embedding-2, and 1536 dimensions. For proxies and authentication settings, see setup.
Search mode defaults to hybrid, even though the quick start explicitly uses keyword. If a key is configured, omitting mode can send the query to the provider. Use mode="keyword" to avoid embedding requests.
Mode | Embedding requests | If query embedding fails |
| None; metadata only | Not applicable |
| Sends the query; indexed vectors support semantic retrieval | Falls back to keyword and reports the fallback |
| Sends the query; requires indexed vectors | Returns an error without keyword fallback |
GEMINI_REQUEST_TIMEOUT_MS defaults to 10000 and bounds each embedding request, including the response body. It does not limit the entire indexing job. gemini_embedding_probe also sends its test text to the endpoint. Third-party proxies can see the text sent to them.
Index files stay in .scythe-context/. Keep that directory, legacy .repo-beacon/, .env, and local/ out of version control. Exclude private files from indexing with .gitignore, and check scope before enabling embeddings. Do not include secrets, private source, or index databases in public issues or logs.
Tools and current limits
Tool | Purpose |
| Check metadata, embedding coverage, and index freshness. |
| Update metadata; embed chunks only with |
| Find code for a task; paths and line ranges by default. |
| Inspect keyword, hybrid, or semantic search ranking; compact output by default. |
| Inspect a file's symbols, imports, and reverse imports. |
| Check local setup and index health without external API calls. |
| Test the configured embedding endpoint with supplied text. |
The default symbol/import extractor uses regex; tree-sitter is experimental and requires separately configured grammars. Related-file results are navigation hints, not a complete runtime call graph. Indexes need refreshing as files change; embedding coverage can be partial.
Documentation
Development
Install dependencies in the environment that will run Node, especially when using Windows and WSL:
git clone https://github.com/Lianye-Scythe/scythe-context-mcp.git
cd scythe-context-mcp
npm ci
npm run build
npm run verifyFor a source-based MCP setup, point node at the absolute path to dist/index.js; see setup. Update all three README languages together when changing user-facing behavior.
Available Tools
7 toolsgemini_embedding_probeGemini Embedding ProbeB
Send one embedding request and return diagnostics for official Gemini or proxy compatibility.
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | ||
| project_path | No | ||
| response_mode | No | compact |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It does not disclose side effects, auth requirements, rate limits, or the nature of the diagnostics. The tool is likely read-only, but this is not stated.
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?
The description is a single sentence of 9 words, which is concise but under-informative. It lacks important details about parameters and output, making it less helpful than it could be.
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?
Given the absence of an output schema and annotations, the description should explain what diagnostics contain. It does not. The three parameters are ignored, leaving the agent with insufficient context for correct usage.
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?
The description adds no meaning beyond the input schema. With 0% schema coverage, it fails to explain the role of project_path or how response_mode affects output. The enum for response_mode is in the schema but not elaborated.
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?
The description clearly states the verb (Send), resource (one embedding request), and purpose (return diagnostics for compatibility). It distinguishes from sibling tools that deal with repository management.
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?
While the purpose implies testing compatibility, there is no explicit guidance on when to use this tool versus alternatives, or when not to use it. The sibling tools are unrelated, so context is implicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
repo_context_packRepo Context PackB
Preferred task-oriented code lookup for unknown file locations. Defaults to paths_only; use compact for short snippets and snippets for ranking/debug detail. Set mode=keyword for local lookup without embedding requests.
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | hybrid | |
| query | Yes | ||
| max_results | No | ||
| project_path | No | ||
| related_depth | No | ||
| response_mode | No | paths_only | |
| max_seed_files | No | ||
| max_context_chars | No | ||
| max_related_files | No | ||
| max_related_items | No | ||
| max_snippet_chars | No | ||
| include_related_snippets | No | ||
| max_related_context_chars | No | ||
| max_related_snippet_chars | No | ||
| max_related_snippets_per_file | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It does disclose useful behavior: the default response_mode is paths_only, and mode=keyword avoids embedding requests (an implicit no-network path). However it says nothing about permissions, side effects, latency, or what the payload actually contains beyond the three response modes.
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?
Three tight sentences with the primary routing statement front-loaded and no filler. Slightly dense in the middle sentence but every clause carries information.
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?
For a 15-parameter tool with no annotations and no output schema, the description is thin: it omits what a 'context pack' returns, how related-file expansion works, and the meaning of nearly all tuning parameters. An agent could call it with just query, but would be guessing on every other field.
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?
Schema description coverage is 0% across 15 parameters, yet the description explains only response_mode and the keyword value of mode. The thirteen sizing/related-context parameters (max_results, related_depth, include_related_snippets, etc.) get no semantic explanation, so the compensation is far from complete.
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?
States a specific verb+resource ('task-oriented code lookup') and a scoping condition ('for unknown file locations'), which tells an agent this is a discovery tool rather than an index or diagnostic one. It doesn't explicitly name the sibling it competes with (repo_semantic_search), so differentiation is inferred from the mode/embedding hint rather than stated.
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?
Gives clear context ('Preferred ... for unknown file locations') and a conditional routing rule: use mode=keyword when you want local lookup without embedding requests. No explicit when-not or named alternative, so it stops short of full 5-level guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
repo_doctorRepo DoctorB
Run local diagnostics for runtime, native modules, config, WSL interop, and index health without calling embedding APIs.
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | No | ||
| response_mode | No | compact |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden for behavioral disclosure. It lists diagnostic areas but does not mention potential side effects, permissions required, whether it is destructive, or the format of the output, leaving significant gaps for an AI agent.
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?
The description is a single concise sentence that front-loads the purpose, but it could be better structured by listing diagnostic areas or including parameter context.
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?
Given no output schema and no annotations, the description should explain return values and behavior. It only lists diagnostic categories without details on output format, making it incomplete for an AI agent to anticipate the tool's response.
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?
The schema has 0% description coverage, and the description does not mention or explain the two parameters (project_path, response_mode), failing to add any meaning beyond the schema's type and enum definitions.
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?
The description clearly states the tool runs local diagnostics for specific areas (runtime, native modules, config, WSL interop, index health) and distinguishes it from sibling tools by emphasizing it does not call embedding APIs.
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?
The description indicates when to use this tool (local diagnostics without embedding APIs) by contrasting with alternatives like gemini_embedding_probe, but does not explicitly state when not to use it or mention other sibling tools like repo_index_status.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
repo_index_statusRepo Index StatusC
Show Scythe Context configuration and current index status.
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | No | ||
| response_mode | No | compact |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries full burden. It states 'Show' implying read-only, but does not disclose permissions, rate limits, or side effects. Minimal transparency beyond the verb.
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?
Single sentence is concise but under-specified. It sacrifices necessary detail for brevity, not earning its place.
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?
No output schema and description does not explain return values. For a status tool, it is incomplete—missing what 'index status' entails or what information is returned.
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?
Schema description coverage is 0%, but description does not mention parameters. It fails to explain project_path or response_mode enum values, leaving parameters completely undocumented.
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?
The description states 'Show Scythe Context configuration and current index status,' clearly indicating a read-only status tool. It distinguishes from siblings like repo_reindex (reindexing) and repo_semantic_search (searching), though 'Scythe Context' is not explained.
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?
No guidance on when to use this tool versus sibling tools like repo_doctor or repo_reindex. The description implies a status check but lacks explicit context for selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
repo_reindexRepo ReindexC
Scan a project, write metadata, and optionally index embeddings.
| Name | Required | Description | Default |
|---|---|---|---|
| dry_run | No | ||
| project_path | No | ||
| response_mode | No | compact | |
| max_file_bytes | No | ||
| index_embeddings | No | ||
| target_chunk_chars | No | ||
| chunk_overlap_chars | No | ||
| max_chunks_per_file | No | ||
| embedding_batch_size | No | ||
| max_embedding_chunks | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must cover behavioral traits. It mentions scanning and writing metadata but does not disclose if the operation is destructive, overwrites existing data, or requires specific permissions. Side effects and state changes are not described.
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?
The description is a single concise sentence, but it sacrifices necessary detail. It is front-loaded but lacks structure for a tool with many parameters.
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?
For a tool with 10 parameters, no annotations, no output schema, and sibling tools requiring differentiation, the description is severely incomplete. It fails to explain the reindexing process, parameter semantics, or return value behavior.
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?
Schema description coverage is 0%, and the description does not explain any of the 10 parameters. Terms like dry_run, response_mode, and index_embeddings are left undefined, so the agent gains no insight beyond the schema.
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?
The description clearly states the action ('Scan a project, write metadata, and optionally index embeddings'), which specifies the verb and resource. It distinguishes from siblings like repo_doctor (diagnose) and repo_semantic_search (search) by focusing on reindexing.
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?
No guidance is provided on when to use this tool versus alternatives like repo_index_status or repo_doctor. There is no mention of prerequisites or scenarios where reindexing is appropriate.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
repo_semantic_searchRepo Semantic SearchA
Debug raw semantic or hybrid ranking over indexed chunks. Prefer repo_context_pack for normal lookup; use paths_only to scout cheaply and snippets only when scores or fuller snippets are needed.
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | hybrid | |
| query | Yes | ||
| max_results | No | ||
| project_path | No | ||
| response_mode | No | compact | |
| max_context_chars | No | ||
| max_snippet_chars | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden, and it does disclose response-size/cost tradeoffs via paths_only vs snippets. However it never states the operation is read-only/non-mutating, nor does it mention latency, indexing prerequisites, or what happens with an unindexed project — meaningful gaps for a zero-annotation tool.
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?
Two dense, front-loaded sentences with no filler: the purpose leads and the routing guidance follows. Some jargon ('raw ranking', 'scores') is compressed rather than explained, but nothing is wasted.
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?
For a 7-parameter tool with no annotations and no output schema, the description covers the routing decision but not the mechanics an agent needs to call it correctly — mode/response_mode semantics, result-count and context-size behavior, or output shape are all absent.
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?
Seven parameters with 0% schema description coverage, so the description must compensate and largely does not. It only alludes to response_mode values (paths_only/snippets) and to 'scores'; the mode enum (keyword/hybrid/semantic), max_results, max_context_chars, max_snippet_chars, and project_path are left entirely undocumented.
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?
States a specific verb and resource ('debug raw semantic or hybrid ranking over indexed chunks') and immediately distinguishes itself from the sibling repo_context_pack for normal lookups. An agent can tell what this tool is for without opening the schema.
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?
Explicit when-to-use routing: prefer repo_context_pack for normal lookup, use paths_only to scout cheaply, and snippets only when scores or fuller snippets are needed. This is exactly the alternative-selection guidance the dimension asks for.
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.
2 tool updates
v0.1.16- Changed
repo_context_pack2 fields changed- changed
Input schema / properties / mode / enumPrevious value: -[ - "hybrid", - "semantic" -]New value: +[ + "keyword", + "hybrid", + "semantic" +] - changed
Input schema / properties / response_mode / defaultPrevious value: -"compact"New value: +"paths_only"
- Changed
repo_semantic_search1 field changed- changed
Input schema / properties / mode / enumPrevious value: -[ - "hybrid", - "semantic" -]New value: +[ + "keyword", + "hybrid", + "semantic" +]
7 tool updates
v0.1.14- First observed
gemini_embedding_probe - First observed
repo_context_pack - First observed
repo_doctor - First observed
repo_index_status - First observed
repo_reindex - First observed
repo_related_files - First observed
repo_semantic_search
TDQS
Scored across 7 tools
Most tools have clearly distinct purposes, with explicit guidance that repo_context_pack is preferred for normal lookup and repo_semantic_search is for debugging rankings. The main possible confusion is between the two lookup tools, and secondarily between repo_doctor and gemini_embedding_probe, but descriptions mitigate this well.
All names use snake_case, and six of seven share a repo_ prefix, creating a mostly predictable pattern. The exception is gemini_embedding_probe, and the names mix noun phrases with action-oriented labels, preventing a perfect score.
With 7 tools, the set is well-scoped for a context/indexing MCP server. Each tool has a clear role spanning diagnostics, indexing, status, search, and related-file lookup without obvious redundancy.
The server covers diagnostics, indexing lifecycle, status, semantic search, context packing, and related-file inspection, which addresses the core workflows. Minor gaps exist, such as no explicit index deletion/reset or project listing tool, but agents can likely work around them.
Maintenance
Related MCP Connectors
Project memory, semantic code search, and grounded agent context.
Shared memory for coding agents. Stop re-explaining your codebase every session.
Deterministic context layer for your codebase: change impact, blast radius, answers with receipts.
Codebase graphs, caller impact analysis, and recorded project context for AI coding agents.
Related MCP Servers
- AlicenseBqualityDmaintenanceLocal-first codebase context engine that parses code into a ranked dependency graph and serves it to AI tools via MCP for deep structural understanding.59 npm1MIT
- AlicenseNot gradedqualityDmaintenanceLocal memory search for Codex and Claude Code conversations. It keeps history on your machine, builds a local graph index, and returns compact evidence from past sessions.6MIT
- FlicenseNot gradedqualityDmaintenanceEnables local semantic code search across repositories using natural language, with AST-aware chunking and hybrid vector/FTS5 retrieval.-
- AlicenseBqualityDmaintenanceTracks working context and code structure in a portable local SQLite database, enabling seamless context and task continuity across different AI coding tools.121MIT