Skip to main content
Glama

Scythe Context MCP

CI npm version License: Apache-2.0 Node.js >=24.11

English | 繁體中文 | 简体中文

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 rg or 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

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

keyword

None; metadata only

Not applicable

hybrid (default)

Sends the query; indexed vectors support semantic retrieval

Falls back to keyword and reports the fallback

semantic

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

repo_index_status

Check metadata, embedding coverage, and index freshness.

repo_reindex

Update metadata; embed chunks only with index_embeddings=true.

repo_context_pack

Find code for a task; paths and line ranges by default.

repo_semantic_search

Inspect keyword, hybrid, or semantic search ranking; compact output by default.

repo_related_files

Inspect a file's symbols, imports, and reverse imports.

repo_doctor

Check local setup and index health without external API calls.

gemini_embedding_probe

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 verify

For 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 tools
gemini_embedding_probeGemini Embedding ProbeB

Send one embedding request and return diagnostics for official Gemini or proxy compatibility.

ParametersJSON Schema
NameRequiredDescriptionDefault
textYes
project_pathNo
response_modeNocompact

TDQS

B3.1/5.0
Behavior2/5

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.

Conciseness3/5

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.

Completeness2/5

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.

Parameters2/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
modeNohybrid
queryYes
max_resultsNo
project_pathNo
related_depthNo
response_modeNopaths_only
max_seed_filesNo
max_context_charsNo
max_related_filesNo
max_related_itemsNo
max_snippet_charsNo
include_related_snippetsNo
max_related_context_charsNo
max_related_snippet_charsNo
max_related_snippets_per_fileNo

TDQS

B3.3/5.0
Behavior3/5

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.

Conciseness4/5

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.

Completeness2/5

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.

Parameters2/5

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.

Purpose4/5

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.

Usage Guidelines4/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
project_pathNo
response_modeNocompact

TDQS

B3.2/5.0
Behavior2/5

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.

Conciseness4/5

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.

Completeness2/5

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.

Parameters1/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
project_pathNo
response_modeNocompact

TDQS

C2.4/5.0
Behavior2/5

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.

Conciseness2/5

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.

Completeness2/5

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.

Parameters1/5

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.

Purpose4/5

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.

Usage Guidelines2/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
dry_runNo
project_pathNo
response_modeNocompact
max_file_bytesNo
index_embeddingsNo
target_chunk_charsNo
chunk_overlap_charsNo
max_chunks_per_fileNo
embedding_batch_sizeNo
max_embedding_chunksNo

TDQS

C2.6/5.0
Behavior2/5

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.

Conciseness3/5

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.

Completeness1/5

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.

Parameters1/5

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.

Purpose5/5

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.

Usage Guidelines2/5

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.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 2 tool updatesv0.1.16
    • Changedrepo_context_pack2 fields changed
      • changedInput schema / properties / mode / enum
        Previous value: -[
        -  "hybrid",
        -  "semantic"
        -]New value: +[
        +  "keyword",
        +  "hybrid",
        +  "semantic"
        +]
      • changedInput schema / properties / response_mode / default
        Previous value: -"compact"New value: +"paths_only"
    • Changedrepo_semantic_search1 field changed
      • changedInput schema / properties / mode / enum
        Previous value: -[
        -  "hybrid",
        -  "semantic"
        -]New value: +[
        +  "keyword",
        +  "hybrid",
        +  "semantic"
        +]
  2. 7 tool updatesv0.1.14
    • First observedgemini_embedding_probe
    • First observedrepo_context_pack
    • First observedrepo_doctor
    • First observedrepo_index_status
    • First observedrepo_reindex
    • First observedrepo_related_files
    • First observedrepo_semantic_search

TDQS

B3.2/5.0

Scored across 7 tools

Disambiguation4/5

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.

Naming Consistency4/5

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.

Tool Count5/5

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.

Completeness4/5

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

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    D
    maintenance
    Local-first codebase context engine that parses code into a ranked dependency graph and serves it to AI tools via MCP for deep structural understanding.
    5
    9 npm
    1
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables local semantic code search across repositories using natural language, with AST-aware chunking and hybrid vector/FTS5 retrieval.
    -