computenexa-mcp 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.
- computenexa_mcp-0.1.0/.github/workflows/publish.yml +45 -0
- computenexa_mcp-0.1.0/.github/workflows/test.yml +17 -0
- computenexa_mcp-0.1.0/.gitignore +7 -0
- computenexa_mcp-0.1.0/CHANGELOG.md +12 -0
- computenexa_mcp-0.1.0/LICENSE +21 -0
- computenexa_mcp-0.1.0/PKG-INFO +145 -0
- computenexa_mcp-0.1.0/README.md +120 -0
- computenexa_mcp-0.1.0/SECURITY.md +29 -0
- computenexa_mcp-0.1.0/docs/help-page.md +93 -0
- computenexa_mcp-0.1.0/pyproject.toml +46 -0
- computenexa_mcp-0.1.0/server.json +37 -0
- computenexa_mcp-0.1.0/src/computenexa_mcp/__init__.py +11 -0
- computenexa_mcp-0.1.0/src/computenexa_mcp/__main__.py +3 -0
- computenexa_mcp-0.1.0/src/computenexa_mcp/_text.py +81 -0
- computenexa_mcp-0.1.0/src/computenexa_mcp/_version.py +1 -0
- computenexa_mcp-0.1.0/src/computenexa_mcp/models.py +202 -0
- computenexa_mcp-0.1.0/src/computenexa_mcp/py.typed +0 -0
- computenexa_mcp-0.1.0/src/computenexa_mcp/server.py +673 -0
- computenexa_mcp-0.1.0/tests/__init__.py +0 -0
- computenexa_mcp-0.1.0/tests/conftest.py +172 -0
- computenexa_mcp-0.1.0/tests/test_server.py +257 -0
- computenexa_mcp-0.1.0/tests/test_stdio.py +40 -0
- computenexa_mcp-0.1.0/uv.lock +1316 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Publishes to PyPI when a GitHub release is published (tag v<version>, matching pyproject.toml and server.json).
|
|
2
|
+
# Uses PyPI trusted publishing: no password or token is stored anywhere. One-time setup on pypi.org
|
|
3
|
+
# (account support@computenexa.com): add a trusted publisher for this repo, workflow publish.yml, environment pypi.
|
|
4
|
+
# Then lists the release in the official MCP Registry, signed in with this repository's GitHub OIDC identity
|
|
5
|
+
# (namespace io.github.computenexa-gpuInfrastructure); the registry checks the mcp-name line in README.md on PyPI.
|
|
6
|
+
name: publish
|
|
7
|
+
on:
|
|
8
|
+
release:
|
|
9
|
+
types: [published]
|
|
10
|
+
jobs:
|
|
11
|
+
publish:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
environment: pypi
|
|
14
|
+
permissions:
|
|
15
|
+
id-token: write
|
|
16
|
+
contents: read
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
- uses: astral-sh/setup-uv@v5
|
|
20
|
+
- name: The tag matches the package and server.json versions
|
|
21
|
+
run: |
|
|
22
|
+
version="$(grep -m1 '^version' pyproject.toml | cut -d'"' -f2)"
|
|
23
|
+
test "${GITHUB_REF_NAME#v}" = "$version"
|
|
24
|
+
test "$(jq -r .version server.json)" = "$version"
|
|
25
|
+
test "$(jq -r '.packages[0].version' server.json)" = "$version"
|
|
26
|
+
- run: uv sync && uv run ruff check src tests && uv run pytest -q
|
|
27
|
+
- run: uv build
|
|
28
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
29
|
+
- uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2
|
|
30
|
+
- name: List it in the MCP Registry
|
|
31
|
+
env:
|
|
32
|
+
MCP_PUBLISHER_VERSION: v1.8.1
|
|
33
|
+
run: |
|
|
34
|
+
base_url="https://github.com/modelcontextprotocol/registry/releases/download/${MCP_PUBLISHER_VERSION}"
|
|
35
|
+
archive="mcp-publisher_linux_amd64.tar.gz"
|
|
36
|
+
curl --fail --location --silent --show-error --output "$archive" "$base_url/$archive"
|
|
37
|
+
curl --fail --location --silent --show-error --output "$archive.sigstore.json" "$base_url/$archive.sigstore.json"
|
|
38
|
+
cosign verify-blob --bundle "$archive.sigstore.json" \
|
|
39
|
+
--certificate-identity "https://github.com/modelcontextprotocol/registry/.github/workflows/release.yml@refs/tags/${MCP_PUBLISHER_VERSION}" \
|
|
40
|
+
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" "$archive"
|
|
41
|
+
tar xzf "$archive" mcp-publisher
|
|
42
|
+
# PyPI can take a minute to serve a new release; the registry reads its README from there.
|
|
43
|
+
for i in 1 2 3 4 5 6; do curl -fsS "https://pypi.org/pypi/computenexa-mcp/${GITHUB_REF_NAME#v}/json" >/dev/null && break; sleep 20; done
|
|
44
|
+
./mcp-publisher login github-oidc
|
|
45
|
+
./mcp-publisher publish
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
name: test
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches: [main]
|
|
5
|
+
pull_request:
|
|
6
|
+
jobs:
|
|
7
|
+
test:
|
|
8
|
+
runs-on: ubuntu-latest
|
|
9
|
+
strategy:
|
|
10
|
+
matrix:
|
|
11
|
+
python: ["3.10", "3.11", "3.12", "3.13"]
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
- uses: astral-sh/setup-uv@v5
|
|
15
|
+
- run: uv sync --python ${{ matrix.python }}
|
|
16
|
+
- run: uv run ruff check src tests
|
|
17
|
+
- run: uv run pytest -q
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
- First release: a stdio MCP server named "ComputeNexa" on the `computenexa` SDK (0.3.0+).
|
|
6
|
+
- Read tools: `whoami`, `list_gpus`, `list_apps`, `list_machines`, `get_machine`, `get_usage`, `list_receipts`,
|
|
7
|
+
`list_projects`, `list_endpoints`.
|
|
8
|
+
- Tools that spend or change (launch-and-stop keys only): `launch_machine`, `extend_machine`, `set_keep_running`,
|
|
9
|
+
`stop_machine`, `create_endpoint`, `get_endpoint_key`.
|
|
10
|
+
- Quote, then confirm with the quoted total, for everything that costs money; a per-call limit
|
|
11
|
+
(`CNX_MCP_MAX_LAUNCH_USD`, default $25); structured results with output schemas; read-only keys see only the read
|
|
12
|
+
tools.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ComputeNexa
|
|
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,145 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: computenexa-mcp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: MCP server for ComputeNexa: let your AI assistant find, launch and stop private GPUs.
|
|
5
|
+
Project-URL: Homepage, https://computenexa.com
|
|
6
|
+
Project-URL: Documentation, https://app.computenexa.com/help/mcp
|
|
7
|
+
Project-URL: Source, https://github.com/computenexa-gpuInfrastructure/computenexa-mcp
|
|
8
|
+
Project-URL: Support, https://app.computenexa.com/help
|
|
9
|
+
Author-email: ComputeNexa <support@computenexa.com>
|
|
10
|
+
Maintainer-email: ComputeNexa <support@computenexa.com>
|
|
11
|
+
License-Expression: MIT
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Keywords: ai agents,claude,cloud,computenexa,cursor,gpu,mcp,model context protocol
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
19
|
+
Classifier: Typing :: Typed
|
|
20
|
+
Requires-Python: >=3.10
|
|
21
|
+
Requires-Dist: computenexa<1,>=0.3.0
|
|
22
|
+
Requires-Dist: mcp<3,>=2.3
|
|
23
|
+
Requires-Dist: pydantic<3,>=2.12
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
|
|
26
|
+
# ComputeNexa MCP server
|
|
27
|
+
|
|
28
|
+
<!-- mcp-name: io.github.computenexa-gpuInfrastructure/computenexa-mcp -->
|
|
29
|
+
|
|
30
|
+
Let your AI assistant find, launch and stop private GPUs on [ComputeNexa](https://computenexa.com). Ask it
|
|
31
|
+
*"Which GPUs with 48 GB or more are in stock?"*, *"Launch the cheapest one with Data Science for two hours"* or
|
|
32
|
+
*"Stop it"*: it uses your team's API key, shows you what each launch costs, and only spends money after you agree.
|
|
33
|
+
|
|
34
|
+
Works with Claude Desktop, Claude Code, Cursor, VS Code and other assistants that support the
|
|
35
|
+
[Model Context Protocol](https://modelcontextprotocol.io). It runs on your computer and talks to the ComputeNexa API;
|
|
36
|
+
your key stays in your own settings.
|
|
37
|
+
|
|
38
|
+
## Set up
|
|
39
|
+
|
|
40
|
+
1. In the ComputeNexa dashboard, open **API keys** and create a key:
|
|
41
|
+
- **Look only** to browse GPUs, machines and spending;
|
|
42
|
+
- **Launch and stop** to also launch, extend and stop machines.
|
|
43
|
+
2. Install [uv](https://docs.astral.sh/uv/) (it runs the server with `uvx`, no separate install needed).
|
|
44
|
+
3. Add the server to your assistant (below), with your key as `CNX_API_KEY`.
|
|
45
|
+
|
|
46
|
+
### Claude Code
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
claude mcp add --env CNX_API_KEY=cnxk_... --transport stdio computenexa -- uvx computenexa-mcp
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Add `--scope user` to use it in every project.
|
|
53
|
+
|
|
54
|
+
### Claude Desktop
|
|
55
|
+
|
|
56
|
+
Settings → Developer → Edit config (`claude_desktop_config.json`):
|
|
57
|
+
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"mcpServers": {
|
|
61
|
+
"computenexa": {
|
|
62
|
+
"command": "uvx",
|
|
63
|
+
"args": ["computenexa-mcp"],
|
|
64
|
+
"env": { "CNX_API_KEY": "cnxk_..." }
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Cursor
|
|
71
|
+
|
|
72
|
+
`~/.cursor/mcp.json` (every project) or `.cursor/mcp.json` (one project): the same `mcpServers` entry as Claude
|
|
73
|
+
Desktop.
|
|
74
|
+
|
|
75
|
+
### VS Code
|
|
76
|
+
|
|
77
|
+
`.vscode/mcp.json`; VS Code asks for the key once and keeps it out of the file:
|
|
78
|
+
|
|
79
|
+
```json
|
|
80
|
+
{
|
|
81
|
+
"inputs": [
|
|
82
|
+
{ "type": "promptString", "id": "cnx-key", "description": "ComputeNexa API key", "password": true }
|
|
83
|
+
],
|
|
84
|
+
"servers": {
|
|
85
|
+
"computenexa": {
|
|
86
|
+
"type": "stdio",
|
|
87
|
+
"command": "uvx",
|
|
88
|
+
"args": ["computenexa-mcp"],
|
|
89
|
+
"env": { "CNX_API_KEY": "${input:cnx-key}" }
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## What it can do
|
|
96
|
+
|
|
97
|
+
| Tool | What it does | Key |
|
|
98
|
+
|---|---|---|
|
|
99
|
+
| `whoami` | Your email, team, balance, GPU limit and the key's permissions | any |
|
|
100
|
+
| `list_gpus` | GPUs with live prices and stock, cheapest first; filter by app, region, memory | any |
|
|
101
|
+
| `list_apps` | The apps a GPU starts with, their models, and what's installed | any |
|
|
102
|
+
| `list_machines` · `get_machine` | Your machines; how to connect (SSH, browser apps, API or endpoint address) | any |
|
|
103
|
+
| `get_usage` · `list_receipts` | Spending and GPU-hours; finished sessions and their cost | any |
|
|
104
|
+
| `list_projects` · `list_endpoints` | Saved projects; Endpoints and the machine each points at | any |
|
|
105
|
+
| `launch_machine` | Launch a GPU (quote first, then launch when you agree) | launch and stop |
|
|
106
|
+
| `extend_machine` | Add time (quote first) | launch and stop |
|
|
107
|
+
| `set_keep_running` | Renew a machine automatically until stopped (quote first) | launch and stop |
|
|
108
|
+
| `stop_machine` | End a machine now; unused time is refunded | launch and stop |
|
|
109
|
+
| `create_endpoint` · `get_endpoint_key` | A stable HTTPS address for your own server; its key | launch and stop |
|
|
110
|
+
|
|
111
|
+
A look-only key only gets the read tools (the first six rows).
|
|
112
|
+
|
|
113
|
+
## Safety
|
|
114
|
+
|
|
115
|
+
- **Nothing is charged without you.** `launch_machine`, `extend_machine` and `set_keep_running` first return a quote,
|
|
116
|
+
e.g. *"NVIDIA RTX A6000 with the datascience app for 2 h: $1.44 charged now ($0.72/h); unused time is refunded if
|
|
117
|
+
it stops early."* Only a second call with `confirm=true` and the quoted total goes ahead; if the price went up in
|
|
118
|
+
between, it's refused.
|
|
119
|
+
- **A limit per call:** a launch, extension or keep-running renewal costing more than **$25** is refused. Change it
|
|
120
|
+
with `CNX_MCP_MAX_LAUNCH_USD` (in dollars) in the server's `env`. Your team's GPU limit and prepaid balance still
|
|
121
|
+
apply on top.
|
|
122
|
+
- **Your API key never appears in a tool result.** Endpoint keys are shown only when you create an endpoint or ask
|
|
123
|
+
for its key.
|
|
124
|
+
- Tools that spend money or end a machine are marked as such, so your assistant asks before using them.
|
|
125
|
+
|
|
126
|
+
## Settings
|
|
127
|
+
|
|
128
|
+
| Variable | |
|
|
129
|
+
|---|---|
|
|
130
|
+
| `CNX_API_KEY` | Required. A ComputeNexa API key (`cnxk_…`) |
|
|
131
|
+
| `CNX_MCP_MAX_LAUNCH_USD` | Most one call may spend, in US dollars. Default `25` |
|
|
132
|
+
| `CNX_API_URL` | Only for testing against another ComputeNexa API |
|
|
133
|
+
|
|
134
|
+
## Develop
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
uv sync
|
|
138
|
+
uv run pytest
|
|
139
|
+
uv run ruff check src tests
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Built on the [ComputeNexa Python SDK](https://pypi.org/project/computenexa/) and the official
|
|
143
|
+
[MCP Python SDK](https://github.com/modelcontextprotocol/python-sdk).
|
|
144
|
+
|
|
145
|
+
Questions: [support@computenexa.com](mailto:support@computenexa.com) · Security issues: see [SECURITY.md](SECURITY.md).
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# ComputeNexa MCP server
|
|
2
|
+
|
|
3
|
+
<!-- mcp-name: io.github.computenexa-gpuInfrastructure/computenexa-mcp -->
|
|
4
|
+
|
|
5
|
+
Let your AI assistant find, launch and stop private GPUs on [ComputeNexa](https://computenexa.com). Ask it
|
|
6
|
+
*"Which GPUs with 48 GB or more are in stock?"*, *"Launch the cheapest one with Data Science for two hours"* or
|
|
7
|
+
*"Stop it"*: it uses your team's API key, shows you what each launch costs, and only spends money after you agree.
|
|
8
|
+
|
|
9
|
+
Works with Claude Desktop, Claude Code, Cursor, VS Code and other assistants that support the
|
|
10
|
+
[Model Context Protocol](https://modelcontextprotocol.io). It runs on your computer and talks to the ComputeNexa API;
|
|
11
|
+
your key stays in your own settings.
|
|
12
|
+
|
|
13
|
+
## Set up
|
|
14
|
+
|
|
15
|
+
1. In the ComputeNexa dashboard, open **API keys** and create a key:
|
|
16
|
+
- **Look only** to browse GPUs, machines and spending;
|
|
17
|
+
- **Launch and stop** to also launch, extend and stop machines.
|
|
18
|
+
2. Install [uv](https://docs.astral.sh/uv/) (it runs the server with `uvx`, no separate install needed).
|
|
19
|
+
3. Add the server to your assistant (below), with your key as `CNX_API_KEY`.
|
|
20
|
+
|
|
21
|
+
### Claude Code
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
claude mcp add --env CNX_API_KEY=cnxk_... --transport stdio computenexa -- uvx computenexa-mcp
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Add `--scope user` to use it in every project.
|
|
28
|
+
|
|
29
|
+
### Claude Desktop
|
|
30
|
+
|
|
31
|
+
Settings → Developer → Edit config (`claude_desktop_config.json`):
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"mcpServers": {
|
|
36
|
+
"computenexa": {
|
|
37
|
+
"command": "uvx",
|
|
38
|
+
"args": ["computenexa-mcp"],
|
|
39
|
+
"env": { "CNX_API_KEY": "cnxk_..." }
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Cursor
|
|
46
|
+
|
|
47
|
+
`~/.cursor/mcp.json` (every project) or `.cursor/mcp.json` (one project): the same `mcpServers` entry as Claude
|
|
48
|
+
Desktop.
|
|
49
|
+
|
|
50
|
+
### VS Code
|
|
51
|
+
|
|
52
|
+
`.vscode/mcp.json`; VS Code asks for the key once and keeps it out of the file:
|
|
53
|
+
|
|
54
|
+
```json
|
|
55
|
+
{
|
|
56
|
+
"inputs": [
|
|
57
|
+
{ "type": "promptString", "id": "cnx-key", "description": "ComputeNexa API key", "password": true }
|
|
58
|
+
],
|
|
59
|
+
"servers": {
|
|
60
|
+
"computenexa": {
|
|
61
|
+
"type": "stdio",
|
|
62
|
+
"command": "uvx",
|
|
63
|
+
"args": ["computenexa-mcp"],
|
|
64
|
+
"env": { "CNX_API_KEY": "${input:cnx-key}" }
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## What it can do
|
|
71
|
+
|
|
72
|
+
| Tool | What it does | Key |
|
|
73
|
+
|---|---|---|
|
|
74
|
+
| `whoami` | Your email, team, balance, GPU limit and the key's permissions | any |
|
|
75
|
+
| `list_gpus` | GPUs with live prices and stock, cheapest first; filter by app, region, memory | any |
|
|
76
|
+
| `list_apps` | The apps a GPU starts with, their models, and what's installed | any |
|
|
77
|
+
| `list_machines` · `get_machine` | Your machines; how to connect (SSH, browser apps, API or endpoint address) | any |
|
|
78
|
+
| `get_usage` · `list_receipts` | Spending and GPU-hours; finished sessions and their cost | any |
|
|
79
|
+
| `list_projects` · `list_endpoints` | Saved projects; Endpoints and the machine each points at | any |
|
|
80
|
+
| `launch_machine` | Launch a GPU (quote first, then launch when you agree) | launch and stop |
|
|
81
|
+
| `extend_machine` | Add time (quote first) | launch and stop |
|
|
82
|
+
| `set_keep_running` | Renew a machine automatically until stopped (quote first) | launch and stop |
|
|
83
|
+
| `stop_machine` | End a machine now; unused time is refunded | launch and stop |
|
|
84
|
+
| `create_endpoint` · `get_endpoint_key` | A stable HTTPS address for your own server; its key | launch and stop |
|
|
85
|
+
|
|
86
|
+
A look-only key only gets the read tools (the first six rows).
|
|
87
|
+
|
|
88
|
+
## Safety
|
|
89
|
+
|
|
90
|
+
- **Nothing is charged without you.** `launch_machine`, `extend_machine` and `set_keep_running` first return a quote,
|
|
91
|
+
e.g. *"NVIDIA RTX A6000 with the datascience app for 2 h: $1.44 charged now ($0.72/h); unused time is refunded if
|
|
92
|
+
it stops early."* Only a second call with `confirm=true` and the quoted total goes ahead; if the price went up in
|
|
93
|
+
between, it's refused.
|
|
94
|
+
- **A limit per call:** a launch, extension or keep-running renewal costing more than **$25** is refused. Change it
|
|
95
|
+
with `CNX_MCP_MAX_LAUNCH_USD` (in dollars) in the server's `env`. Your team's GPU limit and prepaid balance still
|
|
96
|
+
apply on top.
|
|
97
|
+
- **Your API key never appears in a tool result.** Endpoint keys are shown only when you create an endpoint or ask
|
|
98
|
+
for its key.
|
|
99
|
+
- Tools that spend money or end a machine are marked as such, so your assistant asks before using them.
|
|
100
|
+
|
|
101
|
+
## Settings
|
|
102
|
+
|
|
103
|
+
| Variable | |
|
|
104
|
+
|---|---|
|
|
105
|
+
| `CNX_API_KEY` | Required. A ComputeNexa API key (`cnxk_…`) |
|
|
106
|
+
| `CNX_MCP_MAX_LAUNCH_USD` | Most one call may spend, in US dollars. Default `25` |
|
|
107
|
+
| `CNX_API_URL` | Only for testing against another ComputeNexa API |
|
|
108
|
+
|
|
109
|
+
## Develop
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
uv sync
|
|
113
|
+
uv run pytest
|
|
114
|
+
uv run ruff check src tests
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Built on the [ComputeNexa Python SDK](https://pypi.org/project/computenexa/) and the official
|
|
118
|
+
[MCP Python SDK](https://github.com/modelcontextprotocol/python-sdk).
|
|
119
|
+
|
|
120
|
+
Questions: [support@computenexa.com](mailto:support@computenexa.com) · Security issues: see [SECURITY.md](SECURITY.md).
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Security policy
|
|
2
|
+
|
|
3
|
+
## Reporting a vulnerability
|
|
4
|
+
|
|
5
|
+
Please report security issues privately to **support@computenexa.com**, with "Security" in the subject.
|
|
6
|
+
Don't open a public GitHub issue for a security problem.
|
|
7
|
+
|
|
8
|
+
Include what you found, how to reproduce it, and what an attacker could do with it. We aim to acknowledge reports
|
|
9
|
+
within 3 business days and will keep you updated until it's resolved. We're grateful for responsible disclosure
|
|
10
|
+
and are happy to credit you once a fix is released, if you'd like.
|
|
11
|
+
|
|
12
|
+
This covers this MCP server (the `computenexa-mcp` package) and the ComputeNexa API it talks to
|
|
13
|
+
(`https://api.computenexa.com`).
|
|
14
|
+
|
|
15
|
+
## Supported versions
|
|
16
|
+
|
|
17
|
+
Security fixes go into the latest release. `uvx computenexa-mcp` runs the latest one; to refresh a cached copy:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
uvx --refresh computenexa-mcp --version
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Keys and assistants
|
|
24
|
+
|
|
25
|
+
- Give an assistant the least it needs: a **Look only** API key unless it should launch and stop machines.
|
|
26
|
+
- The server never puts its API key in a tool result, and refuses any single launch, extension or renewal above
|
|
27
|
+
`CNX_MCP_MAX_LAUNCH_USD` (default $25). Your team's GPU limit and prepaid balance apply on top.
|
|
28
|
+
- If a key may have been exposed (committed, pasted in a chat, shared in a log), revoke it right away in the
|
|
29
|
+
dashboard under **API keys** and create a new one. Revoking takes effect immediately.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Use ComputeNexa from your AI assistant
|
|
2
|
+
|
|
3
|
+
*Draft for the dashboard help page at /help/mcp.*
|
|
4
|
+
|
|
5
|
+
Your AI assistant (Claude, Cursor, VS Code and others that support MCP, the Model Context Protocol) can find,
|
|
6
|
+
launch and stop GPUs for you. Ask it things like:
|
|
7
|
+
|
|
8
|
+
- *"Which GPUs with at least 48 GB are in stock, and what do they cost?"*
|
|
9
|
+
- *"Launch the cheapest one with Data Science for two hours, with my titanic project."*
|
|
10
|
+
- *"How do I connect to it?"* · *"Add an hour."* · *"Stop it."*
|
|
11
|
+
- *"What did we spend on GPUs this month?"*
|
|
12
|
+
|
|
13
|
+
It uses an API key from your team and runs on your own computer: the key stays in your assistant's settings.
|
|
14
|
+
|
|
15
|
+
## 1. Create an API key
|
|
16
|
+
|
|
17
|
+
Dashboard → **API keys** → **Create key**:
|
|
18
|
+
|
|
19
|
+
| Key | The assistant can |
|
|
20
|
+
|---|---|
|
|
21
|
+
| **Look only** | See GPUs and prices, your machines, spending, projects and endpoints |
|
|
22
|
+
| **Launch and stop** | Also launch, extend, keep running and stop machines, and create endpoints |
|
|
23
|
+
|
|
24
|
+
Start with **Look only** if you just want answers. The key acts as you and spends your team's credits.
|
|
25
|
+
|
|
26
|
+
## 2. Add ComputeNexa to your assistant
|
|
27
|
+
|
|
28
|
+
You need [uv](https://docs.astral.sh/uv/getting-started/installation/) installed; it downloads and runs the server.
|
|
29
|
+
Replace `cnxk_...` with your key.
|
|
30
|
+
|
|
31
|
+
**Claude Code** (in a terminal):
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
claude mcp add --env CNX_API_KEY=cnxk_... --transport stdio computenexa -- uvx computenexa-mcp
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**Claude Desktop:** Settings → Developer → Edit config, then add:
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"mcpServers": {
|
|
42
|
+
"computenexa": {
|
|
43
|
+
"command": "uvx",
|
|
44
|
+
"args": ["computenexa-mcp"],
|
|
45
|
+
"env": { "CNX_API_KEY": "cnxk_..." }
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Restart Claude Desktop.
|
|
52
|
+
|
|
53
|
+
**Cursor:** the same `mcpServers` entry in `~/.cursor/mcp.json`.
|
|
54
|
+
|
|
55
|
+
**VS Code:** in `.vscode/mcp.json` (VS Code asks for the key and keeps it out of the file):
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"inputs": [
|
|
60
|
+
{ "type": "promptString", "id": "cnx-key", "description": "ComputeNexa API key", "password": true }
|
|
61
|
+
],
|
|
62
|
+
"servers": {
|
|
63
|
+
"computenexa": {
|
|
64
|
+
"type": "stdio",
|
|
65
|
+
"command": "uvx",
|
|
66
|
+
"args": ["computenexa-mcp"],
|
|
67
|
+
"env": { "CNX_API_KEY": "${input:cnx-key}" }
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Check it works: ask *"Who am I on ComputeNexa?"*
|
|
74
|
+
|
|
75
|
+
## 3. What happens when it spends money
|
|
76
|
+
|
|
77
|
+
- **You always see the price first.** Before a launch, an extension or Keep running, the assistant gets a quote
|
|
78
|
+
(*"NVIDIA RTX A6000 with Data Science for 2 h: $1.44 charged now; unused time is refunded if it stops early"*) and
|
|
79
|
+
shows it to you. It goes ahead only after you agree.
|
|
80
|
+
- **A limit per request:** anything costing more than **$25** in one go is refused. To change it, add
|
|
81
|
+
`"CNX_MCP_MAX_LAUNCH_USD": "50"` (dollars) next to `CNX_API_KEY`.
|
|
82
|
+
- Your team's GPU limit and prepaid balance apply as everywhere else.
|
|
83
|
+
- **Stopping** a machine deletes files outside a project; unused time is refunded.
|
|
84
|
+
|
|
85
|
+
## Questions
|
|
86
|
+
|
|
87
|
+
- **Is my key sent anywhere else?** No: the server runs on your computer and talks only to the ComputeNexa API.
|
|
88
|
+
It never shows the key in its answers.
|
|
89
|
+
- **It says "This API key may only look."** Create a **Launch and stop** key and use it instead.
|
|
90
|
+
- **A key leaked?** Revoke it under **API keys** right away; it stops working immediately.
|
|
91
|
+
|
|
92
|
+
More: [the server on GitHub](https://github.com/computenexa-gpuInfrastructure/computenexa-mcp) ·
|
|
93
|
+
[support@computenexa.com](mailto:support@computenexa.com)
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "computenexa-mcp"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "MCP server for ComputeNexa: let your AI assistant find, launch and stop private GPUs."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = "MIT"
|
|
7
|
+
license-files = ["LICENSE"]
|
|
8
|
+
authors = [{ name = "ComputeNexa", email = "support@computenexa.com" }]
|
|
9
|
+
maintainers = [{ name = "ComputeNexa", email = "support@computenexa.com" }]
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
dependencies = ["mcp>=2.3,<3", "computenexa>=0.3.0,<1", "pydantic>=2.12,<3"]
|
|
12
|
+
keywords = ["mcp", "model context protocol", "gpu", "cloud", "ai agents", "computenexa", "claude", "cursor"]
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Development Status :: 4 - Beta",
|
|
15
|
+
"Intended Audience :: Developers",
|
|
16
|
+
"Operating System :: OS Independent",
|
|
17
|
+
"Programming Language :: Python :: 3",
|
|
18
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
19
|
+
"Typing :: Typed",
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
[project.scripts]
|
|
23
|
+
computenexa-mcp = "computenexa_mcp.server:main"
|
|
24
|
+
|
|
25
|
+
[project.urls]
|
|
26
|
+
Homepage = "https://computenexa.com"
|
|
27
|
+
Documentation = "https://app.computenexa.com/help/mcp"
|
|
28
|
+
Source = "https://github.com/computenexa-gpuInfrastructure/computenexa-mcp"
|
|
29
|
+
Support = "https://app.computenexa.com/help"
|
|
30
|
+
|
|
31
|
+
[build-system]
|
|
32
|
+
requires = ["hatchling>=1.26"]
|
|
33
|
+
build-backend = "hatchling.build"
|
|
34
|
+
|
|
35
|
+
[tool.hatch.build.targets.wheel]
|
|
36
|
+
packages = ["src/computenexa_mcp"]
|
|
37
|
+
|
|
38
|
+
[dependency-groups]
|
|
39
|
+
dev = ["pytest>=8", "ruff>=0.6"]
|
|
40
|
+
|
|
41
|
+
[tool.pytest.ini_options]
|
|
42
|
+
testpaths = ["tests"]
|
|
43
|
+
|
|
44
|
+
[tool.ruff]
|
|
45
|
+
line-length = 120
|
|
46
|
+
target-version = "py310"
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
|
+
"name": "io.github.computenexa-gpuInfrastructure/computenexa-mcp",
|
|
4
|
+
"title": "ComputeNexa",
|
|
5
|
+
"description": "Find, launch and stop private GPUs on ComputeNexa, with a quote before anything is charged.",
|
|
6
|
+
"websiteUrl": "https://computenexa.com",
|
|
7
|
+
"repository": {
|
|
8
|
+
"url": "https://github.com/computenexa-gpuInfrastructure/computenexa-mcp",
|
|
9
|
+
"source": "github"
|
|
10
|
+
},
|
|
11
|
+
"version": "0.1.0",
|
|
12
|
+
"packages": [
|
|
13
|
+
{
|
|
14
|
+
"registryType": "pypi",
|
|
15
|
+
"registryBaseUrl": "https://pypi.org",
|
|
16
|
+
"identifier": "computenexa-mcp",
|
|
17
|
+
"version": "0.1.0",
|
|
18
|
+
"runtimeHint": "uvx",
|
|
19
|
+
"transport": {
|
|
20
|
+
"type": "stdio"
|
|
21
|
+
},
|
|
22
|
+
"environmentVariables": [
|
|
23
|
+
{
|
|
24
|
+
"name": "CNX_API_KEY",
|
|
25
|
+
"description": "A ComputeNexa API key (dashboard, API keys): Look only, or Launch and stop",
|
|
26
|
+
"isRequired": true,
|
|
27
|
+
"isSecret": true
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "CNX_MCP_MAX_LAUNCH_USD",
|
|
31
|
+
"description": "Most one launch, extension or renewal may cost, in US dollars",
|
|
32
|
+
"default": "25"
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"""ComputeNexa MCP server: let your AI assistant find, launch and stop private GPUs on ComputeNexa.
|
|
2
|
+
|
|
3
|
+
uvx computenexa-mcp # with CNX_API_KEY set: a stdio MCP server named "ComputeNexa"
|
|
4
|
+
|
|
5
|
+
Guide: https://app.computenexa.com/help/mcp
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from ._version import __version__
|
|
9
|
+
from .server import build_server, main
|
|
10
|
+
|
|
11
|
+
__all__ = ["__version__", "build_server", "main"]
|