
Agent Discover
io.github.keshrath由 GitHub 账号 keshrath 发布v3.2.2更新于 Oct 24, 2026
Find, install and enable MCP servers mid-session on any host, with consent and tool pinning
概览
一个本地守护进程,让助手搜索注册表、经确认后安装 MCP 服务器,并在会话中启用或停用其工具而无需重启。
- 可以做什么
- 搜索已安装服务器的工具索引,以及官方 MCP Registry 镜像、npm 和 PyPI 中尚未安装的服务器;跨所有已安装服务器批量搜索或查看工具定义,无论是否启用。按精确的注册表、npm 或 PyPI 名称(版本固定)或手动命令、URL 安装服务器,安装前展示确切命令、来源校验和所需密钥名称供确认。在运行时启用或停用服务器,包括刚安装的服务器,并调用任意已索引工具,原样返回上游结果。查看服务器状态、健康与隔离情况,并在重新批准工具发生变化的服务器前审阅差异。
- 适用场景
- 适合希望助手在会话中途查找并添加新 MCP 服务器、而不必修改宿主配置并重启的场景,也适合保留大量已安装服务器但只启用其中一部分、同时让所有工具仍可搜索的情况。
- 运行要求
- 通过 npx(Node.js)或源码在本地运行;守护进程默认监听 127.0.0.1:3424,可用 AGENT_DISCOVER_PORT 和 AGENT_DISCOVER_HOST 配置。可选设置包括 AGENT_DISCOVER_MODE、AGENT_DISCOVER_DATA_DIR、AGENT_DISCOVER_SETUP_FILE 和 AGENT_DISCOVER_EMBEDDING_PROVIDER。Claude Code 面板需要 Claude Code 2.1.289 或更高版本。访问注册表、npm 和 PyPI 需要网络。
安装
在 SourceWeft 中
- 打开 控制台中的 Agent Discover,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
agent-discover
[License: MIT] [Node.js] [Tests] [MCP Tools]
Find, install and enable MCP servers in the middle of a session, on any MCP host. agent-discover is one local daemon that searches the official MCP Registry, npm and PyPI, installs a server after you approve the exact command and its provenance, and then exposes its tools to your host without a config edit or a restart. It also guards what it installs: tool definitions are pinned and a server whose tools change is quarantined, secrets live in the OS keychain, and every action is audited.
Why
Current hosts (Claude Code, Codex, the Anthropic and OpenAI APIs) have their own tool search, so agent-discover is not mainly about saving prompt tokens any more. What a host's tool search cannot do is work with a server you have not installed yet. Adding a new MCP server still means editing the host's config and restarting the session. agent-discover removes that step:
- Discover. One query searches your installed servers' tool index and the public registries (a local mirror of the official MCP Registry, plus npm and PyPI).
- Install with consent.
install_servershows you the exact command or URL, the env and header names, the pinned version and the provenance checks (registry namespace, npmmcpName, PyPI, OCI label). Nothing runs until you accept. - Enable and disable at runtime, including servers that were installed a minute ago. Enabling indexes the server first if needed.
- Feed the host's own tool search. In
nativemode (the default) every enabled server's tools are listed as<server>__<tool>and agent-discover sendsnotifications/tools/list_changedon each change, so the host's native tool search, permission prompts andalwaysLoadsettings keep working. Inproxymode only eight meta tools are listed and everything goes throughcall_tool, for hosts with weak or no tool search. - Stay in control. See Trust layer.
Quick Start
Claude Code
Install the plugin. It runs the stdio shim as the MCP server, adds the find and install skills and a Claude Code mod (function hooks) with the management UI:
[The /discover pane docked beside the transcript]
New to the pane? The tutorial walks through it with screenshots.
/discoveropens the agent-discover pane (docked beside the transcript in the fullscreen layout, above the prompt otherwise; also in the desktop Code tab and VS Code). Keys 1-4 switch tabs, and the focus lands on the next step (Approve, Enable, the search field, a missing secret, Install). Servers: every installed server with its state; open one for its config (command or URL, tags, source and registry status, package; env and header key names only), a secrets editor (set or delete, values never shown), its tools with input schemas and per-tool metrics, health check and error reset, the quarantine diff with Approve / Keep disabled, OAuth sign-in (the authorize URL as a link), and Enable / Disable / Re-index / Uninstall. Browse: search the registries, review the install plan (exact command or URL, provenance, warnings, required keys with secret inputs) and install. Logs (recent proxied calls) and Audit (filter by server and action, paged). Questions upstream servers ask (elicitation) appear on top./discover <what you need>opens Browse with the results.- A status line entry
MCP 2/6 enabled · 1 to review(enabled of installed, and how many servers need a look), a toast when a server is quarantined, goes unhealthy or asks a question, and a band above the prompt that shows only while something needs you and the pane is closed. - One context block at the start of each conversation tells the model which servers are enabled and to call
search_toolsbefore saying a capability is missing. - The mod needs Claude Code 2.1.289 or newer. Older builds keep the skills and tools.
- Remove any hand-written
agent-discoverentry from~/.claude.jsonso tools do not appear twice.
Any other MCP host
Hosts with Streamable HTTP can instead point at http://127.0.0.1:3424/mcp when the daemon already runs. Cursor, Codex, VS Code, Claude Desktop and the rest: docs/SETUP.md.
Other hosts use agent-discover through its MCP tools (markdown results; the MCP Apps widget where the host renders it). Approving a quarantined server or installing without an elicitation-capable client happens in Claude Code's /discover pane, or an operator sets AGENT_DISCOVER_ALLOW_UNCONFIRMED_INSTALL=1.
From source
How it runs
One daemon per machine, agent-discover daemon, listens on 127.0.0.1:3424 and serves the REST API (/api/*, what the Claude Code pane talks to) and MCP Streamable HTTP at /mcp. /mcp speaks the 2026-07-28 protocol and the 2025 sessionful protocol on the same endpoint.
The default bin agent-discover is a thin stdio shim: it checks /api/health, starts the daemon if it is not running (lockfile-guarded, detached) and relays stdio to /mcp. Every host and every session shares the one daemon, so connection and enablement state has a single owner. The daemon exits after 30 minutes with no open HTTP exchanges (AGENT_DISCOVER_IDLE_MS).
Details: docs/ARCHITECTURE.md.
MCP tools (8)
Prompts discover, install and status appear as slash commands in hosts that surface MCP prompts. All tools except call_tool declare an outputSchema and return structuredContent plus a markdown rendering.
MCP Apps widget. Tool results carry ui://agent-discover/app.html, a single widget that renders search results, server cards, install consent and a tool tester. Claude Desktop, claude.ai and VS Code render it. Claude Code does not render MCP Apps yet and shows the markdown instead.
Full schemas: docs/API.md.
Trust layer
agent-discover sits between your host and MCP servers it did not write, so it assumes their descriptions are hostile. Full model: docs/SECURITY.md.
- Install consent with provenance. The plan shows the exact command, pinned version and registry namespace / package metadata checks. There is deliberately no agent-supplied
confirmargument. - Tool pinning and quarantine. The first index of a server pins a hash of every tool's description, input schema and annotations. Any later change, addition or removal quarantines the server until you re-approve it from a readable diff (or the tools revert).
- Description hygiene. Control, zero-width and bidi characters are stripped, descriptions are capped, and six heuristics flag likely prompt injection. Flags are advisory; pinning is the control.
- Secrets in the OS keychain, or an AES-256-GCM file when no keychain is available. Never in SQLite, never listed unmasked.
- Audit log, append-only, readable at
GET /api/audit. - OpenTelemetry, opt-in via
OTEL_EXPORTER_OTLP_ENDPOINTorAGENT_DISCOVER_OTEL=1. - Loopback only. Host / Origin allowlist, JSON-only bodies, and a per-launch token on every state-changing REST call.
- OAuth 2.1 for remote servers (discovery, PKCE, refresh,
isscheck), with sign-in handed to you as a URL; agent-discover never opens it itself.
Not covered: sandboxing upstream stdio servers. They run with your user's privileges.
Search quality
search_tools ranks with SQLite FTS5 (Porter stemming, fielded BM25 over name, description and argument names), typo repair, server routing and a small usage prior. A local or OpenAI embedding provider is opt-in and adds dense scores.
Measured on the retrieval bench in bench/retrieval/: 50 real MCP servers, 1674 tools, 468 hand-labelled queries (paraphrase, task, cross-server, multi-step, typo, German, and unanswerable). All tuning used the dev split; these numbers are the held-out test split (269 answerable queries).
Read this honestly:
- The zero-config gain over plain BM25 is modest (+4 points R@10). The dense option adds about 6 more.
- It is retrieval only: no LLM chooses a tool, and the corpus is public servers with their real, uneven descriptions.
- The e5 row needs
npm install @huggingface/transformersby hand (about 130 MB model, about 3 minutes to index 1674 tools on one thread) and is not run in CI. - A 5-query-per-tool LLM enrichment of descriptions reached R@10 0.922 offline, but that is bench-only and not shipped: it needs an LLM at index time, and the labelled queries were also LLM-written, so treat it as an upper bound.
- No score floor is applied. No signal separated the unanswerable queries from answerable ones, so 2.0 returns the best matches rather than pretending to reject.
Methodology, per-category results and how to run it: bench/retrieval/README.md. CI runs npm run bench:retrieval -- --check.
Features
- Local registry in SQLite: servers, indexed tools, per-server secrets, metrics. Indexing is independent of enablement: install probes the server once, persists its tools and disconnects.
- Registry mirror of the official MCP Registry (v0.1 API) with incremental
updated_sincesync, deprecated and deleted status tracking, and exact-name installs. A server whose registry entry was deleted is flagged inserver_status. - Federated search over the registry mirror, npm and PyPI.
- Transports to upstream servers: stdio, SSE, streamable HTTP, both protocol eras negotiated automatically. Upstream
input_requiredand 2025elicitation/createrequests are relayed to your client. - Lazy, pooled connections with reconnect backoff, idle disconnect and real health probes.
- Three UI surfaces: the Claude Code
/discoverpane, the MCP Apps widget (Claude Desktop, claude.ai, VS Code) and markdown results for every other host (OpenCode, Cursor, Codex, ...). There is no web dashboard since 3.0. - Declarative setup file (
AGENT_DISCOVER_SETUP_FILE) listing servers to ensure installed at daemon start. - Per-tool metrics and a call log.
Environment variables
The common ones. The complete list is in docs/API.md.
Upgrading
From 2.x: 3.0 removes the web dashboard on port 3424 (and its WebSocket, tester, presets and transient-server routes) and agent-desk support. Manage servers in Claude Code with /discover; other hosts keep the MCP tools. Host configs move to agent-discover@^3. Details in CHANGELOG.md.
From 1.x: 2.0 was a breaking release. The single registry tool is replaced by the eight tools above, REST routes were renamed, the setup file key auto_activate is now enabled, secrets move to the keychain, and the default bin is the shim. The database migrates itself and moves from ~/.claude to the per-user data directory (%LOCALAPPDATA%\agent-discover, ~/Library/Application Support/agent-discover, or $XDG_DATA_HOME/agent-discover / ~/.local/share/agent-discover; AGENT_DISCOVER_DATA_DIR overrides) on first start, so stop any running 1.x process first. Full list in CHANGELOG.md.
Known limitations
- Claude Code forwards a tool's
structuredContentto the model as JSON text instead of the markdowncontent(upstream behaviour, anthropics/claude-code#55677 closed as not planned, see also #15412). Other hosts and the widget use the markdown / UI. - Docker sandboxing for stdio servers is not included yet (deferred).
Testing
Documentation
- Tutorial: the
/discoverpane step by step, with screenshots - User Manual: day-to-day use
- Setup Guide: installation and per-client configuration
- API Reference: MCP tools, REST, environment
- Architecture: process model, domain services, schema, search
- Security: trust model
- Changelog
License
MIT, see LICENSE
来源:README.md,提交 c70b3f9
工具
0版本历史
9- v3.2.2最新Oct 9, 2026
- v3.2.1Oct 9, 2026
- v3.2.0Oct 8, 2026
- v3.1.2Oct 6, 2026
- v3.1.1Oct 6, 2026
- v3.1.0Oct 6, 2026
- v2.0.2Oct 5, 2026
- v1.4.1Oct 1, 2026
- v1.4.0Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分