codeocean-mcp-server 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.
@@ -0,0 +1,174 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+
110
+ # pdm
111
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
112
+ #pdm.lock
113
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
114
+ # in version control.
115
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
116
+ .pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
121
+ __pypackages__/
122
+
123
+ # Celery stuff
124
+ celerybeat-schedule
125
+ celerybeat.pid
126
+
127
+ # SageMath parsed files
128
+ *.sage.py
129
+
130
+ # Environments
131
+ .env
132
+ .venv
133
+ env/
134
+ venv/
135
+ ENV/
136
+ env.bak/
137
+ venv.bak/
138
+
139
+ # Spyder project settings
140
+ .spyderproject
141
+ .spyproject
142
+
143
+ # Rope project settings
144
+ .ropeproject
145
+
146
+ # mkdocs documentation
147
+ /site
148
+
149
+ # mypy
150
+ .mypy_cache/
151
+ .dmypy.json
152
+ dmypy.json
153
+
154
+ # Pyre type checker
155
+ .pyre/
156
+
157
+ # pytype static type analyzer
158
+ .pytype/
159
+
160
+ # Cython debug symbols
161
+ cython_debug/
162
+
163
+ # PyCharm
164
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
165
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
166
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
167
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
168
+ #.idea/
169
+
170
+ # Ruff stuff:
171
+ .ruff_cache/
172
+
173
+ # PyPI configuration file
174
+ .pypirc
@@ -0,0 +1 @@
1
+ 3.13
@@ -0,0 +1,6 @@
1
+ CHANGELOG
2
+ =========
3
+
4
+ ## 0.1.0 (2025-07-01)
5
+
6
+ - [#1](https://github.com/codeocean/codeocean-mcp-server/pull/1) Initial version
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Code Ocean
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,201 @@
1
+ Metadata-Version: 2.4
2
+ Name: codeocean-mcp-server
3
+ Version: 0.1.0
4
+ Summary: Code Ocean MCP Server
5
+ Project-URL: Homepage, https://github.com/codeocean/codeocean-mcp-server
6
+ Project-URL: Issues, https://github.com/codeocean/codeocean-mcp-server/issues
7
+ Project-URL: Changelog, https://github.com/codeocean/codeocean-mcp-server/blob/main/CHANGELOG.md
8
+ Author-email: Code Ocean <dev@codeocean.com>
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python :: 3
14
+ Requires-Python: >=3.10
15
+ Requires-Dist: codeocean>=0.7.0
16
+ Requires-Dist: fastmcp>=2.9.2
17
+ Description-Content-Type: text/markdown
18
+
19
+ # Code Ocean MCP Server
20
+
21
+ Model Context Protocol (MCP) server for Code Ocean.
22
+
23
+ This MCP server provides tools to search and run capsules and pipelines, and manage data assets.
24
+
25
+ ## Table of Contents
26
+
27
+ - [Prerequisites](#prerequisites)
28
+ - [Installation](#installation)
29
+ - [Visual Studio Code](#visual-studio-code)
30
+ - [Claude Desktop](#claude-desktop)
31
+ - [Cline](#cline)
32
+ - [Roo Code](#roo-code)
33
+ - [Cursor](#cursor)
34
+ - [Windsurf](#windsurf)
35
+
36
+ ## Prerequisites
37
+
38
+ 1. Install `uv` from [Astral](https://docs.astral.sh/uv/getting-started/installation/) or the [GitHub README](https://github.com/astral-sh/uv#installation)
39
+ 2. Install Python 3.10 or newer using `uv python install 3.10` (or a more recent version)
40
+ 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
+
42
+ ## Installation
43
+
44
+ ## [Visual Studio Code](https://code.visualstudio.com/docs/copilot/chat/mcp-servers)
45
+
46
+ Here's an example VS Code MCP server configuration:
47
+ ```json
48
+ {
49
+ ...
50
+ "mcp": {
51
+ "inputs": [
52
+ {
53
+ "type": "promptString",
54
+ "id": "codeocean-token",
55
+ "description": "Code Ocean API Key",
56
+ "password": true
57
+ }
58
+ ],
59
+ "servers": {
60
+ "codeocean": {
61
+ "type": "stdio",
62
+ "command": "uvx",
63
+ "args": ["codeocean-mcp-server"],
64
+ "env": {
65
+ "CODEOCEAN_DOMAIN": "https://codeocean.acme.com",
66
+ "CODEOCEAN_TOKEN": "${input:codeocean-token}"
67
+ }
68
+ }
69
+ },
70
+ }
71
+ }
72
+ ```
73
+
74
+ ---
75
+
76
+ ## [Claude Desktop](https://modelcontextprotocol.io/quickstart/user)
77
+
78
+ 1. Open the `claude_desktop_config.json` file:
79
+ - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
80
+ - Windows: `%APPDATA%\Claude\claude_desktop_config.json`
81
+ 2. Under the top-level "mcpServers" object, add a "codeocean" entry. For a stdio transport (child-process) it looks like this:
82
+
83
+ ```json
84
+ {
85
+ "mcpServers": {
86
+ "codeocean": {
87
+ "command": "uvx",
88
+ "args": ["codeocean-mcp-server"],
89
+ "env": {
90
+ "CODEOCEAN_DOMAIN": "https://codeocean.acme.com",
91
+ "CODEOCEAN_TOKEN": "<YOUR_API_KEY>"
92
+ }
93
+ }
94
+ }
95
+ }
96
+ ```
97
+
98
+ ---
99
+
100
+ ## [Cline](https://docs.cline.bot/mcp/configuring-mcp-servers)
101
+
102
+ 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:
103
+ 1. Open Cline and click the MCP Servers icon in the sidebar.
104
+ 2. In the “Installed” tab, click Configure MCP Servers → this opens your cline_mcp_settings.json.
105
+ 3. Add a "codeocean" server under the "mcpServers" key. For stdio transport:
106
+ ```json
107
+ {
108
+ "mcpServers": {
109
+ "codeocean": {
110
+ "command": "uvx",
111
+ "args": ["codeocean-mcp-server"],
112
+ "env": {
113
+ "CODEOCEAN_DOMAIN": "https://codeocean.acme.com",
114
+ "CODEOCEAN_TOKEN": "<YOUR_API_KEY>"
115
+ },
116
+ "alwaysAllow": [], // optional: list of tools to auto-approve
117
+ "disabled": false // ensure it’s enabled
118
+ }
119
+ }
120
+ }
121
+ ```
122
+ 4. Save the file. Cline will automatically detect and launch the new server, making your Code Ocean tools available in chat .
123
+
124
+ ---
125
+
126
+ ## [Roo Code](https://docs.roocode.com/features/mcp/using-mcp-in-roo/)
127
+
128
+ Roo Code’s MCP support is configured globally across all workspaces via a JSON settings file or through its dedicated MCP Settings UI
129
+
130
+ ### Via the MCP Settings UI:
131
+ 1. Click the MCP icon in Roo Code’s sidebar. 
132
+ 2. Select Edit MCP Settings (opens cline_mcp_settings.json). 
133
+ 3. Under "mcpServers", add:
134
+
135
+ ```json
136
+ {
137
+ "mcpServers": {
138
+ "codeocean": {
139
+ "command": "uvx",
140
+ "args": ["codeocean-mcp-server"],
141
+ "env": {
142
+ "CODEOCEAN_DOMAIN": "https://codeocean.acme.com",
143
+ "CODEOCEAN_TOKEN": "<YOUR_API_KEY>"
144
+ }
145
+ }
146
+ }
147
+ }
148
+ ```
149
+ 4. Save and restart Roo Code; your Code Ocean tools will appear automatically.
150
+
151
+ ### Optional: Manually editing cline_mcp_settings.json
152
+ 1. Locate cline_mcp_settings.json (in your home directory or workspace). 
153
+ 2. Insert the same "codeocean" block under "mcpServers" as above.
154
+ 3. Save and restart.
155
+
156
+ ---
157
+
158
+ ## [Cursor](https://docs.cursor.com/context/model-context-protocol)
159
+
160
+ Cursor stores MCP servers in a JSON file at either ~/.cursor/mcp.json (global) or {project}/.cursor/mcp.json (project-specific) .
161
+ 1. Open .cursor/mcp.json (or create it if missing). 
162
+ 2. Add under "mcpServers":
163
+ ```json
164
+ {
165
+ "mcpServers": {
166
+ "codeocean": {
167
+ "command": "uvx",
168
+ "args": ["codeocean-mcp-server"],
169
+ "env": {
170
+ "CODEOCEAN_DOMAIN": "https://codeocean.acme.com",
171
+ "CODEOCEAN_TOKEN": "<YOUR_API_KEY>"
172
+ }
173
+ }
174
+ }
175
+ }
176
+ ```
177
+ 3. Save the file. Cursor will automatically detect and launch the new server on next start. 
178
+
179
+ ---
180
+
181
+ ## [Windsurf](https://docs.windsurf.com/windsurf/cascade/mcp)
182
+
183
+ Windsurf (Cascade) uses mcp_config.json under ~/.codeium/windsurf/ (or via the Cascade → MCP Servers UI) .
184
+ 1. Open your Windsurf Settings and navigate to Cascade → MCP Servers, then click View Raw Config to open mcp_config.json. 
185
+ 2. Insert the following under "mcpServers":
186
+ ```json
187
+ {
188
+ "mcpServers": {
189
+ "codeocean": {
190
+ "command": "uvx",
191
+ "args": ["codeocean-mcp-server"],
192
+ "env": {
193
+ "CODEOCEAN_DOMAIN": "https://codeocean.acme.com",
194
+ "CODEOCEAN_TOKEN": "<YOUR_API_KEY>"
195
+ }
196
+ }
197
+ }
198
+ }
199
+ ```
200
+
201
+ 3. Save and restart Windsurf (or hit “Refresh” in the MCP panel).
@@ -0,0 +1,183 @@
1
+ # Code Ocean MCP Server
2
+
3
+ Model Context Protocol (MCP) server for Code Ocean.
4
+
5
+ This MCP server provides tools to search and run capsules and pipelines, and manage data assets.
6
+
7
+ ## Table of Contents
8
+
9
+ - [Prerequisites](#prerequisites)
10
+ - [Installation](#installation)
11
+ - [Visual Studio Code](#visual-studio-code)
12
+ - [Claude Desktop](#claude-desktop)
13
+ - [Cline](#cline)
14
+ - [Roo Code](#roo-code)
15
+ - [Cursor](#cursor)
16
+ - [Windsurf](#windsurf)
17
+
18
+ ## Prerequisites
19
+
20
+ 1. Install `uv` from [Astral](https://docs.astral.sh/uv/getting-started/installation/) or the [GitHub README](https://github.com/astral-sh/uv#installation)
21
+ 2. Install Python 3.10 or newer using `uv python install 3.10` (or a more recent version)
22
+ 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
+
24
+ ## Installation
25
+
26
+ ## [Visual Studio Code](https://code.visualstudio.com/docs/copilot/chat/mcp-servers)
27
+
28
+ Here's an example VS Code MCP server configuration:
29
+ ```json
30
+ {
31
+ ...
32
+ "mcp": {
33
+ "inputs": [
34
+ {
35
+ "type": "promptString",
36
+ "id": "codeocean-token",
37
+ "description": "Code Ocean API Key",
38
+ "password": true
39
+ }
40
+ ],
41
+ "servers": {
42
+ "codeocean": {
43
+ "type": "stdio",
44
+ "command": "uvx",
45
+ "args": ["codeocean-mcp-server"],
46
+ "env": {
47
+ "CODEOCEAN_DOMAIN": "https://codeocean.acme.com",
48
+ "CODEOCEAN_TOKEN": "${input:codeocean-token}"
49
+ }
50
+ }
51
+ },
52
+ }
53
+ }
54
+ ```
55
+
56
+ ---
57
+
58
+ ## [Claude Desktop](https://modelcontextprotocol.io/quickstart/user)
59
+
60
+ 1. Open the `claude_desktop_config.json` file:
61
+ - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
62
+ - Windows: `%APPDATA%\Claude\claude_desktop_config.json`
63
+ 2. Under the top-level "mcpServers" object, add a "codeocean" entry. For a stdio transport (child-process) it looks like this:
64
+
65
+ ```json
66
+ {
67
+ "mcpServers": {
68
+ "codeocean": {
69
+ "command": "uvx",
70
+ "args": ["codeocean-mcp-server"],
71
+ "env": {
72
+ "CODEOCEAN_DOMAIN": "https://codeocean.acme.com",
73
+ "CODEOCEAN_TOKEN": "<YOUR_API_KEY>"
74
+ }
75
+ }
76
+ }
77
+ }
78
+ ```
79
+
80
+ ---
81
+
82
+ ## [Cline](https://docs.cline.bot/mcp/configuring-mcp-servers)
83
+
84
+ 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:
85
+ 1. Open Cline and click the MCP Servers icon in the sidebar.
86
+ 2. In the “Installed” tab, click Configure MCP Servers → this opens your cline_mcp_settings.json.
87
+ 3. Add a "codeocean" server under the "mcpServers" key. For stdio transport:
88
+ ```json
89
+ {
90
+ "mcpServers": {
91
+ "codeocean": {
92
+ "command": "uvx",
93
+ "args": ["codeocean-mcp-server"],
94
+ "env": {
95
+ "CODEOCEAN_DOMAIN": "https://codeocean.acme.com",
96
+ "CODEOCEAN_TOKEN": "<YOUR_API_KEY>"
97
+ },
98
+ "alwaysAllow": [], // optional: list of tools to auto-approve
99
+ "disabled": false // ensure it’s enabled
100
+ }
101
+ }
102
+ }
103
+ ```
104
+ 4. Save the file. Cline will automatically detect and launch the new server, making your Code Ocean tools available in chat .
105
+
106
+ ---
107
+
108
+ ## [Roo Code](https://docs.roocode.com/features/mcp/using-mcp-in-roo/)
109
+
110
+ Roo Code’s MCP support is configured globally across all workspaces via a JSON settings file or through its dedicated MCP Settings UI
111
+
112
+ ### Via the MCP Settings UI:
113
+ 1. Click the MCP icon in Roo Code’s sidebar. 
114
+ 2. Select Edit MCP Settings (opens cline_mcp_settings.json). 
115
+ 3. Under "mcpServers", add:
116
+
117
+ ```json
118
+ {
119
+ "mcpServers": {
120
+ "codeocean": {
121
+ "command": "uvx",
122
+ "args": ["codeocean-mcp-server"],
123
+ "env": {
124
+ "CODEOCEAN_DOMAIN": "https://codeocean.acme.com",
125
+ "CODEOCEAN_TOKEN": "<YOUR_API_KEY>"
126
+ }
127
+ }
128
+ }
129
+ }
130
+ ```
131
+ 4. Save and restart Roo Code; your Code Ocean tools will appear automatically.
132
+
133
+ ### Optional: Manually editing cline_mcp_settings.json
134
+ 1. Locate cline_mcp_settings.json (in your home directory or workspace). 
135
+ 2. Insert the same "codeocean" block under "mcpServers" as above.
136
+ 3. Save and restart.
137
+
138
+ ---
139
+
140
+ ## [Cursor](https://docs.cursor.com/context/model-context-protocol)
141
+
142
+ Cursor stores MCP servers in a JSON file at either ~/.cursor/mcp.json (global) or {project}/.cursor/mcp.json (project-specific) .
143
+ 1. Open .cursor/mcp.json (or create it if missing). 
144
+ 2. Add under "mcpServers":
145
+ ```json
146
+ {
147
+ "mcpServers": {
148
+ "codeocean": {
149
+ "command": "uvx",
150
+ "args": ["codeocean-mcp-server"],
151
+ "env": {
152
+ "CODEOCEAN_DOMAIN": "https://codeocean.acme.com",
153
+ "CODEOCEAN_TOKEN": "<YOUR_API_KEY>"
154
+ }
155
+ }
156
+ }
157
+ }
158
+ ```
159
+ 3. Save the file. Cursor will automatically detect and launch the new server on next start. 
160
+
161
+ ---
162
+
163
+ ## [Windsurf](https://docs.windsurf.com/windsurf/cascade/mcp)
164
+
165
+ Windsurf (Cascade) uses mcp_config.json under ~/.codeium/windsurf/ (or via the Cascade → MCP Servers UI) .
166
+ 1. Open your Windsurf Settings and navigate to Cascade → MCP Servers, then click View Raw Config to open mcp_config.json. 
167
+ 2. Insert the following under "mcpServers":
168
+ ```json
169
+ {
170
+ "mcpServers": {
171
+ "codeocean": {
172
+ "command": "uvx",
173
+ "args": ["codeocean-mcp-server"],
174
+ "env": {
175
+ "CODEOCEAN_DOMAIN": "https://codeocean.acme.com",
176
+ "CODEOCEAN_TOKEN": "<YOUR_API_KEY>"
177
+ }
178
+ }
179
+ }
180
+ }
181
+ ```
182
+
183
+ 3. Save and restart Windsurf (or hit “Refresh” in the MCP panel).
@@ -0,0 +1,24 @@
1
+ # Version Release Process
2
+
3
+ 1. Open a PR with the following changes:
4
+ 1. Bump the version in [pyproject.toml](pyproject.toml).
5
+ 1. Update the [CHANGELOG.md](CHANGELOG.md).
6
+ 1. Commit the updates with the message `Bump version to X.Y.Z`.
7
+ 1. Merge the PR.
8
+ 1. Locally, sync your clone with GitHub:
9
+ ```
10
+ git fetch origin
11
+ git checkout main
12
+ git reset --hard origin/main
13
+ ```
14
+ 1. Tag the release:
15
+ ```
16
+ git tag vX.Y.Z -m "vX.Y.Z"
17
+ ```
18
+ 1. Push changes:
19
+ ```
20
+ git push origin vX.Y.Z
21
+ ```
22
+
23
+ This will trigger a workflow on CircleCI that will generate a GitHub release
24
+ and publish the new version to PyPI.
@@ -0,0 +1,64 @@
1
+ [project]
2
+ name = "codeocean-mcp-server"
3
+ version = "0.1.0"
4
+ authors = [{ name = "Code Ocean", email = "dev@codeocean.com" }]
5
+ description = "Code Ocean MCP Server"
6
+ readme = "README.md"
7
+ requires-python = ">=3.10"
8
+ classifiers = [
9
+ "Programming Language :: Python :: 3",
10
+ "License :: OSI Approved :: MIT License",
11
+ "Operating System :: OS Independent",
12
+ ]
13
+ dependencies = [
14
+ "codeocean>=0.7.0",
15
+ "fastmcp>=2.9.2",
16
+ ]
17
+ license = "MIT"
18
+
19
+ [dependency-groups]
20
+ dev = [
21
+ "boto3>=1.39.0",
22
+ "deepdiff>=8.5.0",
23
+ "hatch>=1.14.1",
24
+ "mcp-python-client>=0.1.9",
25
+ "pytest>=8.4.1",
26
+ "ruff>=0.12.1",
27
+ ]
28
+
29
+ [project.urls]
30
+ Homepage = "https://github.com/codeocean/codeocean-mcp-server"
31
+ Issues = "https://github.com/codeocean/codeocean-mcp-server/issues"
32
+ Changelog = "https://github.com/codeocean/codeocean-mcp-server/blob/main/CHANGELOG.md"
33
+
34
+ [project.scripts]
35
+ codeocean-mcp-server = "codeocean_mcp_server.server:main"
36
+
37
+ [build-system]
38
+ requires = ["hatchling"]
39
+ build-backend = "hatchling.build"
40
+
41
+ [tool.hatch.build.targets.sdist]
42
+ exclude = ["/.circleci"]
43
+
44
+ [tool.hatch.build.targets.wheel]
45
+ packages = ["src/codeocean_mcp_server"]
46
+
47
+ [tool.hatch.envs.default.scripts]
48
+ test = "pytest"
49
+
50
+ [[tool.hatch.envs.test.matrix]]
51
+ python = ["3.10", "3.11", "3.12", "3.13"]
52
+
53
+ [tool.ruff]
54
+ line-length = 120
55
+
56
+ [tool.ruff.lint]
57
+ select = ["C", "D", "E", "F", "I", "W"]
58
+ ignore = ["D100", "D104"]
59
+
60
+ [tool.pytest.ini_options]
61
+ filterwarnings = [
62
+ "ignore:datetime.datetime.utcnow() is deprecated:DeprecationWarning:botocore.auth",
63
+ "ignore::DeprecationWarning:botocore.*",
64
+ ]
@@ -0,0 +1,21 @@
1
+ """File utilities for downloading and reading files."""
2
+
3
+ import requests
4
+
5
+ # Constants
6
+ MAX_FILE_CONTENT_LENGTH = 50_000 # Maximum length of content to read
7
+ DOWNLOAD_TIMEOUT = 30
8
+
9
+
10
+ def download_and_read_file(url: str) -> str:
11
+ """Download file from URL and return first MAX_FILE_CONTENT_LENGTH characters."""
12
+ try:
13
+ with requests.get(url, timeout=DOWNLOAD_TIMEOUT, stream=True) as response:
14
+ response.raise_for_status()
15
+ # Read the first 'bytes_to_read' bytes of the response
16
+ data = response.raw.read(MAX_FILE_CONTENT_LENGTH)
17
+ # Decode the data into a string using the response's encoding
18
+ return data.decode(response.encoding or "utf-8", errors="ignore")
19
+
20
+ except requests.exceptions.RequestException as e:
21
+ return f"Download error: {e}"