searchcode

com.searchcode由 searchcode.com 发布官方发布者v1.0.0更新于 Oct 24, 2026

Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.

已验证Streamable HTTP可网页运行开发者工具安全与监控

概览

AI 生成的概览

让助手分析、搜索并读取任意公开 git 仓库的代码,包括代码质量问题和泄露凭据扫描。

可以做什么
提供七个面向远程公开 git 仓库的工具:code_analyze 给出仓库概览,包括语言、复杂度、技术栈、质量问题和密钥扫描摘要;code_search 支持正则、布尔、模糊和结构化查询,返回路径、行号和代码片段;code_get_file 与 code_get_files 可按符号、行范围或整文件获取代码;code_file_tree 列出目录;code_get_findings 返回规则级质量问题;code_find_usages 显示哪些文件使用了指定库或框架。
适用场景
适合在助手需要理解或浏览陌生的公开代码库、定位特定函数或类、检查代码质量或扫描泄露凭据、确认某项技术实际用在哪些文件时使用。
运行要求
远程 streamable HTTP 端点;未声明任何软件包、环境变量、请求头或身份验证。需要能访问该端点的网络,且仅覆盖公开 git 仓库。
安装前请注意
密钥扫描和问题查询工具会暴露公开仓库中的泄露凭据和安全问题,应将结果视为敏感信息,避免把密钥复制到后续提示或日志中。查询内容和仓库内容会发送到该远程服务。

安装

在 SourceWeft 中

  1. 打开 控制台中的 searchcode,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/com.searchcode%2Fmcp/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

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

工具

7

code_analyze

Instant repo overview — languages, complexity, file count, tech stack, code quality findings, and secret scanning. Use as your first call to understand any remote public codebase. This is the tool that scans for LEAKED CREDENTIALS: security_summary is a dedicated secret and credential scanner covering API keys, access tokens, private keys and connection strings, each with a file, a line and a confidence grade. Prefer it over grepping for key prefixes with code_search — a pattern search only finds what you thought to spell, and finds nothing at all in the repositories where you guessed wrong. 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.

输入参数pathtestslanguagerepository必填detail_levelscan_test_filesinclude_all_dirs

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.

输入参数path必填end_linemax_linesrepository必填start_linesymbol_nameinclude_adjacent_symbols

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.

输入参数querylanguagemax_depthrepository必填max_resultspath_filterinclude_statsinclude_all_dirs

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.

输入参数paths必填max_linesrepository必填

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), category (security, deprecated, safety, correctness, maintainability, accessibility, modernization, performance, concurrency), and kind (security, quality) — kind=security is every security-category finding in one call, kind=quality is everything else. code_analyze.top_findings shows only the quality half; use kind=security here to see the security-category findings it leaves out. THIS IS NOT THE SECRET SCANNER. kind=security means insecure code — weak hashes, unsafe deserialization, injection-shaped patterns — and it will not find a leaked API key or private key. Leaked credentials are code_analyze.security_summary, which is a different scanner over different rules; the two sets do not overlap, so an audit wants both. Use after code_analyze to drill into specific findings. Shares the same analysis cache — no duplicate work if analyze already ran.

输入参数kindpathtestsoffsetcategoryseverityrepository必填max_resultsscan_test_files

code_find_usages

Find which files in a repository use a given technology, library or framework — with the line number and the import keyword that proves it. Use after code_analyze reports a technology in tech_stack and you need to know which files it is actually in, rather than searching for import statements by hand. Returns file, line, evidence keyword and language. COVERAGE LIMIT: technology detection reads only the first 150 lines of each file, so a file that imports the technology further down, or uses it without a top-of-file import, does not appear. Absence from these results is not proof the file does not use the technology. The count matches the files_using value code_analyze reports for the same technology. Shares the analysis cache with code_analyze — no duplicate work if analyze already ran.

输入参数offsetlanguagerepository必填technology必填max_resultspath_filter

版本历史

1
  1. v1.0.0最新Sep 16, 2026

评分

已满足适用检查项的 83%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分

    请声明包含 README 的 GitHub 仓库,或在 OAuth 受保护资源元数据中提供 resource_documentation。

  • 许可证不适用

    托管服务按其提供方的条款使用,因此这里不要求许可证。此检查项不计入百分比。