Skip to main content
Glama
joutvhu

Search Code MCP

by joutvhu

Search Code MCP

npm version CI License: MIT MCP Compatible

A high-performance, unified Model Context Protocol (MCP) server combining the blazing speed of ripgrep (regex/text search) with the deep structural syntax awareness of ast-grep (AST pattern matching and refactoring).

Designed specifically for AI Coding Agents (Cursor, Claude Desktop, Antigravity, Cline / Roo Code, Windsurf, Zed).


⚡ Highlights & Key Features

  • 6 Unified Tools (Zero Prefix Noise): Clean tool names without redundant prefixes: search, replace, count, find_symbols, dump_tree, and list_files.

  • Multi-Engine Driver Fallback (Zero Setup Friction): Automatically discovers and uses the best available CLI tool on your system without manual configuration:

    • Text & Regex: ripgrep (rg) ➜ ugrep ➜ git grep (runs out of the box on any developer machine with Git installed!).

    • Symbol Search: Universal Ctags (ctags) ➜ ast-grep ➜ ripgrep / git grep regex heuristic.

    • AST Search: ast-grep ➜ alias sg.

    • File Listing: rg --files ➜ git ls-files ➜ Native Node.js recursive directory walk.

  • Hybrid 2-Tier Search (type: "hybrid"): Scans candidate files with ripgrep in ~30ms, then parses AST with ast-grep only on matching files—giving 10x–50x speedups over pure AST searches on large codebases.

  • Project-Scoped Pagination Cache (./.cache/code-search/):

    • Automatically activates only when results exceed your chunk limit.

    • Returns a searchId for instant sub-millisecond scrolling through next pages (offset / limit) without re-scanning disk.

    • Creates an isolated ./.cache/code-search/ directory with an auto-generated .gitignore so cache files are never committed to git.

  • Gitignore Respected by Default: Both ripgrep and ast-grep automatically respect your project's .gitignore (noIgnore: false by default). Pass noIgnore: true only when you need to inspect ignored files.

  • Safe Structural Refactoring (replace): Defaults to dryRun: true to generate unified git-style diff previews and safety limits (maxReplacements: 50) before writing any changes to disk.

  • Token Protection & Truncation: Automatically trims overly long single lines (maxLineLength: 500) and strips ANSI color codes to protect LLM context windows.

  • Actionable Diagnostics: Syntax errors in AST patterns or YAML rules return helpful self-correction hints (e.g. suggesting dump_tree or stopBy: end).

  • Zero-Dependency Single-File Bundle: Packaged with tsup into a self-contained single executable bundle for instant startup via npx.


Related MCP server: MCP Smart Filesystem Server

📦 Prerequisites & Engine Setup

🔧 Interactive Engine Manager (search-code-mcp engine)

Instead of installing binaries manually, you can run the built-in interactive engine manager to inspect your environment and automatically install missing tools with arrow keys (↑ / ↓) and [Enter]:

npx search-code-mcp engine

It automatically detects which text, AST, and symbol engines are installed, and presents an interactive selector to install any missing tools (via npm, choco, winget, or brew).


Manual Installation (Optional)

If you prefer to install engines manually, ensure the following CLI binaries are accessible in your system PATH:

1. ripgrep (rg) — Text & Regex Search

  • Windows: winget install BurntSushi.ripgrep.MSVC or choco install ripgrep

  • macOS: brew install ripgrep

  • Linux (Debian/Ubuntu): sudo apt install ripgrep

  • Linux (Arch): sudo pacman -S ripgrep

2. ast-grep (ast-grep) — Structural AST Search & Refactoring

  • npm (Recommended): npm install -g @ast-grep/cli

  • macOS: brew install ast-grep

  • Cargo (Rust): cargo install ast-grep --locked

  • Windows: choco install ast-grep or winget install ast-grep

3. universal-ctags (ctags) — Symbol Search (Optional)

Note: If ctags is not installed, the server automatically falls back to ripgrep regex heuristics.

  • Windows: choco install universal-ctags or winget install universal-ctags.universal-ctags

  • macOS: brew install universal-ctags

  • Linux (Debian/Ubuntu): sudo apt install universal-ctags


🚀 Quick Start & Configuration

You can run search-code-mcp directly via npx without manual installation.

Claude Desktop

Add to your configuration file:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "code-search": {
      "command": "npx",
      "args": ["-y", "search-code-mcp"]
    }
  }
}

Cursor IDE

Add to your project's .cursor/mcp.json or in Cursor Settings > Features > MCP > Add New MCP Server:

{
  "mcpServers": {
    "code-search": {
      "command": "npx",
      "args": ["-y", "search-code-mcp"]
    }
  }
}

Antigravity IDE / Cline / Roo Code / Windsurf

Add to your MCP settings file:

{
  "mcpServers": {
    "code-search": {
      "command": "npx",
      "args": ["-y", "search-code-mcp"]
    }
  }
}

🛠️ Tool Reference

1. search

Unified search engine supporting regex, literal text, AST patterns, relational YAML rules, and hybrid searches.

Parameter

Type

Default

Description

query

string

-

Search query: text, regex, AST pattern, or YAML rule. (Optional if searchId is provided)

path

string

"."

Target directory or file to search

type

enum

"regex"

Search engine mode: "regex", "text", "ast", "ast_rule", "hybrid", "symbol"

searchId

string

-

ID of a previous search to view remaining results instantly from cache

offset

number

1

Starting result index for pagination (1-based)

limit

number

50

Maximum matches to return in this chunk

filePattern

string

-

Glob pattern to filter files (e.g. "*.{ts,tsx}", "!**/*.spec.ts")

fileType

string

-

Ripgrep file type filter (e.g. "ts", "py", "rust", "json")

excludePattern

string

-

Glob pattern to exclude (e.g. "**/dist/**")

noIgnore

boolean

false

If true, searches inside .gitignore-ignored files

caseSensitive

boolean

smart-case

Case sensitivity

context

number

0

Number of context lines before and after match (-C)

wordMatch

boolean

false

Match whole words only (-w)

multiline

boolean

false

Match regex across line breaks (-U)

includeHidden

boolean

false

Search hidden files and folders (-.)

language

string

auto

Programming language for AST mode (auto-detected from file extension if omitted)

outputFormat

enum

"content"

"content" (full snippets), "compact" (file:line), "files_only", or "json"

Examples:

// Fast regex or text search
search({ query: "handleRequest", path: "./src" });
search({ query: "class.*Controller", type: "regex", context: 2 });

// AST structural pattern (ignores whitespace & formatting differences)
search({ query: "console.log($$$ARGS)", type: "ast", language: "typescript" });

// Hybrid 2-tier search: 10x-50x faster on huge codebases
search({ query: "class $NAME extends BaseService { $$$ }", type: "hybrid" });

// Complex relational YAML rule
search({
  query: `
id: find-async-arrow
language: typescript
rule:
  all:
    - kind: arrow_function
    - has:
        pattern: await $EXPR
        stopBy: end
`,
  type: "ast_rule",
});

// Retrieve next chunk from cache using searchId
search({ searchId: "s_9f2a7b", offset: 51, limit: 50 });

2. replace

Structural code refactoring and replacement engine. Supports AST rewrite patterns and Regex/Text replacements.

Parameter

Type

Default

Description

query

string

Required

Search pattern to replace (AST pattern or regex)

replacement

string

Required

Replacement string or AST rewrite pattern

path

string

"."

Target directory or file

type

enum

"ast"

Replacement mode: "ast" (structural rewrite), "regex", "text"

dryRun

boolean

true

If true, outputs unified diff preview without modifying files on disk

maxReplacements

number

50

Safety limit on maximum matches to replace

filePattern

string

-

Glob pattern to filter files

fileType

string

-

File type filter

excludePattern

string

-

Glob pattern to exclude

noIgnore

boolean

false

Whether to modify .gitignore-ignored files

language

string

auto

Programming language for AST mode

Examples:

// 1. Dry run preview (safe default, outputs unified git diff)
replace({
  query: "fetchData($A, $B)",
  replacement: "fetchData({ url: $A, options: $B })",
  type: "ast",
  dryRun: true,
});

// 2. Apply modifications to disk
replace({
  query: "fetchData($A, $B)",
  replacement: "fetchData({ url: $A, options: $B })",
  type: "ast",
  dryRun: false,
});

3. count

Count matching occurrences or lines across files without returning match content, saving tokens.

Parameter

Type

Default

Description

query

string

Required

Search pattern to count

path

string

"."

Target directory or file

type

enum

"regex"

Engine mode: "regex", "text", "ast"

countLines

boolean

false

Count matching lines (true) or total occurrences (false)

perFile

boolean

false

Show breakdown of matches per file

filePattern

string

-

Glob pattern filter

fileType

string

-

File type filter

excludePattern

string

-

Glob exclude filter

noIgnore

boolean

false

Search inside ignored files

language

string

auto

Language for AST mode

Examples:

count({ query: "TODO:", type: "text" });
count({ query: "catch ($ERR) { $$$ }", type: "ast", perFile: true });

4. find_symbols

Find and navigate code definitions (functions, classes, interfaces, methods, types, variables, structs, enums) across the codebase. Automatically selects the best available engine: Universal Ctags ➜ ast-grep ➜ ripgrep / git-grep regex heuristic.

Parameter

Type

Default

Description

name

string

""

Symbol name or substring to find (leave empty to list all symbols in target directory/file)

path

string

"."

Target directory or file path

kinds

array

-

Filter by symbol kinds: "function", "class", "interface", "method", "variable", "type", "struct", "enum"

exactMatch

boolean

false

If true, matches exact symbol name. If false (default), matches prefix or substring

filePattern

string

-

Glob pattern filter (e.g. "*.ts" or "*.py")

fileType

string

-

Ripgrep file type filter (e.g. "ts", "py", "rust")

excludePattern

string

-

Glob pattern to exclude

noIgnore

boolean

false

Search inside ignored files

maxResults

number

100

Maximum number of symbols to return

outputFormat

enum

"table"

Output format: "table" (default markdown table), "compact" (file:line: [kind] name), or "json"

Examples:

// Find exact function or class by name
find_symbols({ name: "handleSearch", exactMatch: true });

// List all functions in a module/directory
find_symbols({ path: "src/handlers", kinds: ["function"] });

// Search across whole repo with compact output
find_symbols({ name: "Schema", outputFormat: "compact" });

5. dump_tree

Inspect concrete syntax trees (CST) or AST node structures to craft precise ast-grep patterns.

Parameter

Type

Default

Description

code

string

Required

Code snippet to inspect

language

string

Required

Programming language (e.g. "typescript", "python", "rust")

format

enum

"cst"

Tree format: "cst" (syntax tree with kinds), "ast", or "pattern"

Example:

dump_tree({
  code: "const calculate = (a, b) => a + b;",
  language: "typescript",
  format: "cst",
});

6. list_files

Enumerate files matching glob patterns or file types without scanning file contents.

Parameter

Type

Default

Description

path

string

"."

Directory to search

filePattern

string

-

Glob pattern filter (e.g. "*.config.js")

fileType

string

-

Ripgrep file type filter

excludePattern

string

-

Glob pattern to exclude

noIgnore

boolean

false

List files ignored by .gitignore

includeHidden

boolean

false

Include hidden files and folders

Example:

list_files({ path: "./src", filePattern: "*.service.ts" });

🔍 Development & Contributing

# 1. Clone the repository
git clone https://github.com/joutvhu/search-code-mcp.git
cd search-code-mcp

# 2. Install dependencies
npm install

# 3. Type check
npm run check

# 4. Build single-file bundle
npm run build

# 5. Test with MCP Inspector
npx @modelcontextprotocol/inspector node dist/index.js

📄 License

This project is licensed under the MIT License.

Available Tools

6 tools
countA

Count matching lines or total occurrences of a pattern in files without retrieving match content, saving tokens.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathNoDirectory or file to count matches in (default: '.').
typeNoEngine mode: 'regex' (default), 'text', 'ast'regex
queryYesSearch pattern to count
perFileNoIf true, shows breakdown of matches per file
fileTypeNoFile type filter
languageNoLanguage for AST mode
noIgnoreNoWhether to count inside gitignored files
countLinesNoCount matching lines (true) or total occurrences (false)
filePatternNoGlob pattern to filter files
excludePatternNoGlob pattern to exclude

TDQS

A3.5/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 behavioral burden. It usefully discloses the key trait that no match content is returned (only counts), which is the main risk of confusing it with a retrieval tool. However, it does not state that the operation is read-only, that nothing is mutated, or that perFile=true changes the return shape.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single sentence with the core action front-loaded and zero filler. Both clauses (what it counts, and the token-saving consequence) earn their place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a ten-parameter tool with no annotations and no output schema, the description covers the core purpose but not the return-value shape. It never mentions that perFile=true produces a per-file breakdown or that results otherwise default to aggregate counts (countLines=true), which an agent needs to interpret output.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all ten parameters are already documented in the schema, which sets the baseline at 3. The description's 'matching lines or total occurrences' loosely mirrors the countLines parameter but adds no syntax, format, or default detail beyond the schema.

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 (count) and resource (matching lines or total occurrences of a pattern in files) with a clear scope. It implicitly distinguishes itself from the sibling 'search' by noting it counts 'without retrieving match content', so an agent can tell the two apart 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.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'saving tokens' hints at the condition for choosing this tool over content-returning siblings like 'search', but it never explicitly says 'use this when you only need counts'. Usage is implied rather than stated, and no exclusions or alternatives are named.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

dump_treeA

Inspect the concrete syntax tree (CST) or AST of code to discover exact node kinds and structure for crafting ast-grep patterns.

ParametersJSON Schema
NameRequiredDescriptionDefault
codeYesCode snippet or query pattern to inspect
formatNoTree dump format: 'cst' (concrete syntax tree), 'ast', or 'pattern'cst
languageYesProgramming language of the code (e.g. 'typescript', 'python', 'rust')

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full behavioral burden. 'Inspect' reasonably conveys a read-only operation, and the purpose clause adds context, but it says nothing about output size, whether the dump is truncated, or any cost/latency characteristics of parsing arbitrary code.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single front-loaded sentence with the action, the resource, and the reason for using it, with zero redundant or filler text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a three-parameter read-only inspection tool with no output schema and full schema coverage, the description supplies the purpose and the intended workflow. It is nearly complete; only the return shape and the 'pattern' format mode are left unaddressed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all three parameters (code, format, language) are already documented in the schema, including the format enum. The description reinforces the cst/ast distinction but omits the 'pattern' format value and adds no syntax or format guidance beyond the schema, so the baseline 3 applies.

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?

Names a specific verb (Inspect) and resource (CST/AST of code) and states the downstream purpose (crafting ast-grep patterns), which implicitly separates it from siblings like search and find_symbols. It does not explicitly name or contrast any sibling, so a 4 rather than a 5.

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?

The phrase 'for crafting ast-grep patterns' implies the workflow context (use before authoring a pattern), which is genuine but indirect guidance. There is no explicit when-to-use/when-not statement and no named alternative among search, replace, count, find_symbols, or list_files.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

find_symbolsB

Find code symbols (functions, classes, interfaces, methods, types, variables, structs, enums) across the codebase. Automatically selects best available engine: Universal Ctags -> ast-grep -> ripgrep regex heuristic.

ParametersJSON Schema
NameRequiredDescriptionDefault
nameNoSymbol name or substring pattern to find (leave empty to list all symbols in target path)
pathNoFile or directory to search symbols in (default: '.').
kindsNoFilter by symbol kinds: 'function', 'class', 'interface', 'method', 'variable', 'type', 'struct', 'enum', 'trait', 'module'
fileTypeNoFile type filter, e.g. 'ts', 'py', 'rust', 'go'
noIgnoreNoWhether to search inside gitignored files
exactMatchNoIf true, only match exact symbol name. If false (default), matches prefix or substring
maxResultsNoMaximum number of symbols to return (default: 100)
filePatternNoGlob pattern to filter files, e.g. '*.ts' or '*.py'
outputFormatNoOutput format: 'table' (default markdown table), 'json', or 'compact' (file:line: [kind] name)table
excludePatternNoGlob pattern to exclude, e.g. '**/node_modules/**', '**/dist/**'

TDQS

B3.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must carry behavioral disclosure. It usefully reveals the engine fallback chain (Ctags -> ast-grep -> ripgrep) and implicitly that gitignored files are skipped by default, but it never states that the operation is read-only and non-mutating, nor how results are ordered or truncated beyond the maxResults parameter.

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?

Two sentences, front-loaded with the capability before the implementation detail about engines. No filler, though the parenthetical symbol enumeration is somewhat redundant with the kinds enum in the schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 10 parameters fully covered by the schema but no output schema, the description is adequate for invocation but does not describe the shape of results or how outputFormat changes them. It says what is searched but not what comes back, leaving a modest gap for a tool with this much configuration surface.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so every parameter is already documented in the schema, setting the baseline at 3. The description adds no parameter-level detail beyond what the schema provides, such as the interaction between exactMatch and name, so it neither helps nor hurts.

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 (Find) and resource (code symbols), and enumerates the symbol kinds it covers, so the agent knows what it returns. It does not name or distinguish itself from the sibling 'search' tool, which overlaps in intent, so it stops short of a 5.

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?

There is no explicit when-to-use or when-not-to-use guidance relative to siblings like search, count, or dump_tree. The mention of automatic engine selection implies the tool is a higher-level symbol-aware alternative to raw search, but the agent must infer that routing decision itself.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_filesA

Quickly list files matching glob patterns or file types without scanning contents.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathNoDirectory to list files in (default: '.').
fileTypeNoFile type filter
noIgnoreNoWhether to list gitignored files
filePatternNoGlob pattern to filter files
includeHiddenNoInclude hidden files and directories
excludePatternNoGlob pattern to exclude

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full behavioral burden. It discloses that the operation is fast and does not scan file contents, but omits read-only nature, permission requirements, recursion behavior, and return format. This is minimum viable for a simple list tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence with no filler. Every phrase contributes to purpose or scope, making it appropriately concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There are no annotations and no output schema, so the description should ideally cover more behavioral context. It explains the core listing scope, but does not describe return values, recursion, or whether the result includes hidden/ignored files by default. Given the simple read operation and complete parameter schema, it is adequate but not complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all six parameters. The description references glob patterns and file types generically but adds no syntax, defaults, or behavior beyond the schema. The baseline 3 applies.

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 states a specific verb and resource: 'list files'. It adds scope ('matching glob patterns or file types') and a differentiator from content-oriented siblings: 'without scanning contents'. An agent can distinguish this from search without opening schemas.

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?

The phrase 'without scanning contents' implies the tool is for name/path listing rather than content search, which gives context against the sibling 'search'. However, it does not explicitly name alternatives or state when not to use this tool, so guidance is only implied.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

replaceA

Structural code refactoring and replacement engine. Supports AST rewrite or Regex/Text replacement. By default, runs in dryRun mode producing a unified diff preview to ensure safe operations before writing changes to disk.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathNoDirectory or file to perform replacement in (default: '.').
typeNoReplacement engine: 'ast' (default structural rewrite), 'regex', 'text'ast
queryYesTarget search pattern to replace (AST pattern or regex)
dryRunNoIf true (default), outputs unified diff preview without modifying files on disk
fileTypeNoFile type filter
languageNoProgramming language for AST mode (auto-detected if omitted)
noIgnoreNoWhether to search inside gitignored files
filePatternNoGlob pattern to filter files
replacementYesReplacement string or AST rewrite pattern
excludePatternNoGlob pattern to exclude
maxReplacementsNoSafety guardrail: maximum number of matches to replace (default: 50)

TDQS

A3.5/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 behavioral burden. It usefully surfaces that dryRun defaults to true and returns a diff preview before touching disk, but this largely restates the dryRun schema entry, and it says nothing about irreversibility when dryRun=false, permission needs, or failure behavior on zero matches.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three tight sentences with zero filler, front-loaded with the tool's identity and followed immediately by the modes and the safety default. Every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 11-parameter mutation tool with no annotations and no output schema, the description covers the core purpose and the critical dryRun safety default but omits guidance on mode selection, filter parameters, and the maxReplacements guardrail visible only in the schema. Adequate as a minimum viable definition, not fully complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so every parameter is already documented in the schema, including the dryRun default and the ast/regex/text enum. The description only echoes the engine-type distinction and adds no format, syntax, or interaction detail beyond the schema, so the baseline 3 applies.

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 names a specific verb and resource ('Structural code refactoring and replacement engine') and enumerates the modes (AST rewrite vs Regex/Text), which clearly separates it from read-only siblings like search and count. It stops short of explicitly naming an alternative tool or contrasting its scope with them.

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?

Usage is implied rather than stated: the dryRun/default-preview sentence hints at a preview-then-write workflow, but there is no explicit 'use this when...' or 'prefer X instead' guidance, and nothing tells the agent when to pick AST versus regex versus text mode.

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. 6 tool updatesv1.0.0
    • First observedcount
    • First observeddump_tree
    • First observedfind_symbols
    • First observedlist_files
    • First observedreplace
    • First observedsearch

TDQS

A3.7/5.0

Scored across 6 tools

Disambiguation4/5

Each tool has a distinct core purpose: search (find patterns), replace (modify), count (count only for token savings), dump_tree (AST inspection), find_symbols (symbol lookup), and list_files (glob listing). There is minor conceptual overlap between search, count, and find_symbols—all find code—but the descriptions clearly differentiate their outputs and use cases.

Naming Consistency4/5

All names use snake_case consistently, which is good. However, the pattern is mixed: some are bare verbs (search, replace, count) while others are verb_noun (dump_tree, find_symbols, list_files), a minor deviation from a single predictable convention.

Tool Count5/5

Six tools is well-scoped for a code search and refactoring server. Each tool serves a clear, non-redundant function, making the set efficient without being thin or bloated.

Completeness4/5

The surface covers the search/refactor lifecycle well: locate (search, find_symbols, list_files), inspect (dump_tree), quantify (count), and modify (replace). The main minor gap is a direct file-content read tool, though search and list_files let agents work around it.

Maintenance

ActivityNo data
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    Enables AI assistants to understand and navigate codebases through structural analysis. Provides code mapping, symbol search, and impact analysis using ast-grep for accurate parsing of Python, JavaScript, TypeScript, and Go projects.
    4
    53
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Provides LLM-optimized filesystem access with intelligent file pagination for large files, lightning-fast ripgrep-powered code search with regex support, and security sandboxing to safely explore and search codebases.
    7
    9 npm
    1
    MIT
  • F
    license
    D
    quality
    D
    maintenance
    Enables AI agents to perform semantic search over codebases by converting natural language queries into efficient search patterns like grep and ripgrep. It utilizes LLMs to verify relevance and find code snippets that traditional keyword-based searches might miss.
    1
    -