@agimon-ai/po-mcp 0.0.0-alpha.20 → 0.0.0-alpha.201

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.
Files changed (87) hide show
  1. package/LICENSE +97 -8
  2. package/README.md +73 -182
  3. package/dist/apiContracts.cjs +160 -57
  4. package/dist/apiContracts.cjs.map +1 -1
  5. package/dist/apiContracts.d.mts +2 -2
  6. package/dist/apiContracts.d.mts.map +1 -1
  7. package/dist/apiContracts.mjs +160 -57
  8. package/dist/apiContracts.mjs.map +1 -1
  9. package/dist/directTools-CUm1GbQZ.cjs +573 -0
  10. package/dist/directTools-CUm1GbQZ.cjs.map +1 -0
  11. package/dist/directTools-utuNMgg-.mjs +522 -0
  12. package/dist/directTools-utuNMgg-.mjs.map +1 -0
  13. package/dist/extensions/mcp-ui.mjs +4 -3
  14. package/dist/extensions/mcp-ui.mjs.map +1 -1
  15. package/dist/extensions/mcp.cjs +29 -12
  16. package/dist/extensions/mcp.cjs.map +1 -1
  17. package/dist/extensions/mcp.mjs +29 -12
  18. package/dist/extensions/mcp.mjs.map +1 -1
  19. package/dist/extensions/native.mjs +1569 -0
  20. package/dist/extensions/native.mjs.map +1 -0
  21. package/dist/extensions/server.cjs +4318 -2498
  22. package/dist/extensions/server.cjs.map +1 -1
  23. package/dist/extensions/server.d.mts.map +1 -1
  24. package/dist/extensions/server.mjs +4237 -2416
  25. package/dist/extensions/server.mjs.map +1 -1
  26. package/dist/extensions/web.mjs +2195 -1137
  27. package/dist/extensions/web.mjs.map +1 -1
  28. package/dist/index-Ds85F7lv.d.mts +12 -0
  29. package/dist/index-DsAYcBeX.d.mts +51 -0
  30. package/dist/index-DsAYcBeX.d.mts.map +1 -0
  31. package/dist/index-DwdFUhCd.d.mts +49 -0
  32. package/dist/index-DwdFUhCd.d.mts.map +1 -0
  33. package/dist/index.cjs +22 -9
  34. package/dist/index.cjs.map +1 -1
  35. package/dist/index.d.mts +18 -43
  36. package/dist/index.d.mts.map +1 -1
  37. package/dist/index.mjs +10 -1
  38. package/dist/index.mjs.map +1 -1
  39. package/dist/localServers.cjs +4 -0
  40. package/dist/localServers.d.mts +2 -0
  41. package/dist/localServers.mjs +1 -0
  42. package/dist/mcpCatalog-CpRC4RMU.cjs +906 -0
  43. package/dist/mcpCatalog-CpRC4RMU.cjs.map +1 -0
  44. package/dist/mcpCatalog-Dw_-ka5_.mjs +736 -0
  45. package/dist/mcpCatalog-Dw_-ka5_.mjs.map +1 -0
  46. package/dist/{mcpConfig-lHsIQ2fZ.d.mts → mcpConfig-8S120X75.d.mts} +18 -3
  47. package/dist/mcpConfig-8S120X75.d.mts.map +1 -0
  48. package/dist/mcpServerConfig-CoODElmz.mjs +1085 -0
  49. package/dist/mcpServerConfig-CoODElmz.mjs.map +1 -0
  50. package/dist/mcpServerConfig-DFOqLXb-.cjs +1348 -0
  51. package/dist/mcpServerConfig-DFOqLXb-.cjs.map +1 -0
  52. package/dist/po-runtime-identity.json +1 -0
  53. package/dist/projection-BH-vn29y.mjs +56 -0
  54. package/dist/projection-BH-vn29y.mjs.map +1 -0
  55. package/dist/projection-DBpXsw0W.cjs +64 -0
  56. package/dist/projection-DBpXsw0W.cjs.map +1 -0
  57. package/dist/projection.cjs +1 -1
  58. package/dist/projection.d.mts +8 -2
  59. package/dist/projection.d.mts.map +1 -1
  60. package/dist/projection.mjs +1 -1
  61. package/dist/remoteServers.cjs +96 -0
  62. package/dist/remoteServers.cjs.map +1 -0
  63. package/dist/remoteServers.d.mts +150 -0
  64. package/dist/remoteServers.d.mts.map +1 -0
  65. package/dist/remoteServers.mjs +88 -0
  66. package/dist/remoteServers.mjs.map +1 -0
  67. package/dist/sessionServers-D0OaX9tn.mjs +328 -0
  68. package/dist/sessionServers-D0OaX9tn.mjs.map +1 -0
  69. package/dist/sessionServers-D5tX54WC.cjs +357 -0
  70. package/dist/sessionServers-D5tX54WC.cjs.map +1 -0
  71. package/dist/sessionServers.cjs +4 -0
  72. package/dist/sessionServers.d.mts +2 -0
  73. package/dist/sessionServers.mjs +1 -0
  74. package/llms.txt +2 -1
  75. package/package.json +79 -18
  76. package/src/prompts/codemode-how-to-mcp/SKILL.md +56 -0
  77. package/src/prompts/help-how-to-mcp/SKILL.md +122 -0
  78. package/dist/mcpCatalog-BHoE4gfz.cjs +0 -900
  79. package/dist/mcpCatalog-BHoE4gfz.cjs.map +0 -1
  80. package/dist/mcpCatalog-Bp-mLZM1.mjs +0 -806
  81. package/dist/mcpCatalog-Bp-mLZM1.mjs.map +0 -1
  82. package/dist/mcpConfig-lHsIQ2fZ.d.mts.map +0 -1
  83. package/dist/projection-gyAA2jRB.mjs +0 -43
  84. package/dist/projection-gyAA2jRB.mjs.map +0 -1
  85. package/dist/projection-w3XxXmVi.cjs +0 -51
  86. package/dist/projection-w3XxXmVi.cjs.map +0 -1
  87. package/src/prompts/po-use-mcp/SKILL.md +0 -79
package/LICENSE CHANGED
@@ -1,13 +1,102 @@
1
- MIT License
1
+ # Functional Source License, Version 1.1, MIT Future License
2
2
 
3
- Copyright (c) 2026 Vuong Ngo
3
+ ## Abbreviation
4
4
 
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
5
+ FSL-1.1-MIT
6
+
7
+ ## Notice
8
+
9
+ Copyright 2026 Agimon Pty Ltd
10
+
11
+ ## Terms and Conditions
12
+
13
+ ### Licensor ("We")
14
+
15
+ The party offering the Software under these Terms and Conditions.
16
+
17
+ ### The Software
18
+
19
+ The "Software" is each version of the software that we make available under
20
+ these Terms and Conditions, as indicated by our inclusion of these Terms and
21
+ Conditions with the Software.
22
+
23
+ ### License Grant
24
+
25
+ Subject to your compliance with this License Grant and the Patents,
26
+ Redistribution and Trademark clauses below, we hereby grant you the right to
27
+ use, copy, modify, create derivative works, publicly perform, publicly display
28
+ and redistribute the Software for any Permitted Purpose identified below.
29
+
30
+ ### Permitted Purpose
31
+
32
+ A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
33
+ means making the Software available to others in a commercial product or
34
+ service that:
35
+
36
+ 1. substitutes for the Software;
37
+
38
+ 2. substitutes for any other product or service we offer using the Software
39
+ that exists as of the date we make the Software available; or
40
+
41
+ 3. offers the same or substantially similar functionality as the Software.
42
+
43
+ Permitted Purposes specifically include using the Software:
44
+
45
+ 1. for your internal use and access;
46
+
47
+ 2. for non-commercial education;
48
+
49
+ 3. for non-commercial research; and
50
+
51
+ 4. in connection with professional services that you provide to a licensee
52
+ using the Software in accordance with these Terms and Conditions.
53
+
54
+ ### Patents
55
+
56
+ To the extent your use for a Permitted Purpose would necessarily infringe our
57
+ patents, the license grant above includes a license under our patents. If you
58
+ make a claim against any party that the Software infringes or contributes to
59
+ the infringement of any patent, then your patent license to the Software ends
60
+ immediately.
61
+
62
+ ### Redistribution
63
+
64
+ The Terms and Conditions apply to all copies, modifications and derivatives of
65
+ the Software.
66
+
67
+ If you redistribute any copies, modifications or derivatives of the Software,
68
+ you must include a copy of or a link to these Terms and Conditions and not
69
+ remove any copyright notices provided in or with the Software.
70
+
71
+ ### Disclaimer
72
+
73
+ THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
74
+ IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
75
+ PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
76
+
77
+ IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
78
+ SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
79
+ EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
80
+
81
+ ### Trademarks
82
+
83
+ Except for displaying the License Details and identifying us as the origin of
84
+ the Software, you have no right under these Terms and Conditions to use our
85
+ trademarks, trade names, service marks or product names.
86
+
87
+ ## Grant of Future License
88
+
89
+ We hereby irrevocably grant you an additional license to use the Software under
90
+ the MIT license that is effective on the second anniversary of the date we make
91
+ the Software available. On or after that date, you may use the Software under
92
+ the MIT license, in which case the following will apply:
93
+
94
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
95
+ this software and associated documentation files (the "Software"), to deal in
96
+ the Software without restriction, including without limitation the rights to
97
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
98
+ of the Software, and to permit persons to whom the Software is furnished to do
99
+ so, subject to the following conditions:
11
100
 
12
101
  The above copyright notice and this permission notice shall be included in all
13
102
  copies or substantial portions of the Software.
package/README.md CHANGED
@@ -1,32 +1,12 @@
1
1
  # @agimon-ai/po-mcp
2
2
 
3
- Domain-aware MCP selection for Po.
3
+ Domain-aware MCP selection, connections and inline Apps for Po. Disallowed stdio servers are removed before their commands start, not merely hidden from the model.
4
4
 
5
- Part of the [Po distribution](https://www.npmjs.com/package/@agimon-ai/po).
5
+ Requires Node.js 24 or newer. Starter configs select this adapter in `default.packages`; keep it there or move it to a selected layer. Configuration and adapter contracts are alpha.
6
6
 
7
- The package removes disallowed servers before any stdio process is spawned. A filtered server is
8
- absent rather than merely hidden from the model.
7
+ ## Configure servers
9
8
 
10
- > **Alpha:** configuration and adapter contracts may change between releases.
11
-
12
- ## Requirements
13
-
14
- - Node.js 24 or newer
15
-
16
- ## Install
17
-
18
- `po init` include this adapter in `default.packages` in `.po/modes.yaml`.
19
- Remove it or move it to a named layer to change which major modes load it. When loaded in Po,
20
- domain selection controls server access.
21
-
22
- | Entry | Purpose |
23
- | ------------------------------ | --------------------------------------------------------- |
24
- | `@agimon-ai/po-mcp` | Library API |
25
- | `@agimon-ai/po-mcp/projection` | Neutral projection adapter and Agent Plugin normalization |
26
-
27
- ## Configure direct servers
28
-
29
- Repository `.mcp.json` entries describe direct MCP servers:
9
+ Repository `.mcp.json` entries describe direct servers:
30
10
 
31
11
  ```json
32
12
  {
@@ -39,185 +19,96 @@ Repository `.mcp.json` entries describe direct MCP servers:
39
19
  }
40
20
  ```
41
21
 
42
- Selected legacy plugins may also provide root `.mcp.json`. A schema-gated Agent Plugin v1 instead
43
- provides root `mcp.json`. Po validates its portable contract, supplies private persistent
44
- `PLUGIN_DATA`, and resolves plugin-relative stdio commands and working directories. It also
45
- normalizes `streamable-http` for the embedded runtime. Invalid portable server entries are isolated
46
- from the other entries in that plugin.
47
-
48
- Proxy upstreams are read from `mcp-config.yaml`. Domains can select direct `servers` and proxy
49
- upstreams separately in `.po/domains.yaml`:
50
-
51
- ```yaml
52
- # .po/domains.yaml
53
- domains:
54
- development:
55
- description: Repository development tools.
56
- mcp:
57
- servers: [filesystem]
58
- proxy: [github]
59
- ```
22
+ Your Po home's `mcp.json` uses the same shape. Home entries load first; repository, plugin or domain entries with the same name take precedence. Selected legacy plugins may supply `.mcp.json`; Agent Plugin v1 uses `mcp.json`, validated through the portable contract with private persistent `PLUGIN_DATA`. Invalid entries are isolated from other entries.
60
23
 
61
- An absent or empty allowlist retains configured entries. Use `po --no-mcp` when no MCP server
62
- should load.
63
-
64
- Within Po, this package consumes the immutable `poMcpProjection` service published on the
65
- session Cordis root.
66
- Downstream clients run in-process through `@agimon-ai/mcp-proxy`; this adapter does not start its
67
- Hono server.
68
-
69
- ## Direct tools and configured identity
70
-
71
- Main sessions and native child agents receive permitted named MCP tools with their descriptions
72
- and complete input schemas. Names use the configured entry prefix, not the downstream-reported
73
- server name: `personal/search` is exposed as `personal_search` and `work/search` as `work_search`.
74
- Non-alphanumeric prefix characters become underscores, preserving existing names and collision
75
- diagnostics.
76
-
77
- Two configured entries may point to the same URL with different accounts. Each uses its own
78
- configured-name connection and credential slot. Requests retain the exact configured name and
79
- original downstream tool name; tool prefixes are not parsed to route calls.
80
-
81
- Children borrow the parent runtime. Requested `mcp` or `mcp_use` groups expand into permitted
82
- direct tools; `mcpDirectTools` selectors (`*`, a configured server, or `server/tool`) narrow that
83
- set. Capability ceilings must explicitly allow MCP and still constrain the selected tools.
84
- Children cannot manage the parent's connections. Remote `mcp_use` remains a compatibility route,
85
- not the default native model declaration.
86
-
87
- Full schemas cost context tokens. Select domains and child subsets rather than hiding tool
88
- availability or repeating catalogs in prompt prose. Codemode and tool search remain disabled;
89
- the Pi 1.0.0 source review did not measure savings or justify enabling them.
90
-
91
- ## Inline Apps (development)
92
-
93
- The conversation renderer recognizes standard `_meta.ui.resourceUri`, deprecated
94
- `ui/resourceUri`, and ChatGPT `openai/outputTemplate` declarations. HTML stays inside
95
- an opaque, sandboxed inline frame; ordinary text results remain available. Browsers
96
- without iframe CSP enforcement use the text fallback.
97
-
98
- Apps open read-only, including replayed history. Enable interactions to authorize a
99
- fresh connection-bound lease. Each tool call and attributed follow-up requires host
100
- confirmation and the existing session admission checks. Calls are limited to current,
101
- app-visible tools on the original configured server. Visibility is not consent.
102
- Private result metadata and bounded widget state are not injected into model content.
103
- Reopening a widget reads its retained result and state, never reruns the original tool.
104
-
105
- `window.openai` is present in every widget, beside the MCP Apps bridge, so standard Apps
106
- built on the ChatGPT SDK work too. Only ChatGPT widgets receive `toolOutput` globals updates
107
- after their own `callTool`. Each App root gets a `light`/`dark` class, `data-theme` and
108
- `color-scheme` (an App's own class or `data-theme` is kept), and theme changes sync live.
109
- A tool result that rendered an App stays behind the card toggle unless the call failed.
110
-
111
- The ChatGPT adapter implements tool input/output and private metadata globals, globals
112
- updates, `callTool`, `setWidgetState`, `sendFollowUpMessage`, inline display mode, height,
113
- close, and confirmed external links. File libraries, checkout, accounts, modal/fullscreen
114
- modes, stable custom origins, sampling, and automatic model-context updates are unsupported.
115
-
116
- The runtime pins published `@agimon-ai/mcp-proxy@0.32.12` for Apps capability
117
- negotiation, private result capture before output guarding, and upstream request
118
- cancellation. Model-facing output remains guarded; retained App results are bounded
119
- separately. No local proxy dependency or spill-file reads are used.
120
-
121
- Run from the repository root:
122
-
123
- ```sh
124
- pnpm --filter @agimon-ai/po-mcp test
125
- pnpm --filter @agimon-ai/po exec playwright test --config playwright.app.config.ts inlineMcpSandbox.spec.ts
126
- pnpm nx run @agimon-ai/po:test:app
127
- ```
24
+ Proxy upstreams come from `mcp-config.yaml`. Domains select direct `mcp.servers` and proxy `mcp.proxy` names in `.po/domains.yaml`. An absent or empty allowlist retains configured entries. Use `po --no-mcp` to load none.
25
+
26
+ **Add server** in a repository's MCP page writes `.mcp.json`; **Settings > MCP servers** writes the home file. A local command needs explicit trust confirmation. Adding never replaces an existing name or rewrites invalid JSON.
128
27
 
129
- The stdio fixture verifies discovery, visibility, resource reads, pre-guard private
130
- results, and upstream cancellation. Browser tests cover sandbox/bootstrap isolation
131
- and standalone exported widgets. The production conversation fixture uses an isolated
132
- home and a local scripted model to verify standard and ChatGPT Apps, confirmed callbacks
133
- and attributed follow-ups, private metadata exclusion, saved state, read-only replay
134
- without rerunning tools, and a real Po-exported session widget.
28
+ Named header/environment secrets can be stored in the vault through the add request's `secretFields`. The vault is written first and the config stores a `${vault:...}` reference; failed config writes remove the newly stored secrets. This operation requires a vault.
135
29
 
136
- ## Commands
30
+ ## Use tools
137
31
 
138
- ```text
139
- /mcp
140
- /mcp status
141
- /mcp auth <server>
142
- /mcp reload
32
+ Read the [MCP code-mode guide](src/prompts/codemode-how-to-mcp/SKILL.md), then discover the permitted catalog:
33
+
34
+ ```ts
35
+ // Discover actual server/tool names and schemas before this call.
36
+ const result = await mcp.call(serverName, toolName, args);
37
+ return result;
143
38
  ```
144
39
 
145
- The web Context panel lists
146
- configured servers and their named tools, including authorization and management actions. Open a
147
- tool to inspect its description, full input schema, warnings and estimated schema tokens.
148
- Authorization sends one `/mcp auth <server>` prompt frame; headless hosts never open a desktop
149
- browser automatically.
40
+ Typed members such as `mcp.server.tool(args)` use the same connections and admission checks. Names are exact configured server and original tool names; use bracket access when needed. Narrow large discovery output with `discover({ query })`. Never guess signatures.
41
+
42
+ Results expose text, images, structured content and blocks. `image(result)` emits returned images. Upstream `isError` results reject. File parameters sent to another server still require consent, and the wait counts against the exec deadline. After a runtime replacement, use fresh discovery and a new exec; an old run cannot borrow the replacement runtime.
43
+
44
+ With code mode, the main model's duplicate direct declarations are withdrawn, including MCP App tools. Without it, direct tools remain. Children receive only the MCP subset allowed by their inherited capability ceiling and selectors. The namespace never grants new server access.
45
+
46
+ Configured names, not downstream-reported names, identify connections. Two entries pointing at the same URL can use different accounts and credential slots. Tool prefixes are not parsed to route calls.
47
+
48
+ ## Approval and connection controls
49
+
50
+ A tool asks before running unless its server declares `readOnlyHint: true` or `destructiveHint: false`. This applies to direct tools, `mcp_use`, typed code-mode members and App calls. `mcp.call` refuses tools that ask first; use their typed member. Calls queue for replay after approval rather than blocking the agent.
51
+
52
+ The host's `autoApproveDestructiveTools` setting in `<po home>/mcp-settings.json` skips these prompts for all live sessions. `/mcp approve on|off|status` changes one session until restart. Subagents, background runs and unattended calls cannot answer an `ask` prompt. These settings do not make an untrusted server safe.
53
+
54
+ Commands include `/mcp`, `status`, `auth <server>`, `disconnect <server>`, `unauthorize <server>`, `approve on|off|status` and `reload`. The Context panel shows configured tools, schemas, warnings and authorization state. Authorization requests appear in the panel; a headless host does not automatically open a desktop browser.
150
55
 
151
- The compact `po-mcp-session-auth` status carries configured names, states, safe authorization
152
- URLs and tool identities/estimates. It excludes credentials and credential-store data. Repository
153
- catalog and authorization APIs remain separate from this live-session view.
56
+ Removed, disconnected, signed-out or degraded servers leave the active surface until they reconnect. Explicit disconnect survives reload. On edge, a closed remote connection or 401/403 response removes that server for the remainder of the session.
154
57
 
155
58
  ## Credentials and trust
156
59
 
157
- Allowed stdio entries execute their configured commands with the Pi process environment and
158
- operating system privileges. Review configuration as executable code.
60
+ Allowed stdio entries execute with the owning session's admitted environment and OS privileges. Review commands, arguments and configuration as executable code. The adapter uses the workspace-owned `@agimon-ai/po-mcp-proxy` in process; it does not start the proxy's Hono server.
159
61
 
160
- OAuth credentials use the operating system keyring when available. The private-file fallback is
161
- stored under `~/.mcp-proxy/oauth` with owner-only permissions. Credentials remain machine-wide and
162
- keyed by server name, while their upstream URL binding prevents blind replay to another endpoint.
163
- Treat both the configuration and credential store as sensitive.
62
+ OAuth credentials are encrypted in `po/vault`, namespace `mcp.oauth`, keyed by source scope and configured server name. Repository scope uses the Git common-directory digest: worktrees share it, separate clones do not. URL binding prevents blind replay to another endpoint. Old OS-keyring or `~/.mcp-proxy/oauth` credentials are not migrated; authorize again. Without a vault, credentials remain in memory and a diagnostic is shown. Near-expiry tokens refresh before requests; vault leases coordinate rotating-token refresh across processes.
164
63
 
165
- The default OAuth callback is `http://127.0.0.1:19876/callback`. Authorization therefore requires the
166
- browser and Po runtime to share that loopback network namespace. A remote browser cannot complete
167
- the callback when its `127.0.0.1` resolves to another machine or container.
64
+ `${vault:NAME}` works in headers, environment values and `bearerToken`, not in URLs, commands, arguments or working directories. Names are 1 to 64 letters, digits, dots, underscores or hyphens. References resolve on a connection-time copy, so config, hashes and definition caches retain only the reference. Secrets are bound to an HTTPS origin (or loopback HTTP, without redirects) or to an exact command and argument list. Changing that destination makes the secret unavailable. A repository server cannot read a home-scope secret through this mechanism.
168
65
 
169
- ## Public API
66
+ Missing secrets can be supplied through the session's owner-only secret endpoint. Compatibility frontends reading files directly see the unresolved reference. Any trusted in-process plugin can read vault namespaces; this is not package isolation.
170
67
 
171
- ```ts
172
- import { buildMcpConfigGroups, readCachedCatalog, toPiToolName } from '@agimon-ai/po-mcp';
173
- import type { McpAllowlist, McpSessionConfig } from '@agimon-ai/po-mcp';
174
- ```
68
+ The default OAuth callback is `http://127.0.0.1:19876/callback`. Browser and runtime must share that loopback namespace. A remote browser's own loopback is not the server's.
69
+
70
+ ## Temporary and private plugin connections
71
+
72
+ Trusted session plugins inject the core `PO_MCP_SERVICE` contract and use `readPoMcp` on their session Cordis root. `register(input, signal)` connects immediately and returns an identity-owned handle with `name`, live `snapshot()`, validated `invoke()` and asynchronous idempotent `dispose()`. It publishes tools into the session, but never rewrites saved config or replaces an existing name.
73
+
74
+ No-auth HTTP/SSE registrations require explicit-port loopback HTTP. API-key registrations also accept HTTPS, pin credentials to the destination origin, refuse redirects and never start OAuth. Keys can reference the session's admitted environment or be supplied by trusted server code. URL userinfo, fragments, interpolation, reserved names and occupied names are rejected. Keys stay in the session overlay, outside disk caches and the vault. Literal secrets in exec source still persist in scripts and transcripts: do not paste them.
75
+
76
+ Establishment cancellation rolls back partial registration. Exec completion does not dispose a successful connection. Call `dispose()` in `finally` when the work ends; it remains usable after cancellation or selection changes. Provider shutdown retires handles and closes connections, not external server processes. Legacy `localServers` and `sessionServers` remain compatibility APIs.
77
+
78
+ For private upstreams, use the core `PO_MCP_CONNECTIONS_CONTRACT`. `connect()` accepts a package owner, public HTTPS Streamable HTTP URL, credential or saved credential ID, fixed `appTools`, and a plugin lifetime. It does not publish definitions to session tools, discovery, skills, status, saved config or caches. No sign-in or refresh is performed. Saved credentials are encrypted under the owner and origin; disposing retains them, while `forgetCredential()` explicitly deletes them. Package ownership is not a separate access-control boundary.
79
+
80
+ Private App results must retain wrapper-tool invocation identity and `details`; use the shared MCP result card. App interactions require approval once per open App and confirmation for each call, restricted to the fixed allowlist and current App-visible tools. Records are in memory, limited to 256 per connection and unavailable after restart. Edge hosts must supply outbound policy and fetch capabilities.
81
+
82
+ ## Help-only test servers
83
+
84
+ With permission, Help mode's main-agent-only `mcpTest` namespace can add, list and remove temporary URL servers; without code mode use `mcp_test_server`. HTTP/SSE support optional headers and OAuth settings. Stdio and `/mcp add` are unsupported.
85
+
86
+ Test configuration and credentials stay in memory across MCP reloads, never enter saved config or the vault, and do not transfer to new sessions. They cannot replace configured names or override `--no-mcp`. Turning Help off hides management tools but does not disconnect test servers. Memory storage does not redact arguments or history; use admitted `${ENV_VAR}` references rather than literal secrets.
87
+
88
+ ## Inline Apps
89
+
90
+ Standard MCP Apps and supported ChatGPT widgets render in opaque sandboxed frames, with ordinary text fallback where iframe CSP is unavailable. Every App starts read-only, including replayed history. Enabling interactions creates a fresh connection-bound lease; each tool call and attributed follow-up still needs host confirmation. Visibility is not consent.
91
+
92
+ Reopening reads retained results/state without rerunning the original tool. Private metadata and bounded widget state stay outside model content. Apps receive live light/dark theme state. ChatGPT support includes input/output globals, calls, state, follow-ups, inline display, height, close and confirmed external links, but not file libraries, checkout, accounts, modal/fullscreen, stable origins, sampling or automatic context updates.
93
+
94
+ An App called from exec remains attached to that call's card and survives session replay. Background exec and private-connection results do not show an App. Retained App results and model-facing output have separate bounds.
95
+
96
+ ## Remote file transfer
97
+
98
+ Session MCP exposes `share_file` and `save_file` subject to connection grants. `share_file({path})` uses session-bound sharing without a consent prompt. It requires remote access; its bearer links expire after ten minutes and allow at most three downloads. Outbound file parameters to other servers still need consent.
99
+
100
+ `save_file` accepts one HTTPS-download or base64 form. HTTPS uses public-address checks, pinned DNS, at most three revalidated redirects, a 30-second deadline and a 25 MiB cap. Base64 is validated before decoding and capped at 5 MiB. Without a destination it creates a private session attachment. An optional destination is cwd-relative, needs existing non-symlink parents and is created exclusively, never overwritten. MIME hints are not trusted as detection.
175
101
 
176
- `po --emit-mcp <directory>` emits the resolved MCP configuration to the target directory
177
- without launching a model.
102
+ Containment uses realpath rechecks, not atomic descriptor-relative operations. It assumes no hostile concurrent workspace mutation: ancestor swaps may expose bytes or create a file outside cwd before rejection. Failed cwd writes truncate their created descriptor but can leave an empty private file. Cleanup does not unlink mutable paths; inspect and remove an empty artifact before retrying that destination.
178
103
 
179
104
  ## Development
180
105
 
181
106
  ```bash
182
- pnpm build
183
- pnpm typecheck
184
- pnpm test
185
- pnpm lint
107
+ pnpm exec nx run-many -t lint typecheck build test -p @agimon-ai/po-mcp
186
108
  ```
187
109
 
188
- Maintained by [Agimon](https://agimon.ai/about).
110
+ Inline App integration also has CLI-owned Playwright and app-system tests. `po --emit-mcp <directory>` emits resolved configuration without launching a model; it is not a promise that inspecting MCP commands has no side effects.
189
111
 
190
112
  ## License
191
113
 
192
- MIT
193
-
194
- Named routed `src/extensions/` entries declare host contributions and delegate to services. MCP session state and connection behavior live in named service folders, and `src/exports/` exposes reusable public APIs.
195
-
196
- ### Remote file transfer
197
-
198
- Session MCP always exposes `share_file` and `save_file`, both marked with
199
- `_meta['po/fileTransfer']=true`, subject to the connection's capability grants.
200
- `share_file({path})` uses session-bound host sharing without a consent prompt. Its
201
- structured result contains `url`, `fileName`, `mimeType`, `size`, `expiresAt` (epoch
202
- milliseconds), and `maxDownloads` (3). Links expire after 10 minutes and require
203
- remote access. Outbound file parameters sent to other MCP servers still require
204
- consent.
205
-
206
- `save_file` declares `openai/fileParams=['file']` and accepts exactly one file form:
207
- `{download_url,file_name,file_id?,mime_type?}` or `{name,data_base64}`. HTTPS downloads
208
- accept only public addresses, pin DNS for each request, revalidate up to three
209
- redirects, and have a 30-second deadline and 25 MiB cap. Base64 is validated before
210
- decoding and capped at 5 MiB. Without `path`, files become private session
211
- attachments using the bound session environment. Optional `path` is relative to
212
- the bound cwd, requires existing non-symlink parents, and creates a private file
213
- exclusively, never overwriting. Results contain `path`, `name`, `size`, and
214
- `mimeType`; supplied MIME hints are not trusted as content detection.
215
-
216
- Workspace containment uses portable identity and realpath rechecks, not atomic
217
- descriptor-relative operations. This mode assumes no hostile concurrent workspace
218
- mutation: ancestor swaps can create a file outside cwd or expose bytes before a
219
- later check rejects the write. Failed cwd writes truncate the exclusively created
220
- descriptor but may leave an empty private file. Cleanup never unlinks a mutable
221
- pathname, which could delete an unrelated replacement. Remove any empty artifact
222
- before retrying the same destination. Session attachments retain their normal
223
- temporary-file cleanup.
114
+ Functional Source License 1.1, MIT Future License (FSL-1.1-MIT): free for any purpose except a Competing Use; each version converts to MIT two years after release. See [LICENSE](LICENSE).