X402 Codesearch Mcp

io.github.liminalpepe由 GitHub 账号 liminalpepe 发布v0.1.0更新于 Oct 24, 2026

Free MCP server: index a repo's files into the x402-codesearch Worker's search index.

已验证STDIO仅桌面知识与记忆开发者工具

概览

AI 生成的概览

一个本地 MCP 服务器,其唯一工具把仓库文件分块并嵌入后写入第三方在线语义代码搜索服务的索引。

可以做什么
索引代码:提交仓库标识以及文件路径和内容列表,由在线服务分块、生成嵌入并写入索引,返回已索引的文件数和分块数,并提示搜索需使用付费端点。
适用场景
当你希望助手免费把仓库文件推送到该服务的语义搜索索引,并接受之后检索结果需自行调用付费 HTTP 接口时使用。
运行要求
通过 stdio 在本机运行,通常用 npx 配合 Node.js 启动。索引无需 API 密钥或账号,但需要能访问该服务的在线索引端点。
安装前请注意
每次调用都会把文件内容发送到第三方的在线服务,且本地不做缓存,重复索引会再次发送并重新嵌入相同文件。该工具只负责索引,不提供语义搜索;搜索需通过单独的付费端点,每次查询 0.01 USDC(Base 网络)。

安装

在 SourceWeft 中

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

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

x402-codesearch-mcp

A free MCP (Model Context Protocol) server that indexes a repo's files — chunked and embedded — into the live semantic code search Worker, for free, via one MCP tool: index_code.

This is the open funnel twin of a paid, x402-gated HTTP API:

x402-codesearch-poc.theliminalguy.workers.dev — POST /search, $0.01 USDC on Base per query via the x402 payment protocol, for the actual semantic search step over an indexed repo.

Why this one is different from the other free twins (read this first)

Sibling packages like x402-repohealth-mcp fully reimplement their paid Worker's logic locally (pure functions, no external account-bound dependency) and expose the entire feature for free via MCP.

This package cannot do that. The paid Worker's semantic search depends on two Cloudflare-account-bound bindings with no free, local, or portable equivalent:

  • Workers AI (@cf/baai/bge-base-en-v1.5) — generates the embeddings
  • Vectorize — stores and queries those embeddings by cosine similarity

Both only exist inside the Worker's own Cloudflare account. There is no way to run them for free outside that account, so this MCP server does not try to fake or proxy them.

What genuinely is free is POST /index on the live Worker itself — the step that chunks a file, embeds it, and upserts it into that Worker's own Vectorize index. That's the one real, free, stateless capability this package exposes as an MCP tool. The matching POST /search step stays exactly where it already is: a real x402-gated HTTP call directly against the live Worker.

What it does

One tool, index_code:

  • Input: { repoId: string, files: [{ path: string, content: string }] }
  • Calls POST https://x402-codesearch-poc.theliminalguy.workers.dev/index (free, no payment) with that exact body.
  • Output: { repoId, filesIndexed, chunksIndexed } plus a note field reminding the caller that searching what was just indexed requires the paid endpoint.

It does not expose a search_code tool. Semantic search over data indexed with this tool requires calling the x402-gated endpoint directly:

POST https://x402-codesearch-poc.theliminalguy.workers.dev/searchBody: { "repoId": "...", "query": "..." }Price: $0.01 USDC on Base, via the x402 protocol (e.g. x402-fetch / x402-axios)

An unpaid request to /search returns 402 Payment Required with real x402 payment instructions.

Install & run

bash
npx x402-codesearch-mcp

Or add it to an MCP client config (e.g. Claude Desktop's claude_desktop_config.json):

json
{  "mcpServers": {    "codesearch": {      "command": "npx",      "args": ["-y", "x402-codesearch-mcp"]    }  }}

Tool: index_code

Input:

jsonc
{  "repoId": "my-repo",  "files": [    { "path": "src/retry.py", "content": "def retry_with_backoff(...): ..." }  ]}

Output (MCP tool text content, JSON-stringified):

jsonc
{  "repoId": "my-repo",  "filesIndexed": 1,  "chunksIndexed": 2,  "note": "Indexing succeeded (free). To semantically search this repoId, call the x402-gated POST https://x402-codesearch-poc.theliminalguy.workers.dev/search directly ($0.01 USDC on Base per query) — not available through this free MCP tool."}

Local development

bash
npm installnpm run dev              # runs src/index.ts directly on stdio via tsxnpm run build             # compiles to dist/ for the published npm packagenpm run test:index        # calls indexCode() directly against the real live Worker, no MCP transport

src/client.ts and src/types.ts hold the thin HTTP client against the live Worker's /index endpoint — src/index.ts is a thin MCP wrapper around indexCode().

What's real vs. limited

  • Real: the POST /index call this tool makes goes to the actual live Worker, which really chunks the given files, really calls Workers AI for embeddings, and really upserts into Vectorize — nothing here is mocked or hardcoded. Verified end-to-end against the live Worker (see below).
  • Genuinely free: POST /index requires no payment and no API key — confirmed live, not just documented.
  • Not free, and not exposed here by design: POST /search on the same Worker. That's a deliberate scope boundary, not an oversight — see "Why this one is different" above.
  • No local caching/dedup: every index_code call re-POSTs to the live Worker; re-indexing the same file just re-chunks/re-embeds/re-upserts it.

When to use the paid HTTP twin directly

Use POST /search on the live Worker instead of (in addition to) this MCP server when:

  • You've indexed a repo with index_code and now want to actually search it semantically.
  • Your agent already speaks x402 (e.g. via x402-fetch / x402-axios) and can pay $0.01 USDC on Base per query.
  • You need production/high-volume search — this MCP server's index_code tool shares the same free /index endpoint as every other caller, but /search is metered per call regardless of caller.

License

MIT

来源:README.md,提交 c155068

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.0最新Sep 16, 2026

评分

已满足适用检查项的 50%

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

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分