Report this

What is the reason for this report?

Setting Up the DigitalOcean MCP Server in Claude Code

Published on June 3, 2025
Setting Up the DigitalOcean MCP Server in Claude Code

Last week, we announced the new DigitalOcean MCP Server - a tool that connects Claude Desktop (or IDEs like Cursor, or Windsurf) to your DigitalOcean account so it can actually do things: deploy apps, fetch logs, restart services, and more.

In this post, we’ll walk through how to set it up with Claude Code - Anthropic’s terminal-based CLI. Claude Code runs locally in your terminal and has access to your current project folder, which makes it perfect for things like deploying apps with context using MCP servers.

Note: If you’re new to MCP and wondering what this all unlocks, check out our high-level intro: MCP 101: An Introduction to Model Context Protocol, and MCP Server in Python — Everything I Wish I’d Known on Day One.

set up claude code mcp server

We’ll set up the server using the default (local) scope, verify it’s working, and run our first natural language prompt. Let’s dive in.

Step 1: Get Your DigitalOcean API Token

The MCP server needs permission to interact with your DigitalOcean account. To do that, you’ll need a personal access token with App Platform access.

  1. Go to DigitalOcean’s API Tokens page
  2. Click Generate New Token
  3. Give it a name like mcp-server-token
  4. Make sure it has App Platform scopes (read/write)
  5. Copy and save the token somewhere safe—you’ll need it shortly

DO API Token page

Step 2: Install Claude Code CLI

If you haven’t already installed Claude Code, follow the instructions here to set it up.

Once installed, confirm it’s working:

claude --help

You should see a list of Claude’s CLI commands:

Claude CLI Commants

Step 3: Add the DigitalOcean MCP Server (Local Scope)

Let’s add the DigitalOcean MCP server using the default scope—which is local. This means the server will be available only to you inside your current folder (private to you in this project).

Run the following command (replace the token):

claude mcp add digitalocean-mcp-local \
  -e DIGITALOCEAN_API_TOKEN=YOUR_DO_API_TOKEN \
  -- npx "@digitalocean/mcp"

What’s happening here:

  • digitalocean-mcp-local is the name you’re giving the server (you can name it anything)
  • -e sets an environment variable for the token
  • -- separates Claude flags from the server command
  • npx "@digitalocean/mcp" runs the official server without needing a separate install

Adding DigitalOcean MCP Server in Claude Code

Step 4: Check the Server

You can list your registered servers with:

claude mcp list

You should see digitalocean-mcp-local listed.

List the MCP Servers

To see its full configuration:

claude mcp get digitalocean-mcp-local

Get MCP server details

If you don’t see it, or if something went wrong, double-check your token and make sure Claude Code is installed correctly.

Step 5: Try a Prompt

Now that everything is set up, run Claude:

claude

Then try a natural language request like:

List all my apps on DigitalOcean

or

Create a new app from this GitHub repo: https://github.com/do-community/do-one-click-deploy-flask

Claude will ask you to approve the tool call. Say yes, and watch it go to work.

Using DO MCP in Claude Code

What’s Next

You now have Claude Code wired up to your DigitalOcean account using the MCP server. You can:

  • Deploy apps from GitHub repos
  • Check logs and environments
  • Restart or delete services

Curious what else you can do with it? We walk through the full workflow—connecting Claude to DigitalOcean, building and deploying a React app, pulling logs, and more in this video:

The video shows how to do it in Cursor, but everything you see there works exactly the same in Claude Code. The MCP server and tool calls are identical.

For a complete list of tools and capabilities of the DigitalOcean MCP server, check out DigitalOcean MCP Server on GitHub.

More Resources

Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.

Learn more about our products

Still looking for an answer?

Was this helpful?


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Creative CommonsThis work is licensed under a Creative Commons Attribution-NonCommercial- ShareAlike 4.0 International License.
Join the Tech Talk
Success! Thank you! Please check your email for further details.

Please complete your information!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.