ais-webmcp 0.1.0__tar.gz

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 (29) hide show
  1. ais_webmcp-0.1.0/.gitignore +27 -0
  2. ais_webmcp-0.1.0/LICENSE +204 -0
  3. ais_webmcp-0.1.0/NOTICE +33 -0
  4. ais_webmcp-0.1.0/PKG-INFO +221 -0
  5. ais_webmcp-0.1.0/README.md +200 -0
  6. ais_webmcp-0.1.0/pyproject.toml +72 -0
  7. ais_webmcp-0.1.0/src/ais_webmcp/__init__.py +5 -0
  8. ais_webmcp-0.1.0/src/ais_webmcp/__main__.py +3 -0
  9. ais_webmcp-0.1.0/src/ais_webmcp/assets/register.d.ts +177 -0
  10. ais_webmcp-0.1.0/src/ais_webmcp/assets/register.js +53 -0
  11. ais_webmcp-0.1.0/src/ais_webmcp/build_hook.py +32 -0
  12. ais_webmcp-0.1.0/src/ais_webmcp/cli.py +221 -0
  13. ais_webmcp-0.1.0/src/ais_webmcp/files.py +56 -0
  14. ais_webmcp-0.1.0/src/ais_webmcp/fixtures/cross-layer.json +547 -0
  15. ais_webmcp-0.1.0/src/ais_webmcp/listing.py +201 -0
  16. ais_webmcp-0.1.0/src/ais_webmcp/manifest.py +117 -0
  17. ais_webmcp-0.1.0/src/ais_webmcp/operations.py +362 -0
  18. ais_webmcp-0.1.0/src/ais_webmcp/profiles/__init__.py +13 -0
  19. ais_webmcp-0.1.0/src/ais_webmcp/profiles/base.py +52 -0
  20. ais_webmcp-0.1.0/src/ais_webmcp/profiles/webpage.py +144 -0
  21. ais_webmcp-0.1.0/src/ais_webmcp/scaffold.py +252 -0
  22. ais_webmcp-0.1.0/src/ais_webmcp/schema/webmcp-manifest.schema.json +241 -0
  23. ais_webmcp-0.1.0/src/ais_webmcp/validate.py +607 -0
  24. ais_webmcp-0.1.0/src/webmcp_manifest/__init__.py +1 -0
  25. ais_webmcp-0.1.0/src/webmcp_manifest/manifest.py +3 -0
  26. ais_webmcp-0.1.0/src/webmcp_manifest/profiles/__init__.py +3 -0
  27. ais_webmcp-0.1.0/src/webmcp_manifest/profiles/base.py +3 -0
  28. ais_webmcp-0.1.0/src/webmcp_manifest/profiles/webpage.py +3 -0
  29. ais_webmcp-0.1.0/src/webmcp_manifest/validate.py +10 -0
@@ -0,0 +1,27 @@
1
+ .venv/
2
+ __pycache__/
3
+ .pytest_cache/
4
+ .ruff_cache/
5
+ .mypy_cache/
6
+ .playwright-cli/
7
+ build/
8
+ dist/
9
+ *.egg-info/
10
+ *.pyc
11
+ *.pyo
12
+ *.pyd
13
+ .Python
14
+ *.so
15
+ .coverage
16
+ htmlcov/
17
+ .tox/
18
+ .nox/
19
+ output/
20
+ staticfiles/
21
+ node_modules/
22
+ .DS_Store
23
+ *.log
24
+ .env
25
+ .env.*
26
+ !.env.example
27
+ _wt/
@@ -0,0 +1,204 @@
1
+ Copyright (c) 2026 Alpin Insight Solutions GmbH & Co. KG
2
+
3
+
4
+ Apache License
5
+ Version 2.0, January 2004
6
+ http://www.apache.org/licenses/
7
+
8
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
9
+
10
+ 1. Definitions.
11
+
12
+ "License" shall mean the terms and conditions for use, reproduction,
13
+ and distribution as defined by Sections 1 through 9 of this document.
14
+
15
+ "Licensor" shall mean the copyright owner or entity authorized by
16
+ the copyright owner that is granting the License.
17
+
18
+ "Legal Entity" shall mean the union of the acting entity and all
19
+ other entities that control, are controlled by, or are under common
20
+ control with that entity. For the purposes of this definition,
21
+ "control" means (i) the power, direct or indirect, to cause the
22
+ direction or management of such entity, whether by contract or
23
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
24
+ outstanding shares, or (iii) beneficial ownership of such entity.
25
+
26
+ "You" (or "Your") shall mean an individual or Legal Entity
27
+ exercising permissions granted by this License.
28
+
29
+ "Source" form shall mean the preferred form for making modifications,
30
+ including but not limited to software source code, documentation
31
+ source, and configuration files.
32
+
33
+ "Object" form shall mean any form resulting from mechanical
34
+ transformation or translation of a Source form, including but
35
+ not limited to compiled object code, generated documentation,
36
+ and conversions to other media types.
37
+
38
+ "Work" shall mean the work of authorship, whether in Source or
39
+ Object form, made available under the License, as indicated by a
40
+ copyright notice that is included in or attached to the work
41
+ (an example is provided in the Appendix below).
42
+
43
+ "Derivative Works" shall mean any work, whether in Source or Object
44
+ form, that is based on (or derived from) the Work and for which the
45
+ editorial revisions, annotations, elaborations, or other modifications
46
+ represent, as a whole, an original work of authorship. For the purposes
47
+ of this License, Derivative Works shall not include works that remain
48
+ separable from, or merely link (or bind by name) to the interfaces of,
49
+ the Work and Derivative Works thereof.
50
+
51
+ "Contribution" shall mean any work of authorship, including
52
+ the original version of the Work and any modifications or additions
53
+ to that Work or Derivative Works thereof, that is intentionally
54
+ submitted to Licensor for inclusion in the Work by the copyright owner
55
+ or by an individual or Legal Entity authorized to submit on behalf of
56
+ the copyright owner. For the purposes of this definition, "submitted"
57
+ means any form of electronic, verbal, or written communication sent
58
+ to the Licensor or its representatives, including but not limited to
59
+ communication on electronic mailing lists, source code control systems,
60
+ and issue tracking systems that are managed by, or on behalf of, the
61
+ Licensor for the purpose of discussing and improving the Work, but
62
+ excluding communication that is conspicuously marked or otherwise
63
+ designated in writing by the copyright owner as "Not a Contribution."
64
+
65
+ "Contributor" shall mean Licensor and any individual or Legal Entity
66
+ on behalf of whom a Contribution has been received by Licensor and
67
+ subsequently incorporated within the Work.
68
+
69
+ 2. Grant of Copyright License. Subject to the terms and conditions of
70
+ this License, each Contributor hereby grants to You a perpetual,
71
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
72
+ copyright license to reproduce, prepare Derivative Works of,
73
+ publicly display, publicly perform, sublicense, and distribute the
74
+ Work and such Derivative Works in Source or Object form.
75
+
76
+ 3. Grant of Patent License. Subject to the terms and conditions of
77
+ this License, each Contributor hereby grants to You a perpetual,
78
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
79
+ (except as stated in this section) patent license to make, have made,
80
+ use, offer to sell, sell, import, and otherwise transfer the Work,
81
+ where such license applies only to those patent claims licensable
82
+ by such Contributor that are necessarily infringed by their
83
+ Contribution(s) alone or by combination of their Contribution(s)
84
+ with the Work to which such Contribution(s) was submitted. If You
85
+ institute patent litigation against any entity (including a
86
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
87
+ or a Contribution incorporated within the Work constitutes direct
88
+ or contributory patent infringement, then any patent licenses
89
+ granted to You under this License for that Work shall terminate
90
+ as of the date such litigation is filed.
91
+
92
+ 4. Redistribution. You may reproduce and distribute copies of the
93
+ Work or Derivative Works thereof in any medium, with or without
94
+ modifications, and in Source or Object form, provided that You
95
+ meet the following conditions:
96
+
97
+ (a) You must give any other recipients of the Work or
98
+ Derivative Works a copy of this License; and
99
+
100
+ (b) You must cause any modified files to carry prominent notices
101
+ stating that You changed the files; and
102
+
103
+ (c) You must retain, in the Source form of any Derivative Works
104
+ that You distribute, all copyright, patent, trademark, and
105
+ attribution notices from the Source form of the Work,
106
+ excluding those notices that do not pertain to any part of
107
+ the Derivative Works; and
108
+
109
+ (d) If the Work includes a "NOTICE" text file as part of its
110
+ distribution, then any Derivative Works that You distribute must
111
+ include a readable copy of the attribution notices contained
112
+ within such NOTICE file, excluding those notices that do not
113
+ pertain to any part of the Derivative Works, in at least one
114
+ of the following places: within a NOTICE text file distributed
115
+ as part of the Derivative Works; within the Source form or
116
+ documentation, if provided along with the Derivative Works; or,
117
+ within a display generated by the Derivative Works, if and
118
+ wherever such third-party notices normally appear. The contents
119
+ of the NOTICE file are for informational purposes only and
120
+ do not modify the License. You may add Your own attribution
121
+ notices within Derivative Works that You distribute, alongside
122
+ or as an addendum to the NOTICE text from the Work, provided
123
+ that such additional attribution notices cannot be construed
124
+ as modifying the License.
125
+
126
+ You may add Your own copyright statement to Your modifications and
127
+ may provide additional or different license terms and conditions
128
+ for use, reproduction, or distribution of Your modifications, or
129
+ for any such Derivative Works as a whole, provided Your use,
130
+ reproduction, and distribution of the Work otherwise complies with
131
+ the conditions stated in this License.
132
+
133
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
134
+ any Contribution intentionally submitted for inclusion in the Work
135
+ by You to the Licensor shall be under the terms and conditions of
136
+ this License, without any additional terms or conditions.
137
+ Notwithstanding the above, nothing herein shall supersede or modify
138
+ the terms of any separate license agreement you may have executed
139
+ with Licensor regarding such Contributions.
140
+
141
+ 6. Trademarks. This License does not grant permission to use the trade
142
+ names, trademarks, service marks, or product names of the Licensor,
143
+ except as required for reasonable and customary use in describing the
144
+ origin of the Work and reproducing the content of the NOTICE file.
145
+
146
+ 7. Disclaimer of Warranty. Unless required by applicable law or
147
+ agreed to in writing, Licensor provides the Work (and each
148
+ Contributor provides its Contributions) on an "AS IS" BASIS,
149
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
150
+ implied, including, without limitation, any warranties or conditions
151
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
152
+ PARTICULAR PURPOSE. You are solely responsible for determining the
153
+ appropriateness of using or redistributing the Work and assume any
154
+ risks associated with Your exercise of permissions under this License.
155
+
156
+ 8. Limitation of Liability. In no event and under no legal theory,
157
+ whether in tort (including negligence), contract, or otherwise,
158
+ unless required by applicable law (such as deliberate and grossly
159
+ negligent acts) or agreed to in writing, shall any Contributor be
160
+ liable to You for damages, including any direct, indirect, special,
161
+ incidental, or consequential damages of any character arising as a
162
+ result of this License or out of the use or inability to use the
163
+ Work (including but not limited to damages for loss of goodwill,
164
+ work stoppage, computer failure or malfunction, or any and all
165
+ other commercial damages or losses), even if such Contributor
166
+ has been advised of the possibility of such damages.
167
+
168
+ 9. Accepting Warranty or Additional Liability. While redistributing
169
+ the Work or Derivative Works thereof, You may choose to offer,
170
+ and charge a fee for, acceptance of support, warranty, indemnity,
171
+ or other liability obligations and/or rights consistent with this
172
+ License. However, in accepting such obligations, You may act only
173
+ on Your own behalf and on Your sole responsibility, not on behalf
174
+ of any other Contributor, and only if You agree to indemnify,
175
+ defend, and hold each Contributor harmless for any liability
176
+ incurred by, or claims asserted against, such Contributor by reason
177
+ of your accepting any such warranty or additional liability.
178
+
179
+ END OF TERMS AND CONDITIONS
180
+
181
+ APPENDIX: How to apply the Apache License to your work.
182
+
183
+ To apply the Apache License to your work, attach the following
184
+ boilerplate notice, with the fields enclosed by brackets "[]"
185
+ replaced with your own identifying information. (Don't include
186
+ the brackets!) The text should be enclosed in the appropriate
187
+ comment syntax for the file format. We also recommend that a
188
+ file or class name and description of purpose be included on the
189
+ same "printed page" as the copyright notice for easier
190
+ identification within third-party archives.
191
+
192
+ Copyright [yyyy] [name of copyright owner]
193
+
194
+ Licensed under the Apache License, Version 2.0 (the "License");
195
+ you may not use this file except in compliance with the License.
196
+ You may obtain a copy of the License at
197
+
198
+ http://www.apache.org/licenses/LICENSE-2.0
199
+
200
+ Unless required by applicable law or agreed to in writing, software
201
+ distributed under the License is distributed on an "AS IS" BASIS,
202
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
203
+ See the License for the specific language governing permissions and
204
+ limitations under the License.
@@ -0,0 +1,33 @@
1
+ insight-ui-webmcp
2
+ Copyright (c) 2026 Alpin Insight Solutions GmbH & Co. KG
3
+
4
+ This product includes software developed by
5
+ Alpin Insight Solutions GmbH & Co. KG.
6
+
7
+ Product: insight-ui-webmcp
8
+ Repository: https://github.com/alpininsight/insight-ui-webmcp
9
+
10
+ Licensed under the Apache License, Version 2.0 (the "License");
11
+ you may not use this file except in compliance with the License.
12
+ You may obtain a copy of the License at
13
+
14
+ http://www.apache.org/licenses/LICENSE-2.0
15
+
16
+ Unless required by applicable law or agreed to in writing, software
17
+ distributed under the License is distributed on an "AS IS" BASIS,
18
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ See the License for the specific language governing permissions and
20
+ limitations under the License.
21
+
22
+ Packages: ais-webmcp, insight-ui-webmcp
23
+
24
+ Third-party software bundled in the browser helper (register.js, built from
25
+ js/register.source.cjs by scripts/build-js.cjs) remains under its own license:
26
+
27
+ - Ajv JSON schema validator (https://github.com/ajv-validator/ajv),
28
+ MIT License, Copyright (c) 2015-2021 Evgeny Poberezkin.
29
+ - fast-deep-equal (https://github.com/epoberezkin/fast-deep-equal),
30
+ MIT License, Copyright (c) 2017 Evgeny Poberezkin.
31
+
32
+ This NOTICE file is provided for attribution as contemplated by the Apache
33
+ License, Version 2.0. It does not modify the License.
@@ -0,0 +1,221 @@
1
+ Metadata-Version: 2.5
2
+ Name: ais-webmcp
3
+ Version: 0.1.0
4
+ Summary: Create, validate and manage WebMCP manifests for any kind of website
5
+ Project-URL: Homepage, https://github.com/alpininsight/ais-webmcp
6
+ Project-URL: Documentation, https://github.com/alpininsight/ais-webmcp#readme
7
+ Project-URL: Issues, https://github.com/alpininsight/ais-webmcp/issues
8
+ Author: Alpin Insight Solutions GmbH & Co. KG
9
+ License-Expression: Apache-2.0
10
+ License-File: LICENSE
11
+ License-File: NOTICE
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Environment :: Console
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Programming Language :: Python :: 3.14
17
+ Requires-Python: >=3.12
18
+ Requires-Dist: jsonschema<5,>=4.23
19
+ Requires-Dist: pyyaml<7,>=6.0.2
20
+ Description-Content-Type: text/markdown
21
+
22
+ # AIS WebMCP — manage WebMCP for any website
23
+
24
+ Make your website's capabilities clear to AI agents. `ais-webmcp` is the
25
+ framework-independent PyPI command for creating, validating and maintaining
26
+ WebMCP descriptions in the context of your website.
27
+
28
+ Use it with static sites, CMS websites, documentation portals or custom web
29
+ applications. Work with local JSON and YAML manifests, then connect the shared
30
+ browser helper to your website's own content and actions.
31
+
32
+ **DE:** Das frameworkunabhängige PyPI-Kommando, mit dem Sie WebMCP-Beschreibungen
33
+ für jede Art von Webseite erstellen, prüfen und sinnvoll pflegen können.
34
+
35
+ ## Background
36
+
37
+ [Insight UI](https://pypi.org/project/insight-ui/) is our open-source,
38
+ WCAG-focused UI package, which we presented at the September meetup of the
39
+ Berlin Python User Group, hosted at our office. Our work on WebMCP grew out
40
+ of it as an extension, which is why we built insight-ui-webmcp first. At the
41
+ meetup, people asked whether we could offer it without the Django layer we
42
+ use for all our production-critical applications. That question is how
43
+ ais-webmcp came about: the same WebMCP core, without the framework. We look
44
+ forward to hearing what you think, and we warmly welcome contributions; see
45
+ [how to contribute](CONTRIBUTING.md).
46
+
47
+ ## Packages at a glance
48
+
49
+ One browser runtime, `register.js`, ships in the Python package and the npm
50
+ package.
51
+
52
+ ```mermaid
53
+ flowchart LR
54
+ Core["ais-webmcp (PyPI)<br/>manifest, CLI, register.js"]
55
+ Django["insight-ui-webmcp (PyPI)<br/>Django adapter"]
56
+ NPM["@alpininsightsolutions/webmcp (npm)<br/>register.js only"]
57
+ Core --> Django
58
+ Core --> NPM
59
+ Django --> S1["Django sites"]
60
+ NPM --> S2["other websites"]
61
+ ```
62
+
63
+ - `ais-webmcp` on PyPI is the core: manifests, the CLI, and `register.js`.
64
+ The Django adapter `insight-ui-webmcp` installs that core.
65
+ - `@alpininsightsolutions/webmcp` (coming soon) on npm is `register.js` only,
66
+ for other websites.
67
+
68
+ The npm package is pending its first release and is not live yet. The
69
+ unscoped npm package `webmcp` is unrelated.
70
+
71
+ ```bash
72
+ pip install ais-webmcp
73
+ ais-webmcp init --output manifest.yaml --static
74
+ ais-webmcp validate manifest.yaml
75
+ ais-webmcp list manifest.yaml
76
+ ais-webmcp doctor manifest.yaml --html index.html
77
+ ais-webmcp export manifest.yaml --output webmcp.manifest.json
78
+ ais-webmcp export manifest.yaml --kind tools --output tools.json
79
+ ais-webmcp export manifest.yaml --kind snippet --output snippet.html
80
+ ais-webmcp diff manifest.yaml webmcp.manifest.json
81
+ ```
82
+
83
+ Python 3.12+; Django is not required. `doctor` and `status` report local
84
+ configuration and refuse remote URLs; browser support is verified separately.
85
+ CSP is noted and not rewritten. Origin Trial tokens are redacted to character
86
+ lengths. `export` can write a canonical manifest, a JSON tools list, or a
87
+ static snippet with no token. Existing files are protected unless you pass
88
+ `--force`. Consequential tools stay disabled in scaffolds until the host
89
+ explicitly enables and implements them.
90
+
91
+ ## Output schemas
92
+
93
+ Declare a [Draft 2020-12 JSON Schema](https://json-schema.org/draft/2020-12)
94
+ for each tool result next to its input schema. The canonical key is
95
+ `outputSchema`; `output_schema` is an alias, and only one of them may be set.
96
+ `ToolSpec.output_schema` writes `outputSchema`.
97
+
98
+ `ais-webmcp validate` checks a present output schema: it must be a JSON object
99
+ and a valid [Draft 2020-12](https://json-schema.org/draft/2020-12) schema. An
100
+ invalid schema fails validation. Omitting the schema does not. The result stays
101
+ `ok`, the exit code stays 0, and each tool without a schema adds a finding:
102
+
103
+ <!-- markdownlint-disable MD013 -->
104
+
105
+ ```json
106
+ {
107
+ "path": "tools[0]",
108
+ "code": "missing_output_schema",
109
+ "severity": "low",
110
+ "message": "missing outputSchema (also accepts output_schema). Optional for existing hosts; absence is a low-severity finding."
111
+ }
112
+ ```
113
+
114
+ <!-- markdownlint-enable MD013 -->
115
+
116
+ Check engines can treat `missing_output_schema` as a low-severity finding.
117
+ Existing hosts keep validating until they declare output schemas. Text reports
118
+ print `finding:` lines and still start with `ok:` when there are no errors.
119
+
120
+ For Django and [Insight UI](https://pypi.org/project/insight-ui/) applications,
121
+ add the insight-ui-webmcp adapter. The core owns the shared schema and browser
122
+ runtime; the adapter uses the installed core rather than shipping a second
123
+ copy.
124
+
125
+ Development preview; the first public release is pending.
126
+
127
+ ## Public npm package
128
+
129
+ The browser runtime is prepared as the public package
130
+ `@alpininsightsolutions/webmcp` (coming soon). Enterprise code never goes to
131
+ npm. The tarball is only the built `register.js`, its types, this README,
132
+ `LICENSE`, and `NOTICE` (`package.json` is included because npm always packs
133
+ it). A path under `enterprise/`, a path containing `webmcp_check`, or a `.env`
134
+ file fails the tarball guard.
135
+
136
+ | | |
137
+ | ---------- | ------------------------------- |
138
+ | PyPI / CLI | `ais-webmcp` |
139
+ | npm | `@alpininsightsolutions/webmcp` |
140
+ | global | `InsightUiWebmcp` |
141
+
142
+ ```bash
143
+ npm install @alpininsightsolutions/webmcp
144
+ ```
145
+
146
+ ```ts
147
+ import InsightUiWebmcp from "@alpininsightsolutions/webmcp";
148
+
149
+ const status = InsightUiWebmcp.status();
150
+ if (status.supported) {
151
+ await InsightUiWebmcp.registerFromManifest(
152
+ {
153
+ profile: "webpage",
154
+ version: "1",
155
+ tools: [
156
+ {
157
+ id: "search",
158
+ name: "Search",
159
+ description: "Search this page",
160
+ inputSchema: {
161
+ type: "object",
162
+ properties: { q: { type: "string" } },
163
+ },
164
+ },
165
+ ],
166
+ },
167
+ {
168
+ search(input: { q?: string }) {
169
+ return { results: [] };
170
+ },
171
+ },
172
+ );
173
+ }
174
+ ```
175
+
176
+ A `<script>` tag assigns that same object to `window.InsightUiWebmcp`.
177
+
178
+ The committed npm version is the `0.0.0` placeholder. Publish stamps the
179
+ `vX.Y.Z` tag into `package.json` when the name stays in the
180
+ `@alpininsightsolutions` scope, the license is `Apache-2.0`, the files
181
+ allowlist includes `LICENSE` and `NOTICE`, and the repository URL is
182
+ `git+https://github.com/alpininsight/ais-webmcp.git`. `npm run build:release`
183
+ then injects that version into `register.js`. The workflow packs that build
184
+ and publishes the tarball with provenance. `prepublishOnly` rejects a local
185
+ `npm publish` while the version is still `0.0.0`. Publishing runs from
186
+ `.github/workflows/npm-publish.yml`, a manual dispatch from `main` with that
187
+ tag. Trusted Publishing attaches provenance. The trusted publisher is bound
188
+ to `alpininsight/ais-webmcp`, workflow `npm-publish.yml`, and environment
189
+ `npm-ais-webmcp`. A release goes out only with Peter's go. The first publish
190
+ is the manual bootstrap.
191
+ One-time npmjs.com setup is in [docs/release.md](docs/release.md).
192
+
193
+ ## Development
194
+
195
+ ```bash
196
+ uv sync --locked --all-groups
197
+ npm ci
198
+ npm run check:js-build
199
+ npm test
200
+ uv run --locked pytest
201
+ uv run --locked pre-commit run --all-files
202
+ ```
203
+
204
+ See [how to contribute](CONTRIBUTING.md).
205
+
206
+ Python 3.12–3.14 and Node 24 are the versions this repository tests. Node 24
207
+ is the repo pin (`.nvmrc` and `devEngines`); the published package does not
208
+ set `engines`, so installing the browser runtime does not warn on other Node
209
+ versions. Each release contains exactly one wheel and one sdist.
210
+
211
+ License: Apache-2.0 with NOTICE. Bundled dependencies retain their own licenses
212
+ in the generated runtime banner.
213
+
214
+ ## Split provenance
215
+
216
+ Core history was extracted from
217
+ [insight-ui-webmcp at d6ead80843dbe42096791dd6688ed58a35dc3291](https://github.com/alpininsight/insight-ui-webmcp/tree/d6ead80843dbe42096791dd6688ed58a35dc3291).
218
+ See [the implementation tracker](https://github.com/alpininsight/insight-ui-webmcp/issues/63)
219
+ for the architecture decision, adapter/publisher/host migration and separate
220
+ release evidence. The original repository history and existing host pins are
221
+ preserved.
@@ -0,0 +1,200 @@
1
+ # AIS WebMCP — manage WebMCP for any website
2
+
3
+ Make your website's capabilities clear to AI agents. `ais-webmcp` is the
4
+ framework-independent PyPI command for creating, validating and maintaining
5
+ WebMCP descriptions in the context of your website.
6
+
7
+ Use it with static sites, CMS websites, documentation portals or custom web
8
+ applications. Work with local JSON and YAML manifests, then connect the shared
9
+ browser helper to your website's own content and actions.
10
+
11
+ **DE:** Das frameworkunabhängige PyPI-Kommando, mit dem Sie WebMCP-Beschreibungen
12
+ für jede Art von Webseite erstellen, prüfen und sinnvoll pflegen können.
13
+
14
+ ## Background
15
+
16
+ [Insight UI](https://pypi.org/project/insight-ui/) is our open-source,
17
+ WCAG-focused UI package, which we presented at the September meetup of the
18
+ Berlin Python User Group, hosted at our office. Our work on WebMCP grew out
19
+ of it as an extension, which is why we built insight-ui-webmcp first. At the
20
+ meetup, people asked whether we could offer it without the Django layer we
21
+ use for all our production-critical applications. That question is how
22
+ ais-webmcp came about: the same WebMCP core, without the framework. We look
23
+ forward to hearing what you think, and we warmly welcome contributions; see
24
+ [how to contribute](CONTRIBUTING.md).
25
+
26
+ ## Packages at a glance
27
+
28
+ One browser runtime, `register.js`, ships in the Python package and the npm
29
+ package.
30
+
31
+ ```mermaid
32
+ flowchart LR
33
+ Core["ais-webmcp (PyPI)<br/>manifest, CLI, register.js"]
34
+ Django["insight-ui-webmcp (PyPI)<br/>Django adapter"]
35
+ NPM["@alpininsightsolutions/webmcp (npm)<br/>register.js only"]
36
+ Core --> Django
37
+ Core --> NPM
38
+ Django --> S1["Django sites"]
39
+ NPM --> S2["other websites"]
40
+ ```
41
+
42
+ - `ais-webmcp` on PyPI is the core: manifests, the CLI, and `register.js`.
43
+ The Django adapter `insight-ui-webmcp` installs that core.
44
+ - `@alpininsightsolutions/webmcp` (coming soon) on npm is `register.js` only,
45
+ for other websites.
46
+
47
+ The npm package is pending its first release and is not live yet. The
48
+ unscoped npm package `webmcp` is unrelated.
49
+
50
+ ```bash
51
+ pip install ais-webmcp
52
+ ais-webmcp init --output manifest.yaml --static
53
+ ais-webmcp validate manifest.yaml
54
+ ais-webmcp list manifest.yaml
55
+ ais-webmcp doctor manifest.yaml --html index.html
56
+ ais-webmcp export manifest.yaml --output webmcp.manifest.json
57
+ ais-webmcp export manifest.yaml --kind tools --output tools.json
58
+ ais-webmcp export manifest.yaml --kind snippet --output snippet.html
59
+ ais-webmcp diff manifest.yaml webmcp.manifest.json
60
+ ```
61
+
62
+ Python 3.12+; Django is not required. `doctor` and `status` report local
63
+ configuration and refuse remote URLs; browser support is verified separately.
64
+ CSP is noted and not rewritten. Origin Trial tokens are redacted to character
65
+ lengths. `export` can write a canonical manifest, a JSON tools list, or a
66
+ static snippet with no token. Existing files are protected unless you pass
67
+ `--force`. Consequential tools stay disabled in scaffolds until the host
68
+ explicitly enables and implements them.
69
+
70
+ ## Output schemas
71
+
72
+ Declare a [Draft 2020-12 JSON Schema](https://json-schema.org/draft/2020-12)
73
+ for each tool result next to its input schema. The canonical key is
74
+ `outputSchema`; `output_schema` is an alias, and only one of them may be set.
75
+ `ToolSpec.output_schema` writes `outputSchema`.
76
+
77
+ `ais-webmcp validate` checks a present output schema: it must be a JSON object
78
+ and a valid [Draft 2020-12](https://json-schema.org/draft/2020-12) schema. An
79
+ invalid schema fails validation. Omitting the schema does not. The result stays
80
+ `ok`, the exit code stays 0, and each tool without a schema adds a finding:
81
+
82
+ <!-- markdownlint-disable MD013 -->
83
+
84
+ ```json
85
+ {
86
+ "path": "tools[0]",
87
+ "code": "missing_output_schema",
88
+ "severity": "low",
89
+ "message": "missing outputSchema (also accepts output_schema). Optional for existing hosts; absence is a low-severity finding."
90
+ }
91
+ ```
92
+
93
+ <!-- markdownlint-enable MD013 -->
94
+
95
+ Check engines can treat `missing_output_schema` as a low-severity finding.
96
+ Existing hosts keep validating until they declare output schemas. Text reports
97
+ print `finding:` lines and still start with `ok:` when there are no errors.
98
+
99
+ For Django and [Insight UI](https://pypi.org/project/insight-ui/) applications,
100
+ add the insight-ui-webmcp adapter. The core owns the shared schema and browser
101
+ runtime; the adapter uses the installed core rather than shipping a second
102
+ copy.
103
+
104
+ Development preview; the first public release is pending.
105
+
106
+ ## Public npm package
107
+
108
+ The browser runtime is prepared as the public package
109
+ `@alpininsightsolutions/webmcp` (coming soon). Enterprise code never goes to
110
+ npm. The tarball is only the built `register.js`, its types, this README,
111
+ `LICENSE`, and `NOTICE` (`package.json` is included because npm always packs
112
+ it). A path under `enterprise/`, a path containing `webmcp_check`, or a `.env`
113
+ file fails the tarball guard.
114
+
115
+ | | |
116
+ | ---------- | ------------------------------- |
117
+ | PyPI / CLI | `ais-webmcp` |
118
+ | npm | `@alpininsightsolutions/webmcp` |
119
+ | global | `InsightUiWebmcp` |
120
+
121
+ ```bash
122
+ npm install @alpininsightsolutions/webmcp
123
+ ```
124
+
125
+ ```ts
126
+ import InsightUiWebmcp from "@alpininsightsolutions/webmcp";
127
+
128
+ const status = InsightUiWebmcp.status();
129
+ if (status.supported) {
130
+ await InsightUiWebmcp.registerFromManifest(
131
+ {
132
+ profile: "webpage",
133
+ version: "1",
134
+ tools: [
135
+ {
136
+ id: "search",
137
+ name: "Search",
138
+ description: "Search this page",
139
+ inputSchema: {
140
+ type: "object",
141
+ properties: { q: { type: "string" } },
142
+ },
143
+ },
144
+ ],
145
+ },
146
+ {
147
+ search(input: { q?: string }) {
148
+ return { results: [] };
149
+ },
150
+ },
151
+ );
152
+ }
153
+ ```
154
+
155
+ A `<script>` tag assigns that same object to `window.InsightUiWebmcp`.
156
+
157
+ The committed npm version is the `0.0.0` placeholder. Publish stamps the
158
+ `vX.Y.Z` tag into `package.json` when the name stays in the
159
+ `@alpininsightsolutions` scope, the license is `Apache-2.0`, the files
160
+ allowlist includes `LICENSE` and `NOTICE`, and the repository URL is
161
+ `git+https://github.com/alpininsight/ais-webmcp.git`. `npm run build:release`
162
+ then injects that version into `register.js`. The workflow packs that build
163
+ and publishes the tarball with provenance. `prepublishOnly` rejects a local
164
+ `npm publish` while the version is still `0.0.0`. Publishing runs from
165
+ `.github/workflows/npm-publish.yml`, a manual dispatch from `main` with that
166
+ tag. Trusted Publishing attaches provenance. The trusted publisher is bound
167
+ to `alpininsight/ais-webmcp`, workflow `npm-publish.yml`, and environment
168
+ `npm-ais-webmcp`. A release goes out only with Peter's go. The first publish
169
+ is the manual bootstrap.
170
+ One-time npmjs.com setup is in [docs/release.md](docs/release.md).
171
+
172
+ ## Development
173
+
174
+ ```bash
175
+ uv sync --locked --all-groups
176
+ npm ci
177
+ npm run check:js-build
178
+ npm test
179
+ uv run --locked pytest
180
+ uv run --locked pre-commit run --all-files
181
+ ```
182
+
183
+ See [how to contribute](CONTRIBUTING.md).
184
+
185
+ Python 3.12–3.14 and Node 24 are the versions this repository tests. Node 24
186
+ is the repo pin (`.nvmrc` and `devEngines`); the published package does not
187
+ set `engines`, so installing the browser runtime does not warn on other Node
188
+ versions. Each release contains exactly one wheel and one sdist.
189
+
190
+ License: Apache-2.0 with NOTICE. Bundled dependencies retain their own licenses
191
+ in the generated runtime banner.
192
+
193
+ ## Split provenance
194
+
195
+ Core history was extracted from
196
+ [insight-ui-webmcp at d6ead80843dbe42096791dd6688ed58a35dc3291](https://github.com/alpininsight/insight-ui-webmcp/tree/d6ead80843dbe42096791dd6688ed58a35dc3291).
197
+ See [the implementation tracker](https://github.com/alpininsight/insight-ui-webmcp/issues/63)
198
+ for the architecture decision, adapter/publisher/host migration and separate
199
+ release evidence. The original repository history and existing host pins are
200
+ preserved.