Skip to main content
Glama
music-digger-mcp

music-digger-mcp

by hisasann

music-digger-mcp

YouTube + Safari + Apple Music で音楽を掘るための MCP サーバー。Claude Code から自然言語で操作し、聴いて反応した曲だけを Obsidian Vault に蓄積する。

v0.2.0 で再生エンジンを YouTube に切り替えました。 旧 Apple Music + AppleScript ベースの理由は docs/superpowers/specs/2026-06-13-youtube-pivot.md を参照。

ワークフロー

  1. play_station("Roy Ayers") → YouTube 検索 → Safari で再生(autoplay 無し、MCP が制御)

  2. 気に入ったら mark_current("love") → Obsidian 日記に追記 + iTunes Search API で楽曲を照合 → Music.app で同じ楽曲ページを開く(あとはユーザーが「+」でライブラリ追加・再生)

  3. love 1 回 or like 2 回でアルバムカードに自動昇格

Apple Music カタログの「特定の曲」を AppleScript から再生する公式 API は無く、URL を open しても navigate するだけで自動再生しない。digger としての再生は YouTube + Safari に統一し、Apple Music は「気に入った曲をあとで聴くための着地点」として使い分ける。

Related MCP server: mcp-apple-music

Tools

  • play_station(seed?) — YouTube 検索で seed の station を Safari で起動。seed 省略時は music/stations.md からランダム

  • play_album(artist, album) — <artist> <album> full album で YouTube 検索 → Safari

  • current_track() — MCP が「最後に再生指示した曲」の情報を返す(ブラウザに問い合わせない)

  • mark_current(reaction, note?, artist?, album?, track?) — 現在曲を love / like / meh / skip でマーク。日記追記 + 昇格判定。love / like の時は iTunes Search API で Apple Music カタログを引いて、Music.app に楽曲ページを開く

動作環境

  • macOS(Safari、Music.app、open コマンド)

  • Node.js 18+ (built-in fetch)

  • YouTube アカウント(Safari でログイン推奨。Premium ならバックグラウンド再生・広告無し)

  • Apple Music サブスクリプション(love した曲を Music.app で続けるなら)

  • Obsidian Vault

セットアップ

npm install
npm run build

Safari で YouTube にログインしておく(Premium 推奨)。youtube.com の autoplay は OFF にしておくと state ずれが起きない。

Claude Code への接続

examples/mcp.json を参考に、Claude Code の .mcp.json に music-digger エントリを追加して再起動する。

開発

npm run dev          # tsx watch でホットリロード
npm test             # vitest
npm run test:watch   # vitest watch

環境変数

変数

デフォルト

用途

OBSIDIAN_VAULT_PATH

必須

Obsidian Vault のルート

MUSIC_DIARY_SUBDIR

music/diary

反応日記の保存先

MUSIC_ALBUMS_SUBDIR

music/albums

アルバムカードの保存先

MUSIC_STATIONS_PATH

music/stations.md

station の seed リスト

stations.md の書き方

## ソウル / ファンク
- Aaron Frazer       # Introducing... が今のお気に入り (Bad News)
- Curtis Harding     # ◎ The Power
- Roy Ayers          # ◎ Everybody Loves The Sunshine

## スキップ中
# - Lofi             # 今の気分じゃない
  • 行頭 - で 1 行 1 seed

  • 行頭が # の行はコメント / 無効化

  • 末尾の # ... は seed の覚え書き(パーサーが無視する)

仕様書 / 実装計画

  • docs/superpowers/specs/2026-06-12-music-digger-mcp-design.md — 初版(Apple Music ベース、現在は参考資料)

  • docs/superpowers/specs/2026-06-13-youtube-pivot.md — YouTube 移行設計メモ

  • docs/superpowers/plans/2026-06-12-music-digger-mcp.md — 旧実装計画

注意

  • YouTube の HTML スクレイピングを使用しているため、YouTube 側のレイアウト変更で壊れる可能性があります(個人用前提)

  • current_track は MCP がこのセッションで再生指示した曲のみを反映します。ブラウザ上で手動で次の曲に進めた場合は state がずれます(その間 mark_current を呼ばなければ実害なし)

  • mark_current の love / like で Music.app の楽曲ページが開きますが、ライブラリへの追加は手動で「+」を押してください

Available Tools

4 tools
current_trackA

Return the currently playing track info, based on what this MCP last started. Reflects MCP-driven playback only; manual browser interaction is not tracked.

Inputs: no named parameters.

mark_currentA

Stamp the currently playing track with a reaction (love/like/meh/skip). Appends to the day diary and promotes to an album card on love>=1 or like>=2. YouTube title parsing can be overridden with explicit artist / album / track.

Inputs: reaction (required), note, album, track, +1 more.

play_albumA

Play an album by artist + album name. Searches YouTube for <artist> <album> full album and opens the top result in Safari.

Inputs: album (required), artist (required).

play_stationA

Start a YouTube station from an artist or genre seed. Opens the top result in Safari. When seed is omitted, picks one at random from the Obsidian stations note (MUSIC_STATIONS_PATH).

Inputs: seed.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool serves a distinct purpose: displaying current track, reacting, playing album, and playing station. No overlap in functionality.

    Naming Consistency4/5

    All names use snake_case and follow a verb_noun pattern except 'current_track' (adjective_noun). Consistency is high with only a minor deviation.

    Tool Count5/5

    Four tools is well-scoped for a music discovery server. Each tool contributes a necessary function without redundancy.

    Completeness4/5

    Core actions (display, react, play album/station) are covered. Missing features like search or basic playback controls (skip, pause) but acceptable for focused scope.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables Claude Desktop and GitHub Copilot to interact with native macOS applications including Spotify, Apple Music, Notes, Calendar, FaceTime, and Contacts through natural language commands. Provides comprehensive control over music playback, note management, calendar events, video calls, and contact operations using AppleScript integration.
      8
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Full Apple Music integration for Claude: search the catalog, browse your personal library, manage playlists, and get personalised recommendations.
      15
      47
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Connects Claude Code to Apple Music using only your Apple ID, without needing a developer account. Enables access to recently played, playlists, search, recommendations, and playlist creation.
      MIT
    • F
      license
      Not graded
      quality
      B
      maintenance
      Give Claude access to your music library. MixCraft is a hosted MCP server that connects Claude to Apple Music, letting Claude search your library, build playlists, and learn your taste over time.
      2
      -