MCP DigitalOcean Integration
About
Manage DigitalOcean resources and perform actions using the DigitalOcean API.
Details
- Author
- digitalocean-labs
- Categories
- Cloud Service, Infrastructure, API
Jump to
Step 1: Set Up Your API Token as an Environment Variable
Option A: Set it as a System Environment Variable (Recommended — persists across reboots)
- OpenStart Menuand search for"Environment Variables". - Click"Edit the system environment variables". - In the System Properties dialog, click the"Environment Variables..."button. - Under"User variables", click"New...". - Fill in:- Variable name:DIGITALOCEAN_API_TOKEN
- Variable value:your_actual_token_here
Manage DigitalOcean resources and perform actions using the DigitalOcean API.
MCP DigitalOcean Integration is an open-source project that provides a comprehensive interface for managing DigitalOcean resources and performing actions using theDigitalOcean API. Built on top of thegodolibrary and theMCP framework, this project exposes a wide range of tools to simplify cloud infrastructure management.
DISCLAIMER:"Use of MCP technology to interact with your DigitalOcean accountcan come with risks"
WARNING:Do NOT paste your DigitalOcean API token directly into any config file (e.g.,claude_desktop_config.json,~/.cursor/config.json, VS Code settings). If you commit these files to GitHub, your token will be exposed and GitHub will automatically block or revoke it to protect your account.
The safe approach is to store your token in anenvironment variableon your machine and reference it from your config file. Follow the steps below for your operating system before proceeding with any client installation.
Step 1: Set Up Your API Token as an Environment Variable
Option A: Set it in your shell profile (Recommended — persists across reboots)
- If it outputs/bin/zsh→ edit~/.zshrc
- If it outputs/bin/bash→ edit~/.bashrcor~/.bash_profile
# For zsh (default on macOS Monterey and later) nano ~/.zshrc # For bash nano ~/.bashrc
Add the following line at the bottom of the file:
export DIGITALOCEAN_API_TOKEN="your_actual_token_here"
Replaceyour_actual_token_herewith your real token from theDigitalOcean API Tokens page.
- Innano: pressCtrl + O, thenEnterto save, thenCtrl + Xto exit.
You should see your token printed in the terminal.
Option B: Use a.envfile (for project-level isolation)
-
In your project root folder, create a.envfile:
DIGITALOCEAN_API_TOKEN=your_actual_token_here
Immediatelyadd.envto your.gitignoreso it is never committed:
echo ".env" >> .gitignore
To load the.envfile into your current terminal session:
export $(grep -v '^#' .env | xargs)
Note:Option B only sets the variable for the current terminal session. You need to run step 4 each time you open a new terminal. For a permanent solution, use Option A.
Option A: Set it as a System Environment Variable (Recommended — persists across reboots)
- OpenStart Menuand search for"Environment Variables". - Click"Edit the system environment variables". - In the System Properties dialog, click the"Environment Variables..."button. - Under"User variables", click"New...". - Fill in:- Variable name:DIGITALOCEAN_API_TOKEN
- Variable value:your_actual_token_here
Option B: Set it temporarily in PowerShell (current session only)
$env:DIGITALOCEAN_API_TOKEN = "your_actual_token_here"
-
In your project folder, create a file named.env(no extension) with this content:
DIGITALOCEAN_API_TOKEN=your_actual_token_here
Get-Content .env | ForEach-Object { if ($_ -match "^\s([^#][^=])=(.*)$") { [System.Environment]::SetEnvironmentVariable($matches[1].Trim(), $matches[2].Trim(), "Process") } }
- Log in to your DigitalOcean account.
- Navigate toAPI→Tokensin the left sidebar, or go directly to:https://cloud.digitalocean.com/account/api/tokens
- Click"Generate New Token".
- Give it a name (e.g.,mcp-local-dev), set expiry, and choose the required scopes.
- Copy the token immediately — it will only be shown once.
- Store it using one of the methods described in Step 1 above.
The easiest way to get started is to use DigitalOcean's hosted MCP services. Each service is deployed as a standalone MCP server accessible via HTTPS, allowing you to connect without running any local server. You can connect to multiple endpoints simultaneously by adding multiple entries to your configuration.
Make sure you have completed Step 1 and yourDIGITALOCEAN_API_TOKENenvironment variable is set. Then run:
claude mcp add --transport http digitalocean-apps https://apps.mcp.digitalocean.com/mcp \ --header "Authorization: Bearer $DIGITALOCEAN_API_TOKEN"
How this works:The$DIGITALOCEAN_API_TOKENis expanded by your shell at the time you run the command. The actual token value is stored securely in Claude's config — you never paste the token into the command yourself.
You can add multiple services the same way:
claude mcp add --transport http digitalocean-databases https://databases.mcp.digitalocean.com/mcp \ --header "Authorization: Bearer $DIGITALOCEAN_API_TOKEN" claude mcp add --transport http digitalocean-droplets https://droplets.mcp.digitalocean.com/mcp \ --header "Authorization: Bearer $DIGITALOCEAN_API_TOKEN"
See theAvailable Servicessection for the complete list of available endpoints.
claude mcp add digitalocean-mcp \ -e DIGITALOCEAN_API_TOKEN=$DIGITALOCEAN_API_TOKEN \ -- npx @digitalocean/mcp --services apps,databases
- Add the MCP server under the default (local) scope — meaning it's only available inside the current folder.
- Register it with the namedigitalocean-mcp.
- Enable theappsanddatabasesservices.
- Pass your DigitalOcean API token securely to the server via environment variable.
- Store the configuration in your global Claude config at~/.claude.json, scoped to the current folder.
Local scope is great when you're testing or only using the server in one project. User scope is better if you want it available everywhere.
If you'd like to make the server available globally (so you don't have to re-add it in each project), you can use theuserscope:
claude mcp add -s user digitalocean-mcp-user-scope \ -e DIGITALOCEAN_API_TOKEN=$DIGITALOCEAN_API_TOKEN \ -- npx @digitalocean/mcp --services apps,databases
- Make the server available in all folders, not just the one you're in
- Scope it to your user account
- Store it in your global Claude config at~/.claude.json
claude mcp remove -s user digitalocean-mcp-user-scope
Before editing the config file, ensureDIGITALOCEAN_API_TOKENis set in your shell profile (see Step 1 — Option A). Claude Desktop reads environment variables from your shell profile at launch.
- macOS:~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:%APPDATA%\Claude\claude_desktop_config.json
- Linux:~/.config/Claude/claude_desktop_config.json
Add the remote MCP servers to your config file. Reference the env var using${DIGITALOCEAN_API_TOKEN}— Claude Desktop will substitute it at runtime:
{ "mcpServers": { "digitalocean-apps": { "url": "https://apps.mcp.digitalocean.com/mcp", "headers": { "Authorization": "Bearer ${DIGITALOCEAN_API_TOKEN}" } }, "digitalocean-databases": { "url": "https://databases.mcp.digitalocean.com/mcp", "headers": { "Authorization": "Bearer ${DIGITALOCEAN_API_TOKEN}" } } } }
Important:The${DIGITALOCEAN_API_TOKEN}syntax tells Claude Desktop to read the value from your system's environment variables. Your actual token is never written into this file. This file is safe to commit to version control.
You can add any of the endpoints listed in theAvailable Servicessection.
Add the following to yourclaude_desktop_config.jsonfile. Theenvblock passes the environment variable directly to the MCP server process — no hardcoded token needed:
{ "mcpServers": { "digitalocean": { "command": "npx", "args": ["@digitalocean/mcp", "--services", "apps"], "env": { "DIGITALOCEAN_API_TOKEN": "${DIGITALOCEAN_API_TOKEN}" } } } }
How this works:The"env"block in Claude Desktop config passes environment variables to the spawned MCP server process. The${DIGITALOCEAN_API_TOKEN}value is resolved from your system environment at runtime. Your token is never stored in the config file itself.
After saving the file,restart Claude Desktopfor the changes to take effect.
Before editing the config file, ensureDIGITALOCEAN_API_TOKENis set in your shell profile (see Step 1 — Option A).
- macOS / Linux:~/.cursor/config.json
- Windows:%USERPROFILE%\.cursor\config.json
Add the remote MCP servers to your Cursor settings file:
{ "mcpServers": { "digitalocean-apps": { "url": "https://apps.mcp.digitalocean.com/mcp", "headers": { "Authorization": "Bearer ${DIGITALOCEAN_API_TOKEN}" } }, "digitalocean-databases": { "url": "https://databases.mcp.digitalocean.com/mcp", "headers": { "Authorization": "Bearer ${DIGITALOCEAN_API_TOKEN}" } } } }
You can add any of the endpoints listed in theAvailable Servicessection.
Add the following to your Cursor settings file located at~/.cursor/config.json:
{ "mcpServers": { "digitalocean": { "command": "npx", "args": ["@digitalocean/mcp", "--services", "apps"], "env": { "DIGITALOCEAN_API_TOKEN": "${DIGITALOCEAN_API_TOKEN}" } } } }
How this works:Cursor resolves${DIGITALOCEAN_API_TOKEN}from your system environment variables when it launches the MCP server. Make sure the variable is set in your shell profile before starting Cursor.
- Open Cursor and open Command Palette (Shift + ⌘ + Pon Mac orCtrl + Shift + Pon Windows/Linux)
- Search for "MCP" in the command palette search bar
- Select "View: Open MCP Settings"
- Select "Tools & Integrations" from the left sidebar
- You should see "digitalocean" listed under Available MCP Servers
- Click on "N tools enabled" (N is the number of tools currently enabled)
To check MCP server logs and debug issues:
- Open the Command Palette (⌘+Shift+Pon Mac orCtrl+Shift+Pon Windows/Linux)
- Type "Developer: Toggle Developer Tools" and press Enter
- Navigate to the Console tab to view MCP server logs
- You'll find MCP related logs as you interact with the MCP server
In Cursor's chat, try asking: "List all my DigitalOcean apps" — this should trigger the MCP server to fetch your apps if properly configured. If you are getting a 401 error or authentication related errors, verify that theDIGITALOCEAN_API_TOKENvariable is correctly set by runningecho $DIGITALOCEAN_API_TOKENin your terminal.
Before editing the config file, ensureDIGITALOCEAN_API_TOKENis set in your shell profile (see Step 1 — Option A).
The VS Code MCP config file is located at.vscode/mcp.jsonin your workspace root. Create this file if it does not exist. Add the remote MCP servers:
{ "inputs": [ { "id": "digitalocean-token", "type": "promptString", "description": "DigitalOcean API Token", "password": true } ], "servers": { "digitalocean-apps": { "url": "https://apps.mcp.digitalocean.com/mcp", "headers": { "Authorization": "Bearer ${input:digitalocean-token}" } }, "digitalocean-databases": { "url": "https://databases.mcp.digitalocean.com/mcp", "headers": { "Authorization": "Bearer ${input:digitalocean-token}" } } } }
How VS Code inputs work:Theinputsblock defines a named input (digitalocean-token) that VS Code willprompt you to enter securelythe first time you use the server. Your token is stored in VS Code's secret storage — never written to disk in plain text. The"password": trueflag ensures it is masked during input. This config file is completely safe to commit to GitHub.
Alternatively, if you prefer to use a system environment variable directly:
{ "inputs": [], "servers": { "digitalocean-apps": { "url": "https://apps.mcp.digitalocean.com/mcp", "headers": { "Authorization": "Bearer ${env:DIGITALOCEAN_API_TOKEN}" } } } }
Note:VS Code uses${env:VARIABLE_NAME}syntax to read from system environment variables.
Add the following to your.vscode/mcp.jsonfile. Use VS Code'sinputsfeature to avoid hardcoding the token:
{ "inputs": [ { "id": "digitalocean-token", "type": "promptString", "description": "DigitalOcean API Token", "password": true } ], "servers": { "mcpDigitalOcean": { "command": "npx", "args": [ "@digitalocean/mcp", "--services", "apps" ], "env": { "DIGITALOCEAN_API_TOKEN": "${input:digitalocean-token}" } } } }
Or, to use a system environment variable directly:
{ "inputs": [], "servers": { "mcpDigitalOcean": { "command": "npx", "args": [ "@digitalocean/mcp", "--services", "apps" ], "env": { "DIGITALOCEAN_API_TOKEN": "${env:DIGITALOCEAN_API_TOKEN}" } } } }
- Open VS Code and open Command Palette (Shift + ⌘ + Pon Mac orCtrl + Shift + Pon Windows/Linux)
- Search for "MCP" in the command palette search bar
- Select "MCP: List Servers"
- Verify that "mcpDigitalOcean" appears in the list of configured servers
To see what tools are available from the MCP server:
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.

