这是一个用于管理 DevHub CMS 系统 内容的 Model Context Protocol (MCP) 集成。
你需要在本地系统上安装 uv 包管理器。
要使用此服务器与 Claude Desktop 应用,请在你的 claude_desktop_config.json 文件中的 "mcpServers" 部分添加以下配置:
{
"mcpServers": {
"devhub_cms_mcp": {
"command": "uvx",
"args": [
"devhub-cms-mcp"
],
"env": {
"DEVHUB_API_KEY": "YOUR_KEY_HERE",
"DEVHUB_API_SECRET": "YOUR_SECRET_HERE",
"DEVHUB_BASE_URL": "https://yourbrand.cloudfrontend.net"
}
}
}
}
更新配置后,请重启 Claude Desktop。
此 MCP 还可以在 Cursor 中使用,只需将上述类似配置添加到你的 Cursor 全局环境或单独项目中。
示例 这里
Claude Code 的命令行 支持 MCP 安装。
你可以通过更新以下环境变量来添加 devhub-cms-mcp:
claude mcp add devhub-cms-mcp \
-e DEVHUB_API_KEY=YOUR_KEY_HERE \
-e DEVHUB_API_SECRET=YOUR_SECRET_HERE \
-e DEVHUB_BASE_URL=https://yourbrand.cloudfrontend.net \
-- uvx devhub-cms-mcp
要通过 Smithery 自动安装 DevHub CMS MCP 到 Claude Desktop:
npx -y @smithery/cli install @devhub/devhub-cms-mcp --client claude
git clone git@github.com:devhub/devhub-cms-mcp.git
要在本地开发中使用此服务器与 Claude Desktop 应用,需要在你的 claude_desktop_config.json 文件中的 "mcpServers" 部分添加以下配置:
{
"mcpServers": {
"devhub_cms_mcp": {
"command": "uv",
"args": [
"--directory",
"/YOUR/LOCAL/PATH/devhub-cms-mcp/",
"run",
"main.py"
],
"env": {
"DEVHUB_API_KEY": "YOUR_KEY_HERE",
"DEVHUB_API_SECRET": "YOUR_SECRET_HERE",
"DEVHUB_BASE_URL": "https://yourbrand.cloudfrontend.net"
}
}
}
}
更新配置后,请重启 Claude Desktop。
uv 直接运行的配置此 MCP 需要设置以下环境变量:
export DEVHUB_API_KEY="your_api_key"
export DEVHUB_API_SECRET="your_api_secret"
export DEVHUB_BASE_URL="https://yourbrand.cloudfrontend.net"
然后运行 MCP:
uv run main.py
此 MCP 提供了以下工具用于与 DevHub CMS 交互:
此 MCP 设计用于与支持 Model Context Protocol 的大型语言模型一起使用。它允许大型语言模型无需直接集成API访问即可管理 DevHub CMS 内容。
此包包含了一个带有模拟请求到 DevHub API 的测试套件,允许你在不实际调用API的情况下测试功能。
要运行测试,首先安装带有测试依赖项的包:
uv pip install -e ".[test]"
使用 pytest 运行测试:
uv run pytest
为了获得更详细的输出和测试覆盖率信息:
uv run pytest -v --cov=devhub_cms_mcp
tests/devhub_cms_mcp/test_mcp_integration.py: 测试 MCP 集成端点