@agimon-ai/po-mcp 0.0.0-alpha.21 → 0.0.0-alpha.210

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 (90) hide show
  1. package/LICENSE +110 -149
  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 +40 -15
  16. package/dist/extensions/mcp.cjs.map +1 -1
  17. package/dist/extensions/mcp.d.mts.map +1 -1
  18. package/dist/extensions/mcp.mjs +40 -15
  19. package/dist/extensions/mcp.mjs.map +1 -1
  20. package/dist/extensions/native.mjs +1676 -0
  21. package/dist/extensions/native.mjs.map +1 -0
  22. package/dist/extensions/server.cjs +4302 -2468
  23. package/dist/extensions/server.cjs.map +1 -1
  24. package/dist/extensions/server.d.mts.map +1 -1
  25. package/dist/extensions/server.mjs +4433 -2598
  26. package/dist/extensions/server.mjs.map +1 -1
  27. package/dist/extensions/web.mjs +2238 -1139
  28. package/dist/extensions/web.mjs.map +1 -1
  29. package/dist/index-Ds85F7lv.d.mts +12 -0
  30. package/dist/index-DsAYcBeX.d.mts +51 -0
  31. package/dist/index-DsAYcBeX.d.mts.map +1 -0
  32. package/dist/index-DwdFUhCd.d.mts +49 -0
  33. package/dist/index-DwdFUhCd.d.mts.map +1 -0
  34. package/dist/index.cjs +22 -9
  35. package/dist/index.cjs.map +1 -1
  36. package/dist/index.d.mts +17 -42
  37. package/dist/index.d.mts.map +1 -1
  38. package/dist/index.mjs +10 -1
  39. package/dist/index.mjs.map +1 -1
  40. package/dist/localServers.cjs +4 -0
  41. package/dist/localServers.d.mts +2 -0
  42. package/dist/localServers.mjs +1 -0
  43. package/dist/mcpCatalog-CpRC4RMU.cjs +906 -0
  44. package/dist/mcpCatalog-CpRC4RMU.cjs.map +1 -0
  45. package/dist/mcpCatalog-Dw_-ka5_.mjs +736 -0
  46. package/dist/mcpCatalog-Dw_-ka5_.mjs.map +1 -0
  47. package/dist/{mcpConfig-CrnMo7fA.d.mts → mcpConfig-8S120X75.d.mts} +18 -3
  48. package/dist/mcpConfig-8S120X75.d.mts.map +1 -0
  49. package/dist/mcpServerConfig-CoODElmz.mjs +1085 -0
  50. package/dist/mcpServerConfig-CoODElmz.mjs.map +1 -0
  51. package/dist/mcpServerConfig-DFOqLXb-.cjs +1348 -0
  52. package/dist/mcpServerConfig-DFOqLXb-.cjs.map +1 -0
  53. package/dist/po-runtime-identity.json +1 -0
  54. package/dist/projection-BH-vn29y.mjs +56 -0
  55. package/dist/projection-BH-vn29y.mjs.map +1 -0
  56. package/dist/projection-DBpXsw0W.cjs +64 -0
  57. package/dist/projection-DBpXsw0W.cjs.map +1 -0
  58. package/dist/projection.cjs +1 -1
  59. package/dist/projection.d.mts +8 -2
  60. package/dist/projection.d.mts.map +1 -1
  61. package/dist/projection.mjs +1 -1
  62. package/dist/remoteServers.cjs +96 -0
  63. package/dist/remoteServers.cjs.map +1 -0
  64. package/dist/remoteServers.d.mts +150 -0
  65. package/dist/remoteServers.d.mts.map +1 -0
  66. package/dist/remoteServers.mjs +88 -0
  67. package/dist/remoteServers.mjs.map +1 -0
  68. package/dist/sessionServers-D0OaX9tn.mjs +328 -0
  69. package/dist/sessionServers-D0OaX9tn.mjs.map +1 -0
  70. package/dist/sessionServers-D5tX54WC.cjs +357 -0
  71. package/dist/sessionServers-D5tX54WC.cjs.map +1 -0
  72. package/dist/sessionServers.cjs +4 -0
  73. package/dist/sessionServers.d.mts +2 -0
  74. package/dist/sessionServers.mjs +1 -0
  75. package/llms.txt +2 -1
  76. package/locales/vi.json +343 -0
  77. package/locales/zh-CN.json +343 -0
  78. package/package.json +95 -19
  79. package/src/prompts/codemode-how-to-mcp/SKILL.md +56 -0
  80. package/src/prompts/help-how-to-mcp/SKILL.md +122 -0
  81. package/dist/mcpCatalog-BYxR2wMm.cjs +0 -900
  82. package/dist/mcpCatalog-BYxR2wMm.cjs.map +0 -1
  83. package/dist/mcpCatalog-CzC1OFde.mjs +0 -806
  84. package/dist/mcpCatalog-CzC1OFde.mjs.map +0 -1
  85. package/dist/mcpConfig-CrnMo7fA.d.mts.map +0 -1
  86. package/dist/projection-gyAA2jRB.mjs +0 -43
  87. package/dist/projection-gyAA2jRB.mjs.map +0 -1
  88. package/dist/projection-w3XxXmVi.cjs +0 -51
  89. package/dist/projection-w3XxXmVi.cjs.map +0 -1
  90. package/src/prompts/po-use-mcp/SKILL.md +0 -79
package/LICENSE CHANGED
@@ -1,149 +1,110 @@
1
- License text copyright © 2017 MariaDB Corporation Ab, All Rights Reserved.
2
- "Business Source License" is a trademark of MariaDB Corporation Ab.
3
-
4
- Parameters
5
-
6
- Licensor: Agimon Pty Ltd
7
- Licensed Work: Po, the software in the Po source repository and the
8
- packages released from it, in each version released by
9
- the Licensor.
10
- The Licensed Work is (c) 2026 Agimon Pty Ltd.
11
- Material identified as third-party in the "Third-party
12
- components" section at the end of this file or in a
13
- NOTICE file, and any package or directory whose own
14
- license file grants a different license, is not part of
15
- the Licensed Work and remains under its own license.
16
- Additional Use Grant: You may make production use of the Licensed Work if
17
- your use is Eligible Use. "Eligible Use" is production use that falls
18
- within at least one of the following:
19
-
20
- (a) Personal Use. Use by an individual for their own personal purposes,
21
- and not on behalf of, or for the benefit of, an employer, client, or
22
- other Organization. Use by an individual in the course of employment
23
- or engagement by an Organization is use by that Organization.
24
-
25
- (b) Small Organization Use. Use by or on behalf of an Organization whose
26
- Annual Revenue is less than USD 1,000,000.
27
-
28
- (c) Non-profit, Education and Research Use. Use, regardless of Annual
29
- Revenue, by (i) an Organization registered or recognized as a
30
- non-profit or charitable organization under the laws of its
31
- jurisdiction, for its non-profit purposes; (ii) an accredited school,
32
- college, or university, for teaching, learning, or academic research;
33
- or (iii) a publicly funded research institution, for its research.
34
-
35
- (d) Service Provider Use. Use by a consultant, contractor, agency, or other
36
- service provider, regardless of its own Annual Revenue, solely to
37
- build, deploy, host, operate, or support the Licensed Work for a client
38
- whose own use would be Eligible Use under (a), (b), or (c). A service
39
- provider's use for its own purposes is Eligible Use only if the service
40
- provider itself qualifies under (b) or (c).
41
-
42
-
43
- Hosted services. Offering the Licensed Work to third parties as a hosted
44
- or managed service whose primary value is the Licensed Work is Eligible
45
- Use only if each such third party's own use would be Eligible Use.
46
-
47
- Definitions. "Organization" means any company, partnership, sole
48
- proprietorship, trust, association, government body, or other entity, and
49
- includes an individual acting in a business or professional capacity.
50
- "Affiliate" means any entity that directly or indirectly controls, is
51
- controlled by, or is under common control with an Organization, where
52
- "control" means ownership of more than 50% of the voting interests of an
53
- entity or the power to direct its management and policies by contract or
54
- otherwise. "Annual Revenue" means the total gross revenue of an
55
- Organization and all of its Affiliates combined, from all sources and
56
- whether or not related to the Licensed Work, for its most recently
57
- completed fiscal year, or, if it has not completed a fiscal year, for the
58
- twelve months before the use (or since its formation, if shorter),
59
- converted into US dollars at the average exchange rate for that period.
60
- Proceeds of equity or debt financing are not revenue.
61
-
62
- Threshold. If an Organization stops qualifying under (b), its existing
63
- production use remains Eligible Use for 90 days after it stops
64
- qualifying, after which it must obtain a commercial license or stop
65
- production use. Use that was Eligible Use when it occurred never requires
66
- a commercial license after the fact.
67
- Change Date: Four years from the date a version of the Licensed Work
68
- is first publicly released by the Licensor.
69
- Change License: Apache License, Version 2.0
70
-
71
- For information about alternative licensing arrangements for the Licensed
72
- Work, please visit: https://agimon.ai/licensing
73
-
74
- Notice
75
-
76
- The Business Source License (this document, or the "License") is not an Open
77
- Source license. However, the Licensed Work will eventually be made available
78
- under an Open Source License, as stated in this License.
79
-
80
- -----------------------------------------------------------------------------
81
-
82
- Business Source License 1.1
83
-
84
- Terms
85
-
86
- The Licensor hereby grants you the right to copy, modify, create derivative
87
- works, redistribute, and make non-production use of the Licensed Work. The
88
- Licensor may make an Additional Use Grant, above, permitting limited
89
- production use.
90
-
91
- Effective on the Change Date, or the fourth anniversary of the first publicly
92
- available distribution of a specific version of the Licensed Work under this
93
- License, whichever comes first, the Licensor hereby grants you rights under
94
- the terms of the Change License, and the rights granted in the paragraph
95
- above terminate.
96
-
97
- If your use of the Licensed Work does not comply with the requirements
98
- currently in effect as described in this License, you must purchase a
99
- commercial license from the Licensor, its affiliated entities, or authorized
100
- resellers, or you must refrain from using the Licensed Work.
101
-
102
- All copies of the original and modified Licensed Work, and derivative works
103
- of the Licensed Work, are subject to this License. This License applies
104
- separately for each version of the Licensed Work and the Change Date may vary
105
- for each version of the Licensed Work released by Licensor.
106
-
107
- You must conspicuously display this License on each original or modified copy
108
- of the Licensed Work. If you receive the Licensed Work in original or
109
- modified form from a third party, the terms and conditions set forth in this
110
- License apply to your use of that work.
111
-
112
- Any use of the Licensed Work in violation of this License will automatically
113
- terminate your rights under this License for the current and all other
114
- versions of the Licensed Work.
115
-
116
- This License does not grant you any right in any trademark or logo of
117
- Licensor or its affiliates (provided that you may use a trademark or logo of
118
- Licensor as expressly required by this License).
119
-
120
- TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
121
- AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
122
- EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
123
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
124
- TITLE.
125
-
126
- MariaDB hereby grants you permission to use this License’s text to license
127
- your works, and to refer to it using the trademark “Business Source License”,
128
- as long as you comply with the Covenants of Licensor below.
129
-
130
- Covenants of Licensor
131
-
132
- In consideration of the right to use this License’s text and the “Business
133
- Source License” name and trademark, Licensor covenants to MariaDB, and to all
134
- other recipients of the licensed work to be provided by Licensor:
135
-
136
- 1. To specify as the Change License the GPL Version 2.0 or any later version,
137
- or a license that is compatible with GPL Version 2.0 or a later version,
138
- where “compatible” means that software provided under the Change License can
139
- be included in a program with software provided under GPL Version 2.0 or a
140
- later version. Licensor may specify additional Change Licenses without
141
- limitation.
142
-
143
- 2. To either: (a) specify an additional grant of rights to use that does not
144
- impose any additional restriction on the right granted in this License, as
145
- the Additional Use Grant; or (b) insert the text “None”.
146
-
147
- 3. To specify a Change Date.
148
-
149
- 4. Not to modify this License in any other way.
1
+ # Functional Source License, Version 1.1, MIT Future License
2
+
3
+ ## Abbreviation
4
+
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:
100
+
101
+ The above copyright notice and this permission notice shall be included in all
102
+ copies or substantial portions of the Software.
103
+
104
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
105
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
106
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
107
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
108
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
109
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
110
+ 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/po-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 uses workspace-owned `@agimon-ai/po-mcp-proxy` from
117
- `packages/utils/po-mcp-proxy` for Apps capability negotiation, private result capture
118
- before output guarding, and upstream request cancellation. Model-facing output remains
119
- guarded; retained App results are bounded separately. No 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
- Business Source License 1.1: free for personal use, organisations under USD 1M revenue, non-profits and education. See [LICENSE](LICENSE) and https://agimon.ai/licensing.
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).