eztab-mcp

v0.10.2
@hidechae/eztab-mcp Checked 55 minutes ago Published 1 day ago

MCP server for EZTab — lets an AI agent build and edit guitar/bass tablature.

An MCP server that lets an AI agent (e.g. Claude) build and edit guitar/bass tablature using EZTab's data model. エージェントのツール呼び出しがメモリ上のドキュメントを書き換え、get_tab が ASCII レンダリングを返します。send_to_eztab で結果をアプリの inbox に送ると、 アプリ側で「カーソルの後に挿入」「新規タブとして作成」「(open_tab で開いたタブの) 修正版を反映」を選べます。挿入・反映は未保存の編集として入り、Save するまで確定 しません。MCP…

Summary extracted from the README.

EZTab MCP server

An MCP server that lets an AI agent (e.g. Claude) build and edit guitar/bass tablature using EZTab's data model.

How it works

 Claude ──stdio──> MCP server ──> in-memory document
                       │  EZTAB_TOKEN (MCP 連携トークン)
                       ▼
                 eztab-sync ── GET /tabs, GET /tabs/:id   (list_tabs / open_tab)
                            └─ POST /inbox                 (send_to_eztab)
                                   ▲ ポーリング
                              EZTab アプリ: 画面上部のバナーで挿入 / 新規タブ / 修正版の反映

エージェントのツール呼び出しがメモリ上のドキュメントを書き換え、get_tab が ASCII レンダリングを返します。send_to_eztab で結果をアプリの inbox に送ると、 アプリ側で「カーソルの後に挿入」「新規タブとして作成」「(open_tab で開いたタブの) 修正版を反映」を選べます。挿入・反映は未保存の編集として入り、Save するまで確定 しません。MCP からライブラリを直接書き換える経路はありません。

連携トークンはアプリの Settings → MCP 連携 で発行します(1ユーザー1本、再発行で 旧トークンは失効)。トークンで使えるのはタブ一覧・取得と inbox への投函だけです。 トークン無しでも、ライブラリ連携以外のツールは今まで通り使えます。

Install (published package)

Published to npm as @hidechae/eztab-mcp. Add it to any MCP client:

{
  "mcpServers": {
    "eztab": {
      "command": "npx",
      "args": ["-y", "@hidechae/eztab-mcp"],
      "env": { "EZTAB_TOKEN": "eztab_…" }
    }
  }
}

Releasing a new version

npm versions are immutable, so publishing is deliberate (tag-driven):

# bump mcp/package.json "version", commit, then:
git tag mcp-vX.Y.Z origin/main && git push origin mcp-vX.Y.Z

The Publish MCP to npm GitHub Action builds and publishes on mcp-v* tags. 認証は npm の Trusted Publishing(GitHub Actions の OIDC)で、トークンの Secret は不要。 npmjs.com のパッケージ設定で hidechae/eztab の publish-mcp.yml を Trusted Publisher に 登録してある前提。タグ名と mcp/package.json の version が一致しないと公開しない。 公開に失敗したタグをやり直すときは、失敗した run の re-run ではなく(古いワークフローのまま 再実行される)、Publish MCP to npm を workflow_dispatch し、tag にそのタグを指定する (gh workflow run publish-mcp.yml -f tag=mcp-vX.Y.Z)。指定したタグの中身が公開される。

Setup (local dev)

Dependencies are in the repo's package.json (npm install). This repo ships a project-scoped .mcp.json, so Claude Code running here offers the eztab server automatically (approve it when asked).

For Claude Desktop or elsewhere:

{
  "mcpServers": {
    "eztab": {
      "command": "npx",
      "args": ["tsx", "mcp/server.ts"],
      "cwd": "/absolute/path/to/eztab"
    }
  }
}

Run standalone for testing: task mcp (or npx tsx mcp/server.ts).

Tools

Tool What it does
list_tabs ライブラリの一覧(アプリで編集中のタブは端末名つき)。要 EZTAB_TOKEN
open_tab ライブラリのタブをこのセッションに読み込む(修正用)。要 EZTAB_TOKEN
send_to_eztab 今のドキュメントをアプリの inbox に送る。open_tab で開いたものは修正版として届く(as_new で新規扱い)。要 EZTAB_TOKEN
get_tab Readable ASCII rendering of the document under edit (from/to で小節範囲を絞れる)
new_tab Start a fresh document (title, artist, tuning/preset, measures, tempo)
set_title Set the document title
set_artist Set the document artist
write_measures 小節単位の一括入力。1拍を1文字列で書き("6:5 6:~7" など)、列番号への割り付けはサーバ側で行う。譜面・画像からの書き起こし向け
set_cells Set tab cells: a fret number, rest, mute (cutting "x"), or clear (empty = sustain). Optional bend (0.5/1/1.5) chokes a fret note; optional tie ties/slurs it to the previous note (same pitch = just sustain); optional pm palm-mutes it; optional harm (natural / artificial / pinch / none) + harmAt writes a harmonic
set_chords Set chord labels per column
set_key / remove_key Set/add or remove a key (key change) at a measure
set_section Set/remove a section marker (e.g. "Verse", "Chorus")
set_tempo / remove_tempo Set the start BPM, or set/remove a tempo change at a measure
set_time_signature Set a measure's time signature
set_resolution Set a measure's subdivisions per beat (8th/16th/triplets/quintuplets)
add_measures / remove_measure Insert/remove measures (keys & sections re-anchored)
set_tuning Replace tuning / string count (track で対象パートを指定)
add_track / remove_track パート(ベース・2本目のギターなど)の追加・削除。メインを含めて最大4、track 0(メイン)は削除不可

複数パート(トラック)

1つのタブにメインを含めて最大4パートを持てる(docs/design/0001-multiple-tracks.md)。

  • set_cells / write_measures / set_resolution / set_tuning は任意の track(0 始まり、既定 0 = メイン)を取る
  • 小節と拍子は全パート共通。add_measures / remove_measure / set_time_signature は全パートに作用し、 write_measures で末尾に書き足すと全パートに小節が増える。分割(subdivisions)はパートごと
  • コードは track 0 のもの(set_chords は track 0 の列で指定)。write_measures(track > 0) ではコード指定と、 既存小節の拍子を変える time を拒否する
  • get_tab は全パートを小節ごとに並べて表示する(track で1パートに絞れる)
  • send_to_eztab は対応する最新の形式リビジョンをヘッダーに付けて送る(0.5.2では 6)。 対応上限を超える形式のタブは閲覧のみで、編集・送信できない。 0.2.0以前のMCPは複数パートのタブを送り返せない(サーバが409で拒否する)。

小節メモの保持

0.5.1以降はアプリで入力した小節共通メモ(形式リビジョン5)を保持して編集・送信できます。 メモ専用の入力ツールはなく、追加・変更・削除はアプリの「小節メモ…」で行います。 write_measures で既存小節を書き換えた場合もメモを残します。小節削除ではその小節のメモも削除し、 挿入した空小節はメモなしになります。旧MCPはメモのあるタブを編集・送信できません。

These cover the editor's current model: variable string count, per-beat chords, keys with mid-piece changes, section markers, per-measure resolution, time signature, tempo, and title/artist metadata. (Playback, the on-screen keypad, undo/redo and the library/archive are app-only UI concerns and intentionally have no MCP tools.)

Indices are 0-based. string 0 is the top line; tuning is ordered high→low. 例外として write_measures の弦番号はギターの呼び方どおり 1 始まり(1 = TAB の一番上の線) で、get_tab の行ラベルと一致する。

Prompts

Prompt What it does
import_tab_from_image 添付した TAB 譜画像(通常 TAB・コードフォーム図・YouTube の TAB・バンドスコア1ページ)を書き起こす手順。引数 part(例: Guitar II)でバンドスコアのパートを指定、notes で補足

Claude Desktop では入力欄の「+」→ eztab → import_tab_from_image、Claude Code では /mcp__eztab__import_tab_from_image で呼び出し、画像を添付して送る。

EZTab のモデルに無い記譜(スライド・ハンマリング・プリング → タイ/スラー、 ハーモニクス・ビブラート・装飾音 → 主音のみ等)の寄せ方は手順書 (prompts.ts)に書いてあり、書き起こし後に簡略化した箇所を報告させる。

0.5.2以降は曲全体のMarkdownメモ(形式リビジョン6)を既存の編集・送信操作で保持します。曲メモの入力・表示はwebアプリで行います。