codeocean-mcp-server 0.4.0__tar.gz → 0.6.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.
- {codeocean_mcp_server-0.4.0 → codeocean_mcp_server-0.6.0}/CHANGELOG.md +11 -0
- {codeocean_mcp_server-0.4.0 → codeocean_mcp_server-0.6.0}/PKG-INFO +34 -11
- {codeocean_mcp_server-0.4.0 → codeocean_mcp_server-0.6.0}/README.md +32 -9
- {codeocean_mcp_server-0.4.0 → codeocean_mcp_server-0.6.0}/pyproject.toml +5 -2
- {codeocean_mcp_server-0.4.0 → codeocean_mcp_server-0.6.0}/src/codeocean_mcp_server/server.py +8 -3
- {codeocean_mcp_server-0.4.0 → codeocean_mcp_server-0.6.0}/src/codeocean_mcp_server/tools/capsules.py +7 -0
- {codeocean_mcp_server-0.4.0 → codeocean_mcp_server-0.6.0}/src/codeocean_mcp_server/tools/computations.py +8 -8
- codeocean_mcp_server-0.6.0/src/codeocean_mcp_server/tools/custom_metadata.py +12 -0
- {codeocean_mcp_server-0.4.0 → codeocean_mcp_server-0.6.0}/src/codeocean_mcp_server/tools/data_assets.py +9 -9
- {codeocean_mcp_server-0.4.0 → codeocean_mcp_server-0.6.0}/tests/test_tool_calling.py +3 -3
- {codeocean_mcp_server-0.4.0 → codeocean_mcp_server-0.6.0}/uv.lock +6 -6
- {codeocean_mcp_server-0.4.0 → codeocean_mcp_server-0.6.0}/.gitignore +0 -0
- {codeocean_mcp_server-0.4.0 → codeocean_mcp_server-0.6.0}/.python-version +0 -0
- {codeocean_mcp_server-0.4.0 → codeocean_mcp_server-0.6.0}/LICENSE +0 -0
- {codeocean_mcp_server-0.4.0 → codeocean_mcp_server-0.6.0}/RELEASE.md +0 -0
- {codeocean_mcp_server-0.4.0 → codeocean_mcp_server-0.6.0}/src/codeocean_mcp_server/__init__.py +0 -0
- {codeocean_mcp_server-0.4.0 → codeocean_mcp_server-0.6.0}/src/codeocean_mcp_server/file_utils.py +0 -0
- {codeocean_mcp_server-0.4.0 → codeocean_mcp_server-0.6.0}/src/codeocean_mcp_server/models.py +0 -0
- {codeocean_mcp_server-0.4.0 → codeocean_mcp_server-0.6.0}/src/codeocean_mcp_server/tools/__init__.py +0 -0
- {codeocean_mcp_server-0.4.0 → codeocean_mcp_server-0.6.0}/tests/bedrock_call.py +0 -0
- {codeocean_mcp_server-0.4.0 → codeocean_mcp_server-0.6.0}/tests/bedrock_tools_converter.py +0 -0
- {codeocean_mcp_server-0.4.0 → codeocean_mcp_server-0.6.0}/tests/mcp_client.py +0 -0
- {codeocean_mcp_server-0.4.0 → codeocean_mcp_server-0.6.0}/tests/test_multi_tool_calling.py +0 -0
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
CHANGELOG
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
## 0.6.0 (2025-10-10)
|
|
5
|
+
|
|
6
|
+
- [#13](https://github.com/codeocean/codeocean-mcp-server/pull/13) feat: Updates for Code Ocean v4.0
|
|
7
|
+
- **Minimum Code Ocean platform version updated to `4.0.0`.**
|
|
8
|
+
|
|
9
|
+
## 0.5.0 (2025-09-01)
|
|
10
|
+
|
|
11
|
+
- [#9](https://github.com/codeocean/codeocean-mcp-server/pull/9) feat: Updates for Code Ocean v3.9
|
|
12
|
+
- **Minimum Code Ocean platform version updated to `3.9.0`.**
|
|
13
|
+
|
|
4
14
|
## 0.4.0 (2025-08-04)
|
|
5
15
|
|
|
6
16
|
- [#7](https://github.com/codeocean/codeocean-mcp-server/pull/7) fix: pin mcp package dependency
|
|
@@ -17,3 +27,4 @@ CHANGELOG
|
|
|
17
27
|
## 0.1.0 (2025-07-01)
|
|
18
28
|
|
|
19
29
|
- [#1](https://github.com/codeocean/codeocean-mcp-server/pull/1) Initial version
|
|
30
|
+
- **Minimum Code Ocean platform version updated to `3.6.0`.**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codeocean-mcp-server
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.0
|
|
4
4
|
Summary: Code Ocean MCP Server
|
|
5
5
|
Project-URL: Homepage, https://github.com/codeocean/codeocean-mcp-server
|
|
6
6
|
Project-URL: Issues, https://github.com/codeocean/codeocean-mcp-server/issues
|
|
@@ -12,7 +12,7 @@ Classifier: License :: OSI Approved :: MIT License
|
|
|
12
12
|
Classifier: Operating System :: OS Independent
|
|
13
13
|
Classifier: Programming Language :: Python :: 3
|
|
14
14
|
Requires-Python: >=3.10
|
|
15
|
-
Requires-Dist: codeocean<0.
|
|
15
|
+
Requires-Dist: codeocean<0.12.0,>=0.11.0
|
|
16
16
|
Requires-Dist: mcp<1.13.0,>=1.12.0
|
|
17
17
|
Description-Content-Type: text/markdown
|
|
18
18
|
|
|
@@ -25,6 +25,7 @@ This MCP server provides tools to search and run capsules and pipelines, and man
|
|
|
25
25
|
## Table of Contents
|
|
26
26
|
|
|
27
27
|
- [Prerequisites](#prerequisites)
|
|
28
|
+
- [Code Ocean Platform Version Compatibility](#code-ocean-platform-version-compatibility)
|
|
28
29
|
- [Installation](#installation)
|
|
29
30
|
- [Visual Studio Code](#visual-studio-code)
|
|
30
31
|
- [Claude Desktop](#claude-desktop)
|
|
@@ -32,6 +33,7 @@ This MCP server provides tools to search and run capsules and pipelines, and man
|
|
|
32
33
|
- [Roo Code](#roo-code)
|
|
33
34
|
- [Cursor](#cursor)
|
|
34
35
|
- [Windsurf](#windsurf)
|
|
36
|
+
- [Local Testing](#local-testing)
|
|
35
37
|
|
|
36
38
|
## Prerequisites
|
|
37
39
|
|
|
@@ -39,9 +41,16 @@ This MCP server provides tools to search and run capsules and pipelines, and man
|
|
|
39
41
|
2. Install Python 3.10 or newer using `uv python install 3.10` (or a more recent version)
|
|
40
42
|
3. Generate a Code Ocean access token. Follow instructions in the [Code Ocean user guide](https://docs.codeocean.com/user-guide/code-ocean-api/authentication).
|
|
41
43
|
|
|
44
|
+
## Code Ocean Platform Version Compatibility
|
|
45
|
+
|
|
46
|
+
Each release of this Code Ocean MCP Server is tested and verified against a specific minimum version of the Code Ocean platform API.
|
|
47
|
+
Generally, this minimum version is the latest Code Ocean version at the time of the MCP Server release.
|
|
48
|
+
We recommend ensuring your MCP Server dependency is pinned to a version compatible with your Code Ocean deployment.
|
|
49
|
+
For details on when the minimum Code Ocean platform version changes, see the [CHANGELOG](CHANGELOG.md).
|
|
50
|
+
|
|
42
51
|
## Installation
|
|
43
52
|
|
|
44
|
-
|
|
53
|
+
### [Visual Studio Code](https://code.visualstudio.com/docs/copilot/chat/mcp-servers)
|
|
45
54
|
|
|
46
55
|
Here's an example VS Code MCP server configuration:
|
|
47
56
|
```json
|
|
@@ -74,7 +83,7 @@ Here's an example VS Code MCP server configuration:
|
|
|
74
83
|
|
|
75
84
|
---
|
|
76
85
|
|
|
77
|
-
|
|
86
|
+
### [Claude Desktop](https://modelcontextprotocol.io/quickstart/user)
|
|
78
87
|
|
|
79
88
|
1. Open the `claude_desktop_config.json` file:
|
|
80
89
|
- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
@@ -99,7 +108,7 @@ Here's an example VS Code MCP server configuration:
|
|
|
99
108
|
|
|
100
109
|
---
|
|
101
110
|
|
|
102
|
-
|
|
111
|
+
### [Cline](https://docs.cline.bot/mcp/configuring-mcp-servers)
|
|
103
112
|
|
|
104
113
|
Cline stores all of its MCP settings in a JSON file called cline_mcp_settings.json. You can edit this either through the GUI (“Configure MCP Servers” in the MCP Servers pane) or by hand:
|
|
105
114
|
1. Open Cline and click the MCP Servers icon in the sidebar.
|
|
@@ -126,11 +135,11 @@ Cline stores all of its MCP settings in a JSON file called cline_mcp_settings.js
|
|
|
126
135
|
|
|
127
136
|
---
|
|
128
137
|
|
|
129
|
-
|
|
138
|
+
### [Roo Code](https://docs.roocode.com/features/mcp/using-mcp-in-roo/)
|
|
130
139
|
|
|
131
140
|
Roo Code’s MCP support is configured globally across all workspaces via a JSON settings file or through its dedicated MCP Settings UI
|
|
132
141
|
|
|
133
|
-
|
|
142
|
+
#### Via the MCP Settings UI:
|
|
134
143
|
1. Click the MCP icon in Roo Code’s sidebar. 
|
|
135
144
|
2. Select Edit MCP Settings (opens cline_mcp_settings.json). 
|
|
136
145
|
3. Under "mcpServers", add:
|
|
@@ -152,14 +161,14 @@ Roo Code’s MCP support is configured globally across all workspaces via a JSON
|
|
|
152
161
|
```
|
|
153
162
|
4. Save and restart Roo Code; your Code Ocean tools will appear automatically.
|
|
154
163
|
|
|
155
|
-
|
|
164
|
+
#### Optional: Manually editing cline_mcp_settings.json
|
|
156
165
|
1. Locate cline_mcp_settings.json (in your home directory or workspace). 
|
|
157
166
|
2. Insert the same "codeocean" block under "mcpServers" as above.
|
|
158
167
|
3. Save and restart.
|
|
159
168
|
|
|
160
169
|
---
|
|
161
170
|
|
|
162
|
-
|
|
171
|
+
### [Cursor](https://docs.cursor.com/context/model-context-protocol)
|
|
163
172
|
|
|
164
173
|
Cursor stores MCP servers in a JSON file at either ~/.cursor/mcp.json (global) or {project}/.cursor/mcp.json (project-specific) .
|
|
165
174
|
1. Open .cursor/mcp.json (or create it if missing). 
|
|
@@ -183,7 +192,7 @@ Cursor stores MCP servers in a JSON file at either ~/.cursor/mcp.json (global) o
|
|
|
183
192
|
|
|
184
193
|
---
|
|
185
194
|
|
|
186
|
-
|
|
195
|
+
### [Windsurf](https://docs.windsurf.com/windsurf/cascade/mcp)
|
|
187
196
|
|
|
188
197
|
Windsurf (Cascade) uses mcp_config.json under ~/.codeium/windsurf/ (or via the Cascade → MCP Servers UI) .
|
|
189
198
|
1. Open your Windsurf Settings and navigate to Cascade → MCP Servers, then click View Raw Config to open mcp_config.json. 
|
|
@@ -204,4 +213,18 @@ Windsurf (Cascade) uses mcp_config.json under ~/.codeium/windsurf/ (or via the C
|
|
|
204
213
|
}
|
|
205
214
|
```
|
|
206
215
|
|
|
207
|
-
3. Save and restart Windsurf (or hit “Refresh” in the MCP panel).
|
|
216
|
+
3. Save and restart Windsurf (or hit “Refresh” in the MCP panel).
|
|
217
|
+
|
|
218
|
+
## Local Testing
|
|
219
|
+
|
|
220
|
+
You can test the MCP server locally during development with [MCP Inspector](https://modelcontextprotocol.io/legacy/tools/inspector):
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
npx @modelcontextprotocol/inspector uv tool run codeocean-mcp-server
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
This will start a web server where you can:
|
|
227
|
+
|
|
228
|
+
- View available tools and resources
|
|
229
|
+
- Test tool calls interactively
|
|
230
|
+
- See server logs and responses
|
|
@@ -7,6 +7,7 @@ This MCP server provides tools to search and run capsules and pipelines, and man
|
|
|
7
7
|
## Table of Contents
|
|
8
8
|
|
|
9
9
|
- [Prerequisites](#prerequisites)
|
|
10
|
+
- [Code Ocean Platform Version Compatibility](#code-ocean-platform-version-compatibility)
|
|
10
11
|
- [Installation](#installation)
|
|
11
12
|
- [Visual Studio Code](#visual-studio-code)
|
|
12
13
|
- [Claude Desktop](#claude-desktop)
|
|
@@ -14,6 +15,7 @@ This MCP server provides tools to search and run capsules and pipelines, and man
|
|
|
14
15
|
- [Roo Code](#roo-code)
|
|
15
16
|
- [Cursor](#cursor)
|
|
16
17
|
- [Windsurf](#windsurf)
|
|
18
|
+
- [Local Testing](#local-testing)
|
|
17
19
|
|
|
18
20
|
## Prerequisites
|
|
19
21
|
|
|
@@ -21,9 +23,16 @@ This MCP server provides tools to search and run capsules and pipelines, and man
|
|
|
21
23
|
2. Install Python 3.10 or newer using `uv python install 3.10` (or a more recent version)
|
|
22
24
|
3. Generate a Code Ocean access token. Follow instructions in the [Code Ocean user guide](https://docs.codeocean.com/user-guide/code-ocean-api/authentication).
|
|
23
25
|
|
|
26
|
+
## Code Ocean Platform Version Compatibility
|
|
27
|
+
|
|
28
|
+
Each release of this Code Ocean MCP Server is tested and verified against a specific minimum version of the Code Ocean platform API.
|
|
29
|
+
Generally, this minimum version is the latest Code Ocean version at the time of the MCP Server release.
|
|
30
|
+
We recommend ensuring your MCP Server dependency is pinned to a version compatible with your Code Ocean deployment.
|
|
31
|
+
For details on when the minimum Code Ocean platform version changes, see the [CHANGELOG](CHANGELOG.md).
|
|
32
|
+
|
|
24
33
|
## Installation
|
|
25
34
|
|
|
26
|
-
|
|
35
|
+
### [Visual Studio Code](https://code.visualstudio.com/docs/copilot/chat/mcp-servers)
|
|
27
36
|
|
|
28
37
|
Here's an example VS Code MCP server configuration:
|
|
29
38
|
```json
|
|
@@ -56,7 +65,7 @@ Here's an example VS Code MCP server configuration:
|
|
|
56
65
|
|
|
57
66
|
---
|
|
58
67
|
|
|
59
|
-
|
|
68
|
+
### [Claude Desktop](https://modelcontextprotocol.io/quickstart/user)
|
|
60
69
|
|
|
61
70
|
1. Open the `claude_desktop_config.json` file:
|
|
62
71
|
- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
@@ -81,7 +90,7 @@ Here's an example VS Code MCP server configuration:
|
|
|
81
90
|
|
|
82
91
|
---
|
|
83
92
|
|
|
84
|
-
|
|
93
|
+
### [Cline](https://docs.cline.bot/mcp/configuring-mcp-servers)
|
|
85
94
|
|
|
86
95
|
Cline stores all of its MCP settings in a JSON file called cline_mcp_settings.json. You can edit this either through the GUI (“Configure MCP Servers” in the MCP Servers pane) or by hand:
|
|
87
96
|
1. Open Cline and click the MCP Servers icon in the sidebar.
|
|
@@ -108,11 +117,11 @@ Cline stores all of its MCP settings in a JSON file called cline_mcp_settings.js
|
|
|
108
117
|
|
|
109
118
|
---
|
|
110
119
|
|
|
111
|
-
|
|
120
|
+
### [Roo Code](https://docs.roocode.com/features/mcp/using-mcp-in-roo/)
|
|
112
121
|
|
|
113
122
|
Roo Code’s MCP support is configured globally across all workspaces via a JSON settings file or through its dedicated MCP Settings UI
|
|
114
123
|
|
|
115
|
-
|
|
124
|
+
#### Via the MCP Settings UI:
|
|
116
125
|
1. Click the MCP icon in Roo Code’s sidebar. 
|
|
117
126
|
2. Select Edit MCP Settings (opens cline_mcp_settings.json). 
|
|
118
127
|
3. Under "mcpServers", add:
|
|
@@ -134,14 +143,14 @@ Roo Code’s MCP support is configured globally across all workspaces via a JSON
|
|
|
134
143
|
```
|
|
135
144
|
4. Save and restart Roo Code; your Code Ocean tools will appear automatically.
|
|
136
145
|
|
|
137
|
-
|
|
146
|
+
#### Optional: Manually editing cline_mcp_settings.json
|
|
138
147
|
1. Locate cline_mcp_settings.json (in your home directory or workspace). 
|
|
139
148
|
2. Insert the same "codeocean" block under "mcpServers" as above.
|
|
140
149
|
3. Save and restart.
|
|
141
150
|
|
|
142
151
|
---
|
|
143
152
|
|
|
144
|
-
|
|
153
|
+
### [Cursor](https://docs.cursor.com/context/model-context-protocol)
|
|
145
154
|
|
|
146
155
|
Cursor stores MCP servers in a JSON file at either ~/.cursor/mcp.json (global) or {project}/.cursor/mcp.json (project-specific) .
|
|
147
156
|
1. Open .cursor/mcp.json (or create it if missing). 
|
|
@@ -165,7 +174,7 @@ Cursor stores MCP servers in a JSON file at either ~/.cursor/mcp.json (global) o
|
|
|
165
174
|
|
|
166
175
|
---
|
|
167
176
|
|
|
168
|
-
|
|
177
|
+
### [Windsurf](https://docs.windsurf.com/windsurf/cascade/mcp)
|
|
169
178
|
|
|
170
179
|
Windsurf (Cascade) uses mcp_config.json under ~/.codeium/windsurf/ (or via the Cascade → MCP Servers UI) .
|
|
171
180
|
1. Open your Windsurf Settings and navigate to Cascade → MCP Servers, then click View Raw Config to open mcp_config.json. 
|
|
@@ -186,4 +195,18 @@ Windsurf (Cascade) uses mcp_config.json under ~/.codeium/windsurf/ (or via the C
|
|
|
186
195
|
}
|
|
187
196
|
```
|
|
188
197
|
|
|
189
|
-
3. Save and restart Windsurf (or hit “Refresh” in the MCP panel).
|
|
198
|
+
3. Save and restart Windsurf (or hit “Refresh” in the MCP panel).
|
|
199
|
+
|
|
200
|
+
## Local Testing
|
|
201
|
+
|
|
202
|
+
You can test the MCP server locally during development with [MCP Inspector](https://modelcontextprotocol.io/legacy/tools/inspector):
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
npx @modelcontextprotocol/inspector uv tool run codeocean-mcp-server
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
This will start a web server where you can:
|
|
209
|
+
|
|
210
|
+
- View available tools and resources
|
|
211
|
+
- Test tool calls interactively
|
|
212
|
+
- See server logs and responses
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "codeocean-mcp-server"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.6.0"
|
|
4
4
|
authors = [{ name = "Code Ocean", email = "dev@codeocean.com" }]
|
|
5
5
|
description = "Code Ocean MCP Server"
|
|
6
6
|
readme = "README.md"
|
|
@@ -11,7 +11,7 @@ classifiers = [
|
|
|
11
11
|
"Operating System :: OS Independent",
|
|
12
12
|
]
|
|
13
13
|
dependencies = [
|
|
14
|
-
"codeocean>=0.
|
|
14
|
+
"codeocean>=0.11.0,<0.12.0",
|
|
15
15
|
"mcp>=1.12.0,<1.13.0",
|
|
16
16
|
]
|
|
17
17
|
license = "MIT"
|
|
@@ -44,6 +44,9 @@ exclude = ["/.circleci"]
|
|
|
44
44
|
[tool.hatch.build.targets.wheel]
|
|
45
45
|
packages = ["src/codeocean_mcp_server"]
|
|
46
46
|
|
|
47
|
+
[tool.hatch.metadata]
|
|
48
|
+
allow-direct-references = true
|
|
49
|
+
|
|
47
50
|
[tool.hatch.envs.default.scripts]
|
|
48
51
|
test = "pytest"
|
|
49
52
|
|
{codeocean_mcp_server-0.4.0 → codeocean_mcp_server-0.6.0}/src/codeocean_mcp_server/server.py
RENAMED
|
@@ -3,7 +3,12 @@ import os
|
|
|
3
3
|
from codeocean import CodeOcean
|
|
4
4
|
from mcp.server.fastmcp import FastMCP
|
|
5
5
|
|
|
6
|
-
from codeocean_mcp_server.tools import
|
|
6
|
+
from codeocean_mcp_server.tools import (
|
|
7
|
+
capsules,
|
|
8
|
+
computations,
|
|
9
|
+
custom_metadata,
|
|
10
|
+
data_assets,
|
|
11
|
+
)
|
|
7
12
|
|
|
8
13
|
|
|
9
14
|
def main():
|
|
@@ -12,8 +17,7 @@ def main():
|
|
|
12
17
|
token = os.getenv("CODEOCEAN_TOKEN")
|
|
13
18
|
if not domain or not token:
|
|
14
19
|
raise ValueError(
|
|
15
|
-
"Environment variables CODEOCEAN_DOMAIN and "
|
|
16
|
-
"CODEOCEAN_TOKEN must be set."
|
|
20
|
+
"Environment variables CODEOCEAN_DOMAIN and " "CODEOCEAN_TOKEN must be set."
|
|
17
21
|
)
|
|
18
22
|
agent_id = os.getenv("AGENT_ID", "AI Agent")
|
|
19
23
|
client = CodeOcean(domain=domain, token=token, agent_id=agent_id)
|
|
@@ -29,6 +33,7 @@ def main():
|
|
|
29
33
|
capsules.add_tools(mcp, client)
|
|
30
34
|
data_assets.add_tools(mcp, client)
|
|
31
35
|
computations.add_tools(mcp, client)
|
|
36
|
+
custom_metadata.add_tools(mcp, client)
|
|
32
37
|
|
|
33
38
|
mcp.run()
|
|
34
39
|
|
{codeocean_mcp_server-0.4.0 → codeocean_mcp_server-0.6.0}/src/codeocean_mcp_server/tools/capsules.py
RENAMED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from codeocean import CodeOcean
|
|
2
2
|
from codeocean.capsule import (
|
|
3
|
+
AppPanel,
|
|
3
4
|
Capsule,
|
|
4
5
|
CapsuleSearchParams,
|
|
5
6
|
CapsuleSearchResults,
|
|
@@ -11,6 +12,7 @@ from mcp.server.fastmcp import FastMCP
|
|
|
11
12
|
|
|
12
13
|
from codeocean_mcp_server.models import dataclass_to_pydantic
|
|
13
14
|
|
|
15
|
+
AppPanelModel = dataclass_to_pydantic(AppPanel)
|
|
14
16
|
CapsuleSearchParamsModel = dataclass_to_pydantic(CapsuleSearchParams)
|
|
15
17
|
DataAssetAttachParamsModel = dataclass_to_pydantic(DataAssetAttachParams)
|
|
16
18
|
|
|
@@ -65,3 +67,8 @@ def add_tools(mcp: FastMCP, client: CodeOcean):
|
|
|
65
67
|
def list_computations(capsule_id: str) -> list[Computation]:
|
|
66
68
|
"""List all computations for a capsule."""
|
|
67
69
|
return client.capsules.list_computations(capsule_id)
|
|
70
|
+
|
|
71
|
+
@mcp.tool(description=client.capsules.get_capsule_app_panel.__doc__)
|
|
72
|
+
def get_capsule_app_panel(capsule_id: str, version: int | None = None) -> AppPanelModel:
|
|
73
|
+
"""Retrieve the app panel for a capsule, optionally for a specific version."""
|
|
74
|
+
return client.capsules.get_capsule_app_panel(capsule_id, version)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from codeocean import CodeOcean
|
|
2
2
|
from codeocean.computation import (
|
|
3
3
|
Computation,
|
|
4
|
-
|
|
4
|
+
FileURLs,
|
|
5
5
|
Folder,
|
|
6
6
|
RunParams,
|
|
7
7
|
)
|
|
@@ -26,7 +26,7 @@ def add_tools(mcp: FastMCP, client: CodeOcean):
|
|
|
26
26
|
str(client.computations.run_capsule.__doc__)
|
|
27
27
|
+ "Typical workflow: 1) run_capsule() to start execution "
|
|
28
28
|
"2) wait_until_completed() to monitor progress "
|
|
29
|
-
"3) list_computation_results() and
|
|
29
|
+
"3) list_computation_results() and get_result_file_urls() "
|
|
30
30
|
"to retrieve outputs."
|
|
31
31
|
)
|
|
32
32
|
)
|
|
@@ -53,10 +53,10 @@ def add_tools(mcp: FastMCP, client: CodeOcean):
|
|
|
53
53
|
return client.computations.list_computation_results(computation_id)
|
|
54
54
|
|
|
55
55
|
|
|
56
|
-
@mcp.tool(description=(client.computations.
|
|
57
|
-
def
|
|
58
|
-
"""Get download
|
|
59
|
-
return client.computations.
|
|
56
|
+
@mcp.tool(description=(client.computations.get_result_file_urls.__doc__))
|
|
57
|
+
def get_result_file_urls(computation_id: str, file_path: str) -> FileURLs:
|
|
58
|
+
"""Get view and download URLs for a specific result file from computation."""
|
|
59
|
+
return client.computations.get_result_file_urls(computation_id, file_path)
|
|
60
60
|
|
|
61
61
|
@mcp.tool(
|
|
62
62
|
description=(
|
|
@@ -65,5 +65,5 @@ def add_tools(mcp: FastMCP, client: CodeOcean):
|
|
|
65
65
|
)
|
|
66
66
|
def download_and_read_a_file_from_computation(computation_id: str, file_path: str) -> str:
|
|
67
67
|
"""Download a file using the provided URL and return its content."""
|
|
68
|
-
|
|
69
|
-
return download_and_read_file(
|
|
68
|
+
file_urls = client.computations.get_result_file_urls(computation_id, file_path)
|
|
69
|
+
return download_and_read_file(file_urls.download_url)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from codeocean import CodeOcean
|
|
2
|
+
from codeocean.custom_metadata import CustomMetadata
|
|
3
|
+
from mcp.server.fastmcp import FastMCP
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def add_tools(mcp: FastMCP, client: CodeOcean):
|
|
7
|
+
"""Add custom_metadata tools to the MCP server."""
|
|
8
|
+
|
|
9
|
+
@mcp.tool(description=client.custom_metadata.get_custom_metadata.__doc__)
|
|
10
|
+
def get_custom_metadata() -> CustomMetadata:
|
|
11
|
+
"""Retrieve custom metadata."""
|
|
12
|
+
return client.custom_metadata.get_custom_metadata()
|
|
@@ -7,7 +7,7 @@ from codeocean.data_asset import (
|
|
|
7
7
|
DataAssetSearchParams,
|
|
8
8
|
DataAssetSearchResults,
|
|
9
9
|
DataAssetUpdateParams,
|
|
10
|
-
|
|
10
|
+
FileURLs,
|
|
11
11
|
Folder,
|
|
12
12
|
)
|
|
13
13
|
from mcp.server.fastmcp import FastMCP
|
|
@@ -39,16 +39,16 @@ def add_tools(mcp: FastMCP, client: CodeOcean):
|
|
|
39
39
|
|
|
40
40
|
@mcp.tool(
|
|
41
41
|
description=(
|
|
42
|
-
str(client.data_assets.
|
|
42
|
+
str(client.data_assets.get_data_asset_file_urls.__doc__)
|
|
43
43
|
+ "Call only when the data asset is already created and in a ready "
|
|
44
44
|
"state. If the asset may not yet be ready, first use "
|
|
45
45
|
"`wait_until_ready` to poll until readiness, then retrieve the "
|
|
46
46
|
"download URL."
|
|
47
47
|
)
|
|
48
48
|
)
|
|
49
|
-
def
|
|
50
|
-
"""Get
|
|
51
|
-
return client.data_assets.
|
|
49
|
+
def get_data_asset_file_urls(data_asset_id: str, file_path: str) -> FileURLs:
|
|
50
|
+
"""Get view and download URLs for a specific file in a data asset."""
|
|
51
|
+
return client.data_assets.get_data_asset_file_urls(data_asset_id, file_path)
|
|
52
52
|
|
|
53
53
|
@mcp.tool(
|
|
54
54
|
description=(
|
|
@@ -57,13 +57,13 @@ def add_tools(mcp: FastMCP, client: CodeOcean):
|
|
|
57
57
|
)
|
|
58
58
|
def download_and_read_a_file_from_data_asset(data_asset_id: str, file_path: str) -> str:
|
|
59
59
|
"""Download a file using the provided URL and return its content."""
|
|
60
|
-
|
|
61
|
-
return download_and_read_file(
|
|
60
|
+
file_urls = client.data_assets.get_data_asset_file_urls(data_asset_id, file_path)
|
|
61
|
+
return download_and_read_file(file_urls.download_url)
|
|
62
62
|
|
|
63
63
|
@mcp.tool(description=client.data_assets.list_data_asset_files.__doc__)
|
|
64
|
-
def list_data_asset_files(data_asset_id: str) -> Folder:
|
|
64
|
+
def list_data_asset_files(data_asset_id: str, path: str = "") -> Folder:
|
|
65
65
|
"""List files in a data asset."""
|
|
66
|
-
return client.data_assets.list_data_asset_files(data_asset_id)
|
|
66
|
+
return client.data_assets.list_data_asset_files(data_asset_id, path)
|
|
67
67
|
|
|
68
68
|
@mcp.tool(description=client.data_assets.update_metadata.__doc__)
|
|
69
69
|
def update_metadata(
|
|
@@ -346,12 +346,12 @@ test_response = [
|
|
|
346
346
|
# ==============================================================================================================
|
|
347
347
|
# data assets tests
|
|
348
348
|
# --------------------------------------------------------------
|
|
349
|
-
#
|
|
349
|
+
# get_data_asset_file_urls
|
|
350
350
|
{
|
|
351
|
-
"id": "
|
|
351
|
+
"id": "get_data_asset_file_urls",
|
|
352
352
|
"prompt": "get download URL for file '/data/file.txt' in data asset with id: data_asset123",
|
|
353
353
|
"expected": {
|
|
354
|
-
"name": "
|
|
354
|
+
"name": "get_data_asset_file_urls",
|
|
355
355
|
"input": {
|
|
356
356
|
"data_asset_id": "data_asset123",
|
|
357
357
|
"file_path": "/data/file.txt",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
version = 1
|
|
2
|
-
revision =
|
|
2
|
+
revision = 3
|
|
3
3
|
requires-python = ">=3.10"
|
|
4
4
|
|
|
5
5
|
[[package]]
|
|
@@ -338,7 +338,7 @@ wheels = [
|
|
|
338
338
|
|
|
339
339
|
[[package]]
|
|
340
340
|
name = "codeocean"
|
|
341
|
-
version = "0.
|
|
341
|
+
version = "0.11.0"
|
|
342
342
|
source = { registry = "https://pypi.org/simple" }
|
|
343
343
|
dependencies = [
|
|
344
344
|
{ name = "backports-strenum", marker = "python_full_version < '3.11'" },
|
|
@@ -346,14 +346,14 @@ dependencies = [
|
|
|
346
346
|
{ name = "requests" },
|
|
347
347
|
{ name = "requests-toolbelt" },
|
|
348
348
|
]
|
|
349
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
349
|
+
sdist = { url = "https://files.pythonhosted.org/packages/4c/cf/cb84db5bbcd578c6056cb4450b7b2b890bce11e38d73bbe851efc82ed3b7/codeocean-0.11.0.tar.gz", hash = "sha256:327870828acd52d389fa7e886f5afd2939ba44f98042792ceeb71f4e633e5fca", size = 19399, upload-time = "2025-10-07T12:26:14.063Z" }
|
|
350
350
|
wheels = [
|
|
351
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
351
|
+
{ url = "https://files.pythonhosted.org/packages/ae/d5/7db76b3bccca71b6ede63e941d76cfff3f22018a8c31818978bc8b1ed13a/codeocean-0.11.0-py3-none-any.whl", hash = "sha256:836400084ba433e9474f7b6ecd6337a9b45fb41d0f4d67a2d72d38338d4fbed3", size = 20379, upload-time = "2025-10-07T12:26:15.03Z" },
|
|
352
352
|
]
|
|
353
353
|
|
|
354
354
|
[[package]]
|
|
355
355
|
name = "codeocean-mcp-server"
|
|
356
|
-
version = "0.
|
|
356
|
+
version = "0.6.0"
|
|
357
357
|
source = { editable = "." }
|
|
358
358
|
dependencies = [
|
|
359
359
|
{ name = "codeocean" },
|
|
@@ -372,7 +372,7 @@ dev = [
|
|
|
372
372
|
|
|
373
373
|
[package.metadata]
|
|
374
374
|
requires-dist = [
|
|
375
|
-
{ name = "codeocean", specifier = ">=0.
|
|
375
|
+
{ name = "codeocean", specifier = ">=0.11.0,<0.12.0" },
|
|
376
376
|
{ name = "mcp", specifier = ">=1.12.0,<1.13.0" },
|
|
377
377
|
]
|
|
378
378
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{codeocean_mcp_server-0.4.0 → codeocean_mcp_server-0.6.0}/src/codeocean_mcp_server/__init__.py
RENAMED
|
File without changes
|
{codeocean_mcp_server-0.4.0 → codeocean_mcp_server-0.6.0}/src/codeocean_mcp_server/file_utils.py
RENAMED
|
File without changes
|
{codeocean_mcp_server-0.4.0 → codeocean_mcp_server-0.6.0}/src/codeocean_mcp_server/models.py
RENAMED
|
File without changes
|
{codeocean_mcp_server-0.4.0 → codeocean_mcp_server-0.6.0}/src/codeocean_mcp_server/tools/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|