pi-mcp-adapter 5.0.0 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +48 -0
- package/README.md +1 -1
- package/cli.js +51 -3
- package/config.ts +11 -0
- package/direct-tools.ts +2 -1
- package/dist/config.js +11 -0
- package/dist/config.js.map +1 -1
- package/dist/jev-key-store.js +11 -3
- package/dist/jev-key-store.js.map +1 -1
- package/dist/mcp-trace.d.ts +2 -0
- package/dist/mcp-trace.js +6 -0
- package/dist/mcp-trace.js.map +1 -1
- package/dist/server-manager.d.ts +4 -0
- package/dist/server-manager.js +39 -6
- package/dist/server-manager.js.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.js.map +1 -1
- package/docs/configuration.md +3 -3
- package/docs/extension-api.md +2 -0
- package/docs/pi-builtin-comparison.md +1 -1
- package/docs/prompts-and-ui.md +2 -0
- package/docs/protocol-extensions.md +47 -0
- package/docs/scripting.md +2 -1
- package/docs/servers.md +1 -0
- package/docs/tools.md +2 -0
- package/index.ts +24 -1
- package/jev-key-store.ts +12 -2
- package/mcp-trace.ts +8 -0
- package/package.json +9 -14
- package/proxy-modes.ts +32 -15
- package/runtime-protocol.ts +501 -0
- package/server-manager.ts +50 -6
- package/types.ts +2 -0
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../types.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAIzC,8EAA8E;AAC9E,MAAM,CAAC,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;AAE3D,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAU,CAAC;AAuMtD,6DAA6D;AAC7D,+GAA+G;AAC/G,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,EAC1B,6BAA6B,EAC7B,iCAAiC,EACjC,gCAAgC,EAChC,kBAAkB,EAClB,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AE,sBAAsB,CAAC,CAAC;AACjG,CAAC;AAED,MAAM,UAAU,cAAc,CAC5B,QAAgB,EAChB,UAAkB,EAClB,MAAkB,EAClB,YAAsB,EACtB,sBAAqD;IAErD,OAAO,mBAAmB,CAAC,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,sBAAsB,CAAC,CAAC;AACjG,CAAC;AAED,MAAM,UAAU,aAAa,CAC3B,QAAgB,EAChB,UAAkB,EAClB,MAAkB,EAClB,YAAsB,EACtB,YAAsB,EACtB,sBAAqD;IAErD,OAAO,cAAc,CAAC,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,sBAAsB,CAAC;WACpF,CAAC,cAAc,CAAC,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,sBAAsB,CAAC,CAAC;AAC3F,CAAC"}
|
package/docs/configuration.md
CHANGED
|
@@ -6,7 +6,7 @@ Where the adapter reads MCP servers from, which file wins, how project servers a
|
|
|
6
6
|
|
|
7
7
|
**Interactive configuration:** Run `/mcp-adapter` (or `/mcp`) to open an interactive panel showing all servers with connection status, tools, and direct/proxy toggles. You can reconnect servers, toggle tools between direct and proxy, and enable or disable servers (`ctrl+d`) from the same overlay. For OAuth, press Enter on a server that needs auth or `ctrl+a` on any OAuth server, or `ctrl+p` to [import sign-ins from Pi's built-in MCP](auth.md#import-a-sign-in-from-pis-built-in-mcp) when there are any. The Save action defaults to `ctrl+s` and can be remapped with the `mcp.panel.save` keybinding.
|
|
8
8
|
|
|
9
|
-
**Guided first-run setup:** Run `/mcp-adapter setup` to choose the normal write target for new shared servers — project `.mcp.json` or global `~/.config/mcp/mcp.json` — inspect detected shared MCP files, adopt compatibility imports from other hosts, open discovered config paths, preview exact before/after file diffs for writes, scaffold a minimal selected config, add a curated known server (DeepWiki, Context7, Parallel Search, Notion, GitHub, Chrome DevTools, or Figma (desktop) when the Figma app is installed), or quick-add RepoPrompt into a standard/shared MCP file.
|
|
9
|
+
**Guided first-run setup:** Run `/mcp-adapter setup` to choose the normal write target for new shared servers — project `.mcp.json` or global `~/.config/mcp/mcp.json` — inspect detected shared MCP files, adopt compatibility imports from other hosts, open discovered config paths, preview exact before/after file diffs for writes, scaffold a minimal selected config, add a curated known server (DeepWiki, Context7, Parallel Search, Tavily Search, Notion, GitHub, Chrome DevTools, or Figma (desktop) when the Figma app is installed), or quick-add RepoPrompt into a standard/shared MCP file.
|
|
10
10
|
|
|
11
11
|
**Figma:** Figma's remote server, `https://mcp.figma.com/mcp`, only accepts approved clients, and Pi isn't approved yet. Use the Figma desktop app's local server instead: run `/mcp-adapter setup` and add Figma (desktop). It needs a Dev or Full seat on a paid Figma plan; to turn it on, open a Design file, switch to Dev Mode (Shift+D), and click "Enable desktop MCP server" in the inspect panel.
|
|
12
12
|
|
|
@@ -62,7 +62,7 @@ On Pi 0.84 to 0.87, the adapter does not read either file. If you used one with
|
|
|
62
62
|
|
|
63
63
|
On Pi 0.99 and later, the adapter replaces Pi's built-in MCP extension in sessions, except when a host supplies its own config through [`createMcpAdapter()`](extension-api.md#sdk-configuration). Both register `/mcp`, and Pi leaves the built-in out when another extension does, so `/mcp` opens the adapter and only the adapter connects the servers in Pi's `mcp.json` files.
|
|
64
64
|
|
|
65
|
-
While the built-in is turned on, Pi warns at every startup and `/reload` that it was not loaded. So on the first start after you install or update the adapter, the adapter turns it off for you: it adds `"-builtin:mcp"` to `extensions` in Pi's user `settings.json`, the same entry `pi config` writes, and says so once. It never changes project settings and leaves any existing `builtin:mcp` entry alone, so turning the built-in back on under Built-in extensions in `pi config` sticks. If you remove the adapter, turn the built-in back on there to get Pi's MCP support again.
|
|
65
|
+
While the built-in is turned on, Pi warns at every startup and `/reload` that it was not loaded. So on the first start after you install or update the adapter, the adapter turns it off for you: it adds `"-builtin:mcp"` to `extensions` in Pi's user `settings.json`, the same entry `pi config` writes, and says so once. It skips this when the process was given a config path with `--mcp-config` or the `configPath` option, so a one-off run such as `pi -e <adapter> --mcp-config <file> -p ...` leaves your settings alone; the adapter still owns `/mcp` in that process. It never changes project settings and leaves any existing `builtin:mcp` entry alone, so turning the built-in back on under Built-in extensions in `pi config` sticks. If you remove the adapter, turn the built-in back on there to get Pi's MCP support again.
|
|
66
66
|
|
|
67
67
|
Pi's shell commands `pi mcp add`, `list`, `login`, and `logout` still use Pi's own files. Servers added with `pi mcp add` are read as described above. Sign-ins made with `pi mcp login` stay in Pi's `mcp-auth.json`: the adapter can [import them](auth.md#import-a-sign-in-from-pis-built-in-mcp), but later sign-ins and sign-outs on either side are not shared.
|
|
68
68
|
|
|
@@ -117,7 +117,7 @@ In print, JSON, and RPC sessions, an unapproved project server is skipped. To in
|
|
|
117
117
|
|
|
118
118
|
`pi-mcp-adapter doctor` loads the config a session in the current directory would (including Pi's own `mcp.json` files when `pi --version` reports 0.99 or later), gives each enabled server 15 seconds to connect, and prints one line per server: name, state (`ok`, `failed`, `needs-auth`, `blocked`, or `disabled`), tool count, and the error or a hint. Secret commands (`!command` values) run with their own timeouts. `--json` prints the same report as a JSON array. It exits 1 when an enabled server fails or needs a sign-in; blocked and disabled servers don't count.
|
|
119
119
|
|
|
120
|
-
Project servers follow the trust and approval rules above as in a non-interactive session.
|
|
120
|
+
Project servers follow the trust and approval rules above as in a non-interactive session. Like Pi, doctor trusts a project without trust-requiring Pi resources (such as `.pi/settings.json` or a project `.agents/skills`). Otherwise it needs Pi's stored trust decision for the project, because it can't run the Pi extensions a session asks first. It loads Pi from where the CLI is installed, or else from the Pi package that provides the `pi` on PATH; if neither works, the project is treated as untrusted. Doctor never starts OAuth: a server without a stored sign-in is reported as `needs-auth`; sign in with `/mcp-auth <server>` in Pi. Errors show only what the adapter can state itself, such as the HTTP status, network error code, or endpoint probe result; doctor never prints server output, response bodies, or configured secrets. Run a failing command directly to see its output.
|
|
121
121
|
|
|
122
122
|
## Lifecycle Modes
|
|
123
123
|
|
package/docs/extension-api.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
For extension authors, plugin authors, and apps that embed Pi: loading servers from plugins and packages, registering or calling servers at runtime, SDK configuration, host-managed embedding, and status events.
|
|
4
4
|
|
|
5
|
+
For protocol capabilities beyond tool calls, trusted extensions can [register protocol methods and stream handlers](protocol-extensions.md). The adapter mediates their requests, routes correlated notifications, and manages connection lifetime without exposing its SDK client or transport.
|
|
6
|
+
|
|
5
7
|
## Agent Plugins
|
|
6
8
|
|
|
7
9
|
The adapter can load MCP servers from [Agent Plugins](https://agent-plugins.org/) packages when you list plugin directories in `settings.agentPluginPaths`:
|
|
@@ -28,7 +28,7 @@ Pi's `codemode` scripts work with both. Sign-ins made with the built-in can be i
|
|
|
28
28
|
| | Pi's built-in MCP | pi-mcp-adapter |
|
|
29
29
|
|---|---|---|
|
|
30
30
|
| Add a server | `pi mcp add` and `pi mcp remove` in a shell, then `/reload` in a running session ([Quick setup](https://pi.dev/docs/latest/mcp#quick-setup)) | In a session: give the agent the URL, and `mcp({ action: "install", url })` connects the server and checks its tools without `/reload`. For an OAuth server it first opens the sign-in page, then checks the tools once you approve. Or use `/mcp-adapter setup`. There's no shell command for adding, but servers added with `pi mcp add` are read ([Install from one URL](servers.md#install-from-one-url)) |
|
|
31
|
-
| Guided setup | None. `/mcp` inspects servers, signs in, reconnects, changes exposure, and turns configured servers on or off; new servers are added by hand or with `pi mcp add` ([Quick setup](https://pi.dev/docs/latest/mcp#quick-setup)) | The `/mcp-adapter setup` overlay picks where new servers go, imports configs found on the machine, scaffolds a config, and adds presets: Figma (desktop) when the Figma app is installed, RepoPrompt when its MCP server is installed locally, and GitHub, Notion, Context7, DeepWiki, Parallel Search, and Chrome DevTools. Every write shows the exact file diff first ([Setup panel](configuration.md#setup-panel)) |
|
|
31
|
+
| Guided setup | None. `/mcp` inspects servers, signs in, reconnects, changes exposure, and turns configured servers on or off; new servers are added by hand or with `pi mcp add` ([Quick setup](https://pi.dev/docs/latest/mcp#quick-setup)) | The `/mcp-adapter setup` overlay picks where new servers go, imports configs found on the machine, scaffolds a config, and adds presets: Figma (desktop) when the Figma app is installed, RepoPrompt when its MCP server is installed locally, and GitHub, Notion, Context7, DeepWiki, Parallel Search, Tavily Search, and Chrome DevTools. Every write shows the exact file diff first ([Setup panel](configuration.md#setup-panel)) |
|
|
32
32
|
| Configs from other clients | Convert entries by hand ([Migrate configuration](https://pi.dev/docs/latest/mcp#migrate-configuration-from-another-client)) | `imports` reads Cursor, Claude Code, Claude Desktop, OpenCode, VS Code, Windsurf, and Codex configs; `/mcp-adapter setup` and `pi-mcp-adapter init` find them ([Import existing configs](configuration.md#import-existing-configs)) |
|
|
33
33
|
| Config files | `~/.pi/agent/mcp.json` and `.pi/mcp.json` ([Configure servers](https://pi.dev/docs/latest/mcp#configure-servers)) | Pi's two files, plus `.mcp.json`, `~/.config/mcp/mcp.json`, `~/.agents/mcp.json`, `~/.agents/mcp/mcp.json`, and `mcp-adapter.json` ([File layout](configuration.md#file-layout)) |
|
|
34
34
|
| Check servers from a shell | `pi mcp list`, which exits with status 1 when a server fails ([Diagnose connection problems](https://pi.dev/docs/latest/mcp#diagnose-connection-problems)) | `pi-mcp-adapter doctor [--json]`, which exits with status 1 when a server fails or needs sign-in, and never starts OAuth ([Check servers from a shell](configuration.md#check-servers-from-a-shell)) |
|
package/docs/prompts-and-ui.md
CHANGED
|
@@ -35,6 +35,8 @@ MCP servers can ship interactive UIs via the [MCP UI](https://github.com/MCP-UI-
|
|
|
35
35
|
|
|
36
36
|
**Native rendering:** On macOS, if [Glimpse](https://github.com/hazat/glimpse) is installed (`pi install npm:glimpseui`), UIs open in a native WKWebView window instead of a browser tab. Set `MCP_UI_VIEWER=browser` to force the browser, `MCP_UI_VIEWER=glimpse` to require native rendering, `MCP_UI_VIEWER=orca` to open in the [Orca](https://github.com/orca) built-in browser (falls back to the system browser if Orca is unavailable), or `MCP_UI_VIEWER=none` (also accepts `off` / `disabled`) to suppress the window entirely — the tool still runs and its inline result is returned to the agent, but no browser or native window opens. This is useful for headless setups, CI, or users who want the tool output delivered inline as text only. When suppressed, a one-line info notification shows the UI URL so it can still be opened manually if needed.
|
|
37
37
|
|
|
38
|
+
To turn off UIs for one server only, set `"openUi": false` on its entry. That server's tools run as if they had no UI: no window opens, no UI session starts, and the result is returned inline. Other servers keep opening UIs.
|
|
39
|
+
|
|
38
40
|
**Bidirectional communication:** The UI talks back. When it sends a prompt or intent, the message is stored and `triggerTurn()` wakes the agent. The agent retrieves messages via `mcp({ action: "ui-messages" })` and responds, enabling conversational UIs where the app and agent collaborate in real-time.
|
|
39
41
|
|
|
40
42
|
**Session reuse:** When the agent calls the same tool again while its UI is already open, the adapter pushes the new result to the existing window instead of replacing it. This enables live updates — the agent can refine a chart, add data, or respond to user input without losing the current view. Different tools still replace the session as before.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Protocol extensions
|
|
2
|
+
|
|
3
|
+
A companion Pi extension can implement an additional MCP protocol capability using the adapter's existing server configuration, authentication and connection lifecycle. Register the capability's methods, then explicitly request its operations. Registration does not connect or subscribe to servers.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { registerMcpProtocol } from 'pi-mcp-adapter';
|
|
7
|
+
|
|
8
|
+
const protocol = registerMcpProtocol(pi, {
|
|
9
|
+
namespace: 'example',
|
|
10
|
+
requests: ['example/list'],
|
|
11
|
+
streams: ['example/stream'],
|
|
12
|
+
notifications: ['notifications/example/active', 'notifications/example/item', 'notifications/example/list_changed'],
|
|
13
|
+
});
|
|
14
|
+
const session = await protocol.connect('configured-server');
|
|
15
|
+
const watch = session.watchNotifications(['notifications/example/list_changed'], () => {
|
|
16
|
+
// Invalidate the companion's catalog; re-fetch when needed.
|
|
17
|
+
});
|
|
18
|
+
const catalog = await session.request('example/list', {});
|
|
19
|
+
// Validate the capability-specific result before using it.
|
|
20
|
+
const stream = session.openStream('example/stream', { name: 'chosen-item' }, (method, params) => {
|
|
21
|
+
// Validate and render this capability's notifications in the companion.
|
|
22
|
+
});
|
|
23
|
+
await stream.sent; // Written to the server, not necessarily acknowledged.
|
|
24
|
+
const end = await stream.closed; // cancelled, ended, error, or disconnected
|
|
25
|
+
// Alternatively: await stream.cancel();
|
|
26
|
+
watch.close();
|
|
27
|
+
session.close();
|
|
28
|
+
protocol.dispose(); // Close its sessions and unregister the namespace.
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Call registration after the adapter has loaded (for example on first use); an unavailable hook throws an actionable error for the companion to handle. Only one registration may own a namespace per adapter. Namespaces and method declarations are copied at registration. Requests/streams must belong to that namespace; notifications must use `notifications/<namespace>/...`. Core namespaces such as `tools`, `resources`, and `subscriptions` are reserved and cannot be registered. Ordinary tool calls continue through the adapter's tool-call API and its approval handling.
|
|
32
|
+
|
|
33
|
+
This API exposes no SDK client, transport, arbitrary send method, or handler replacement. `request` accepts only declared request methods and returns an ordinary SDK request result. `openStream` accepts only declared stream methods and delivers only declared notifications correlated to that stream through `params._meta["io.modelcontextprotocol/subscriptionId"]`. Unrelated traffic continues to the SDK. The adapter allocates request IDs, sends cancellation, and reports remote results/errors, server cancellation, transport closure, and session replacement. Consumer exceptions terminate only that consumer's stream. Parameters cannot override reserved `_meta` fields.
|
|
34
|
+
|
|
35
|
+
An operation prevents idle cleanup only while its request, stream, or notification observer is active. Counts belong to the exact connection and never transfer during reconnect. Closing a protocol session or disposing its registration cancels its work without closing the shared MCP client. Consumers must observe `session.signal` or `stream.closed` and explicitly reconnect after a disconnection; there is no automatic subscription or replay. A stream's `sent` promise confirms transmission only: acknowledgement validation, activation timeouts, heartbeat policy, and any agent wakeup belong to the companion protocol implementation.
|
|
36
|
+
|
|
37
|
+
`watchNotifications(methods, handler)` observes only declared notification methods outside the adapter's extension streams, such as a capability's catalog-change notification. Each observer has `close()` and a `closed` promise with the same termination reasons as a stream. Notification parameters and method declarations are copied, observer failures close only that observer, and messages continue to the SDK. Stream-correlated messages belong to their stream handler and are not broadcast to observers. Watching is passive: it does not send a subscription request or create a remote notification channel. If a transport/server does not deliver catalog-change notifications, the companion must refresh its catalog through ordinary requests.
|
|
38
|
+
|
|
39
|
+
Stream JSON-RPC errors preserve their code, message, and optional data in `end.protocolError`, alongside the display string `end.error`. Ordinary requests retain the SDK's typed rejection. This lets companions distinguish authorization failure, unsupported operations, and transient failures without parsing display text.
|
|
40
|
+
|
|
41
|
+
An active Pi session and an enabled server in its effective configuration are required. Connection setup uses normal project trust, server approval, lazy connection, and runtime ownership checks. This is a trusted installed-extension API, not a sandbox for untrusted extension code. The method restrictions preserve the adapter's protocol and tool boundaries; they cannot constrain arbitrary code running in Pi's process. Companions own additional capability consent and payload validation, and should treat received content as external data.
|
|
42
|
+
|
|
43
|
+
The API works over every transport currently supported by the adapter: **stdio, Streamable HTTP, legacy HTTP+SSE, and Unix sockets**. The SDK provides ordinary custom requests and the underlying transport. Since it lacks a generic long-lived extension stream primitive, the adapter provides one internal router per transport. Streamable HTTP uses the SDK's per-request abort signal and stream-end callback; cancellation closes only that request's SSE response, preserving sibling streams and normal MCP requests. Shared-channel transports use `notifications/cancelled`. A request-stream EOF without a final response reports `disconnected`; the protocol session remains usable while its shared connection is alive. The SDK still owns HTTP headers, OAuth, TLS, and transport-level resumption. An MCP protocol cursor belongs to the companion and is separate from an SSE transport resumption token.
|
|
44
|
+
|
|
45
|
+
Companions can implement polling, streaming, and webhook subscription management using these same primitives. Poll and webhook control calls are ordinary declared requests; webhook receiving, signature verification, renewal, delivery selection, cursor/replay policy, and persistence belong to the companion. No webhook server or delivery loop is started by the adapter. A companion should reacquire a session after idle disconnection before its next scheduled request, and must stop retrying when its Pi session ends. WebSocket is not currently an adapter transport; this API adds no new network transport or server configuration.
|
|
46
|
+
|
|
47
|
+
Across independently loaded Pi packages, use the synchronous event bus `pi-mcp-adapter:protocol:v1` with `{version: 1, definition}`. The adapter sets `result` to the mediated protocol handle or `error` to a registration error; an absent result/error means the hook is unavailable. This is also how `registerMcpProtocol` works. A companion can use the structural contract without importing another adapter instance.
|
package/docs/scripting.md
CHANGED
|
@@ -40,12 +40,13 @@ System One decisions are the same API at different origins, so pointing at anoth
|
|
|
40
40
|
| OpenCode Zen | `https://opencode.ai/zen/v1/systemone` | `jev-1.13` |
|
|
41
41
|
| Command Code | `https://api.commandcode.ai/provider/v1/systemone` | `typesafe/jev` |
|
|
42
42
|
| OpenRouter | `https://openrouter.ai/api/alpha/decisions` | `typesafe/jev-1.13` |
|
|
43
|
+
| Local server | `http://127.0.0.1:8080/v1/systemone` | the model your server serves |
|
|
43
44
|
|
|
44
45
|
These are example configurations, subject to each provider's current documentation ([OpenCode Zen](https://opencode.ai/docs/zen/), [Command Code](https://commandcode.ai/docs/provider), [OpenRouter](https://openrouter.ai/docs/guides/community/jev), [TypeSafe](https://docs.typesafe.ai/)).
|
|
45
46
|
|
|
46
47
|
With `SYSTEMONE_ENDPOINT` pointed at OpenRouter, an existing `OPENROUTER_API_KEY` works as the key and the model defaults to `typesafe/jev-1.13`. `OPENROUTER_API_KEY` is never sent to any other endpoint, and `SYSTEMONE_API_KEY` takes precedence over it.
|
|
47
48
|
|
|
48
|
-
The endpoint must be an absolute `https` URL with a path. A set-but-invalid `SYSTEMONE_ENDPOINT` disables Jev instead of falling back to the default. Treat the endpoint as trusted configuration: it receives the API key and the judgment payload. Credentials are stored per endpoint, so switching endpoints does not overwrite a saved key. Set the model with:
|
|
49
|
+
The endpoint must be an absolute `https` URL with a path; plain `http` is accepted only on `localhost`, `127.0.0.0/8`, or `[::1]`, so the key and payload never leave the machine unencrypted. A local server that ignores keys still needs some non-empty `SYSTEMONE_API_KEY`, because Jev does not run without a key. A set-but-invalid `SYSTEMONE_ENDPOINT` disables Jev instead of falling back to the default. Treat the endpoint as trusted configuration: it receives the API key and the judgment payload. Credentials are stored per endpoint, so switching endpoints does not overwrite a saved key. Set the model with:
|
|
49
50
|
|
|
50
51
|
```json
|
|
51
52
|
{ "settings": { "jev": { "model": "jev-1.13" } } }
|
package/docs/servers.md
CHANGED
|
@@ -57,6 +57,7 @@ In the configuration examples below, `30000` is illustrative only. If `requestTi
|
|
|
57
57
|
| `includeTools` | `string[]` of tool names or glob patterns to expose (matches original names like `get_screenshot`, generated resource names like `read_figjam`, and prefixed names like `figma_get_screenshot`) |
|
|
58
58
|
| `excludeTools` | `string[]` of tool names or glob patterns to hide (applied after `includeTools`) |
|
|
59
59
|
| `searchKeywords` | `{ "tool-or-glob": ["keyword", ...] }` — extra keywords that boost `mcp({ search })` ranking for matching tools; never shown to the model |
|
|
60
|
+
| `openUi` | Set to `false` to never open MCP App UIs for this server's tools (default: true). Its tools still run and return their results inline; sign-in and URL elicitation are unaffected |
|
|
60
61
|
| `description` | What the server offers, in a sentence (same key as Pi's `mcp.json`). `mcp({ server })` shows it under the listing header, `mcp({ search })` ranks the server's tools by it like tool descriptions, and the `/mcp-adapter` panel shows it when the server is expanded. Without it, the panel shows the first line of the server's instructions. A non-string value is ignored with a warning. |
|
|
61
62
|
| `debug` | Show server stderr (default: false) |
|
|
62
63
|
| `trace` | Enable metadata-only JSONL protocol tracing for this server; payloads, prompts, tool arguments/results, authorization data, and URLs are never persisted |
|
package/docs/tools.md
CHANGED
|
@@ -31,6 +31,8 @@ When a server declares MCP tool annotations, `describe` adds a `Hints:` line suc
|
|
|
31
31
|
|
|
32
32
|
When `includeSchemas` is enabled, search and describe render common JSON Schema parameters as compact TypeScript shapes like `{ query: string; limit?: number; }`, with the older schema formatter retained as a fallback for unsupported schemas.
|
|
33
33
|
|
|
34
|
+
`mcp({ server: "name" })` lists each tool's top-level parameter names after its name, required ones first, such as `- search(query, limit?) - ...`. Types and nested fields stay in `describe`. A tool whose schema has no properties shows `()`. A tool with no schema, or one whose top level uses `$ref`, `allOf`, `anyOf`, `oneOf`, `not`, `if`/`then`/`else`, or dependent requirements, shows no parentheses, because those can add parameters or requirements the list would miss.
|
|
35
|
+
|
|
34
36
|
Most tools declare no output schema. After such a tool returns structured content or a JSON text result, `describe` (and `tools.describe` in `mcpScript`) also shows the output shape seen so far: field names and types only, never values, labeled as observed, not a contract. A wide object that appears more than once, such as a user under `user`, `assignee`, and `assignees`, is written once as a named type. With `scriptMode` on, shapes are also saved in `mcp-cache.json`, so later sessions can write a script without calling the tool first. A shape is used only while the tool's description and input schema stay the same, and a saved one is dropped when they or the server's config change.
|
|
35
37
|
|
|
36
38
|
When an `mcpScript` run throws, times out, or returns `[]`, `{}`, `null`, `""`, or nothing, its result ends with the shapes seen from the schemaless tools it called, so the model can fix a wrong field guess without a separate look at the data.
|
package/index.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { registerProtocolBridge } from "./runtime-protocol.ts";
|
|
2
|
+
export { registerMcpProtocol, MCP_PROTOCOL_EVENT, type McpProtocolDefinition, type McpProtocol, type McpProtocolSession, type McpProtocolStream, type McpProtocolWatch, type McpProtocolEnd } from "./runtime-protocol.ts";
|
|
1
3
|
import { withFileMutationQueue, type AgentToolResult, type AgentToolUpdateCallback, type ExtensionAPI, type ExtensionContext, type RegisteredMcpServer, type ToolInfo } from "@earendil-works/pi-coding-agent";
|
|
2
4
|
import { resolve } from "node:path";
|
|
3
5
|
import { existsSync } from "node:fs";
|
|
@@ -992,6 +994,26 @@ function installMcpAdapter(pi: ExtensionAPI, options: McpAdapterOptions) {
|
|
|
992
994
|
})();
|
|
993
995
|
});
|
|
994
996
|
|
|
997
|
+
registerProtocolBridge(pi, async name => {
|
|
998
|
+
if (!sessionCtx) throw new Error("MCP connections require an active Pi session");
|
|
999
|
+
const target = await ensureSessionRuntime(sessionCtx);
|
|
1000
|
+
if (!target) throw new Error("MCP is not initialized");
|
|
1001
|
+
const guard = captureRuntimeGuard(target);
|
|
1002
|
+
const definition = target.config.mcpServers[name];
|
|
1003
|
+
if (!Object.hasOwn(target.config.mcpServers, name) || !definition || isServerDisabled(definition)) {
|
|
1004
|
+
throw new Error("MCP server is not configured or enabled");
|
|
1005
|
+
}
|
|
1006
|
+
const core = await loadForRuntime(loadCoreRuntime, guard);
|
|
1007
|
+
if (!await core.lazyConnect(target, name, target.owner.signal)) throw new Error("MCP server could not connect; check /mcp-adapter");
|
|
1008
|
+
assertRuntimeGuard(guard);
|
|
1009
|
+
if (target.config.mcpServers[name] !== definition || isServerDisabled(definition)) {
|
|
1010
|
+
throw new Error("MCP server configuration changed while connecting");
|
|
1011
|
+
}
|
|
1012
|
+
const connection = target.manager.getConnection(name);
|
|
1013
|
+
if (!connection || connection.status !== "connected") throw new Error("MCP connection is unavailable");
|
|
1014
|
+
return { connection, signal: target.owner.signal };
|
|
1015
|
+
});
|
|
1016
|
+
|
|
995
1017
|
// Compares registrations with the active session's config, so it runs only once state exists.
|
|
996
1018
|
function applyPiMcpServers(activeState: McpExtensionState, ctx: ExtensionContext): Promise<void> {
|
|
997
1019
|
const next = new Map(piRegistered.map((server) => [server.name, JSON.stringify(server.config)]));
|
|
@@ -1320,7 +1342,8 @@ function installMcpAdapter(pi: ExtensionAPI, options: McpAdapterOptions) {
|
|
|
1320
1342
|
}
|
|
1321
1343
|
|
|
1322
1344
|
if (generation !== lifecycleGeneration || !owner.isActive()) return;
|
|
1323
|
-
|
|
1345
|
+
// An explicit config path marks a one-off process; Pi already skips its built-in for it because /mcp is ours.
|
|
1346
|
+
if (!programmaticConfig && earlyConfigPath === undefined && piSupportsMcp(pi)) {
|
|
1324
1347
|
const report = (message: string, level: "info" | "warning") => {
|
|
1325
1348
|
if (generation !== lifecycleGeneration || !owner.isActive()) return;
|
|
1326
1349
|
if (ctx.hasUI) ctx.ui.notify(message, level);
|
package/jev-key-store.ts
CHANGED
|
@@ -59,7 +59,15 @@ function validateApiKey(value: unknown): string {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
|
-
*
|
|
62
|
+
* The endpoint receives the API key and judgment payload, so plaintext http is allowed only where it cannot leave the
|
|
63
|
+
* machine: literal loopback names and addresses, never names that merely resolve to loopback.
|
|
64
|
+
*/
|
|
65
|
+
function isLoopbackHostname(hostname: string): boolean {
|
|
66
|
+
return hostname === "localhost" || hostname === "[::1]" || /^127\.\d+\.\d+\.\d+$/.test(hostname);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Constrains the operator-supplied endpoint to an absolute HTTPS (or loopback HTTP) URL without credentials, query, or fragment, so
|
|
63
71
|
* the pinned fetch can match it exactly and a stray value cannot redirect requests or smuggle a query string.
|
|
64
72
|
*/
|
|
65
73
|
function parseEndpoint(raw: string, label: string): ResolvedJevEndpoint {
|
|
@@ -69,7 +77,9 @@ function parseEndpoint(raw: string, label: string): ResolvedJevEndpoint {
|
|
|
69
77
|
let url: URL;
|
|
70
78
|
try { url = new URL(raw); }
|
|
71
79
|
catch { throw new Error(`${label} must be an absolute URL`); }
|
|
72
|
-
if (url.protocol !== "https:"
|
|
80
|
+
if (url.protocol !== "https:" && !(url.protocol === "http:" && isLoopbackHostname(url.hostname))) {
|
|
81
|
+
throw new Error(`${label} must use https, except http on localhost, 127.0.0.0/8, or [::1]`);
|
|
82
|
+
}
|
|
73
83
|
if (url.username !== "" || url.password !== "") throw new Error(`${label} must not embed credentials`);
|
|
74
84
|
if (url.search !== "") throw new Error(`${label} must not include a query string`);
|
|
75
85
|
if (url.hash !== "") throw new Error(`${label} must not include a fragment`);
|
package/mcp-trace.ts
CHANGED
|
@@ -227,6 +227,13 @@ export function isMcpTraceEnabled(
|
|
|
227
227
|
return definition.trace ?? settings?.enabled === true;
|
|
228
228
|
}
|
|
229
229
|
|
|
230
|
+
const untracedMessageHandlers = new WeakMap<Transport, () => Transport["onmessage"]>();
|
|
231
|
+
|
|
232
|
+
/** The handler behind the trace wrapper, so a chained router forwards without tracing the frame again. */
|
|
233
|
+
export function untracedMessageHandler(transport: Transport): Transport["onmessage"] {
|
|
234
|
+
return untracedMessageHandlers.get(transport)?.() ?? transport.onmessage;
|
|
235
|
+
}
|
|
236
|
+
|
|
230
237
|
/**
|
|
231
238
|
* Compose the SDK's transport callbacks in place instead of replacing the
|
|
232
239
|
* transport object. SDK v2 detects its base stdio transport before connect so
|
|
@@ -268,6 +275,7 @@ export function wrapTransportWithMcpTrace(
|
|
|
268
275
|
},
|
|
269
276
|
});
|
|
270
277
|
transport.onmessage = messageHandler;
|
|
278
|
+
untracedMessageHandlers.set(transport, () => messageHandler);
|
|
271
279
|
} catch {
|
|
272
280
|
// Some future transport may make onmessage non-configurable. Keep tracing
|
|
273
281
|
// best-effort rather than changing connection behavior.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-mcp-adapter",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.2.0",
|
|
4
4
|
"description": "MCP (Model Context Protocol) adapter extension for Pi coding agent",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./index.ts",
|
|
@@ -87,6 +87,7 @@
|
|
|
87
87
|
"utils.ts",
|
|
88
88
|
"abort.ts",
|
|
89
89
|
"runtime-owner.ts",
|
|
90
|
+
"runtime-protocol.ts",
|
|
90
91
|
"tool-metadata.ts",
|
|
91
92
|
"ts-shape.ts",
|
|
92
93
|
"output-shape.ts",
|
|
@@ -181,8 +182,8 @@
|
|
|
181
182
|
"dist"
|
|
182
183
|
],
|
|
183
184
|
"dependencies": {
|
|
184
|
-
"@modelcontextprotocol/client": "2.
|
|
185
|
-
"@modelcontextprotocol/core": "2.
|
|
185
|
+
"@modelcontextprotocol/client": "2.3.1",
|
|
186
|
+
"@modelcontextprotocol/core": "2.3.1",
|
|
186
187
|
"@modelcontextprotocol/ext-tasks": "^0.1.0",
|
|
187
188
|
"@napi-rs/keyring": "^2.1.0",
|
|
188
189
|
"@typesafe-ai/sdk": "0.6.0",
|
|
@@ -198,7 +199,7 @@
|
|
|
198
199
|
"zod": "^3.25.0 || ^4.0.0"
|
|
199
200
|
},
|
|
200
201
|
"peerDependencies": {
|
|
201
|
-
"@earendil-works/pi-ai": "^0.84.1 || ^0.85.0 || ^0.86.0 || ^0.87.0 || ^0.99.0",
|
|
202
|
+
"@earendil-works/pi-ai": "^0.84.1 || ^0.85.0 || ^0.86.0 || ^0.87.0 || ^0.99.0 || ^1.0.0",
|
|
202
203
|
"@earendil-works/pi-tui": "*",
|
|
203
204
|
"typebox": "*",
|
|
204
205
|
"zod": "^3.25.0 || ^4.0.0"
|
|
@@ -206,25 +207,19 @@
|
|
|
206
207
|
"peerDependenciesMeta": {
|
|
207
208
|
"@earendil-works/pi-ai": {
|
|
208
209
|
"optional": true
|
|
209
|
-
},
|
|
210
|
-
"@earendil-works/pi-tui": {
|
|
211
|
-
"optional": true
|
|
212
|
-
},
|
|
213
|
-
"typebox": {
|
|
214
|
-
"optional": true
|
|
215
210
|
}
|
|
216
211
|
},
|
|
217
212
|
"devDependencies": {
|
|
218
|
-
"@earendil-works/pi-ai": "0.
|
|
219
|
-
"@earendil-works/pi-coding-agent": "0.
|
|
220
|
-
"@earendil-works/pi-tui": "0.
|
|
213
|
+
"@earendil-works/pi-ai": "1.0.0",
|
|
214
|
+
"@earendil-works/pi-coding-agent": "1.0.0",
|
|
215
|
+
"@earendil-works/pi-tui": "1.0.0",
|
|
221
216
|
"@modelcontextprotocol/conformance": "0.1.16",
|
|
222
217
|
"@types/bun": "^1.0.0",
|
|
223
218
|
"@types/cross-spawn": "6.0.6",
|
|
224
219
|
"@types/node": "20.19.43",
|
|
225
220
|
"@types/open": "^6.2.1",
|
|
226
221
|
"tsx": "^4.21.0",
|
|
227
|
-
"typebox": "1.3.
|
|
222
|
+
"typebox": "1.3.27",
|
|
228
223
|
"typescript": "5.9.3",
|
|
229
224
|
"vitest": "^3.0.0"
|
|
230
225
|
}
|
package/proxy-modes.ts
CHANGED
|
@@ -1062,17 +1062,9 @@ export function executeList(state: McpExtensionState, server: string): ProxyTool
|
|
|
1062
1062
|
}
|
|
1063
1063
|
let text = `${server} (${toolNames.length} tools${cachedNote}):${descriptionText}\n\n`;
|
|
1064
1064
|
|
|
1065
|
-
const
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
descMap.set(m.name, m.description);
|
|
1069
|
-
}
|
|
1070
|
-
}
|
|
1071
|
-
|
|
1072
|
-
for (const tool of toolNames) {
|
|
1073
|
-
const desc = descMap.get(tool) ?? "";
|
|
1074
|
-
const truncated = truncateAtWord(desc, 50);
|
|
1075
|
-
text += `- ${tool}`;
|
|
1065
|
+
for (const toolMeta of metadata ?? []) {
|
|
1066
|
+
const truncated = truncateAtWord(toolMeta.description, 50);
|
|
1067
|
+
text += `- ${toolMeta.name}${formatParameterNames(toolMeta)}`;
|
|
1076
1068
|
if (truncated) text += ` - ${truncated}`;
|
|
1077
1069
|
text += "\n";
|
|
1078
1070
|
}
|
|
@@ -1085,6 +1077,29 @@ export function executeList(state: McpExtensionState, server: string): ProxyTool
|
|
|
1085
1077
|
};
|
|
1086
1078
|
}
|
|
1087
1079
|
|
|
1080
|
+
const PARAMETER_NAME_UNREADABLE_KEYWORDS = ["$ref", "allOf", "anyOf", "oneOf", "not", "if", "then", "else", "dependentRequired", "dependentSchemas", "dependencies"];
|
|
1081
|
+
|
|
1082
|
+
/** Top-level parameter names, required first, e.g. `(query, limit?)`; empty when the schema can't be read. */
|
|
1083
|
+
function formatParameterNames(toolMeta: ToolMetadata): string {
|
|
1084
|
+
if (toolMeta.resourceUri) return "()";
|
|
1085
|
+
const schema = toolMeta.inputSchema;
|
|
1086
|
+
if (!schema || typeof schema !== "object" || Array.isArray(schema)) return "";
|
|
1087
|
+
// Composed or conditional schemas can add properties or requirements that a top-level read would miss.
|
|
1088
|
+
if (PARAMETER_NAME_UNREADABLE_KEYWORDS.some(keyword => Object.hasOwn(schema, keyword))) return "";
|
|
1089
|
+
const { properties, required } = schema as { properties?: unknown; required?: unknown };
|
|
1090
|
+
if (required !== undefined && !Array.isArray(required)) return "";
|
|
1091
|
+
if (properties !== undefined && (!properties || typeof properties !== "object" || Array.isArray(properties))) return "";
|
|
1092
|
+
const requiredSet = new Set((required ?? []).filter((name): name is string => typeof name === "string"));
|
|
1093
|
+
if (properties === undefined && requiredSet.size === 0 && (schema as { type?: unknown }).type !== "object") return "";
|
|
1094
|
+
const names = properties ? Object.keys(properties) : [];
|
|
1095
|
+
const ordered = [
|
|
1096
|
+
...names.filter(name => requiredSet.has(name)),
|
|
1097
|
+
...[...requiredSet].filter(name => !names.includes(name)),
|
|
1098
|
+
...names.filter(name => !requiredSet.has(name)).map(name => `${name}?`),
|
|
1099
|
+
];
|
|
1100
|
+
return `(${ordered.join(", ")})`;
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1088
1103
|
export function executeInstructions(state: McpExtensionState, server: string): ProxyToolResult {
|
|
1089
1104
|
const definition = state.config.mcpServers[server];
|
|
1090
1105
|
if (!definition) {
|
|
@@ -1548,6 +1563,8 @@ export async function executeCall(
|
|
|
1548
1563
|
}
|
|
1549
1564
|
|
|
1550
1565
|
let uiSession: UiSessionRuntime | null = null;
|
|
1566
|
+
// openUi: false runs the tool as if it declared no UI.
|
|
1567
|
+
const uiResourceUri = state.config.mcpServers[serverName]?.openUi === false ? undefined : toolMeta.uiResourceUri;
|
|
1551
1568
|
const requestOptions = withUiProgressBridge(
|
|
1552
1569
|
state.manager.getRequestOptions?.(serverName, ownedSignal) ?? (ownedSignal ? { signal: ownedSignal } : undefined),
|
|
1553
1570
|
state.ui,
|
|
@@ -1643,12 +1660,12 @@ export async function executeCall(
|
|
|
1643
1660
|
};
|
|
1644
1661
|
}
|
|
1645
1662
|
|
|
1646
|
-
uiSession =
|
|
1663
|
+
uiSession = uiResourceUri
|
|
1647
1664
|
? await maybeStartUiSession(state, {
|
|
1648
1665
|
serverName,
|
|
1649
1666
|
toolName: toolMeta.originalName,
|
|
1650
1667
|
toolArgs: normalizedArgs,
|
|
1651
|
-
uiResourceUri
|
|
1668
|
+
uiResourceUri,
|
|
1652
1669
|
...(toolMeta.uiStreamMode !== undefined ? { streamMode: toolMeta.uiStreamMode } : {}),
|
|
1653
1670
|
...(signal ? { signal } : {}),
|
|
1654
1671
|
onNeedsAuth: recoverAuthConnection,
|
|
@@ -1685,7 +1702,7 @@ export async function executeCall(
|
|
|
1685
1702
|
);
|
|
1686
1703
|
if (!result.isError) recordOutput(result as Record<string, unknown>);
|
|
1687
1704
|
|
|
1688
|
-
if (
|
|
1705
|
+
if (uiResourceUri) {
|
|
1689
1706
|
uiSession?.sendToolResult(result as unknown as import("@modelcontextprotocol/client").CallToolResult);
|
|
1690
1707
|
}
|
|
1691
1708
|
|
|
@@ -1695,7 +1712,7 @@ export async function executeCall(
|
|
|
1695
1712
|
return { content: [], details: { mode: "call", ...callIdentity } };
|
|
1696
1713
|
}
|
|
1697
1714
|
|
|
1698
|
-
if (
|
|
1715
|
+
if (uiResourceUri) {
|
|
1699
1716
|
if (result.isError) {
|
|
1700
1717
|
const content = resolveMcpResultContent(result as Record<string, unknown>, state.owner?.signal);
|
|
1701
1718
|
const outputContent = content.length > 0 ? content : [{ type: "text" as const, text: "(empty result)" }];
|