MCP Deploy Server
Project description
Cloud Studio MCP 部署服务
Cloud Studio MCP 部署服务是一个基于FastMCP的服务器,提供Cloud Studio工作空间的管理功能,包括创建工作空间、上传文件和执行命令等操作。
功能特性
- 创建工作空间:创建新的Cloud Studio工作空间实例
- 文件管理:上传文件到指定工作空间
- 命令执行:在工作空间中执行shell命令
- MCP集成:通过MCP协议提供标准化接口
安装指南
前置要求
- Python 3.8+
- API_TOKEN环境变量(Cloud Studio API访问令牌)
安装步骤
-
克隆仓库:
git clone <repository-url> cd mcp_deploy
-
创建并激活虚拟环境:
python -m venv .venv source .venv/bin/activate # Linux/macOS .\.venv\Scripts\activate # Windows
-
安装依赖:
pip install -e .
配置说明
在运行服务前,需要设置以下环境变量:
export API_TOKEN="your_cloud_studio_api_token"
export region="ap-shanghai" # 可选,默认为ap-shanghai
使用说明
启动服务
python -m mcp_deploy
API 文档
服务提供以下MCP工具:
1. 创建工作空间
create_workspace() -> dict
返回示例:
{
"workspace_key": "ws-kmhhvqnlogr48",
"webIDE": "https://ws-kmhhv1pyvc48--ide.ap-shanghai.cloudstudio.club"
}
2. 上传文件
write_files(workspace_key: str, region: str, files: list[File]) -> str
文件格式:
class File:
save_path: str # 文件保存路径
file_content: str # 文件内容(UTF-8编码)
3. 执行命令
execute_command(workspace_key: str, region: str, command: str) -> str
示例:
execute_command("ws-xxxx", "ap-shanghai", "ls -al")
开发指南
项目结构
mcp_deploy/
├── __init__.py
├── __main__.py
├── mcp_handlers.py # 核心业务逻辑
├── models.py # 数据模型定义
└── server.py # FastMCP服务器实现
测试
- 确保已设置API_TOKEN环境变量
- 运行测试命令:
python -m pytest
贡献
欢迎提交Pull Request或Issue报告问题。
许可证
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mcp_deploy-0.1.3.tar.gz
(22.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_deploy-0.1.3.tar.gz.
File metadata
- Download URL: mcp_deploy-0.1.3.tar.gz
- Upload date:
- Size: 22.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9afe4fbf06a69b9b7b0ce9c288f6d1f320e30627c1b2c68594ef091920aa5355
|
|
| MD5 |
78917452659c7d4b6f8b49072651b742
|
|
| BLAKE2b-256 |
19ca62387a1fcf61d55f06953724f6d1340045e2d70525b78e9cec38c45a0240
|
File details
Details for the file mcp_deploy-0.1.3-py3-none-any.whl.
File metadata
- Download URL: mcp_deploy-0.1.3-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce31e412dbf68f9012cbf5d329345167321d80d477c5e96f77c84cf6021dc726
|
|
| MD5 |
145e5f4d410070e7a96d93164ea4fa56
|
|
| BLAKE2b-256 |
798b4e0964fcd0e7c7d15738b70e972a08d7701dc4b5d6e087fb3289ea2afb3a
|