Home / Servers / DigitalOcean API / gateway_code_run

Execute Code

An MCP tool from the DigitalOcean API server, hosted on mcp.hjlabs.in.

Execute Code Runs Python code in an ephemeral sandbox and returns its stdout, stderr, and exit_code. This is the REST form of the action_code MCP tool. Use it for computation, parsing, and data processing, or to… [POST /code/execute]

Name on the gateway: digitalocean_api__gateway_code_run · may change things.

Parameters

NameTypeDescription
code requiredstringPython source to run. The sandbox provides invoke_digitalocean_tool(name: str…

How to call it

Through the Smart Gateway, any client can run it by name with call_tool, or let the gateway find it with search_tools:

call_tool arguments
{
  "name": "digitalocean_api__gateway_code_run",
  "arguments": {
    "code": "…"
  }
}

Or connect the DigitalOcean API server directly, which lists 874 tools including this one:

Run in your terminal
claude mcp add --transport http hj-digitalocean-api https://mcp.hjlabs.in/mcp/digitalocean-api \
  --header "Authorization: Bearer YOUR_API_KEY"

Try asking

Use the execute code tool with code set to ….

More from DigitalOcean API