What tools does searchcode provide for code analysis?

Updated

searchcode exposes six specialized tools through an MCP server, and each returns structured, pre-computed data rather than raw file contents. The point is that an LLM spends tokens on reasoning instead of parsing: the site claims roughly 1 call and ~500 tokens per investigation versus ~30+ tool calls and ~50,000 tokens when an assistant clones, greps, and reads a repo itself. You can use the tools either by pasting a public GitHub URL into the web dossier, or by adding the MCP server to an editor so Claude Code, Cursor, Codex, or Copilot calls them directly. The service is described as free during beta, with no signup and no API key required.

The six tools and what each returns

Tool What it does Typical use
code_analyze Language breakdowns, complexity metrics, tech stack detection, code quality, and secret scanning Get an orientation dossier on an unfamiliar repo
code_search Full-text code search with boolean queries, regex, and structural filters Find where something is declared or used
code_get_file Retrieve full files, line ranges, or specific symbols by name Pull exactly the code you need
code_get_files Batch retrieve up to 10 files in one call Cross-file analysis
code_file_tree Directory structure with language, path, and depth filters Map a repo before diving in
(one further tool) Listed as part of the six —

The page names code_analyze, code_search, code_get_file, and "three more," and explicitly lists code_file_tree and code_get_files in the capabilities section, which accounts for five of the six.

code_analyze

This is the entry point for understanding a repository you have never seen. It returns language breakdowns, complexity metrics, tech stack detection, and code quality signals in one structured response.

It also includes security_summary, which the page describes as the credential scanner: it reports API keys, tokens, and private keys with file, line, and confidence. For large monorepos you can scope the analysis to a subdirectory rather than the whole tree.

code_search

Full-text search across the code, with three layers of query control:

  • Boolean queries for combining terms
  • Regex for pattern matching
  • Structural filters for declarations, usages, strings, and comments

That last layer is what separates it from plain grep: you can ask for a symbol's declaration sites specifically, or only its usages, or restrict matches to strings or comments.

code_get_file and code_get_files

code_get_file retrieves a full file, a line range, or a specific symbol by name. It can also include adjacent declarations so you get surrounding context in a single call instead of a follow-up round trip.

code_get_files does the same in batch, up to 10 files per call. This is the tool for cross-file analysis — for example, tracing how a type defined in one module is consumed across several others.

code_file_tree

Returns the directory structure with filters for language, path, and depth. Useful as a first call on a large repo to decide which subdirectories are worth analyzing or searching.

Connecting the tools to your editor

The MCP endpoint is https://api.searchcode.com/v1/mcp. Setup differs by client:

Claude Code — one command:

claude mcp add searchcode --transport http https://api.searchcode.com/v1/mcp

Cursor — add to .cursor/mcp.json:

{"mcpServers":{"searchcode":{"url":"https://api.searchcode.com/v1/mcp"}}}

VS Code / Copilot — add to .vscode/settings.json:

{"mcp":{"servers":{"searchcode":{"url":"https://api.searchcode.com/v1/mcp"}}}}

Claude Desktop — uses a local bridge:

{"mcpServers":{"searchcode":{"command":"npx","args":["-y","mcp-remote","https://api.searchcode.com/v1/mcp"]}}}

For OpenCode, Crush, Codex, Gemini CLI, Amp, or LM Studio, the site points to a full setup guide. Once connected, your assistant gets the same six tools over any public repo.

Choosing between the web dossier and the MCP server

If you just want to look at a repo yourself, paste a GitHub URL or owner/repo into searchcode.com and you get a dossier in seconds with no install. The page also supports side-by-side comparison of two repos (its example is redis vs memcached).

If you want your AI assistant to do the investigation inside your editor — and to avoid the token cost of it cloning and grepping — add the MCP server. The two paths use the same underlying tools; the difference is who is reading the output.