自由市场mcp
A. 模型上下文协议 将Claude(或任何兼容MCP的AI客户端)连接到 自由时间 无线电台通过其REST API。让克劳德直接从你的电台检查你的日程安排、管理文件、提取听众统计数据等。
有两种方法可以运行它:
- 标准 --Claude Desktop将其作为子流程生成。无需主机。如果你只想在自己的机器上使用人工智能工具,那就最好了。
- 超文本传输协议 --将其自托管为网络服务器。最适合用于连接远程MCP客户端或与其他服务集成的高级设置。
工具
工具被组织到以下子目录中 src/tools/ --每个工具一个文件。
只读(客户端和管理员)
get_shows--列出所有节目get_show--按ID获取单场演出get_show_instances--列出预定的放映时段(可按放映、日期范围筛选)get_schedule--广播时间表get_stream_state--当前空中状态get_station_info--站点名称、时区和配置
分析(管理员)
- ~~
get_listener_counts~~-disabled(API返回完整历史记录,无需筛选,约120k条记录) get_playout_history--带有曲目元数据的最近播放历史
媒体库(管理员)
search_files--搜索您的媒体库upload_file--通过拖放UI上传音频文件(可在stdio和HTTP模式下使用——请参阅 文件上传)update_file_metadata--编辑曲目元数据delete_file--删除文件
显示和日程安排(管理员)
create_show--创建新节目schedule_file--将上传的文件安排到显示实例中
播放列表(管理员)
get_playlists--列出所有播放列表create_playlist--创建新的播放列表get_playlist_contents--列出播放列表中的项目add_to_playlist--将文件或流添加到播放列表
用户(管理员)
get_users--列出车站用户(通行证include_email: true包含电子邮件地址,默认情况下省略)get_hosts--列出节目主持人及其节目任务
文件上传
upload_file 在Claude聊天窗口中呈现拖放UI。它在两种运输方式中的工作方式相同:
- HTTP模式 --UI直接发布到MCP服务器
/upload端点 - stdio模式 --管理服务器启动一个轻量级的sidecar HTTP服务器(默认端口
4000)MCP协议本身在stdio上继续;上传是一个侧通道。
这两种模式都使用启动时生成的相同上传令牌,因此不需要单独的配置。在stdio模式下更改sidecar端口 UPLOAD_PORT 在您的环境中。
选项1-Claude桌面(stdio)
无需主机。Claude Desktop将服务器作为子进程生成并管理其生命周期。
全局安装
npm install -g @powerfm/libretime-mcp添加 ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"libretime": {
"command": "libretime-mcp",
"args": [],
"env": {
"LIBRETIME_URL": "https://your-instance.example.com",
"LIBRETIME_USER": "user",
"LIBRETIME_PASS": "pass",
"LIBRETIME_API_KEY": "your_libretime_api_key"
}
}
}
}LIBRETIME_API_KEY 是 general.api_key LibreTime的价值 config.yml。它是文件上传所必需的。如果您使用的是只读客户端,请省略它。
使用 libretime-mcp-client 而不是 libretime-mcp 用于只读访问和提交 LIBRETIME_API_KEY.
npx(不安装)
{
"mcpServers": {
"libretime": {
"command": "npx",
"args": ["@powerfm/libretime-mcp"],
"env": {
"LIBRETIME_URL": "https://your-instance.example.com",
"LIBRETIME_USER": "user",
"LIBRETIME_PASS": "pass",
"LIBRETIME_API_KEY": "libretime-api-key"
}
}
}
}来源
克隆仓库,创建一个 .env 使用您的凭据文件(请参阅 发展 下面),然后将Claude Desktop指向本地版本:
{
"mcpServers": {
"libretime": {
"command": "node",
"args": ["/absolute/path/to/libretime-mcp/dist/stdio/admin.js"],
"env": {
"LIBRETIME_URL": "https://your-instance.example.com",
"LIBRETIME_USER": "user",
"LIBRETIME_PASS": "pass"
}
}
}
}选项2——自托管HTTP服务器
最适合高级设置——通过网络连接任何兼容MCP的客户端。
安装:
npm install -g @powerfm/libretime-mcp设置环境变量:
LIBRETIME_URL=https://your-libretime-instance.example.com
LIBRETIME_USER=your_api_username
LIBRETIME_PASS=your_api_password
MCP_API_KEY=your_secret_api_key # clients must send this as a Bearer token
MCP_PORT=3000 # optional, defaults to 3000 (admin) / 3001 (client)
CORS_ORIGIN=https://your-app.example.com # optional, lock CORS to a specific origin (default: reflect any)生成随机API密钥:
libretime-mcp-keygen启动服务器:
libretime-mcp-http # full access, port 3000
libretime-mcp-client-http # read-only, port 3001客户端必须发送:
POST /mcp
Authorization: Bearer 接收没有有效密钥的请求 401 Unauthorized.
发展
git clone https://github.com/nelsonra/libretime-mcp.git
cd libretime-mcp
npm install
cp .env.example .env # fill in your credentials# Dev (tsx watch — restarts on save)
npm run dev:client # read-only stdio
npm run dev:admin # full-access stdio
npm run dev:client-http # read-only HTTP (port 3001)
npm run dev:admin-http # full-access HTTP (port 3000)
# Build
npm run build
# Tests
npm test
# MCP Inspector — browse and call tools interactively
npm run inspect:admin # stdio admin server
npm run inspect:client # stdio read-only server
npm run inspect:admin-http # HTTP admin (start the server first, then run this)
npm run inspect:client-http # HTTP read-only (start the server first, then run this)检查器在以下位置打开浏览器UI http://localhost:5173 在那里,您可以列出工具,查看它们的模式,并使用自定义输入调用它们。
服务器
| 命令 | 传输 | 端口 | 访问 |
|---|---|---|---|
libretime-mcp | stdio | --管理员 | |
libretime-mcp-client | stdio | -- | 只读 |
libretime-mcp-http | HTTP | 3000 | 管理员 |
libretime-mcp-client-http | HTTP | 3001 | 只读 |
