SongPilot MCP服务器

模型上下文协议(MCP)服务器,用于将SongPilot AI代理与Claude Desktop和其他MCP客户端集成。
概述
SongPilot MCP是一个客户端包,它使像Claude这样的AI助手能够与您的SongPilot工作区进行交互。它在您的机器上本地运行,并与SongPilot的后端服务通信。
安装
来自PyPI(推荐)
pip install songpilot-mcp来自源头
git clone https://github.com/songpilotai/songpilot-mcp.git
cd songpilot-mcp
pip install -r requirements.txt
pip install -e .配置
创建一个 .env 工作目录中的文件:
SONGPILOT_API_KEY=sp_your_api_key_here
SONGPILOT_WORKSPACE_ID=your_workspace_id
SONGPILOT_MCP_BASE_URL=https://mcp.songpilot.ai或者直接设置环境变量:
export SONGPILOT_API_KEY=sp_your_api_key_here
export SONGPILOT_WORKSPACE_ID=your_workspace_id获取API密钥
- 登录您的SongPilot帐户
- 前往“设置”>“API密钥”
- 生成新密钥(格式:
sp_...) - 从URL或设置页面复制您的工作区ID
使用Claude Desktop
添加到您的Claude Desktop配置(claude_desktop_config.json):
{
"mcpServers": {
"songpilot": {
"command": "songpilot-mcp",
"env": {
"SONGPILOT_API_KEY": "sp_your_api_key",
"SONGPILOT_WORKSPACE_ID": "your_workspace_id"
}
}
}
}在macOS上,配置文件位于: ~/Library/Application Support/Claude/claude_desktop_config.json
在Windows上: %APPDATA%\Claude\claude_desktop_config.json
你能做什么
连接后,您可以要求Claude:
- 为歌曲和专辑创作艺术作品
- 计划发布策略
- 撰写艺术家简介和社交媒体内容
- 分析您的音乐目录
- 获取职业管理建议
示例提示:
"Create artwork for my song 'Midnight Dreams'"
"Help me plan a release strategy for my new album"
"Write a bio for my artist profile"
"Which of my songs are ready for release?"建筑
这是一个客户端MCP实现:
- 在本地计算机上运行(不在SongPilot服务器上)
- 通过stdio与Claude Desktop通信
- 对SongPilot服务进行HTTP API调用
- 无需Docker或Kubernetes
发展
设置
make venv # Create virtual environment
make install-dev # Install dependencies命令
make format # Format code with black and isort
make lint # Run ruff linter and format checks
make test # Run pytest with coverage
make build # Build package for distribution
make publish # Publish to PyPI (requires token)测试
# Run all tests
pytest
# With coverage
pytest --cov=songpilot_mcp --cov-report=html
# Specific test file
pytest tests/unit/test_client.py -v环境变量
| 变量 | 必填 | 默认 | 描述 |
|---|---|---|---|
SONGPILOT_API_KEY | 是 | - | 您的SongPilot API密钥(sp\_…) |
SONGPILOT_WORKSPACE_ID | 是 | - | 您的工作区ID |
SONGPILOT_MCP_BASE_URL | 没有 | https://mcp.songpilot.ai | API基本URL |
LOG_LEVEL | 没有 | INFO | 日志记录级别(调试、信息、警告、错误) |
故障排除
“身份验证失败”
- 验证您的API密钥以
sp_ - 检查该键是否在SongPilot设置中处于活动状态
- 确保工作区ID正确
“找不到工作区”
- 确认您使用的是正确的工作区ID
- 验证您是否有权访问工作区
连接问题
- 检查您的互联网连接
- 验证
SONGPILOT_MCP_BASE_URL正确(默认值:https://mcp.songpilot.ai) - 检查SongPilot状态页面以了解服务中断情况
许可证
MIT许可证-有关详细信息,请参阅许可证文件。
支持
- 文档:https://docs.songpilot.ai
- 问题:https://github.com/songpilotai/songpilot-mcp/issues
- 电子邮件:support@songpilot.ai
