返回 CodeWhale
SKILL.md
1 ---
2 name: mcp-discovery
3 description: "Find and start a zero-environment local MCP server when the session lacks a capability that no available tool, project script, or ordinary local code can cover."
4 ---
5
6 # mcp-discovery
7
8 The public MCP Registry ships hundreds of ready-made stdio servers
9 (filesystems, databases, browsers, media processing, developer utilities, cloud
10 APIs, SaaS integrations, …). This skill is how you reach one when the session
11 is genuinely missing a capability.
12
13 It is a fallback, not a first step. Discovery costs a query, an approval, and an
14 install — spend that only when it buys a capability you do not have.
15
16 ## When to use
17
18 - An available tool, a project script or test, or a few lines of local code
19 cannot do the job.
20 - The task needs an external service, database, or protocol client that this
21 session has no access to.
22 - You would otherwise install a package or reimplement a well-known converter
23 or client by hand.
24
25 ## When not to use
26
27 - Ordinary work: writing and editing files, reading fixtures, running repo
28 commands, and checking your own output. Do those directly.
29 - A capability an already-loaded tool covers, even partially — try it first.
30 - A near-miss row in a result list. A scored match is a suggestion; the missing
31 capability is what decides.
32
33 ## Workflow
34
35 1. **Name the gap.** State the capability you lack before searching. If you
36 cannot name one, you do not need the Registry.
37 2. **Query.** `registry_sync` and `start_registry_mcp_server` are deferred. In
38 `execute_tools`, run `tools.call('registry_sync', {query: "<the missing
39 capability>"})`; otherwise call `registry_sync {query: "<the missing
40 capability>"}` by name. If a call only loads the schema without executing,
41 retry once with that schema. It scores a host-side
42 snapshot and returns at most eight matches; the full index never enters the
43 conversation. Packages declaring any environment variable (including API
44 keys/tokens) are excluded and never written to the cache.
45 3. **Judge the matches.** Take a server when it covers the gap you named. If
46 nothing does, refine the query once, then continue with local tools.
47 4. **Install + run transactionally.** Call
48 `start_registry_mcp_server {registry_name: "<exact name>", arguments: {...}}`.
49 Supply only values listed in `required_args`; omit `arguments` when none are
50 required. Never install or launch the package through the shell. Starting a
51 server requires approval.
52 5. **Solve the task with the new tools.** Their complete schemas are added to
53 the current turn immediately after a successful connection; call the exact
54 names returned by the start result.
55
56 ## If a server fails to start
57
58 `start_registry_mcp_server` reports when a package exits before the handshake
59 (often CLI help output = incomplete launch args). Verify the exact required
60 arguments, retry once with the corrected structured values, and if it still
61 fails move on to the next candidate or to a local approach. Failed starts are
62 rolled back, so retrying the same Registry name is safe.
63
64 ## Don't
65
66 - Don't attempt to pass env vars or secrets; this flow has no env channel.
67 - Don't reconstruct or edit the Registry-provided package command.
68
68 lines MARKDOWN