Skip to content

configuration

dmingolla edited this page Jul 9, 2025 · 7 revisions

1. Project Installation and Setup

Before using the MCP server, you need to install the necessary software and set up the project on your local machine.

Prerequisites

Ensure you have the following software installed:

  • Python 3.10+
  • UV (Python package manager)
  • A running OpenNebula deployment that is accessible from your machine.
  • An MCP Client (e.g., Cursor, Warp Terminal, MCP Host).

Installation Steps

  1. Install UV (if you haven't already):

    # On Linux/macOS
    curl -LsSf https://astral.sh/uv/install.sh | sh
    
    # Or via pip
    pip install uv
  2. Clone the Repository:

    git clone https://github.com/OpenNebula/one-mcp.git
    cd one-mcp
  3. Create a Virtual Environment and Install Dependencies:

    # Create the virtual environment
    uv venv
    
    # Activate the environment
    source .venv/bin/activate
    
    # Install project dependencies
    uv sync
  4. Verify the Installation: Run the server to confirm it starts correctly.

    python main.py

    You should see the output: >>> Starting MCP server...

2. MCP Client Configuration

Integrate the MCP server with your AI-powered client for seamless interaction.

Cursor IDE

  1. Configure MCP Server in Cursor: Open your Cursor MCP settings file (~/.cursor/mcp.json) and add the following server configuration. Remember to update the paths to match your project's location.

    {
      "mcpServers": {
        "opennebula-mcp-server": {
          "command": "uv",
          "args": [
            "run",
            "-p",
            "/opt/one-mcp/.venv/bin/python",
            "--",
            "/opt/one-mcp/main.py"
          ],
          "type": "command",
          "cwd": "/opt/one-mcp"
        }
      }
    }

Warp Terminal

  1. Configure MCP Server in Warp: In Warp's settings (Settings > AI > MCP Server), add the following configuration. Remember to adjust the paths.

    {
      "opennebula-mcp-server": {
        "command": "uv",
        "args": [
          "run",
          "-p",
          "/opt/one-mcp/.venv/bin/python",
          "--",
          "/opt/one-mcp/main.py"
        ],
        "env": {},
        "working_directory": null,
        "start_on_launch": true
      }
    }

3. Testing Environment Configuration

Configure your environment to run the project's test suites.

Promptfoo (AI Interaction Tests)

Promptfoo is used to test the MCP Server's ability to select and use the correct tools.

  1. Set Up Environment Variables: Create an .env file in the project's root directory.

  2. Add Your OpenAI API Key: Add your API key to the .env file. This is required for the evaluation model.

    OPENAI_API_KEY=sk-proj-XXX
    

Pytest (Tool Unit Tests)

Pytest is used to run unit tests against individual tool functions.

  1. Configure Test VM IP Address: The VM-related tests require an active OpenNebula VM. Edit src/tests/pytest/conftest.py and set TEST_VM_IP_ADDRESS to the IP of your test VM.

    # src/tests/pytest/conftest.py
    
    # ...
    # Update this IP address to match an active VM with SSH access
    TEST_VM_IP_ADDRESS = "172.20.0.12"  # 👈 Replace with your test VM's IP
  2. Test VM Requirements: Your test VM must meet the following criteria:

    • State must be ACTIVE/RUNNING.
    • SSH access must be enabled.
    • The VM must have root access or sudo privileges.
    • The MCP server host must have network connectivity to the VM.
  3. Verify VM Connectivity: You can test the connection from your terminal:

    # Replace with your test VM's IP
    ssh root@172.20.0.12 "echo 'VM connectivity test successful'"

Clone this wiki locally