mcp-music-studio 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Anthropic, PBC
4
+ Copyright (c) 2026 Xule Lin
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,212 @@
1
+ # MCP Music Studio
2
+
3
+ A creative music tool for AI systems — compose, arrange, and play music with multi-instrument audio, style presets, and visual sheet music.
4
+
5
+ Forked from [`@modelcontextprotocol/server-sheet-music`](https://github.com/modelcontextprotocol/ext-apps/tree/main/examples/sheet-music-server) and substantially extended.
6
+
7
+ ## Features
8
+
9
+ - **8 style presets** — rock, jazz, bossa, waltz, march, reggae, folk, classical. One parameter adds drums + bass + chord accompaniment.
10
+ - **30 instruments** — selectable from UI or via tool parameter, with fuzzy matching
11
+ - **Browser fallback** — `openInBrowser: true` launches a standalone player for CLI environments (Claude Code, Codex, Gemini CLI) that don't support ext-apps UI
12
+ - **`get-music-guide` tool** — on-demand reference for AI systems (instruments, drums, ABC syntax, arrangements, genre templates, MIDI directives)
13
+ - **7 `music://guide/*` resources** — same content for resource-capable clients
14
+ - **Note highlighting** — currently playing notes light up during playback
15
+ - **Forgiving parser** — warnings don't block playback, only fatal errors do
16
+ - **Streaming render** — sheet music appears as the AI types (`ontoolinputpartial`)
17
+ - **Tempo slider** — warp control in the UI
18
+ - **Fullscreen mode** — via ext-apps `requestDisplayMode`
19
+
20
+ ## Install
21
+
22
+ Requires Node.js 18+. Supports stdio and HTTP transports.
23
+
24
+ ### CLI Install (one-liner)
25
+
26
+ ```bash
27
+ # Claude Code
28
+ claude mcp add music-studio -- npx -y mcp-music-studio --stdio
29
+
30
+ # Codex CLI
31
+ codex mcp add -- npx -y mcp-music-studio --stdio
32
+
33
+ # Gemini CLI
34
+ gemini mcp add -- npx -y mcp-music-studio --stdio
35
+ ```
36
+
37
+ ### Claude Desktop
38
+
39
+ Config file location:
40
+
41
+ | OS | Path |
42
+ |----|------|
43
+ | macOS | `~/Library/Application Support/Claude/claude_desktop_config.json` |
44
+ | Windows | `%APPDATA%\Claude\claude_desktop_config.json` |
45
+ | Linux | `~/.config/Claude/claude_desktop_config.json` |
46
+
47
+ ```json
48
+ {
49
+ "mcpServers": {
50
+ "music-studio": {
51
+ "command": "npx",
52
+ "args": ["-y", "mcp-music-studio", "--stdio"]
53
+ }
54
+ }
55
+ }
56
+ ```
57
+
58
+ ### VS Code
59
+
60
+ Add to `.vscode/mcp.json` (project) or user settings:
61
+
62
+ > **Note**: VS Code uses `"servers"` not `"mcpServers"`. Also works in Trae, Void, and PearAI.
63
+
64
+ ```json
65
+ {
66
+ "servers": {
67
+ "music-studio": {
68
+ "command": "npx",
69
+ "args": ["-y", "mcp-music-studio", "--stdio"]
70
+ }
71
+ }
72
+ }
73
+ ```
74
+
75
+ ### Cursor
76
+
77
+ Add to `~/.cursor/mcp.json` (global) or `.cursor/mcp.json` (project):
78
+
79
+ ```json
80
+ {
81
+ "mcpServers": {
82
+ "music-studio": {
83
+ "command": "npx",
84
+ "args": ["-y", "mcp-music-studio", "--stdio"]
85
+ }
86
+ }
87
+ }
88
+ ```
89
+
90
+ ### Windsurf
91
+
92
+ Add to `~/.codeium/windsurf/mcp_config.json`:
93
+
94
+ ```json
95
+ {
96
+ "mcpServers": {
97
+ "music-studio": {
98
+ "command": "npx",
99
+ "args": ["-y", "mcp-music-studio", "--stdio"]
100
+ }
101
+ }
102
+ }
103
+ ```
104
+
105
+ ### Windows
106
+
107
+ On Windows, `npx` is a `.cmd` file and requires a shell wrapper:
108
+
109
+ ```json
110
+ {
111
+ "mcpServers": {
112
+ "music-studio": {
113
+ "command": "cmd",
114
+ "args": ["/c", "npx", "-y", "mcp-music-studio", "--stdio"]
115
+ }
116
+ }
117
+ }
118
+ ```
119
+
120
+ ### ChatGPT
121
+
122
+ ChatGPT only supports remote HTTPS MCP servers. Run the HTTP transport and expose via tunnel:
123
+
124
+ ```bash
125
+ npx mcp-music-studio
126
+ # Server starts on http://localhost:3001/mcp
127
+ # Use ngrok, Cloudflare Tunnel, etc. to expose publicly
128
+ ```
129
+
130
+ ### HTTP Transport
131
+
132
+ ```bash
133
+ npx mcp-music-studio
134
+ # Server starts on http://localhost:3001/mcp
135
+ ```
136
+
137
+ ## Tools
138
+
139
+ ### `play-sheet-music`
140
+
141
+ Creates and plays music with visual sheet music and multi-instrument audio.
142
+
143
+ | Parameter | Type | Description |
144
+ |-----------|------|-------------|
145
+ | `abcNotation` | string | ABC notation with optional chord symbols |
146
+ | `instrument` | string? | Default instrument (e.g., "Violin", "Flute") |
147
+ | `style` | enum? | Accompaniment style: rock, jazz, bossa, waltz, march, reggae, folk, classical |
148
+ | `tempo` | number? | BPM (40-240) |
149
+ | `swing` | number? | Swing feel (0-100) |
150
+ | `transpose` | number? | Semitones (-12 to 12) |
151
+ | `openInBrowser` | boolean? | Open standalone browser player (for CLI environments without UI) |
152
+
153
+ **Example — jazz arrangement:**
154
+ ```json
155
+ {
156
+ "abcNotation": "X:1\nT:Blue Note\nM:4/4\nL:1/8\nK:Bb\n\"Bbmaj7\"d2 f2 d2 Bc | \"Eb7\"_e2 g2 e2 cB | \"Dm7\"d2 f2 a2 fd | \"G7\"g2 f2 e2 dc |",
157
+ "style": "jazz",
158
+ "instrument": "Alto Sax",
159
+ "tempo": 140
160
+ }
161
+ ```
162
+
163
+ ### `get-music-guide`
164
+
165
+ Returns reference material for composition. Topics:
166
+
167
+ | Topic | Contents |
168
+ |-------|----------|
169
+ | `instruments` | All 128 GM instruments by family, program numbers, combo suggestions |
170
+ | `drums` | Percussion notes, pattern syntax, 8 ready-to-use patterns |
171
+ | `abc-syntax` | Notes, rests, chords, repeats, dynamics, multi-voice, lyrics |
172
+ | `arrangements` | Multi-voice patterns, volume balancing, accompaniment setup |
173
+ | `genres` | Complete ABC examples: jazz, blues, folk, minuet, rock, bossa, lullaby |
174
+ | `styles` | What each style preset does and when to use it |
175
+ | `midi-directives` | Full `%%MIDI` reference for ABCJS |
176
+
177
+ ## Development
178
+
179
+ ```bash
180
+ bun install
181
+ bun run dev # watch + serve (hot reload)
182
+ bun run build # production build
183
+ bun run serve # HTTP server on port 3001
184
+ ```
185
+
186
+ ## Architecture
187
+
188
+ ```
189
+ mcp-music-studio/
190
+ ├── server.ts # MCP server: tools, resources, guides, forgiving parser
191
+ ├── main.ts # Entry point: HTTP + stdio transports
192
+ ├── mcp-app.html # HTML shell (Vite inlines everything for ext-apps UI)
193
+ ├── src/
194
+ │ ├── mcp-app.ts # Ext-apps client: rendering, audio, streaming
195
+ │ ├── mcp-app.css # Styles: dark mode, note highlighting, toolbar
196
+ │ ├── music-logic.ts # Shared: instruments, presets, ABC processing
197
+ │ ├── server-logic.ts # Server: parse validation, result construction
198
+ │ ├── browser-fallback.ts # Browser player: HTML generation, auto-open
199
+ │ └── global.css # Base reset
200
+ ├── tests/ # Vitest tests
201
+ ├── vite.config.ts # Single-file HTML bundling
202
+ ├── tsconfig.json # Client TypeScript config
203
+ └── tsconfig.server.json # Server TypeScript config
204
+ ```
205
+
206
+ ## Attribution
207
+
208
+ This project is a fork of the [Sheet Music Server](https://github.com/modelcontextprotocol/ext-apps/tree/main/examples/sheet-music-server) example from the [MCP ext-apps](https://github.com/modelcontextprotocol/ext-apps) repository by Anthropic, licensed under MIT.
209
+
210
+ ## License
211
+
212
+ MIT