DigitalOcean MCP server

Integrates with DigitalOcean's API to enable automated server management, scaling, and infrastructure operations through natural language commands.
Back to servers
Provider
Lucio
Release date
Jan 29, 2025
Language
Python
Stats
6 stars

This MCP server implements the Model Context Protocol with DigitalOcean integration for server management. It provides a FastAPI-based HTTP server that allows you to manage DigitalOcean resources through MCP protocol interactions.

Installation

To get started with the MCP DigitalOcean Server, follow these steps:

  1. Clone the repository:

    git clone https://github.com/username/mcp-digitalocean-server.git
    cd mcp-digitalocean-server
    
  2. Create your environment file by copying the example:

    cp .env.example .env
    
  3. Edit the .env file and add your DigitalOcean API token and other configuration values.

  4. Install the required dependencies:

    pip install -r requirements.txt
    

Configuration

The server can be configured using environment variables in your .env file:

  • DIGITALOCEAN_TOKEN: Your DigitalOcean API token (required)
  • MCP_SERVER_PORT: Port for the MCP server (default: 8000)
  • MCP_SERVER_HOST: Host for the MCP server (default: 0.0.0.0)

Example .env file:

DIGITALOCEAN_TOKEN=your_digitalocean_api_token_here
MCP_SERVER_PORT=8000
MCP_SERVER_HOST=0.0.0.0

Running the Server

After installation and configuration, you can run the server with:

python src/server.py

The server will start on the host and port specified in your configuration. By default, it will be available at http://0.0.0.0:8000.

Features and Usage

Basic Functionality

The MCP DigitalOcean Server provides:

  • Complete MCP Protocol implementation
  • Integration with DigitalOcean's API for server management
  • HTTP endpoints exposed through FastAPI

Interacting with the Server

The server exposes MCP protocol endpoints that you can interact with using any HTTP client. For example, using curl:

# Example of a basic MCP request
curl -X POST http://localhost:8000/v1/invoke \
  -H "Content-Type: application/json" \
  -d '{"context": {"your_context_here": "value"}, "parameters": {"param1": "value1"}}'

Managing DigitalOcean Resources

Through the MCP protocol, you can manage your DigitalOcean resources by sending appropriately formatted requests to the server. The exact format will depend on the specific operations you want to perform.

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later