内容
# Foobar DJ MCP 服务器
不要满足于另一种 “AI 到 Spotify”的控制器。如果你花费了多年时间精心打造一个高质量的本地音乐库,你理应拥有一个尊重你的音乐比特的 AI。
<img width="1345" height="1012" alt="12121" src="https://github.com/user-attachments/assets/08bf373a-12e0-4a83-b812-574c2a0088ed" />
Foobar DJ 是一个 [模型上下文协议(MCP)](https://modelcontextprotocol.io/) 服务器,它直接将 Gemini(或任何 MCP 兼容的代理)连接到你的 **foobar2000** 设置。有一种非常棒的感觉,当你要求 AI “深入我的 90 年代垃圾摇滚”时,它会为你提供一个完美的 `.flac` 库,而不是压缩流。
## 为什么存在?
- **无需云服务**: 这是你的音乐,在你的硬件上。
- **FLAC 支持**: 因为品质很重要。
- **本地智能**: AI 会索引你的实际文件夹结构,识别你的特定版本、合集和盗版。
## 设置
### 1. 桥梁(Beefweb)
该服务器使用 Beefweb REST API 与 Foobar 通信。
- 在 Foobar2000 中安装包含的 `foo_beefweb-0.10.fb2k-component` 组件(首选项 -> 组件)。
- 重启 Foobar。它默认为 `http://localhost:8880`。
### 2. 安装服务器
```bash
npm install
npm run build
```
### 3. 配置
将 `.env.example` 复制到 `.env` 并设置你的 `MUSIC_LIBRARY_PATH`。
### 4. 连接到 Gemini CLI
将以下内容添加到你的 `gemini-config.json` 中:
```json
{
"mcpServers": {
"foobar-dj": {
"command": "node",
"args": ["C:/Foobar-DJ-Repo/dist/index.js"]
}
}
}
```
## 包含的工具
- `foobar_play_artist`: 随机播放特定艺术家的音乐。
- `foobar_play_album`: 播放特定专辑。
- `foobar_search_library`: 查找那首 obscure 的 B 面歌曲。
- `foobar_now_playing`: 获取当前曲目的统计信息。
- `foobar_create_playlist`: 让 AI 担任 DJ 并创建自定义混音。
---
*捐赠给社区。保持你的音乐库本地化。*