-
Notifications
You must be signed in to change notification settings - Fork 3
configuration
Before using the MCP server, you need to install the necessary software and set up the project on your local machine.
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).
-
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
-
Clone the Repository:
git clone https://github.com/OpenNebula/one-mcp.git cd one-mcp -
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
-
Verify the Installation: Run the server to confirm it starts correctly.
python main.py
You should see the output:
>>> Starting MCP server...
Integrate the MCP server with your AI-powered client for seamless interaction.
mcphost is an open-source, command-line host application for the Model Context Protocol. It enables Large Language Models (LLMs) — including proprietary models from providers like Anthropic and open-source models via Ollama — to interact with external tools. This allows you to use the OpenNebula MCP Server directly from your terminal for powerful scripting and automation.
-
Configure MCPHost: Create a configuration file at
~/.mcphost.ymland add theopennebula-mcp-serveras a local server.# ~/.mcphost.yml # Add the OpenNebula server to your list of MCP servers mcpServers: opennebula-mcp-server: type: "local" command: ["uv", "run", "-p", "/MY_PATH/one-mcp/.venv/bin/python", "--", "/MY_PATH/one-mcp/main.py"] cwd: "/MY_PATH/one-mcp" # (Optional) Configure your preferred model and other settings model: "anthropic:claude-sonnet-4-20250514" system-prompt: "You are an expert at managing OpenNebula."
-
Usage and Verification: To verify that
mcphosthas successfully connected to the OpenNebula MCP Server:- Start
mcphostin interactive mode:mcphost
- Inside the interactive session, run the
/serverscommand:/servers - You should see
opennebula-mcp-serverlisted as an available server. This confirms the connection is active, and you can now ask the LLM to perform tasks:> List all my OpenNebula clusters
- Start
-
Usage Example: Once configured, you can interact with your OpenNebula environment directly from the command line.
# Run in non-interactive mode with a specific prompt mcphost -p "List all my OpenNebula clusters" # Run in interactive mode to have a chat session mcphost # Quiet mode - only output the AI response (no UI elements) mcphost -p "List running VMs" --quiet
-
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", "/MY_PATH/one-mcp/.venv/bin/python", "--", "/MY_PATH/one-mcp/main.py" ], "type": "command", "cwd": "/MY_PATH/one-mcp" } } }
-
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", "/MY_PATH/one-mcp/.venv/bin/python", "--", "/MY_PATH/one-mcp/main.py" ], "env": {}, "working_directory": null, "start_on_launch": true } }
Configure your environment to run the project's test suites.
Promptfoo is used to test the MCP Server's ability to select and use the correct tools.
-
Set Up Environment Variables: Create an
.envfile in the project's root directory. -
Add Your OpenAI API Key: Add your API key to the
.envfile. This is required for the evaluation model.OPENAI_API_KEY=sk-proj-XXX
Pytest is used to run unit tests against individual tool functions.
-
Configure Test VM IP Address: The VM-related tests require an active OpenNebula VM. Edit
src/tests/pytest/conftest.pyand setTEST_VM_IP_ADDRESSto 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
-
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.
-
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'"
If you observe incorrect behavior or unexpected results, please report it via GitHub Issues so the team can investigate and improve the experience.