com.searchcode/mcp
Official6 toolssearchcode
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
Search and analyze code across public git repositories for LLM context.
Captured live from the server via tools/list.
code_analyze
Instant repo overview — languages, complexity, file count, tech stack, code quality findings, and credential scanning. Use as your first call to understand any remote public codebase. Supports language filtering and path scoping (for large monorepos, analyze a subdirectory instead of the full repo). When analysing multiple repositories, call in parallel rather than sequentially. Dependency/build directories excluded by default.
Parameters (6)
- detail_levelstring
Controls response verbosity. summary returns top 20 across all languages; full returns top 20 per language. Use summary for portfolio reviews, hiring assessments, and high-level overviews. Use full for deep per-language audits or when you need granular per-file breakdowns within a specific language.
- include_all_dirsboolean
Include dependency/build/cache directories that are excluded by default (vendor, node_modules, third_party, target, build, dist, Pods, generated, etc.). Set to true if you need to analyze generated/vendored code.
- languagestring
Filter results to a specific language (e.g. "Java", "Go", "Python").
- pathstring
Subdirectory to scope analysis to (e.g. 'src', 'clang/lib'). Only files under this path are walked and analyzed — use this for large monorepos where full analysis is too slow or when the user's question is about a specific component. Omit to analyze the entire repository.
- repositorystringrequired
Git URL of a public remote repository
- scan_test_filesboolean
Include test files in code quality and credential scan results. Test files are excluded by default to reduce false positives (e.g. test credit card numbers, mock credentials). Set to true if you need to audit test code.
code_search
Fast code search across any public git repo. Returns file paths, line numbers, and code snippets with context. Supports regex, boolean queries, fuzzy matching, and structural filters (declarations, usages, strings, comments). Dependency/build directories excluded by default.
Parameters (10)
- case_sensitiveboolean
Whether to match case-sensitively.
- code_filterstring
Structural filter to narrow matches to specific code regions. only-declarations and only-usages use heuristic patterns and support 30+ languages (Go, Python, JS/TS, Rust, Java, C/C++, C#, Ruby, PHP, Kotlin, Swift, and more). For unsupported languages, all matches are classified as usages.
- context_linesinteger
Lines of context before and after each match.
- include_all_dirsboolean
Include dependency/build/cache directories that are excluded by default (vendor, node_modules, third_party, target, build, dist, Pods, generated, etc.). Set to true if you need to search generated/vendored code.
- max_matches_per_fileinteger
Maximum matches to show per file (cap: 50). Keeps responses compact for files with many hits. The response includes matches_in_file (total) so you know if more exist.
- max_resultsinteger
Maximum number of file results to return (cap: 100).
- offsetinteger
Skip this many results before returning. Use for paging.
- querystringrequired
Search query. Keywords are ANDed — use OR for exploratory multi-term searches (e.g. auth OR login OR session). Prefer single precise terms over multi-keyword phrases. Supports OR, NOT, "phrases", regex (/pattern/), fuzzy (term~1), file:, path:, lang:, ext: filters.
- repositorystringrequired
Git URL of a public remote repository
- snippet_modestring
auto (ranked relevance), grep (every matching line), or summary (1 best match per file, no context — very compact). Use auto when exploring or discovering where something is used across a codebase (e.g. "how is authentication handled?"). Use grep when you know the exact identifier or string you want every occurrence of (e.g. "find all calls to parseConfig"). Use summary for broad queries where you want a compact overview of which files match.
code_get_file
Get code from a remote public git repository — either a specific function/class by name, a line range, or a full file. PREFERRED WORKFLOW: When search results or findings have already identified a specific function, method, or class, use symbol_name to extract just that declaration. This avoids fetching entire files and keeps context focused. Only fetch full files when you need a broad understanding of a file you haven't seen before. For supported languages (Go, Python, TypeScript, JavaScript, Java, C, C++, C#, Kotlin, Swift, Rust) the response includes a symbols list of declarations with line ranges. This is not a first-call tool — use code_analyze or code_search first to identify targets, then extract precisely what you need.
Parameters (7)
- end_lineinteger
Last line to return (inclusive). If omitted, returns to end of file. Cannot combine with symbol_name.
- include_adjacent_symbolsboolean
When true and symbol_name is set, includes structurally related declarations (nearby siblings) alongside the target symbol.
- max_linesinteger
Lines to return (max: 2000). When reading an unfamiliar file for orientation, set this to 2000. When you already know which function or class you need (from search or findings results), prefer symbol_name instead — it returns only the relevant declaration and avoids pulling unnecessary context.
- pathstringrequired
File path relative to repository root
- repositorystringrequired
Git URL of a public remote repository
- start_lineinteger
First line to return (1-based). Cannot combine with symbol_name.
- symbol_namestring
PREFERRED for targeted retrieval. Name of a function/method/class to extract — returns only that declaration. Use this when search results or findings have pointed you to a specific symbol, instead of fetching the entire file. Cannot combine with start_line/end_line. Response includes a symbols list for supported languages.
code_file_tree
List files and directories in any public git repo. Supports fuzzy file search (query parameter), language/path filtering, and depth control. Combine query with path_filter to search within a directory subset. Use to explore project layout, find files by name, or browse specific directories. Results capped at 1000 files; response includes total_files, files_shown, and truncated fields. Use language or path_filter to narrow large repos. Dependency/build directories excluded by default.
Parameters (8)
- include_all_dirsboolean
Include dependency/build/cache directories that are excluded by default (vendor, node_modules, third_party, target, build, dist, Pods, generated, etc.). Set to true if you need to see generated/vendored code in the tree.
- include_statsboolean
If true, include line count and file size for each file.
- languagestring
Filter to only show files of this language (e.g. "Go", "Java").
- max_depthinteger
Maximum directory depth to return. If omitted, returns full tree.
- max_resultsinteger
Max fuzzy matches to return (default 20, max 100). Only used with query.
- path_filterstring
Filter to restrict tree to matching paths. Supports both glob patterns (e.g. 'pkg/**', 'src/**/*.go') and token-style filters (e.g. 'pkg/api .go'). Glob patterns are auto-converted to token filters. When combined with query, narrows the file set before fuzzy matching.
- querystring
Fuzzy search query for finding files by approximate name. Returns ranked matches instead of tree. Examples: 'main.go', 'auth handler'. Can be combined with path_filter to search within a directory subset.
- repositorystringrequired
Git URL of a public remote repository
code_get_files
Get contents of multiple files from a remote public git repository in a single call. Reduces round-trips when you need to read several related files. Max 10 files per batch, 5000 total lines budget across all files. Each file supports optional line ranges. Failed files return per-file errors without blocking other files.
Parameters (3)
- max_linesinteger
Per-file safety cap on lines returned (cap: 2000).
- pathsarrayrequired
List of files to read. Each entry has a path and optional line range.
- repositorystringrequired
Git URL of a public remote repository
code_get_findings
Get detailed code quality findings from a remote public git repository. Returns rule IDs, line numbers, severity, category, descriptions, and source snippets. Supports filtering by file path, severity (error, warning, info), and category (security, deprecated, safety, correctness, maintainability, accessibility, modernization, performance, concurrency). Use after code_analyze to drill into specific findings. Shares the same analysis cache — no duplicate work if analyze already ran.
Parameters (7)
- categorystring
Filter findings by category.
- max_resultsinteger
Maximum number of findings to return (cap: 200).
- offsetinteger
Skip this many findings before returning. Use for paging.
- pathstring
Filter findings to files matching this path prefix (e.g. "pkg/api/" or "src/main.go").
- repositorystringrequired
Git URL of a public remote repository
- scan_test_filesboolean
Include findings from test files. By default test files are excluded.
- severitystring
Filter findings by severity level.
README not available yet.
Install
claude_desktop_config.json
{
"mcpServers": {
"mcp": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://api.searchcode.com/v1/mcp"
]
}
}
}Desktop config is stdio-only; this bridges via mcp-remote. Native remote: Settings > Connectors.