mcp-toolsets-runtime 0.1.3__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 (55) hide show
  1. mcp_toolsets_runtime-0.1.3/.github/CODEOWNERS +2 -0
  2. mcp_toolsets_runtime-0.1.3/.github/dependabot.yml +14 -0
  3. mcp_toolsets_runtime-0.1.3/.github/workflows/ci.yml +54 -0
  4. mcp_toolsets_runtime-0.1.3/.github/workflows/publish.yaml +55 -0
  5. mcp_toolsets_runtime-0.1.3/.github/workflows/release-please.yml +29 -0
  6. mcp_toolsets_runtime-0.1.3/.gitignore +225 -0
  7. mcp_toolsets_runtime-0.1.3/.release-please-manifest.json +3 -0
  8. mcp_toolsets_runtime-0.1.3/CHANGELOG.md +24 -0
  9. mcp_toolsets_runtime-0.1.3/CONTRIBUTING.md +66 -0
  10. mcp_toolsets_runtime-0.1.3/LICENSE +21 -0
  11. mcp_toolsets_runtime-0.1.3/PKG-INFO +117 -0
  12. mcp_toolsets_runtime-0.1.3/README.md +76 -0
  13. mcp_toolsets_runtime-0.1.3/docs/CONSUMING.md +229 -0
  14. mcp_toolsets_runtime-0.1.3/js/mcp-view/LICENSE +21 -0
  15. mcp_toolsets_runtime-0.1.3/js/mcp-view/README.md +65 -0
  16. mcp_toolsets_runtime-0.1.3/js/mcp-view/package-lock.json +2637 -0
  17. mcp_toolsets_runtime-0.1.3/js/mcp-view/package.json +40 -0
  18. mcp_toolsets_runtime-0.1.3/js/mcp-view/src/host.ts +58 -0
  19. mcp_toolsets_runtime-0.1.3/js/mcp-view/src/index.ts +1 -0
  20. mcp_toolsets_runtime-0.1.3/js/mcp-view/test/host.test.ts +63 -0
  21. mcp_toolsets_runtime-0.1.3/js/mcp-view/tsconfig.json +19 -0
  22. mcp_toolsets_runtime-0.1.3/pyproject.toml +82 -0
  23. mcp_toolsets_runtime-0.1.3/release-please-config.json +19 -0
  24. mcp_toolsets_runtime-0.1.3/scripts/build-js +10 -0
  25. mcp_toolsets_runtime-0.1.3/scripts/format +6 -0
  26. mcp_toolsets_runtime-0.1.3/scripts/lint +7 -0
  27. mcp_toolsets_runtime-0.1.3/scripts/test +5 -0
  28. mcp_toolsets_runtime-0.1.3/src/mcp_agent/__init__.py +0 -0
  29. mcp_toolsets_runtime-0.1.3/src/mcp_agent/elements/McpView.jsx +89 -0
  30. mcp_toolsets_runtime-0.1.3/src/mcp_agent/main.py +376 -0
  31. mcp_toolsets_runtime-0.1.3/src/mcp_agent/py.typed +0 -0
  32. mcp_toolsets_runtime-0.1.3/src/mcp_agent/web.py +315 -0
  33. mcp_toolsets_runtime-0.1.3/src/mcp_cli/__init__.py +1 -0
  34. mcp_toolsets_runtime-0.1.3/src/mcp_cli/main.py +170 -0
  35. mcp_toolsets_runtime-0.1.3/src/mcp_cli/py.typed +0 -0
  36. mcp_toolsets_runtime-0.1.3/src/mcp_runtime/__init__.py +5 -0
  37. mcp_toolsets_runtime-0.1.3/src/mcp_runtime/credentials.py +80 -0
  38. mcp_toolsets_runtime-0.1.3/src/mcp_runtime/fastmcp_output.py +112 -0
  39. mcp_toolsets_runtime-0.1.3/src/mcp_runtime/index.py +167 -0
  40. mcp_toolsets_runtime-0.1.3/src/mcp_runtime/py.typed +0 -0
  41. mcp_toolsets_runtime-0.1.3/src/mcp_runtime/server.py +148 -0
  42. mcp_toolsets_runtime-0.1.3/src/mcp_runtime/tool_result.py +45 -0
  43. mcp_toolsets_runtime-0.1.3/src/mcp_runtime/views.py +115 -0
  44. mcp_toolsets_runtime-0.1.3/src/mcp_toolset/__init__.py +1 -0
  45. mcp_toolsets_runtime-0.1.3/src/mcp_toolset/main.py +387 -0
  46. mcp_toolsets_runtime-0.1.3/src/mcp_toolset/py.typed +0 -0
  47. mcp_toolsets_runtime-0.1.3/tests/mcp_agent/test_agent.py +167 -0
  48. mcp_toolsets_runtime-0.1.3/tests/mcp_cli/test_cli.py +28 -0
  49. mcp_toolsets_runtime-0.1.3/tests/mcp_runtime/test_credentials.py +31 -0
  50. mcp_toolsets_runtime-0.1.3/tests/mcp_runtime/test_fastmcp_output.py +164 -0
  51. mcp_toolsets_runtime-0.1.3/tests/mcp_runtime/test_index.py +98 -0
  52. mcp_toolsets_runtime-0.1.3/tests/mcp_runtime/test_server.py +150 -0
  53. mcp_toolsets_runtime-0.1.3/tests/mcp_runtime/test_views.py +102 -0
  54. mcp_toolsets_runtime-0.1.3/tests/mcp_toolset/test_new.py +56 -0
  55. mcp_toolsets_runtime-0.1.3/uv.lock +2997 -0
@@ -0,0 +1,2 @@
1
+ # Default owners for everything in the repo.
2
+ * @ciaransweet
@@ -0,0 +1,14 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "uv"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
7
+ - package-ecosystem: "npm"
8
+ directory: "/js/mcp-view"
9
+ schedule:
10
+ interval: "weekly"
11
+ - package-ecosystem: "github-actions"
12
+ directory: "/"
13
+ schedule:
14
+ interval: "weekly"
@@ -0,0 +1,54 @@
1
+ name: CI
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches: [main]
7
+
8
+ jobs:
9
+ python:
10
+ runs-on: ubuntu-latest
11
+ strategy:
12
+ fail-fast: false
13
+ matrix:
14
+ python-version: ["3.12", "3.13"]
15
+ steps:
16
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
17
+ - uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
18
+ with:
19
+ python-version: ${{ matrix.python-version }}
20
+ # Include [agent] so mcp_agent is imported/typechecked/tested too.
21
+ - run: uv sync --frozen --all-extras
22
+ - run: ./scripts/lint
23
+ - run: ./scripts/test
24
+
25
+ js:
26
+ runs-on: ubuntu-latest
27
+ steps:
28
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
29
+ - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
30
+ with:
31
+ node-version: "22"
32
+ - run: ./scripts/build-js
33
+
34
+ pr-title:
35
+ # The "changelog entry or fail" gate: the PR title must be a valid
36
+ # conventional commit, which (via squash-by-title) becomes the commit
37
+ # release-please turns into a CHANGELOG line.
38
+ if: github.event_name == 'pull_request'
39
+ runs-on: ubuntu-latest
40
+ steps:
41
+ - uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1
42
+ env:
43
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44
+ with:
45
+ types: |
46
+ feat
47
+ fix
48
+ perf
49
+ refactor
50
+ docs
51
+ test
52
+ build
53
+ ci
54
+ chore
@@ -0,0 +1,55 @@
1
+ name: publish
2
+
3
+ # Fires on the release release-please cuts (it uses an App token, so the event
4
+ # is not suppressed — see release-please.yml).
5
+ #
6
+ # Both registries' trusted publishers are registered against this workflow's
7
+ # *filename* and environment: `publish.yaml` / `release`. Renaming either breaks
8
+ # publishing with an OIDC claim mismatch; change it on PyPI and npm first.
9
+ #
10
+ # `release` restricts deployments by ref. This workflow is triggered by a
11
+ # release, so the ref is a *tag* — the environment needs a matching tag policy
12
+ # (`mcp-toolsets-runtime-v*`), not just a branch one, or both jobs are blocked
13
+ # before they start.
14
+ on:
15
+ release:
16
+ types: [published]
17
+
18
+ jobs:
19
+ pypi:
20
+ runs-on: ubuntu-latest
21
+ environment: release
22
+ permissions:
23
+ id-token: write # OIDC trusted publishing — no long-lived token
24
+ steps:
25
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
26
+ with:
27
+ ref: ${{ github.event.release.tag_name }}
28
+ - uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
29
+ - run: uv build
30
+ - uses: pypa/gh-action-pypi-publish@ba38be9e461d3875417946c167d0b5f3d385a247 # v1.14.1
31
+
32
+ npm:
33
+ runs-on: ubuntu-latest
34
+ environment: release
35
+ permissions:
36
+ contents: read
37
+ id-token: write # OIDC trusted publishing — no long-lived token
38
+ defaults:
39
+ run:
40
+ working-directory: js/mcp-view
41
+ steps:
42
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
43
+ with:
44
+ ref: ${{ github.event.release.tag_name }}
45
+ - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
46
+ with:
47
+ node-version: "22"
48
+ registry-url: "https://registry.npmjs.org"
49
+ scope: "@developmentseed"
50
+ # Node 22 ships npm 10; trusted publishing needs >= 11.5.1.
51
+ - run: npm install -g npm@latest
52
+ working-directory: .
53
+ - run: npm ci
54
+ - run: npm run build
55
+ - run: npm publish
@@ -0,0 +1,29 @@
1
+ name: release-please
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+
7
+ permissions:
8
+ contents: write
9
+ pull-requests: write
10
+
11
+ jobs:
12
+ release-please:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ # Runs as a GitHub App rather than GITHUB_TOKEN so the release it creates
16
+ # can trigger `publish.yaml` — GitHub suppresses workflow events for
17
+ # anything GITHUB_TOKEN does, to stop CI recursing.
18
+ - uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
19
+ id: app-token
20
+ with:
21
+ app-id: ${{ vars.DS_RELEASE_BOT_CLIENT_ID }}
22
+ private-key: ${{ secrets.DS_RELEASE_BOT_PRIVATE_KEY }}
23
+
24
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
25
+ - uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0
26
+ id: release
27
+ with:
28
+ token: ${{ steps.app-token.outputs.token }}
29
+ # config + manifest are read from the repo root
@@ -0,0 +1,225 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ # Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ # poetry.lock
109
+ # poetry.toml
110
+
111
+ # pdm
112
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115
+ # pdm.lock
116
+ # pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # pixi
121
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122
+ # pixi.lock
123
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124
+ # in the .venv directory. It is recommended not to include this directory in version control.
125
+ .pixi
126
+
127
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128
+ __pypackages__/
129
+
130
+ # Celery stuff
131
+ celerybeat-schedule
132
+ celerybeat.pid
133
+
134
+ # Redis
135
+ *.rdb
136
+ *.aof
137
+ *.pid
138
+
139
+ # RabbitMQ
140
+ mnesia/
141
+ rabbitmq/
142
+ rabbitmq-data/
143
+
144
+ # ActiveMQ
145
+ activemq-data/
146
+
147
+ # SageMath parsed files
148
+ *.sage.py
149
+
150
+ # Environments
151
+ .env
152
+ .envrc
153
+ .venv
154
+ env/
155
+ venv/
156
+ ENV/
157
+ env.bak/
158
+ venv.bak/
159
+
160
+ # Spyder project settings
161
+ .spyderproject
162
+ .spyproject
163
+
164
+ # Rope project settings
165
+ .ropeproject
166
+
167
+ # mkdocs documentation
168
+ /site
169
+
170
+ # mypy
171
+ .mypy_cache/
172
+ .dmypy.json
173
+ dmypy.json
174
+
175
+ # Pyre type checker
176
+ .pyre/
177
+
178
+ # pytype static type analyzer
179
+ .pytype/
180
+
181
+ # Cython debug symbols
182
+ cython_debug/
183
+
184
+ # PyCharm
185
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
186
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
187
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
188
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
189
+ # .idea/
190
+
191
+ # Abstra
192
+ # Abstra is an AI-powered process automation framework.
193
+ # Ignore directories containing user credentials, local state, and settings.
194
+ # Learn more at https://abstra.io/docs
195
+ .abstra/
196
+
197
+ # Visual Studio Code
198
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
199
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
200
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
201
+ # you could uncomment the following to ignore the entire vscode folder
202
+ # .vscode/
203
+ # Temporary file for partial code execution
204
+ tempCodeRunnerFile.py
205
+
206
+ # Ruff stuff:
207
+ .ruff_cache/
208
+
209
+ # PyPI configuration file
210
+ .pypirc
211
+
212
+ # Marimo
213
+ marimo/_static/
214
+ marimo/_lsp/
215
+ __marimo__/
216
+
217
+ # Streamlit
218
+ .streamlit/secrets.toml
219
+
220
+ # Node / JS bridge
221
+ node_modules/
222
+ js/**/dist/
223
+
224
+ # Chainlit runtime scaffolding
225
+ .chainlit/
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.1.3"
3
+ }
@@ -0,0 +1,24 @@
1
+ # Changelog
2
+
3
+ ## [0.1.3](https://github.com/developmentseed/mcp-toolsets-runtime/compare/mcp-toolsets-runtime-v0.1.2...mcp-toolsets-runtime-v0.1.3) (2026-07-30)
4
+
5
+
6
+ ### Features
7
+
8
+ * **publish:** release via App token, publish to PyPI and public npm ([#14](https://github.com/developmentseed/mcp-toolsets-runtime/issues/14)) ([b1da2e0](https://github.com/developmentseed/mcp-toolsets-runtime/commit/b1da2e0439d4525274b7d83a379e74a4078198d8))
9
+
10
+ ## [0.1.2](https://github.com/developmentseed/mcp-toolsets-runtime/compare/mcp-toolsets-runtime-v0.1.1...mcp-toolsets-runtime-v0.1.2) (2026-07-28)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * **release:** publish the npm bridge inline and lock versions in step ([#12](https://github.com/developmentseed/mcp-toolsets-runtime/issues/12)) ([ee28bc2](https://github.com/developmentseed/mcp-toolsets-runtime/commit/ee28bc208b4f8af0022a4796dad08d7da54570bb))
16
+
17
+ ## [0.1.1](https://github.com/developmentseed/mcp-toolsets-runtime/compare/mcp-toolsets-runtime-v0.1.0...mcp-toolsets-runtime-v0.1.1) (2026-07-28)
18
+
19
+
20
+ ### Features
21
+
22
+ * extract shared runtime into an installable package ([#1](https://github.com/developmentseed/mcp-toolsets-runtime/issues/1)) ([ca9ec3d](https://github.com/developmentseed/mcp-toolsets-runtime/commit/ca9ec3d37893b54dfd53409d4e4c13c7fef1b762))
23
+
24
+ ## Changelog
@@ -0,0 +1,66 @@
1
+ # Contributing
2
+
3
+ ## Your PR title is the changelog
4
+
5
+ This repo releases with [release-please](https://github.com/googleapis/release-please):
6
+ it reads the commits on `main`, groups them into `CHANGELOG.md`, and bumps the
7
+ version. Because `main` uses **squash-merge with the PR title as the commit
8
+ subject**, your **PR title** is the line that lands in the changelog.
9
+
10
+ So every PR title must be a valid [Conventional Commit](https://www.conventionalcommits.org/):
11
+
12
+ ```
13
+ <type>(<optional scope>): <description>
14
+ ```
15
+
16
+ CI (`pr-title`) fails the PR if the title isn't one of these types:
17
+
18
+ | Type | Use for | Version effect (pre-1.0) |
19
+ | --- | --- | --- |
20
+ | `feat` | a new capability | minor |
21
+ | `fix` | a bug fix | patch |
22
+ | `perf` | a performance improvement | patch |
23
+ | `refactor` | internal change, no behaviour change | patch |
24
+ | `docs` | docs only | none |
25
+ | `test` | tests only | none |
26
+ | `build` | build system / deps | none |
27
+ | `ci` | CI config | none |
28
+ | `chore` | anything else | none |
29
+
30
+ A **breaking change** — an incompatible change to the plugin contract
31
+ (`TOOLS` / `VIEWS` / `CREDENTIAL_HEADERS`), `ToolResult`, the `ui/*` wire
32
+ protocol, or a public signature — gets a `!`:
33
+
34
+ ```
35
+ feat!: require ToolResult from every tool
36
+ ```
37
+
38
+ Examples:
39
+
40
+ ```
41
+ feat(runtime): stamp view _meta on tools that declare VIEWS
42
+ fix(agent): only inject declared credential headers
43
+ chore(deps): bump mcp to 1.29
44
+ ```
45
+
46
+ ## The release flow
47
+
48
+ 1. Merge PRs with conventional titles.
49
+ 2. release-please keeps a rolling **release PR** that bumps `pyproject.toml` and
50
+ `js/mcp-view/package.json` (kept equal by the linked-versions plugin) and
51
+ updates `CHANGELOG.md`. **This PR is editable** — curate the changelog prose
52
+ before merging if a release warrants it.
53
+ 3. Merging the release PR tags `vX.Y.Z`, cuts a GitHub Release, and publishes
54
+ the JS package.
55
+
56
+ ## Local checks
57
+
58
+ ```bash
59
+ uv sync --all-extras
60
+ ./scripts/lint
61
+ ./scripts/test
62
+ ./scripts/build-js
63
+ ```
64
+
65
+ Lint/type rules live entirely in `pyproject.toml` — the scripts pass no rule
66
+ flags, so your editor, `./scripts/format`, and CI all agree.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Development Seed
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:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,117 @@
1
+ Metadata-Version: 2.4
2
+ Name: mcp-toolsets-runtime
3
+ Version: 0.1.3
4
+ Summary: Shared runtime for MCP Toolsets: discover LangChain tools, serve them as MCP, plus a CLI and an example chat agent.
5
+ License: MIT License
6
+
7
+ Copyright (c) 2026 Development Seed
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ of this software and associated documentation files (the "Software"), to deal
11
+ in the Software without restriction, including without limitation the rights
12
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ copies of the Software, and to permit persons to whom the Software is
14
+ furnished to do so, subject to the following conditions:
15
+
16
+ The above copyright notice and this permission notice shall be included in all
17
+ copies or substantial portions of the Software.
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
+ SOFTWARE.
26
+ License-File: LICENSE
27
+ Requires-Python: <3.14,>=3.12
28
+ Requires-Dist: fastapi<1.0.0,>=0.140.11
29
+ Requires-Dist: langchain-core<2.0.0,>=1.4.6
30
+ Requires-Dist: langchain-mcp-adapters<0.4.0,>=0.3.0
31
+ Requires-Dist: mcp<2.0.0,>=1.27.2
32
+ Requires-Dist: pydantic-settings<3.0.0,>=2.12.0
33
+ Requires-Dist: rich<16.0.0,>=15.0.0
34
+ Requires-Dist: typer<0.28.0,>=0.27.0
35
+ Requires-Dist: typing-extensions>=4.10.0
36
+ Provides-Extra: agent
37
+ Requires-Dist: chainlit<3.0.0,>=2.11.1; extra == 'agent'
38
+ Requires-Dist: httpx<1.0.0,>=0.28.1; extra == 'agent'
39
+ Requires-Dist: langchain<2.0.0,>=1.3.7; extra == 'agent'
40
+ Description-Content-Type: text/markdown
41
+
42
+ # mcp-toolsets-runtime
43
+
44
+ The shared runtime for [MCP Toolsets](https://github.com/developmentseed/mcp-toolsets).
45
+ Both `developmentseed/mcp-toolsets` and downstream repos generated from it
46
+ (e.g. `ecmwf/dss-agentic-ai-services`) install this package instead of each
47
+ carrying their own copy of the runtime.
48
+
49
+ ## What's in here
50
+
51
+ One Python distribution (`mcp-toolsets-runtime`) exposing three top-level
52
+ modules, plus the view-side JS bridge:
53
+
54
+ | Module | What it is |
55
+ | --- | --- |
56
+ | `mcp_runtime` | Discovers a toolset's LangChain tools (`TOOLS`) and serves them as an MCP server; serves UI views (`VIEWS`) as `ui://` resources; derives server `instructions` from `CREDENTIAL_HEADERS`. Entry points: `mcp-serve`, `mcp-index`. |
57
+ | `mcp_cli` | Typer CLI to list and call tools on a running MCP service. Entry point: `mcp-cli`. |
58
+ | `mcp_toolset` | Scaffolds a new toolset in a consumer repo (`mcp-toolset new [--with-ui] <name>`), wired to this package + the npm view bridge. |
59
+ | `mcp_agent` | Example Chainlit chat agent that discovers MCP servers behind an index URL and drives their tools. Ships the Chainlit host element `elements/McpView.jsx`. Entry points: `mcp-agent`, `mcp-agent-web`. Requires the `[agent]` extra. |
60
+ | `@developmentseed/mcp-view` (`js/mcp-view`) | The view-side `ui/*` postMessage bridge a toolset UI imports (`onData` / `sendMessage`). Published to npm separately. |
61
+
62
+ ### The toolset plugin contract
63
+
64
+ `mcp_runtime` discovers a toolset purely by convention — a `<toolset>.tools`
65
+ module exporting:
66
+
67
+ - `TOOLS` — a non-empty list of LangChain tools that return a `ToolResult`.
68
+ - `VIEWS` *(optional)* — `{tool_name: view_id}`, with a built bundle at
69
+ `<package>/views/<view_id>.html`.
70
+ - `CREDENTIAL_HEADERS` *(optional)* — header names the tools read off the
71
+ transport; used to derive the model-facing auth hint.
72
+
73
+ Treat these, `ToolResult`, and the `ui/*` wire protocol as **public API**.
74
+
75
+ ## Install
76
+
77
+ ```bash
78
+ # base: runtime + cli (lean, for tool-serving images)
79
+ pip install "mcp-toolsets-runtime @ git+https://github.com/developmentseed/mcp-toolsets-runtime.git@v0.1.0"
80
+
81
+ # with the Chainlit web agent
82
+ pip install "mcp-toolsets-runtime[agent] @ git+https://github.com/developmentseed/mcp-toolsets-runtime.git@v0.1.0"
83
+ ```
84
+
85
+ With uv, as a consumer:
86
+
87
+ ```toml
88
+ dependencies = ["mcp-toolsets-runtime[agent]"]
89
+
90
+ [tool.uv.sources]
91
+ mcp-toolsets-runtime = { git = "https://github.com/developmentseed/mcp-toolsets-runtime.git", tag = "v0.1.0" }
92
+ ```
93
+
94
+ Imports are unchanged from the old workspace packages: `from mcp_runtime.server
95
+ import build_server`, etc. Bump the runtime by changing the `tag` and running
96
+ `uv lock`.
97
+
98
+ **Consuming this package** — the plugin contract, serving toolsets, wiring up UI
99
+ views (including `mcp-agent install-elements` and the npm bridge), and migrating
100
+ off the in-repo workspace: see **[docs/CONSUMING.md](./docs/CONSUMING.md)**.
101
+
102
+ ## Develop
103
+
104
+ ```bash
105
+ uv sync --all-extras # install with [agent] + dev tools
106
+ ./scripts/lint # ruff check + ruff format --check + mypy (config in pyproject)
107
+ ./scripts/test # pytest
108
+ ./scripts/build-js # typecheck + build + vitest for js/mcp-view (needs node)
109
+ ```
110
+
111
+ ## Releases
112
+
113
+ Versioning and `CHANGELOG.md` are managed by
114
+ [release-please](https://github.com/googleapis/release-please) from Conventional
115
+ Commits. See [CONTRIBUTING.md](./CONTRIBUTING.md) — in short, **your PR title is
116
+ the changelog entry**, and CI fails a PR whose title isn't a valid conventional
117
+ commit. The Python package and the JS bridge share one version (linked).