nodepal-mcp 0.2.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.
- nodepal_mcp-0.2.0/.dockerignore +5 -0
- nodepal_mcp-0.2.0/.gitignore +4 -0
- nodepal_mcp-0.2.0/Dockerfile +32 -0
- nodepal_mcp-0.2.0/LICENSE +202 -0
- nodepal_mcp-0.2.0/PKG-INFO +148 -0
- nodepal_mcp-0.2.0/README.md +120 -0
- nodepal_mcp-0.2.0/bundle/.mcpbignore +3 -0
- nodepal_mcp-0.2.0/bundle/manifest.json +36 -0
- nodepal_mcp-0.2.0/bundle/server/main.py +7 -0
- nodepal_mcp-0.2.0/pyproject.toml +59 -0
- nodepal_mcp-0.2.0/scripts/build-bundle.sh +15 -0
- nodepal_mcp-0.2.0/server.json +38 -0
- nodepal_mcp-0.2.0/src/nodepal_mcp/__init__.py +3 -0
- nodepal_mcp-0.2.0/src/nodepal_mcp/__main__.py +3 -0
- nodepal_mcp-0.2.0/src/nodepal_mcp/client.py +214 -0
- nodepal_mcp-0.2.0/src/nodepal_mcp/config.py +36 -0
- nodepal_mcp-0.2.0/src/nodepal_mcp/coverage.py +309 -0
- nodepal_mcp-0.2.0/src/nodepal_mcp/http.py +317 -0
- nodepal_mcp-0.2.0/src/nodepal_mcp/prompts.py +133 -0
- nodepal_mcp-0.2.0/src/nodepal_mcp/server.py +141 -0
- nodepal_mcp-0.2.0/src/nodepal_mcp/tools/__init__.py +57 -0
- nodepal_mcp-0.2.0/src/nodepal_mcp/tools/_base.py +194 -0
- nodepal_mcp-0.2.0/src/nodepal_mcp/tools/account.py +56 -0
- nodepal_mcp-0.2.0/src/nodepal_mcp/tools/backups.py +92 -0
- nodepal_mcp-0.2.0/src/nodepal_mcp/tools/configs.py +141 -0
- nodepal_mcp-0.2.0/src/nodepal_mcp/tools/console.py +64 -0
- nodepal_mcp-0.2.0/src/nodepal_mcp/tools/content.py +285 -0
- nodepal_mcp-0.2.0/src/nodepal_mcp/tools/diagnostics.py +35 -0
- nodepal_mcp-0.2.0/src/nodepal_mcp/tools/fit.py +108 -0
- nodepal_mcp-0.2.0/src/nodepal_mcp/tools/groups.py +114 -0
- nodepal_mcp-0.2.0/src/nodepal_mcp/tools/members.py +64 -0
- nodepal_mcp-0.2.0/src/nodepal_mcp/tools/modpacks.py +165 -0
- nodepal_mcp-0.2.0/src/nodepal_mcp/tools/nodes.py +182 -0
- nodepal_mcp-0.2.0/src/nodepal_mcp/tools/servers.py +353 -0
- nodepal_mcp-0.2.0/src/nodepal_mcp/tools/storage.py +53 -0
- nodepal_mcp-0.2.0/src/nodepal_mcp/tools/worlds.py +297 -0
- nodepal_mcp-0.2.0/tests/__init__.py +0 -0
- nodepal_mcp-0.2.0/tests/conftest.py +71 -0
- nodepal_mcp-0.2.0/tests/test_client.py +78 -0
- nodepal_mcp-0.2.0/tests/test_diagnostics.py +64 -0
- nodepal_mcp-0.2.0/tests/test_domain_tools.py +518 -0
- nodepal_mcp-0.2.0/tests/test_http.py +401 -0
- nodepal_mcp-0.2.0/tests/test_parity.py +60 -0
- nodepal_mcp-0.2.0/tests/test_tools.py +284 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Test image for nodepal-mcp. Build the test target, then run pytest + ruff with the folder mounted:
|
|
2
|
+
# docker build -q --target test -t nodepal-mcp-test .
|
|
3
|
+
# docker run --rm -v "$(cd .. && pwd -W):/portal" -w /portal/mcp nodepal-mcp-test sh -c "python -m pytest -q && ruff check ."
|
|
4
|
+
# (the whole portal is mounted: tests/test_parity.py reads backend/tests/data/api_routes.json)
|
|
5
|
+
FROM python:3.12-slim AS test
|
|
6
|
+
WORKDIR /app
|
|
7
|
+
COPY pyproject.toml README.md ./
|
|
8
|
+
COPY src ./src
|
|
9
|
+
RUN pip install --no-cache-dir -e ".[dev]"
|
|
10
|
+
CMD ["sh", "-c", "python -m pytest -q && ruff check ."]
|
|
11
|
+
|
|
12
|
+
# Stdio image (optional): stdio server, token passed through the environment.
|
|
13
|
+
FROM python:3.12-slim AS stdio
|
|
14
|
+
WORKDIR /app
|
|
15
|
+
COPY pyproject.toml README.md ./
|
|
16
|
+
COPY src ./src
|
|
17
|
+
RUN pip install --no-cache-dir .
|
|
18
|
+
ENTRYPOINT ["nodepal-mcp"]
|
|
19
|
+
|
|
20
|
+
# Remote endpoint (Streamable HTTP at /mcp on 8080), the image the portal stack runs as service `mcp`.
|
|
21
|
+
# Build context = the mcp/ folder (scripts/release-local.sh archives it). Not root; no port is published.
|
|
22
|
+
FROM python:3.12-slim AS runner
|
|
23
|
+
WORKDIR /app
|
|
24
|
+
COPY pyproject.toml README.md ./
|
|
25
|
+
COPY src ./src
|
|
26
|
+
RUN pip install --no-cache-dir . && useradd --system --uid 10001 --no-create-home nodepal
|
|
27
|
+
USER 10001
|
|
28
|
+
ENV NODEPAL_MCP_MODE=http PYTHONUNBUFFERED=1
|
|
29
|
+
EXPOSE 8080
|
|
30
|
+
HEALTHCHECK --interval=15s --timeout=4s --start-period=10s --retries=3 \
|
|
31
|
+
CMD ["python", "-c", "import urllib.request as u; u.urlopen('http://127.0.0.1:8080/healthz', timeout=3)"]
|
|
32
|
+
ENTRYPOINT ["nodepal-mcp"]
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: nodepal-mcp
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: MCP server that lets AI agents manage NodePal Minecraft servers through the portal API
|
|
5
|
+
Project-URL: Homepage, https://nodepal.net
|
|
6
|
+
Project-URL: Documentation, https://nodepal.net/developers
|
|
7
|
+
License-Expression: Apache-2.0
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Keywords: ai-agents,mcp,minecraft,model-context-protocol,nodepal
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Topic :: Games/Entertainment
|
|
20
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
21
|
+
Requires-Python: >=3.10
|
|
22
|
+
Requires-Dist: httpx>=0.27
|
|
23
|
+
Requires-Dist: mcp<3,>=2.3
|
|
24
|
+
Provides-Extra: dev
|
|
25
|
+
Requires-Dist: pytest>=8; extra == 'dev'
|
|
26
|
+
Requires-Dist: ruff>=0.6; extra == 'dev'
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
|
|
29
|
+
# nodepal-mcp
|
|
30
|
+
|
|
31
|
+
An [MCP](https://modelcontextprotocol.io) server that lets AI agents manage your NodePal Minecraft servers through the portal API: check the PCs hosting servers, find a modpack, check it fits, create the server, start it, add mods, and back it up.
|
|
32
|
+
|
|
33
|
+
You can connect in two ways:
|
|
34
|
+
|
|
35
|
+
1. **Remote endpoint (OAuth)** — `https://nodepal.net/mcp` for AI apps with remote connectors (no API token to paste).
|
|
36
|
+
2. **Local stdio (`uvx nodepal-mcp`)** — runs on your PC for desktop and terminal AI apps, using a personal API token (`NODEPAL_TOKEN`). Also supports local file uploads.
|
|
37
|
+
|
|
38
|
+
## Remote endpoint (`https://nodepal.net/mcp`)
|
|
39
|
+
|
|
40
|
+
For AI apps that connect to remote MCP servers by URL:
|
|
41
|
+
|
|
42
|
+
- **URL:** `https://nodepal.net/mcp`
|
|
43
|
+
- **Auth:** OAuth — sign in with your NodePal account when the AI app asks. There is no API token to copy or paste.
|
|
44
|
+
- **Toolsets:** Append `?toolsets=...` to narrow the exposed tools (see [Toolsets](#toolsets-fewer-tools-less-context)).
|
|
45
|
+
|
|
46
|
+
The remote endpoint exposes the same tools over MCP Streamable HTTP (spec 2026-07-28), stateless, with JSON responses. It runs as its own container (`nodepal-mcp --http` or `NODEPAL_MCP_MODE=http`; Docker target `runner`; port 8080 inside the stack, reached only through the portal's nginx at `/mcp`).
|
|
47
|
+
|
|
48
|
+
- **Auth details:** `Authorization: Bearer` on every request. Missing or invalid returns `401` with `WWW-Authenticate: Bearer resource_metadata=".../.well-known/oauth-protected-resource/mcp"`. The token is checked against the backend (`GET <NODEPAL_INTERNAL_API>/api/oauth/token-info`, cached up to 30 s by token hash); an OAuth token issued for another resource is refused. Personal API tokens (`npl_`) work too.
|
|
49
|
+
- The tools call the backend's API with the caller's own token. That is the same system that issued the token, not a pass-through to a third party; the scopes, group limits and approvals of the token apply.
|
|
50
|
+
- `Origin`: absent (not a browser) is accepted; present it must be the portal's own origin, else `403`.
|
|
51
|
+
- `GET` and `DELETE` answer `405`; `Mcp-Session-Id` is ignored and never sent. `MCP-Protocol-Version` / `Mcp-Method` checks and the 4 MiB body limit are the SDK's. Tools that upload a local file answer that uploads only work in local mode.
|
|
52
|
+
- **Server environment:** `NODEPAL_URL` (public address = OAuth issuer, must equal the backend's `FRONTEND_URL`), `NODEPAL_INTERNAL_API` (default `http://backend:8000`), `NODEPAL_MCP_PORT` (default `8080`).
|
|
53
|
+
- The token is never logged; log lines carry a short id (the start of its SHA-256).
|
|
54
|
+
|
|
55
|
+
## Local stdio (`uvx nodepal-mcp`)
|
|
56
|
+
|
|
57
|
+
Requires Python 3.10+ or [uv](https://docs.astral.sh/uv/) (`uvx` downloads and runs `nodepal-mcp` in an isolated environment).
|
|
58
|
+
|
|
59
|
+
### Create an API token
|
|
60
|
+
|
|
61
|
+
1. Sign in at <https://nodepal.net> and open **Account > API & agents** (`/app/account/api`).
|
|
62
|
+
2. Create a token: give it a name, choose the scopes it needs (see [Safety](#safety)), the groups it may touch (or all of yours), an expiry (30 days by default), and the approval mode.
|
|
63
|
+
3. Copy the token (`npl_...`). It is shown **once**.
|
|
64
|
+
|
|
65
|
+
Configuration is by environment variables:
|
|
66
|
+
|
|
67
|
+
| Variable | Meaning |
|
|
68
|
+
|---|---|
|
|
69
|
+
| `NODEPAL_TOKEN` | Required in stdio mode. The API token. Never logged or printed by the server. |
|
|
70
|
+
| `NODEPAL_URL` | Optional. Default `https://nodepal.net` (use `http://127.0.0.1:3060` for a local stack). |
|
|
71
|
+
| `NODEPAL_MCP_TOOLSETS` | Optional. Comma-separated toolset names to limit which tools are exposed. |
|
|
72
|
+
|
|
73
|
+
### Desktop and terminal AI app configuration
|
|
74
|
+
|
|
75
|
+
Generic `mcpServers` JSON configuration for desktop and terminal AI apps:
|
|
76
|
+
|
|
77
|
+
```json
|
|
78
|
+
{
|
|
79
|
+
"mcpServers": {
|
|
80
|
+
"nodepal": {
|
|
81
|
+
"command": "uvx",
|
|
82
|
+
"args": ["nodepal-mcp"],
|
|
83
|
+
"env": {
|
|
84
|
+
"NODEPAL_TOKEN": "npl_xxx"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
If you installed the package directly with `pip install nodepal-mcp`, use `"command": "nodepal-mcp"` with no `"args"`.
|
|
92
|
+
|
|
93
|
+
### One-click desktop bundle (`.mcpb`)
|
|
94
|
+
|
|
95
|
+
The `.mcpb` desktop bundle wraps `uvx nodepal-mcp` and asks securely for your `NODEPAL_TOKEN` during setup. Using the bundle requires [`uv`](https://docs.astral.sh/uv/) to be installed on your computer so `uvx` is available on your `PATH`.
|
|
96
|
+
|
|
97
|
+
## Tools
|
|
98
|
+
|
|
99
|
+
Everything a person does with their groups in the portal has a tool, grouped by domain in `src/nodepal_mcp/tools/`: `account`, `groups`, `members`, `nodes`, `servers`, `fit`, `console`, `diagnostics`, `backups`, `worlds`, `content`, `modpacks`, `storage`, and `configs`. Names are `verb_object` (`list_servers`, `create_world_from_modpack`, `set_node_p2p`, ...). Each tool says in its description what needs a scope or an approval: `read` < `control` (power, backups, console) < `manage` (create/change) < `destructive` (deletes, restores, roles, ownership: `approval_id` flow).
|
|
100
|
+
|
|
101
|
+
**Local uploads:** `upload_modpack`, `upload_custom_content`, `import_world_archive`, `set_group_icon`, and `set_server_icon` take a **local file path** and **only work locally** in the stdio server running on your PC (they are disabled on the remote `https://nodepal.net/mcp` endpoint).
|
|
102
|
+
|
|
103
|
+
What an agent never gets: sign-in, account and API-token management, admin, node secrets and storage credentials (session only); tokens or links in answers; secret-looking values of config files (shown as `***`).
|
|
104
|
+
|
|
105
|
+
Resources are reported as `"unknown"` when a PC's daemon has not reported them; nothing is invented. `estimate_fit` compares a modpack's (estimated) needs with a node's free RAM and disk and answers `fits`, `tight`, `does_not_fit`, or `unknown`, with reasons.
|
|
106
|
+
|
|
107
|
+
### Diagnosis
|
|
108
|
+
|
|
109
|
+
- `diagnose_server`: one call with the last failed start and its suggested actions, health warnings, the jar inventory (approved on the node, on disk), conflicts, Java required vs configured, and the node/daemon state. Unknown values are `null`.
|
|
110
|
+
- `console_tail`: takes `level` (`all|warn|error`; a stack trace stays with its error), `since` (`start` = the output of the last start; `since_start_known: false` when the portal did not see it begin), and `grep` (literal text, up to 100 characters).
|
|
111
|
+
- `check_instance`: returns the "Check this instance" result your own NodePal Companion reported for a server (file names, mod ids, versions only; never folders), or says how to generate it.
|
|
112
|
+
- Prompts (recipes) list the tools in order and when to ask you: `diagnose_server_that_does_not_start`, `add_mods_safely`, `create_world_from_modpack_with_seed`, `move_world_to_another_node`, `recover_from_bad_backup`.
|
|
113
|
+
|
|
114
|
+
Developer setup and API reference: <https://nodepal.net/developers>.
|
|
115
|
+
|
|
116
|
+
### Toolsets (fewer tools, less context)
|
|
117
|
+
|
|
118
|
+
Exposing every tool uses a lot of model context. You can limit them to the domains you need; the names match the modules under `src/nodepal_mcp/tools/`: `account`, `groups`, `members`, `nodes`, `servers`, `fit`, `console`, `diagnostics`, `backups`, `worlds`, `content`, `modpacks`, `storage`, `configs`. Default: all.
|
|
119
|
+
|
|
120
|
+
- **stdio:** `NODEPAL_MCP_TOOLSETS=servers,console,diagnostics` in the server's environment (unknown names are an error).
|
|
121
|
+
- **remote:** `https://nodepal.net/mcp?toolsets=servers,console,diagnostics` (unknown names return `400`).
|
|
122
|
+
|
|
123
|
+
Prompts are not affected.
|
|
124
|
+
|
|
125
|
+
## Safety
|
|
126
|
+
|
|
127
|
+
- **Scopes:** `read` (all reads), `control` (start/stop/restart, backups), `manage` (create/change servers, worlds, content), `destructive` (deletes, restores). Give the agent only what it needs; a read-only token is a fine start.
|
|
128
|
+
- **Approval modes** for destructive actions: in **confirm** mode (default) the portal does *not* execute them; it answers "approval required" with a link. The tool tells the agent to ask you, you approve in the portal, and the agent repeats the call with the `approval_id` (works once, for exactly that request, for 15 minutes). In **free** mode they run immediately: only enable it for tokens and agents you fully trust.
|
|
129
|
+
- Revoke a token or disconnect an OAuth app at any time in the portal (`/app/account/api`); tokens expire on their own (max 1 year).
|
|
130
|
+
- The token is a secret like a password: keep it out of repositories and chats.
|
|
131
|
+
- Account security (password, 2FA, sessions, tokens themselves) can never be reached with a token.
|
|
132
|
+
|
|
133
|
+
## Development
|
|
134
|
+
|
|
135
|
+
The host has no Python toolchain; everything runs in Docker. From this `mcp/` folder (Git Bash):
|
|
136
|
+
|
|
137
|
+
```sh
|
|
138
|
+
MSYS_NO_PATHCONV=1 docker build -q --target test -t nodepal-mcp-test .
|
|
139
|
+
MSYS_NO_PATHCONV=1 docker run --rm -v "$(pwd -W):/app" -w /app nodepal-mcp-test sh -c "python -m pytest -q && ruff check ."
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
To build the PyPI artifacts and `.mcpb` bundle inside Docker:
|
|
143
|
+
|
|
144
|
+
```sh
|
|
145
|
+
sh scripts/build-bundle.sh
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
mcp-name: net.nodepal/nodepal-mcp
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# nodepal-mcp
|
|
2
|
+
|
|
3
|
+
An [MCP](https://modelcontextprotocol.io) server that lets AI agents manage your NodePal Minecraft servers through the portal API: check the PCs hosting servers, find a modpack, check it fits, create the server, start it, add mods, and back it up.
|
|
4
|
+
|
|
5
|
+
You can connect in two ways:
|
|
6
|
+
|
|
7
|
+
1. **Remote endpoint (OAuth)** — `https://nodepal.net/mcp` for AI apps with remote connectors (no API token to paste).
|
|
8
|
+
2. **Local stdio (`uvx nodepal-mcp`)** — runs on your PC for desktop and terminal AI apps, using a personal API token (`NODEPAL_TOKEN`). Also supports local file uploads.
|
|
9
|
+
|
|
10
|
+
## Remote endpoint (`https://nodepal.net/mcp`)
|
|
11
|
+
|
|
12
|
+
For AI apps that connect to remote MCP servers by URL:
|
|
13
|
+
|
|
14
|
+
- **URL:** `https://nodepal.net/mcp`
|
|
15
|
+
- **Auth:** OAuth — sign in with your NodePal account when the AI app asks. There is no API token to copy or paste.
|
|
16
|
+
- **Toolsets:** Append `?toolsets=...` to narrow the exposed tools (see [Toolsets](#toolsets-fewer-tools-less-context)).
|
|
17
|
+
|
|
18
|
+
The remote endpoint exposes the same tools over MCP Streamable HTTP (spec 2026-07-28), stateless, with JSON responses. It runs as its own container (`nodepal-mcp --http` or `NODEPAL_MCP_MODE=http`; Docker target `runner`; port 8080 inside the stack, reached only through the portal's nginx at `/mcp`).
|
|
19
|
+
|
|
20
|
+
- **Auth details:** `Authorization: Bearer` on every request. Missing or invalid returns `401` with `WWW-Authenticate: Bearer resource_metadata=".../.well-known/oauth-protected-resource/mcp"`. The token is checked against the backend (`GET <NODEPAL_INTERNAL_API>/api/oauth/token-info`, cached up to 30 s by token hash); an OAuth token issued for another resource is refused. Personal API tokens (`npl_`) work too.
|
|
21
|
+
- The tools call the backend's API with the caller's own token. That is the same system that issued the token, not a pass-through to a third party; the scopes, group limits and approvals of the token apply.
|
|
22
|
+
- `Origin`: absent (not a browser) is accepted; present it must be the portal's own origin, else `403`.
|
|
23
|
+
- `GET` and `DELETE` answer `405`; `Mcp-Session-Id` is ignored and never sent. `MCP-Protocol-Version` / `Mcp-Method` checks and the 4 MiB body limit are the SDK's. Tools that upload a local file answer that uploads only work in local mode.
|
|
24
|
+
- **Server environment:** `NODEPAL_URL` (public address = OAuth issuer, must equal the backend's `FRONTEND_URL`), `NODEPAL_INTERNAL_API` (default `http://backend:8000`), `NODEPAL_MCP_PORT` (default `8080`).
|
|
25
|
+
- The token is never logged; log lines carry a short id (the start of its SHA-256).
|
|
26
|
+
|
|
27
|
+
## Local stdio (`uvx nodepal-mcp`)
|
|
28
|
+
|
|
29
|
+
Requires Python 3.10+ or [uv](https://docs.astral.sh/uv/) (`uvx` downloads and runs `nodepal-mcp` in an isolated environment).
|
|
30
|
+
|
|
31
|
+
### Create an API token
|
|
32
|
+
|
|
33
|
+
1. Sign in at <https://nodepal.net> and open **Account > API & agents** (`/app/account/api`).
|
|
34
|
+
2. Create a token: give it a name, choose the scopes it needs (see [Safety](#safety)), the groups it may touch (or all of yours), an expiry (30 days by default), and the approval mode.
|
|
35
|
+
3. Copy the token (`npl_...`). It is shown **once**.
|
|
36
|
+
|
|
37
|
+
Configuration is by environment variables:
|
|
38
|
+
|
|
39
|
+
| Variable | Meaning |
|
|
40
|
+
|---|---|
|
|
41
|
+
| `NODEPAL_TOKEN` | Required in stdio mode. The API token. Never logged or printed by the server. |
|
|
42
|
+
| `NODEPAL_URL` | Optional. Default `https://nodepal.net` (use `http://127.0.0.1:3060` for a local stack). |
|
|
43
|
+
| `NODEPAL_MCP_TOOLSETS` | Optional. Comma-separated toolset names to limit which tools are exposed. |
|
|
44
|
+
|
|
45
|
+
### Desktop and terminal AI app configuration
|
|
46
|
+
|
|
47
|
+
Generic `mcpServers` JSON configuration for desktop and terminal AI apps:
|
|
48
|
+
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"mcpServers": {
|
|
52
|
+
"nodepal": {
|
|
53
|
+
"command": "uvx",
|
|
54
|
+
"args": ["nodepal-mcp"],
|
|
55
|
+
"env": {
|
|
56
|
+
"NODEPAL_TOKEN": "npl_xxx"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
If you installed the package directly with `pip install nodepal-mcp`, use `"command": "nodepal-mcp"` with no `"args"`.
|
|
64
|
+
|
|
65
|
+
### One-click desktop bundle (`.mcpb`)
|
|
66
|
+
|
|
67
|
+
The `.mcpb` desktop bundle wraps `uvx nodepal-mcp` and asks securely for your `NODEPAL_TOKEN` during setup. Using the bundle requires [`uv`](https://docs.astral.sh/uv/) to be installed on your computer so `uvx` is available on your `PATH`.
|
|
68
|
+
|
|
69
|
+
## Tools
|
|
70
|
+
|
|
71
|
+
Everything a person does with their groups in the portal has a tool, grouped by domain in `src/nodepal_mcp/tools/`: `account`, `groups`, `members`, `nodes`, `servers`, `fit`, `console`, `diagnostics`, `backups`, `worlds`, `content`, `modpacks`, `storage`, and `configs`. Names are `verb_object` (`list_servers`, `create_world_from_modpack`, `set_node_p2p`, ...). Each tool says in its description what needs a scope or an approval: `read` < `control` (power, backups, console) < `manage` (create/change) < `destructive` (deletes, restores, roles, ownership: `approval_id` flow).
|
|
72
|
+
|
|
73
|
+
**Local uploads:** `upload_modpack`, `upload_custom_content`, `import_world_archive`, `set_group_icon`, and `set_server_icon` take a **local file path** and **only work locally** in the stdio server running on your PC (they are disabled on the remote `https://nodepal.net/mcp` endpoint).
|
|
74
|
+
|
|
75
|
+
What an agent never gets: sign-in, account and API-token management, admin, node secrets and storage credentials (session only); tokens or links in answers; secret-looking values of config files (shown as `***`).
|
|
76
|
+
|
|
77
|
+
Resources are reported as `"unknown"` when a PC's daemon has not reported them; nothing is invented. `estimate_fit` compares a modpack's (estimated) needs with a node's free RAM and disk and answers `fits`, `tight`, `does_not_fit`, or `unknown`, with reasons.
|
|
78
|
+
|
|
79
|
+
### Diagnosis
|
|
80
|
+
|
|
81
|
+
- `diagnose_server`: one call with the last failed start and its suggested actions, health warnings, the jar inventory (approved on the node, on disk), conflicts, Java required vs configured, and the node/daemon state. Unknown values are `null`.
|
|
82
|
+
- `console_tail`: takes `level` (`all|warn|error`; a stack trace stays with its error), `since` (`start` = the output of the last start; `since_start_known: false` when the portal did not see it begin), and `grep` (literal text, up to 100 characters).
|
|
83
|
+
- `check_instance`: returns the "Check this instance" result your own NodePal Companion reported for a server (file names, mod ids, versions only; never folders), or says how to generate it.
|
|
84
|
+
- Prompts (recipes) list the tools in order and when to ask you: `diagnose_server_that_does_not_start`, `add_mods_safely`, `create_world_from_modpack_with_seed`, `move_world_to_another_node`, `recover_from_bad_backup`.
|
|
85
|
+
|
|
86
|
+
Developer setup and API reference: <https://nodepal.net/developers>.
|
|
87
|
+
|
|
88
|
+
### Toolsets (fewer tools, less context)
|
|
89
|
+
|
|
90
|
+
Exposing every tool uses a lot of model context. You can limit them to the domains you need; the names match the modules under `src/nodepal_mcp/tools/`: `account`, `groups`, `members`, `nodes`, `servers`, `fit`, `console`, `diagnostics`, `backups`, `worlds`, `content`, `modpacks`, `storage`, `configs`. Default: all.
|
|
91
|
+
|
|
92
|
+
- **stdio:** `NODEPAL_MCP_TOOLSETS=servers,console,diagnostics` in the server's environment (unknown names are an error).
|
|
93
|
+
- **remote:** `https://nodepal.net/mcp?toolsets=servers,console,diagnostics` (unknown names return `400`).
|
|
94
|
+
|
|
95
|
+
Prompts are not affected.
|
|
96
|
+
|
|
97
|
+
## Safety
|
|
98
|
+
|
|
99
|
+
- **Scopes:** `read` (all reads), `control` (start/stop/restart, backups), `manage` (create/change servers, worlds, content), `destructive` (deletes, restores). Give the agent only what it needs; a read-only token is a fine start.
|
|
100
|
+
- **Approval modes** for destructive actions: in **confirm** mode (default) the portal does *not* execute them; it answers "approval required" with a link. The tool tells the agent to ask you, you approve in the portal, and the agent repeats the call with the `approval_id` (works once, for exactly that request, for 15 minutes). In **free** mode they run immediately: only enable it for tokens and agents you fully trust.
|
|
101
|
+
- Revoke a token or disconnect an OAuth app at any time in the portal (`/app/account/api`); tokens expire on their own (max 1 year).
|
|
102
|
+
- The token is a secret like a password: keep it out of repositories and chats.
|
|
103
|
+
- Account security (password, 2FA, sessions, tokens themselves) can never be reached with a token.
|
|
104
|
+
|
|
105
|
+
## Development
|
|
106
|
+
|
|
107
|
+
The host has no Python toolchain; everything runs in Docker. From this `mcp/` folder (Git Bash):
|
|
108
|
+
|
|
109
|
+
```sh
|
|
110
|
+
MSYS_NO_PATHCONV=1 docker build -q --target test -t nodepal-mcp-test .
|
|
111
|
+
MSYS_NO_PATHCONV=1 docker run --rm -v "$(pwd -W):/app" -w /app nodepal-mcp-test sh -c "python -m pytest -q && ruff check ."
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
To build the PyPI artifacts and `.mcpb` bundle inside Docker:
|
|
115
|
+
|
|
116
|
+
```sh
|
|
117
|
+
sh scripts/build-bundle.sh
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
mcp-name: net.nodepal/nodepal-mcp
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"manifest_version": "0.3",
|
|
3
|
+
"name": "nodepal-mcp",
|
|
4
|
+
"display_name": "NodePal",
|
|
5
|
+
"version": "0.2.0",
|
|
6
|
+
"description": "Manage NodePal Minecraft servers, worlds, mods, backups and console from AI agents.",
|
|
7
|
+
"author": {
|
|
8
|
+
"name": "NodePal",
|
|
9
|
+
"url": "https://nodepal.net"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://nodepal.net",
|
|
12
|
+
"license": "Apache-2.0",
|
|
13
|
+
"documentation": "https://nodepal.net/developers",
|
|
14
|
+
"server": {
|
|
15
|
+
"type": "python",
|
|
16
|
+
"entry_point": "server/main.py",
|
|
17
|
+
"mcp_config": {
|
|
18
|
+
"command": "uvx",
|
|
19
|
+
"args": [
|
|
20
|
+
"nodepal-mcp"
|
|
21
|
+
],
|
|
22
|
+
"env": {
|
|
23
|
+
"NODEPAL_TOKEN": "${user_config.nodepal_token}"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"user_config": {
|
|
28
|
+
"nodepal_token": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"title": "NodePal API Token",
|
|
31
|
+
"description": "Personal API token created at https://nodepal.net/app/account/api (starts with npl_).",
|
|
32
|
+
"sensitive": true,
|
|
33
|
+
"required": true
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"""Bundle entry point: the host starts the server through `mcp_config` (`uvx nodepal-mcp`), which installs and
|
|
2
|
+
runs the published package; this file only satisfies the manifest and does the same when run directly."""
|
|
3
|
+
|
|
4
|
+
import os
|
|
5
|
+
import sys
|
|
6
|
+
|
|
7
|
+
os.execvp("uvx", ["uvx", "nodepal-mcp", *sys.argv[1:]])
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "nodepal-mcp"
|
|
7
|
+
version = "0.2.0"
|
|
8
|
+
description = "MCP server that lets AI agents manage NodePal Minecraft servers through the portal API"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "Apache-2.0"
|
|
11
|
+
license-files = ["LICENSE"]
|
|
12
|
+
requires-python = ">=3.10"
|
|
13
|
+
keywords = ["mcp", "model-context-protocol", "minecraft", "nodepal", "ai-agents"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 4 - Beta",
|
|
16
|
+
"Intended Audience :: Developers",
|
|
17
|
+
"Intended Audience :: End Users/Desktop",
|
|
18
|
+
"Operating System :: OS Independent",
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"Programming Language :: Python :: 3.10",
|
|
21
|
+
"Programming Language :: Python :: 3.11",
|
|
22
|
+
"Programming Language :: Python :: 3.12",
|
|
23
|
+
"Programming Language :: Python :: 3.13",
|
|
24
|
+
"Topic :: Games/Entertainment",
|
|
25
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
26
|
+
]
|
|
27
|
+
dependencies = [
|
|
28
|
+
"mcp>=2.3,<3",
|
|
29
|
+
"httpx>=0.27",
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
[project.urls]
|
|
33
|
+
Homepage = "https://nodepal.net"
|
|
34
|
+
Documentation = "https://nodepal.net/developers"
|
|
35
|
+
|
|
36
|
+
[project.optional-dependencies]
|
|
37
|
+
dev = [
|
|
38
|
+
"pytest>=8",
|
|
39
|
+
"ruff>=0.6",
|
|
40
|
+
]
|
|
41
|
+
|
|
42
|
+
[project.scripts]
|
|
43
|
+
nodepal-mcp = "nodepal_mcp.server:main"
|
|
44
|
+
|
|
45
|
+
[tool.hatch.build.targets.wheel]
|
|
46
|
+
packages = ["src/nodepal_mcp"]
|
|
47
|
+
|
|
48
|
+
[tool.pytest.ini_options]
|
|
49
|
+
testpaths = ["tests"]
|
|
50
|
+
pythonpath = ["src"]
|
|
51
|
+
filterwarnings = ["error"]
|
|
52
|
+
|
|
53
|
+
[tool.ruff]
|
|
54
|
+
line-length = 100
|
|
55
|
+
target-version = "py310"
|
|
56
|
+
|
|
57
|
+
[tool.ruff.lint]
|
|
58
|
+
select = ["E", "W", "F", "I", "B", "C4", "UP"]
|
|
59
|
+
ignore = ["E501"]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# Build PyPI distributions (sdist + wheel) and validate/pack the .mcpb desktop bundle inside Docker.
|
|
3
|
+
set -eu
|
|
4
|
+
cd "$(dirname "$0")/.."
|
|
5
|
+
export MSYS_NO_PATHCONV=1
|
|
6
|
+
mcp_dir=$(pwd -W 2>/dev/null || pwd)
|
|
7
|
+
|
|
8
|
+
rm -rf dist
|
|
9
|
+
mkdir -p dist
|
|
10
|
+
|
|
11
|
+
docker run --rm -v "$mcp_dir:/work" -w /work python:3.12-slim sh -c \
|
|
12
|
+
"pip install --no-cache-dir -q build twine && python -m build && python -m twine check dist/*"
|
|
13
|
+
|
|
14
|
+
docker run --rm -v "$mcp_dir:/work" -w /work/bundle -e NPM_CONFIG_UPDATE_NOTIFIER=false node:22 sh -c \
|
|
15
|
+
"npx -y @anthropic-ai/mcpb validate manifest.json && npx -y @anthropic-ai/mcpb pack . /work/dist/nodepal-mcp.mcpb"
|