Agent Discover

io.github.keshrath由 GitHub 帳號 keshrath 發布v3.3.0更新於 Nov 14, 2026

Find, install and enable MCP servers mid-session on any host, with consent and tool pinning

概覽

AI 產生的概覽

一個 MCP 閘道,可在工作階段中尋找、安裝、啟用並代理其他 MCP 伺服器,具備確認、工具固定與隔離機制。

可以做什麼
  • 在已安裝伺服器以及公開 MCP 登錄庫、npm 與 PyPI 中依需求搜尋伺服器
  • 在使用者確認安裝方案後,依精確名稱或手動指令安裝伺服器並建立工具索引
  • 在執行期間啟用或停用伺服器,查看狀態、健康檢查、隔離情況與工具數量
  • 批次搜尋所有已安裝伺服器的工具索引,並讀取單一工具的完整定義
  • 呼叫任何已建立索引的工具,包括未向主機暴露的伺服器上的工具
適用情境
適合希望助理不必修改主機設定、也不必重啟工作階段就能新增 MCP 能力,或在斷定某項能力不存在前跨多個已安裝伺服器搜尋工具的情境。
執行需求
透過 npm(npx agent-discover)在桌面主機上以本機程序執行,會啟動監聽 127.0.0.1:3424 的本機常駐程式。需要網路存取公開 MCP 登錄庫、npm 與 PyPI,並連線遠端上游伺服器。未宣告 API 金鑰;上游伺服器的密鑰存放於作業系統鑰匙圈或加密檔案。
安裝前請注意
它會以你的使用者權限安裝並執行第三方 MCP 伺服器,上游 stdio 伺服器沒有沙箱隔離。安裝與隔離伺服器的重新核准本應由使用者確認,但存在允許未經確認安裝的維運變數。密鑰透過另一步指令設定,在面板中輸入的值可能以明文顯示。操作會被稽核,工具變更會觸發隔離。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Agent Discover,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

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_server shows you the exact command or URL, the env and header names, the pinned version and the provenance checks (registry namespace, npm mcpName, 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 native mode (the default) every enabled server's tools are listed as <server>__<tool> and agent-discover sends notifications/tools/list_changed on each change, so the host's native tool search, permission prompts and alwaysLoad settings keep working. In proxy mode only eight meta tools are listed and everything goes through call_tool, for hosts with weak or no tool search.
  • Stay in control. See Trust layer.
Static MCP configWith agent-discover
DiscoveryKnow the server name in advanceSearch the registries by need, with provenance
InstallationEdit config, restart the sessionOne tool call, you approve the exact command
EnablementAll configured servers always loadEnable and disable mid-session; the index stays searchable
SecretsKeys in config files or envOS keychain (or an encrypted file), injected on connect
Changed toolsSilentPinned hashes, drift quarantines the server until you approve
VisibilityPer-host logs/discover pane, health, per-tool metrics, audit log, OTel

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:

bash
claude plugin marketplace add keshrath/agent-discoverclaude plugin install agent-discover@agent-discover

[The /discover pane docked beside the transcript]

New to the pane? The tutorial walks through it with screenshots.

  • /discover opens 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 a safe next step (the first server, Check health, the first search result, the way back), never on a button that consents or destroys (Approve, Enable, Install, Uninstall): those are your own Tab away. 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), each config key with where its value comes from and, for a secret, the command that sets it (npx -y agent-discover@^3.3 secret set <server> <KEY>, which asks for the value in a terminal without echo; Claude Code panes have no masked input yet: a value typed into a pane is drawn in clear while it is typed, and keys can reach the Claude prompt), Delete, and Store as secret for a value written in the config, 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; a required secret is set with the command once installed, and the server installs disabled until then) 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 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_tools before 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-discover entry from ~/.claude.json so tools do not appear twice.

Any other MCP host

json
{  "mcpServers": {    "agent-discover": { "command": "npx", "args": ["-y", "agent-discover@^3"] }  }}

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

bash
git clone https://github.com/keshrath/agent-discover.gitcd agent-discovernpm installnpm run buildnode dist/index.js daemon

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)

ToolPurpose
search_serversInstalled servers plus public registry / npm / PyPI matches, for something not installed yet.
install_serverInstall by exact registry, npm or PyPI name (version pinned) or from a manual command or URL. Asks you to confirm the plan, then indexes.
enable_serverExpose a server's tools to the host. A quarantined server asks you to review a diff and re-approve first.
disable_serverStop exposing the tools. The server stays installed and searchable.
server_statusInstalled / indexed / enabled / connected / quarantined, tool counts, flagged tools, health (check_health runs a live probe).
search_toolsBatch search (up to 10 queries) across the tool index of every installed server, enabled or not.
get_toolFull definition of one indexed tool by server and name.
call_toolCall any indexed tool and return the upstream result unchanged. The way to call tools in proxy mode.

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 confirm argument.
  • 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. Set with npx -y agent-discover@^3.3 secret set <server> <KEY> (--stdin reads a pipe, --from-config moves a value written in the config, --new adds a key the server does not declare) or PUT /api/servers/:id/secrets/:key[?new=1]; agent-discover secret delete <server> <KEY> removes one. The /discover pane shows the command and never takes a value: Claude Code panes have no masked input yet: a value typed into a pane is drawn in clear while it is typed, and keys can reach the Claude prompt.
  • Audit log, append-only, readable at GET /api/audit.
  • OpenTelemetry, opt-in via OTEL_EXPORTER_OTLP_ENDPOINT or AGENT_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, iss check), 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).

RankerR@1R@5R@10MRR
plain BM25 (about what hosted BM25 tool search does)0.3050.5220.6180.430
agent-discover 1.x0.3070.5610.6420.446
agent-discover 2.0, zero config0.3380.5760.6610.474
2.0 + multilingual-e5-small (opt-in)0.3810.6180.7220.522

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/transformers by 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_since sync, deprecated and deleted status tracking, and exact-name installs. A server whose registry entry was deleted is flagged in server_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_required and 2025 elicitation/create requests are relayed to your client.
  • Lazy, pooled connections with reconnect backoff, idle disconnect and real health probes.
  • Three UI surfaces: the Claude Code /discover pane, 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.

VariableDefaultDescription
AGENT_DISCOVER_PORT3424Daemon port
AGENT_DISCOVER_HOST127.0.0.1Listen address
AGENT_DISCOVER_DATA_DIRplatform data dirData directory (see Upgrading from 1.x)
AGENT_DISCOVER_DBagent-discover.db in itSQLite file path
AGENT_DISCOVER_MODEnativenative lists enabled servers' tools; proxy lists only the meta tools
AGENT_DISCOVER_IDLE_MS1800000Daemon idle exit (0 = never)
AGENT_DISCOVER_SETUP_FILEunsetDeclarative server list synced at start
AGENT_DISCOVER_EMBEDDING_PROVIDERnonelocal or openai adds semantic ranking
AGENT_DISCOVER_SECRETSautokeyring or file forces the secret backend

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 structuredContent to the model as JSON text instead of the markdown content (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

bash
npm test              # 218 tests across 27 files (+9 e2e skipped unless AGENT_DISCOVER_E2E=1, +16 pane e2e)npm run check         # typecheck + lint + format + testnpm run bench:retrievalnpm run plugin:check  # claude plugin validate + the pane's 9 plugin testsnpm run e2e:claude    # the /discover pane in the real Claude Code CLI (inline and docked), screenshots to ~/.claude/tmp/pane-shots

Documentation


License

MIT, see LICENSE

來源:README.md,提交 c8a48bc

工具

8

call_tool

Call a tool

Invoke any indexed tool of an installed server (enabled or not) and return its result unchanged. Prefer calling exposed tools directly.

輸入參數tool必填server必填arguments

disable_server

Disable an MCP server

Stop exposing a server's tools. The server stays installed and its tools stay searchable.

輸入參數name必填

enable_server

Enable an MCP server

Expose an installed server's tools to this host (as <server>__<tool> in native mode). Indexes the server first if needed. A quarantined server (tools changed since approval) asks the user to review and re-approve first.

輸入參數name必填

get_tool

Get tool definition

Full definition (input/output schema, annotations, hash) of one indexed tool by server + tool name.

輸入參數tool必填server必填

install_server

Install an MCP server

Install a server found by search_servers (exact `server` name; version pinned) or from a manual command/url, then index its tools. The user confirms the exact command and provenance first. Tools become searchable immediately; pass enable=true (or call enable_server) to expose them.

輸入參數envurlargsnametagsenableserversourcecommandheadersversiontransport另有 1 個

search_servers

Search MCP servers

Find MCP servers: installed ones (local registry) and, unless marketplace=false, the public MCP registry plus npm/PyPI. Use before install_server.

輸入參數limitquery必填marketplace

search_tools

Search tools

Search the tool index of ALL installed servers (enabled or not) — one entry per query, batch several needs in one call. Exposed tools can be called directly; others via call_tool or after enable_server.

輸入參數limitqueries必填

server_status

Server status

State of installed servers (enabled, quarantined + drift, indexed, connected, tool count, flagged tools, health). check_health=true runs a live probe.

輸入參數namecheck_health

版本歷史

10
  1. v3.3.0最新Nov 14, 2026
  2. v3.2.2Oct 9, 2026
  3. v3.2.1Oct 9, 2026
  4. v3.2.0Oct 8, 2026
  5. v3.1.2Oct 6, 2026
  6. v3.1.1Oct 6, 2026
  7. v3.1.0Oct 6, 2026
  8. v2.0.2Oct 5, 2026
  9. v1.4.1Oct 1, 2026
  10. v1.4.0Sep 16, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分