关于 CloudStack MCP
CloudStack MCP 是面向 Apache CloudStack 的概念验证 MCP 服务,使 AI Agent 能与 CloudStack 基础设施交互。项目仍在开发中,功能尚不完整。
主要功能
- 01将 MCP 请求转换为 CloudStack API 调用
- 02提供虚拟机部署与管理操作
- 03自动处理认证和 API 交互
适用场景
- 01通过 Agent 列出 CloudStack VPC
- 02管理 CloudStack 虚拟机
MCP 相关
服务将 MCP 协议请求转换为 CloudStack API 调用,可通过 SSE 或 stdio 接入 MCP 客户端。
配置
远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。
服务地址
http://localhost:8250/sse一键复制安装命令
Claude CodeTerminal
claude mcp add --transport http cloudstack http://localhost:8250/sseCursor.cursor/mcp.json
{"mcpServers":{"cloudstack":{"type":"http","url":"http://localhost:8250/sse"}}}在 Cursor 中打开VS Code.vscode/mcp.json
{"servers":{"cloudstack":{"type":"http","url":"http://localhost:8250/sse"}}}在 VS Code 中打开Claude Desktopclaude_desktop_config.json
{"mcpServers":{"cloudstack":{"type":"http","url":"http://localhost:8250/sse"}}}Windsurf~/.codeium/windsurf/mcp_config.json
{"mcpServers":{"cloudstack":{"serverUrl":"http://localhost:8250/sse"}}}命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。
工具
README 原文English
来自项目 READMEREADME 暂无中文译文,以下为英文原文;中文介绍见上方。
= CloudStack MCP
A Model Context Protocol (MCP) server for Apache CloudStack, allowing AI agents to interact with CloudStack infrastructure.
IMPORTANT: This project is still under development and not all features are available. Treat it as a proof of concept.
== Running the server (macOS)
[source,bash]
----
# Install the dependencies
brew install go-task go docker
# Install the CLI
git clone https://github.com/walteh/cloudstack-mcp.git
cd cloudstack-mcp
# Start the environment (will take a while)
task docker:start
----
== Generic MCP Usage
=== for `sse` servers (recommended, if possible)
* works with `Cursor`
[source,json]
----
{
"mcpServers": {
"cloudstack": {
"url": "http://localhost:8250/sse"
}
}
}
----
=== for `stdio` servers
* works with `Cursor`, and `Claude Desktop`
[source,json]
----
{
"mcpServers": {
"cloudstack": {
"command": "docker",
"args": ["compose", "-f", "<<LOCAL_PATH_TO_THIS_REPO>>/docker-compose.yaml", "run", "mcp-stdio-server"]
}
}
}
----
== Usage with Cursor (macOS)
1. make sure server is running and you are in the root of the project (see above)
2. set up dependencies
+
[source,bash]
----
brew install --cask cursor
----
3. open the project in Cursor
+
[source,bash]
----
cursor cloudstack-mcp.code-workspace
----
4. open cursor settings from the menu bar `Cursor -> Settings... -> Cursor Settings` (or press `Shift-Cmd-J`)
5. go to the `MCP` tab, you should see the `cloudstack` server already added (because of link:./.cursor/mcp.json[`./.cursor/mcp.json`])
6. click on the buttons to refresh and enable the `cloudstack` server - you should see a green dot and a list of `list` cloudstack api commands
7. open a new composer by making sure the composer pane is open (toggle with `Cmd-Option-B`) and start a new conversation (press `Cmd-N`)
8. make sure the composer is set to `Agent`
9. type `can you list my @cloudstack vpcs?`
10. press `Enter` and watch the magic happen! (realistically, you might have to try and convince the AI to do this, but it should work)
== Usage with Claude Desktop (macOS)
CAUTION: There is a 99% chance this will not work, but you can use it as a starting point to get the MCP working with Claude Desktop if you like.
1. make sure server is running and you are in the root of the project (see above)
2. set up dependencies
+
[source,bash]
----
brew install --cask claude-desktop
----
3. run this to setup the server in Claude Desktop
+
[source,bash]
----
# injects the server into claudes config, doesn't overwrite anything (unless you have another mcp called 'cloudstack')
task mcp:setup:claude-desktop
----
4. restart claude desktop
== How It Works
This MCP implementation allows AI assistants to manage CloudStack resources by:
* Translating MCP protocol requests into CloudStack API calls
* Providing common operations like VM deployment and management
* Handling authentication and API interaction automatically
== CloudMonkey Usage
CloudMonkey (the CloudStack CLI) is containerized in this setup:
[source,bash]
----
# Basic commands
task cmk -- list zones
task cmk -- list serviceofferings
# Fix API cache issues if they occur
task cmk -- sync
# Get API credentials
task cloudstack:get-credentials
----
== License
Apache License 2.0评论
支持 Markdown
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。