PC

phantosmax/cloudstack-mcp-server

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

6 stars 6 forks 质量 64 趋势 14MIT

Apache CloudStack Local MCP Server

概览

A high-performance MCP (Model Context Protocol) server for Apache CloudStack API integration. This server provides comprehensive tools for managing CloudStack infrastructure through the MCP protocol, enabling seamless integration with AI assistants and automation tools. - : Deploy, start, stop, reboot, and destroy virtual machines - : List zones, templates, and service offerings - : HMAC-SHA1 signed requests with CloudStack API credentials - : Efficient TypeScript implementation with proper error handling - : Full TypeScript support with comprehensive interfaces - : Detailed VM metadata including CPU, memory, network, and status - : Direct CLI access for interactive CloudStack management - : Seamless integration with AI assistants via MCP protocol 2. Create a .env file in the project root: Add to your MCP client configuration (e.g., Claude Desktop): For direct command-line access, use the built-in CLI: For detailed CLI documentation, see CLI.md.

README

以下为原文 README 节选,完整内容请查看原文。

CloudStack MCP Server

A high-performance MCP (Model Context Protocol) server for Apache CloudStack API integration. This server provides comprehensive tools for managing CloudStack infrastructure through the MCP protocol, enabling seamless integration with AI assistants and automation tools.

Features

  • 🔧 Complete VM Lifecycle Management: Deploy, start, stop, reboot, and destroy virtual machines
  • 🏗️ Infrastructure Discovery: List zones, templates, and service offerings
  • 🔐 Secure Authentication: HMAC-SHA1 signed requests with CloudStack API credentials
  • ⚡ High Performance: Efficient TypeScript implementation with proper error handling
  • 🛡️ Type Safety: Full TypeScript support with comprehensive interfaces
  • 📊 Rich Information: Detailed VM metadata including CPU, memory, network, and status
  • 🖥️ Command Line Interface: Direct CLI access for interactive CloudStack management
  • 🤖 MCP Integration: Seamless integration with AI assistants via MCP protocol

Quick Start

Installation

  1. Clone and install dependencies:

    git clone 
    cd cloudstack-mcp-server
    npm install
    
  2. Configure environment variables: Create a .env file in the project root:

    CLOUDSTACK_API_URL=https://your-cloudstack-server/client/api
    CLOUDSTACK_API_KEY=your-api-key
    CLOUDSTACK_SECRET_KEY=your-secret-key
    CLOUDSTACK_TIMEOUT=30000
    
  3. Build the project:

    npm run build
    
  4. Run the server:

    # Development mode (MCP server)
    npm run dev
    
    # Production mode (MCP server)
    npm start
    
    # CLI mode
    npm run cli -- --help
    

MCP Client Integration

Add to your MCP client configuration (e.g., Claude Desktop):

{
  "mcpServers": {
    "cloudstack": {
      "command": "node",
      "args": ["/path/to/cloudstack-mcp-server/build/index.js"],
      "env": {
        "CLOUDSTACK_API_URL": "https://your-cloudstack-server/client/api",
        "CLOUDSTACK_API_KEY": "your-api-key",
        "CLOUDSTACK_SECRET_KEY": "your-secret-key"
      }
    }
  }
}

Command Line Interface

For direct command-line access, use the built-in CLI:

# Install globally (optional)
npm link

# Use the CLI
cloudstack-cli list-vms --state Running
cloudstack-cli deploy-vm --service-offering-id 1 --template-id 2 --zone-id 3
cloudstack-cli get-vm --id 12345-67890-abcdef

# See all available commands
cloudstack-cli --help

For detailed CLI documentation, see CLI.md.

Available Tools (45 Tools)

🖥️ Virtual Machine Management (7 Tools)

Tool Description Parameters
在 GitHub 查看完整 README

安装

npx tsc --noEmit
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "cloudstack": { "command": "node", "args": ["/path/to/cloudstack-mcp-server/build/index.js"], "env": { "CLOUDSTACK_API_URL": "https://your-cloudstack-server/client/api", "CLOUDSTACK_API_KEY": "your-api-key", "CLOUDSTACK_SECRET_KEY": "your-secret-key" } } } }