Skip to main content
Glama
Code Ocean MCP Server

Code Ocean MCP Server

Official
by codeocean

Code Ocean MCP Server

Model Context Protocol (MCP) server for Code Ocean.

This MCP server provides tools to search, run, and release capsules and pipelines, and manage data assets.

Table of Contents

Related MCP server: MCP Data Science

Prerequisites

  1. Install uv from Astral or the GitHub README

  2. Install Python 3.10 or newer using uv python install 3.10 (or a more recent version)

  3. Generate a Code Ocean access token. Follow instructions in the Code Ocean user guide.

Code Ocean Platform Version Compatibility

Each release of this Code Ocean MCP Server is tested and verified against a specific minimum version of the Code Ocean platform API. Generally, this minimum version is the latest Code Ocean version at the time of the MCP Server release. We recommend ensuring your MCP Server dependency is pinned to a version compatible with your Code Ocean deployment. For details on when the minimum Code Ocean platform version changes, see the CHANGELOG.

Installation

Visual Studio Code

Here's an example VS Code MCP server configuration:

{
    ...
    "mcp": {
        "inputs": [
            {
            "type": "promptString",
            "id": "codeocean-token",
            "description": "Code Ocean API Key", 
            "password": true
            }
        ],
        "servers": {
            "codeocean": {
                "type": "stdio",
                "command": "uvx",
                "args": ["codeocean-mcp-server"],
                "env": {
                    "CODEOCEAN_DOMAIN": "https://codeocean.acme.com",
                    "CODEOCEAN_TOKEN": "${input:codeocean-token}",
                    "AGENT_ID": "VS Code"
                }
            }
        },
    }
}

Claude Desktop

  1. Open the claude_desktop_config.json file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

  1. Under the top-level "mcpServers" object, add a "codeocean" entry. For a stdio transport (child-process) it looks like this:

{
  "mcpServers": {
    "codeocean": {
      "command": "uvx",
      "args": ["codeocean-mcp-server"],
      "env": {
        "CODEOCEAN_DOMAIN": "https://codeocean.acme.com",
        "CODEOCEAN_TOKEN": "<YOUR_API_KEY>",
        "AGENT_ID": "Claude Desktop"
      }
    }
  }
}

Cline

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:

  1. Open Cline and click the MCP Servers icon in the sidebar.

  2. In the “Installed” tab, click Configure MCP Servers → this opens your cline_mcp_settings.json.

  3. Add a "codeocean" server under the "mcpServers" key. For stdio transport:

{
  "mcpServers": {
    "codeocean": {
      "command": "uvx",
      "args": ["codeocean-mcp-server"],
      "env": {
        "CODEOCEAN_DOMAIN": "https://codeocean.acme.com",
        "CODEOCEAN_TOKEN": "<YOUR_API_KEY>",
        "AGENT_ID": "Cline"
      },
      "alwaysAllow": [],       // optional: list of tools to auto-approve
      "disabled": false        // ensure it’s enabled
    }
  }
}
  1. Save the file. Cline will automatically detect and launch the new server, making your Code Ocean tools available in chat .


Roo Code

Roo Code’s MCP support is configured globally across all workspaces via a JSON settings file or through its dedicated MCP Settings UI

Via the MCP Settings UI:

  1. Click the MCP icon in Roo Code’s sidebar. 

  2. Select Edit MCP Settings (opens cline_mcp_settings.json). 

  3. Under "mcpServers", add:

{
  "mcpServers": {
    "codeocean": {
      "command": "uvx",
      "args": ["codeocean-mcp-server"],
      "env": {
        "CODEOCEAN_DOMAIN": "https://codeocean.acme.com",
        "CODEOCEAN_TOKEN": "<YOUR_API_KEY>",
        "AGENT_ID": "Roo Code"
      }
    }
  }
}
  1. Save and restart Roo Code; your Code Ocean tools will appear automatically.

Optional: Manually editing cline_mcp_settings.json

  1. Locate cline_mcp_settings.json (in your home directory or workspace). 

  2. Insert the same "codeocean" block under "mcpServers" as above.

  3. Save and restart.


Cursor

Cursor stores MCP servers in a JSON file at either ~/.cursor/mcp.json (global) or {project}/.cursor/mcp.json (project-specific) .

  1. Open .cursor/mcp.json (or create it if missing). 

  2. Add under "mcpServers":

{
  "mcpServers": {
    "codeocean": {
      "command": "uvx",
      "args": ["codeocean-mcp-server"],
      "env": {
        "CODEOCEAN_DOMAIN": "https://codeocean.acme.com",
        "CODEOCEAN_TOKEN": "<YOUR_API_KEY>",
        "AGENT_ID": "Cursor"
      }
    }
  }
}
  1. Save the file. Cursor will automatically detect and launch the new server on next start. 


Windsurf

Windsurf (Cascade) uses mcp_config.json under ~/.codeium/windsurf/ (or via the Cascade → MCP Servers UI) .

  1. Open your Windsurf Settings and navigate to Cascade → MCP Servers, then click View Raw Config to open mcp_config.json. 

  2. Insert the following under "mcpServers":

{
  "mcpServers": {
    "codeocean": {
      "command": "uvx",
      "args": ["codeocean-mcp-server"],
      "env": {
        "CODEOCEAN_DOMAIN": "https://codeocean.acme.com",
        "CODEOCEAN_TOKEN": "<YOUR_API_KEY>",
        "AGENT_ID": "Windsurf"
      }
    }
  }
}
  1. Save and restart Windsurf (or hit “Refresh” in the MCP panel).

Streamable HTTP Transport

By default the server runs over stdio and authenticates with the CODEOCEAN_TOKEN environment variable, as described above. It can also serve multiple users from a single process over streamable HTTP, taking each caller's API token from the request instead:

CODEOCEAN_DOMAIN=https://acmecorp.codeocean.com codeocean-mcp-server --transport streamable-http --host 127.0.0.1 --port 8000

Clients then pass their own token as Authorization: Bearer <YOUR_API_KEY> on every request; CODEOCEAN_TOKEN is not used, and a request without a token is refused. The endpoint is http://<host>:<port>/mcp.

Local Testing

You can test the MCP server locally during development with MCP Inspector:

npx @modelcontextprotocol/inspector uv tool run codeocean-mcp-server

This will start a web server where you can:

  • View available tools and resources

  • Test tool calls interactively

  • See server logs and responses

Log Formatting (Optional)

The MCP server supports custom log formatting through the LOG_FORMAT environment variable. This allows you to control the format of log messages output by the server. Example Format Strings: "%(asctime)s %(levelname)s [%(name)s] %(message)s". If LOG_FORMAT is not set, the server uses FastMCP's default logging configuration.

The LOG_LEVEL environment variable sets the level the server logs at: DEBUG, INFO (the default), WARNING, ERROR or CRITICAL. Raising it drops the record the server writes for every request it serves, which is worth doing when the server runs alongside a caller that logs those requests itself.

Available Tools

26 tools
attach_computation_data_assetsC

Attach one or more data assets to a cloud workstation session computation. Accepts a list of parameter objects (e.g. [{'id': '...'}]). Use for cloud workstation sessions.

Inputs: computation_id (required), attach_params (required). Returns: result

attach_data_assetsA

Attach one or more data assets to a capsule with optional mount paths. Use when the capsule has no running cloud workstations. For active cloud workstation sessions use attach_computation_data_assets instead. Accepts a list of parameter objects (e.g. [{'id': '...'}]), not just a list of IDs.

Inputs: capsule_id (required), attach_params (required). Returns: result

create_data_assetA

Create a new data asset from various sources including S3 buckets, computation results, or combined assets.

Data assets are versioned, immutable collections of files that serve as inputs or outputs for computational workflows in Code Ocean. Internal data assets store files within Code Ocean's infrastructure, while external data assets reference files in external storage (S3/GCP) without copying.

Supports creating data assets from AWS S3, GCP Cloud Storage, computation results, or combining existing data assets. Returns confirmation of creation request validity, not success, as creation takes time. Use wait_until_ready() to monitor creation progress.

You can link to the created data assets with the 'data_asset_id' with the pattern: https://codeocean.example.com with /data-assets/<data_asset_id>.

Inputs: data_asset_params (required). Returns: id, name, size, tags, +16 more

delete_computationB

Delete a computation and stop it if currently running.

Inputs: computation_id (required). Returns: result

detach_computation_data_assetsB

Detach one or more data assets from a cloud workstation session computation by their IDs.

Inputs: computation_id (required), data_assets (required). Returns: result

detach_data_assetsA

Detach one or more data assets from a capsule by their IDs. Use when the capsule has no running cloud workstations. For active cloud workstation sessions use detach_computation_data_assets instead.

Inputs: capsule_id (required), data_assets (required). Returns: result

download_and_read_a_file_from_computationC

Use when you want to read the content of a file from a computation

Inputs: computation_id (required), file_path (required). Returns: result

download_and_read_a_file_from_data_assetC

Use when you want to read the content of a file from a data asset

Inputs: data_asset_id (required), file_path (required). Returns: result

get_capsuleA

Retrieve metadata for a specific capsule by its ID.Use only to fetch metadata for a known capsule ID. Do not use for searching.

Inputs: capsule_id (required). Returns: id, name, slug, tags, +12 more

get_capsule_app_panelB

Retrieve app panel information for a specific capsule by its ID.

Inputs: capsule_id (required), version. Returns: App Panel configuration for a capsule or pipeline, including general info, data…

get_computationB

Retrieve metadata and status information for a specific computation by its ID.

Inputs: computation_id (required). Returns: id, name, state, created, +9 more

get_custom_metadataB

Retrieve the Code Ocean deployment's custom metadata schema.

Inputs: no named parameters. Returns: fields, categories

get_data_assetA

Get full details for a data asset by ID. Use after compact search to retrieve complete metadata.

Inputs: data_asset_id (required). Returns: id, name, size, tags, +16 more

get_data_asset_file_urlsA

Generate view and download URLs for a specific file from an internal data asset.Call only when the data asset is already created and in a ready state. If the asset may not yet be ready, first use wait_until_ready to poll until readiness, then retrieve the download URL.

Inputs: data_asset_id (required), file_path (required). Returns: view_url, download_url

get_result_file_urlsB

Generate view and download URLs for a specific result file from a computation.

Inputs: computation_id (required), file_path (required). Returns: view_url, download_url

list_computation_resultsB

List result files and folders generated by a computation at the specified path. Empty path retrieves the /results root folder. computation_id is required as string

Inputs: computation_id (required). Returns: items

list_computationsB

Get all computations associated with a specific capsule.

Inputs: capsule_id (required). Returns: result

list_data_asset_filesB

List files and folders within an internal data asset at the specified path. Empty path retrieves root level contents.

Inputs: data_asset_id (required), path. Returns: items

rename_computationB

Rename an existing computation with a new display name.

Inputs: computation_id (required), name (required). Returns: result

run_capsuleA

Execute a capsule or pipeline with specified parameters and data assets.

For capsule execution: Set run_params.capsule_id and optionally provide data_assets, parameters, or named_parameters.

For pipeline execution: Set run_params.pipeline_id and optionally provide data_assets, processes (with process-specific parameters), and nextflow_profile configuration.

Typical workflow: 1) run_capsule() to start execution 2) wait_until_completed() to monitor progress 3) list_computation_results() and get_result_file_urls() to retrieve outputs.

Inputs: run_params (required). Returns: id, name, state, created, +9 more

search_capsulesA

Search for capsules with filtering, sorting, and pagination options. Compact results: {items: [{id, n, s, d, t}], has_more, next_token, item_count}.

Item fields: id=id, n=name, s=slug, d=description (truncated), t=tags (limited). Pagination: item_count returns the number of items in the current page. Use next_token for additional pages when has_more=true. Set include_field_names=true to add field_names with full labels. Use get_capsule(id) if full details needed.

Inputs: search_params (required), include_field_names. Returns: Compact results: {items: [{id, n, s, d, t}], has_more, next_token, item_count}.…

search_data_assetsA

Search for data assets with filtering, sorting, and pagination options. Compact results: {items: [{id, n, d, t}], has_more, next_token, item_count}.

Item fields: id=id, n=name, d=description (truncated), t=tags (limited). Pagination: item_count returns the number of items in the current page. Use next_token for additional pages when has_more=true. Set include_field_names=true to add field_names with full labels. Use get_data_asset(id) if full details needed.

Inputs: search_params (required), include_field_names. Returns: Compact results: {items: [{id, n, d, t}], has_more, next_token, item_count}. It…

search_pipelinesA

Search for pipelines with filtering, sorting, and pagination options. Compact results: {items: [{id, n, s, d, t}], has_more, next_token, item_count}.

Item fields: id=id, n=name, s=slug, d=description (truncated), t=tags (limited). Pagination: item_count returns the number of items in the current page. Use next_token for additional pages when has_more=true. Set include_field_names=true to add field_names with full labels. Use get_capsule(id) if full details needed.

Inputs: search_params (required), include_field_names. Returns: Compact results: {items: [{id, n, s, d, t}], has_more, next_token, item_count}.…

update_metadataB

Update metadata for a data asset including name, description, tags, mount, and custom metadata.

Supports updating various metadata types:

  • Basic metadata: name (display name), description (free text description)

  • Organization: tags (keywords for searching), mount (default mount folder path)

  • Custom metadata: admin-defined custom fields with user-set values according to deployment configuration (string, number, or date fields in unix epoch format)

Inputs: data_asset_id (required), update_params (required). Returns: id, name, size, tags, +16 more

wait_until_completedA

Poll a computation until it reaches 'Completed' or 'Failed' state with configurable timing.

Args: computation: The computation object to monitor polling_interval: Time between status checks in seconds (minimum 5 seconds) timeout: Maximum time to wait in seconds, or None for no timeout

Returns: Updated computation object once completed or failed

Raises: ValueError: If polling_interval < 5 or timeout constraints are violated TimeoutError: If computation doesn't complete within the timeout period

Inputs: computation_id (required). Returns: id, name, state, created, +9 more

wait_until_readyA

Poll a data asset until it reaches 'Ready' or 'Failed' state with configurable timing.

Args: data_asset: The data asset object to monitor polling_interval: Time between status checks in seconds (minimum 5 seconds) timeout: Maximum time to wait in seconds, or None for no timeout

Returns: Updated data asset object once ready or failed

Raises: ValueError: If polling_interval < 5 or timeout constraints are violated TimeoutError: If data asset doesn't become ready within timeout period Poll until the specified data asset becomes ready before performing further operations (e.g., downloading files). You can set polling_interval and optional timeout.

Inputs: data_asset (required), polling_interval, timeout. Returns: id, name, size, tags, +16 more

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 26 tools

    Disambiguation3/5

    The tool set has clear distinctions between major resource types (capsules, computations, data assets, pipelines), but there is notable overlap and confusion in specific areas. For example, attach_computation_data_assets and attach_data_assets have overlapping purposes with subtle context differences that could lead to misselection, and download_and_read_a_file_from_computation vs get_result_file_urls serve similar file access needs but with different approaches. The descriptions help clarify, but the boundaries are not always crisp.

    Naming Consistency4/5

    Most tools follow a consistent verb_noun pattern (e.g., create_data_asset, list_computations, update_metadata), which is predictable and readable. However, there are minor deviations, such as download_and_read_a_file_from_computation using a verbose phrase instead of a simpler verb_noun structure, and get_custom_metadata not fully aligning with the pattern. Overall, the naming is mostly consistent with only a few outliers.

    Tool Count3/5

    With 26 tools, the count is borderline high for the server's purpose of managing computational workflows in Code Ocean. While the domain is complex and may justify many operations, the set feels heavy and could be streamlined, such as by merging similar tools like the attach/detach pairs. It's not extreme, but it approaches the upper limit of what is manageable without confusion.

    Completeness4/5

    The tool surface provides comprehensive coverage for core workflows involving capsules, computations, data assets, and pipelines, including CRUD operations, execution, monitoring, and file access. Minor gaps exist, such as no direct tools for deleting capsules or pipelines, and limited update capabilities beyond metadata, but agents can likely work around these with the available tools. The set supports typical user journeys from creation to result retrieval.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers