Skip to main content
Glama
hisasann

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.jsonmusic-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.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.8/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Given no annotations, the description adds value by disclosing that results are based on MCP-started playback only and manual interaction is excluded. This is a key behavioral trait beyond the empty schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short, front-loaded sentences with no extraneous information. Every word contributes to understanding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has no input schema, no output schema, and no annotations. The description states its purpose and limitation, but does not specify what fields the 'track info' includes, which could help the agent understand the return value.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There are no parameters and schema coverage is 100%. The baseline for 0 parameters is 4, and the description does not need to add parameter info.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it returns currently playing track info, with a specific verb and resource. It implies a read-only status query, but does not explicitly differentiate from siblings like 'mark_current' or 'play_album'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for checking MCP-driven playback status, and notes that manual browser interaction is not tracked. However, it does not provide explicit when-to-use or when-not-to-use guidance, nor does it mention alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
noteNo
albumNo
trackNo
artistNo
reactionYes

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses side effects: appending to diary, promotions based on thresholds, and override for YouTube parsing. However, it does not mention reversibility or authentication needs, but for a simple reaction tool, this is fairly transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences with no wasted words. All information is relevant and efficiently conveyed.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given moderate complexity (5 params, 1 required) and no output schema, the description covers purpose, side effects, and parameter usage. It lacks mention of the return value or error handling, but these are minor omissions for a stamping action.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It explains that artist/album/track override YouTube parsing, but does not clarify the 'note' parameter. The reaction parameter is covered by listing the enum. Overall, it adds value for 3 of 5 parameters but misses one.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Stamp' and the resource 'currently playing track' with a specific reaction. It distinctly differentiates from sibling tools like current_track, play_album, and play_station, which are for retrieval or playback, while this performs a marking action.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains when to use this tool (to react to the current track) and provides context about side effects (appending to diary, promoting album card) and parameter overrides. It lacks explicit exclusion of alternatives but still offers solid guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

play_albumA

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

ParametersJSON Schema
NameRequiredDescriptionDefault
albumYes
artistYes

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description takes on the burden of disclosure. It transparently reveals that the tool searches YouTube for a specific query ('<artist> <album> full album') and opens the top result in Safari. This provides useful behavioral context, though it does not cover edge cases like missing results or errors.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, well-structured sentence that front-loads the purpose and immediately explains the mechanism. Every word serves a purpose, with no redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with no output schema, the description covers the main flow: input, search, and action (open in Safari). It does not address error handling, prerequisites, or return values, but given the tool's simplicity, it is reasonably complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0% description coverage, so the description adds significant value by explaining how 'artist' and 'album' are used in the YouTube search query. This goes beyond just naming the parameters, though it does not specify input format or constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Play an album') and the resources (artist + album name), which distinguishes it from siblings like 'play_station' (station) and 'current_track' (track). The mechanism (YouTube search and Safari open) is also specific.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does not provide explicit guidance on when to use this tool versus alternatives such as 'play_station'. It only states what it does, leaving the agent to infer usage context without any when-not-to-use or exclusion criteria.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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).

ParametersJSON Schema
NameRequiredDescriptionDefault
seedNoArtist or genre (optional; falls back to stations note)

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses that it opens the top result in Safari (a side effect) and that it may randomly pick a seed from a specific path. This is good transparency for a non-destructive tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences, no wasted words. Front-loaded with the core action, then additional details. Very concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with one optional parameter and no output schema, the description covers the essential information: what it does, where it opens, and the fallback mechanism. Missing edge cases (e.g., no stations note) but not critical.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema already describes the parameter as optional and its fallback. The description adds value by explaining that the fallback picks a random entry from the Obsidian stations note, which goes beyond the schema's 'falls back to stations note'.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action: starting a YouTube station from an artist or genre seed. It specifies the resource (YouTube station) and distinguishes from siblings like play_album by mentioning it opens the top result in Safari.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains that the seed is optional and the fallback uses a random entry from a stations note, giving context on when to omit the parameter. However, it does not explicitly state when not to use this tool versus other siblings, though the behavior is clear enough.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A4.1/5.0
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
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    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
  • A
    license
    A
    quality
    D
    maintenance
    Full Apple Music integration for Claude: search the catalog, browse your personal library, manage playlists, and get personalised recommendations.
    11
    38
    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.
    12
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hisasann/music-digger-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server