AI无线电MCP
一个MCP服务器,允许任何AI代理从头开始启动一个完全配置的直播电台,包括依赖性安装、电台个性、内容源和部署。
代理调用工具来配置和启动电台,然后可以选择将其注册到中央集线器站点,听众可以在那里发现所有正在运行的电台。
建立在 艾区块链电台 --广义上支持任何主题,而不仅仅是区块链。
______________________________________________________________________
它的作用
Agent calls MCP tools
→ checks + installs dependencies (Ollama, ffmpeg, Python packages)
→ pulls an LLM model via Ollama
→ configures station: DJ name, personality, voice, content source, schedule
→ deploys: generates config, launches HLS stream
→ returns stream URL + embed code
→ optionally registers station with the hub aggregator site所有音频合成运行 本地 --Kokoro TTS+Ollama LLM,没有云API。
______________________________________________________________________
安装
git clone https://github.com/Degens-World/ai-radio-mcp
cd ai-radio-mcp
python -m venv venv
# Windows:
venv\Scripts\activate
# macOS / Linux:
source venv/bin/activate
pip install -r requirements.txt先决条件(单独安装)
| 依赖关系 | 安装 |
|---|---|
| Python 3.10+ | python.org |
| 奥拉玛 | ollama.com/下载 |
| FFmpeg | 视窗: winget install ffmpeg ·macOS: brew install ffmpeg ·Linux: apt install ffmpeg |
| 版本控制系统 | git-scm.com |
MCP服务器可以安装ffmpeg并为您提取Ollama模型(请参阅下面的工具)。Ollama本身必须在Windows/macOS上手动安装。
______________________________________________________________________
添加到您的MCP客户端
克劳德代码/克劳德桌面
添加到您的 claude_desktop_config.json 或 .claude/settings.json:
{
"mcpServers": {
"ai-radio": {
"command": "python",
"args": ["/absolute/path/to/ai-radio-mcp/server.py"]
}
}
}______________________________________________________________________
可用工具
设置工具
| 工具 | 说明 |
|---|---|
check_dependencies() | 审计已安装的工具——Python、git、ffmpeg、Ollama、软件包 |
install_dependency(name) | 安装 "ffmpeg" 或获取Ollama下载链接 |
install_python_deps() | pip install 所有必需的Python包 |
pull_model(model) | 拉动Ollama模型(默认值: mistral-nemo:latest) |
setup_all(model) | 在一次调用中运行所有设置步骤 |
站点构建工具
| 工具 | 说明 |
|---|---|
create_station(name, tagline) | 启动一个新站点,返回 station_id |
set_personality(station_id, dj_name, personality, speaking_style, topics) | 定义DJ角色 |
set_voice(station_id, voice) | 选择Kokoro TTS语音 |
set_content(station_id, source_type, params) | 设置内容源: blockchain, rss,或 freestyle |
set_schedule(station_id, type) | balanced, talk_heavy,或 music_heavy |
set_ollama_model(station_id, model) | 覆盖此站的LLM模型 |
preview_config(station_id) | 部署前查看完整配置 |
部署工具
| 工具 | 说明 |
|---|---|
deploy_station(station_id) | 启动站点,返回流URL |
get_embed_code(station_id, public_stream_url) | 任何网站的HTML嵌入片段 |
register_with_hub(station_id, hub_url, public_stream_url) | 在主枢纽网站上注册 |
管理工具
| 工具 | 说明 |
|---|---|
list_stations() | 所有车站及其状态 |
station_status(station_id) | 详细状态+实时端口检查 |
stop_station(station_id) | 停止一个正在运行的车站 |
delete_station(station_id) | 停止并永久删除工作站 |
______________________________________________________________________
典型代理流
1. check_dependencies()
→ sees ffmpeg is missing
2. install_dependency("ffmpeg")
→ installs via winget/brew/apt
3. pull_model("mistral-nemo:latest")
→ downloads the LLM
4. create_station("Crypto Vibes Radio", "Where the chain never sleeps")
→ returns station_id: "a1b2c3d4"
5. set_personality(
"a1b2c3d4",
dj_name="DegenBot",
personality="An unhinged crypto DJ who loves chaos and moon shots",
speaking_style="High energy, uses slang, 8-10 sentences per drop",
topics=["DeFi", "NFTs", "market moves", "whale alerts"]
)
6. set_voice("a1b2c3d4", "am_michael")
7. set_content("a1b2c3d4", "blockchain", {
"explorer_url": "https://api.ergoplatform.com/api/v1",
"coin_symbol": "ERG",
"coin_id": "ergo",
"whale_threshold": 10000
})
8. set_schedule("a1b2c3d4", "balanced")
9. preview_config("a1b2c3d4")
→ review everything looks right
10. deploy_station("a1b2c3d4")
→ stream live at http://localhost:8300/stream.m3u8
11. register_with_hub("a1b2c3d4", "https://hub.airadio.world", "https://my-ngrok-url/stream.m3u8")
→ station listed on main site______________________________________________________________________
内容源
blockchain
通过公共资源管理器API监控区块链并生成实时评论。
set_content("id", "blockchain", {
"explorer_url": "https://api.ergoplatform.com/api/v1", # or any compatible API
"coin_symbol": "ERG",
"coin_id": "ergo", # CoinGecko ID for price data
"whale_threshold": 10000,
})rss
阅读RSS提要,并让DJ评论头条新闻。
set_content("id", "rss", {
"feeds": [
"https://feeds.feedburner.com/TechCrunch",
"https://rss.nytimes.com/services/xml/rss/nyt/Technology.xml",
],
"max_items": 5,
})freestyle
没有实时数据——DJ纯粹根据其角色和主题生成评论。
set_content("id", "freestyle", {
"topics": ["music theory", "AI news", "philosophy", "motivation"],
})______________________________________________________________________
声音
| 声音 | 角色 |
|---|---|
am_michael | 深度、权威(默认) |
am_adam | 热情、健谈 |
am_echo | 清爽、充满活力 |
am_fenrir | 大胆、戏剧性 |
am_puck | 轻盈、俏皮 |
af_bella | 明亮、热情 |
af_heart | 温暖、富有表现力 |
af_nicole | 清晰、专业 |
______________________________________________________________________
推荐的LLM型号
| 型号 | 最适合 |
|---|---|
mistral-nemo:latest | 最佳个性+速度(推荐) |
llama3.1:8b | 更多事实,更少创意 |
mistral:7b | 重量轻,速度快 |
gemma3:4b | 最低硬件要求 |
______________________________________________________________________
枢纽集成
这 register_with_hub 工具将站点元数据发布到中央枢纽API:
{
"station_id": "a1b2c3d4",
"name": "Crypto Vibes Radio",
"tagline": "Where the chain never sleeps",
"stream_url": "https://my-tunnel.ngrok-free.app/stream.m3u8",
"dj_name": "DegenBot",
"content_type": "blockchain",
"registered_at": 1711720000
}中心站点可以对所有注册的站点进行索引,并提供发现页面。
对于公共流媒体,请使用 吸烟 或 Cloudflare 隧道:
# ngrok
ngrok http 8300
# Cloudflare Tunnel (free, persistent URL)
cloudflared tunnel --url http://localhost:8300______________________________________________________________________
项目结构
server.py — MCP server (all tools)
runner.py — Generic station runner (reads station_config.json)
content/
__init__.py — Source factory (build_source)
base.py — ContentSource base class
blockchain.py — Blockchain explorer data source
rss.py — RSS feed data source
freestyle.py — Topic-driven no-data source
stations/ — Created at runtime, one dir per station
/
station_config.json
runner.py — Copy of runner for this station
content/ — Copy of content package
hls_output/ — Live HLS segments (.ts + .m3u8)
clips/ — TTS audio clips (auto-cleaned)
music_library/ — WAV/MP3 tracks to play between drops
player.html — Auto-generated web player
registry.json — Persisted station registry______________________________________________________________________
添加音乐
掉落 .wav 或 .mp3 文件进入车站 music_library/ 部署之前或之后的目录。跑步者会自动拿起它们进行音乐片段。
______________________________________________________________________
许可证
麻省理工学院——建立自己的广播帝国。
______________________________________________________________________
*部分 德根斯。世界 生态系统。*
