@cyanheads/musicbrainz-mcp-server 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.
Files changed (89) hide show
  1. package/AGENTS.md +466 -0
  2. package/CLAUDE.md +466 -0
  3. package/Dockerfile +121 -0
  4. package/LICENSE +201 -0
  5. package/README.md +329 -0
  6. package/changelog/0.1.x/0.1.0.md +27 -0
  7. package/changelog/template.md +127 -0
  8. package/dist/config/server-config.d.ts +24 -0
  9. package/dist/config/server-config.d.ts.map +1 -0
  10. package/dist/config/server-config.js +90 -0
  11. package/dist/config/server-config.js.map +1 -0
  12. package/dist/index.d.ts +10 -0
  13. package/dist/index.d.ts.map +1 -0
  14. package/dist/index.js +27 -0
  15. package/dist/index.js.map +1 -0
  16. package/dist/mcp-server/resources/definitions/entity.resource.d.ts +33 -0
  17. package/dist/mcp-server/resources/definitions/entity.resource.d.ts.map +1 -0
  18. package/dist/mcp-server/resources/definitions/entity.resource.js +72 -0
  19. package/dist/mcp-server/resources/definitions/entity.resource.js.map +1 -0
  20. package/dist/mcp-server/resources/definitions/index.d.ts +27 -0
  21. package/dist/mcp-server/resources/definitions/index.d.ts.map +1 -0
  22. package/dist/mcp-server/resources/definitions/index.js +8 -0
  23. package/dist/mcp-server/resources/definitions/index.js.map +1 -0
  24. package/dist/mcp-server/tools/definitions/_shared.d.ts +105 -0
  25. package/dist/mcp-server/tools/definitions/_shared.d.ts.map +1 -0
  26. package/dist/mcp-server/tools/definitions/_shared.js +382 -0
  27. package/dist/mcp-server/tools/definitions/_shared.js.map +1 -0
  28. package/dist/mcp-server/tools/definitions/browse-entities.tool.d.ts +62 -0
  29. package/dist/mcp-server/tools/definitions/browse-entities.tool.d.ts.map +1 -0
  30. package/dist/mcp-server/tools/definitions/browse-entities.tool.js +236 -0
  31. package/dist/mcp-server/tools/definitions/browse-entities.tool.js.map +1 -0
  32. package/dist/mcp-server/tools/definitions/get-artist.tool.d.ts +78 -0
  33. package/dist/mcp-server/tools/definitions/get-artist.tool.d.ts.map +1 -0
  34. package/dist/mcp-server/tools/definitions/get-artist.tool.js +200 -0
  35. package/dist/mcp-server/tools/definitions/get-artist.tool.js.map +1 -0
  36. package/dist/mcp-server/tools/definitions/get-cover-art.tool.d.ts +42 -0
  37. package/dist/mcp-server/tools/definitions/get-cover-art.tool.d.ts.map +1 -0
  38. package/dist/mcp-server/tools/definitions/get-cover-art.tool.js +149 -0
  39. package/dist/mcp-server/tools/definitions/get-cover-art.tool.js.map +1 -0
  40. package/dist/mcp-server/tools/definitions/get-label.tool.d.ts +52 -0
  41. package/dist/mcp-server/tools/definitions/get-label.tool.d.ts.map +1 -0
  42. package/dist/mcp-server/tools/definitions/get-label.tool.js +110 -0
  43. package/dist/mcp-server/tools/definitions/get-label.tool.js.map +1 -0
  44. package/dist/mcp-server/tools/definitions/get-recording.tool.d.ts +58 -0
  45. package/dist/mcp-server/tools/definitions/get-recording.tool.d.ts.map +1 -0
  46. package/dist/mcp-server/tools/definitions/get-recording.tool.js +135 -0
  47. package/dist/mcp-server/tools/definitions/get-recording.tool.js.map +1 -0
  48. package/dist/mcp-server/tools/definitions/get-release-group.tool.d.ts +55 -0
  49. package/dist/mcp-server/tools/definitions/get-release-group.tool.d.ts.map +1 -0
  50. package/dist/mcp-server/tools/definitions/get-release-group.tool.js +140 -0
  51. package/dist/mcp-server/tools/definitions/get-release-group.tool.js.map +1 -0
  52. package/dist/mcp-server/tools/definitions/get-release.tool.d.ts +66 -0
  53. package/dist/mcp-server/tools/definitions/get-release.tool.d.ts.map +1 -0
  54. package/dist/mcp-server/tools/definitions/get-release.tool.js +213 -0
  55. package/dist/mcp-server/tools/definitions/get-release.tool.js.map +1 -0
  56. package/dist/mcp-server/tools/definitions/get-work.tool.d.ts +62 -0
  57. package/dist/mcp-server/tools/definitions/get-work.tool.d.ts.map +1 -0
  58. package/dist/mcp-server/tools/definitions/get-work.tool.js +132 -0
  59. package/dist/mcp-server/tools/definitions/get-work.tool.js.map +1 -0
  60. package/dist/mcp-server/tools/definitions/index.d.ts +468 -0
  61. package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -0
  62. package/dist/mcp-server/tools/definitions/index.js +28 -0
  63. package/dist/mcp-server/tools/definitions/index.js.map +1 -0
  64. package/dist/mcp-server/tools/definitions/lookup-identifier.tool.d.ts +59 -0
  65. package/dist/mcp-server/tools/definitions/lookup-identifier.tool.d.ts.map +1 -0
  66. package/dist/mcp-server/tools/definitions/lookup-identifier.tool.js +214 -0
  67. package/dist/mcp-server/tools/definitions/lookup-identifier.tool.js.map +1 -0
  68. package/dist/mcp-server/tools/definitions/search-entities.tool.d.ts +42 -0
  69. package/dist/mcp-server/tools/definitions/search-entities.tool.d.ts.map +1 -0
  70. package/dist/mcp-server/tools/definitions/search-entities.tool.js +187 -0
  71. package/dist/mcp-server/tools/definitions/search-entities.tool.js.map +1 -0
  72. package/dist/services/cover-art/cover-art-service.d.ts +40 -0
  73. package/dist/services/cover-art/cover-art-service.d.ts.map +1 -0
  74. package/dist/services/cover-art/cover-art-service.js +118 -0
  75. package/dist/services/cover-art/cover-art-service.js.map +1 -0
  76. package/dist/services/musicbrainz/musicbrainz-service.d.ts +81 -0
  77. package/dist/services/musicbrainz/musicbrainz-service.d.ts.map +1 -0
  78. package/dist/services/musicbrainz/musicbrainz-service.js +188 -0
  79. package/dist/services/musicbrainz/musicbrainz-service.js.map +1 -0
  80. package/dist/services/musicbrainz/rate-limiter.d.ts +32 -0
  81. package/dist/services/musicbrainz/rate-limiter.d.ts.map +1 -0
  82. package/dist/services/musicbrainz/rate-limiter.js +54 -0
  83. package/dist/services/musicbrainz/rate-limiter.js.map +1 -0
  84. package/dist/services/musicbrainz/types.d.ts +301 -0
  85. package/dist/services/musicbrainz/types.d.ts.map +1 -0
  86. package/dist/services/musicbrainz/types.js +11 -0
  87. package/dist/services/musicbrainz/types.js.map +1 -0
  88. package/package.json +103 -0
  89. package/server.json +111 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2025 Casey Hand @cyanheads
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,329 @@
1
+ <div align="center">
2
+ <h1>musicbrainz-mcp-server</h1>
3
+ <p><b>Search artists, releases, recordings, works, and labels; traverse relationships; resolve ISRC/ISWC/barcode; fetch cover art via MCP. STDIO or Streamable HTTP.</b>
4
+ <div>10 Tools • 1 Resource</div>
5
+ </p>
6
+ </div>
7
+
8
+ <div align="center">
9
+
10
+ [![Version](https://img.shields.io/badge/Version-0.1.0-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.29.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![TypeScript](https://img.shields.io/badge/TypeScript-^6.0.3-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.3.2-blueviolet.svg?style=flat-square)](https://bun.sh/)
11
+
12
+ [![Framework](https://img.shields.io/badge/Built%20on-@cyanheads/mcp--ts--core-67E8F9?style=flat-square)](https://www.npmjs.com/package/@cyanheads/mcp-ts-core)
13
+
14
+ </div>
15
+
16
+ ---
17
+
18
+ ## Tools
19
+
20
+ Ten read-only tools mapping the three MusicBrainz access modes — **search** when you have text, **lookup** (`get_*` and `lookup_identifier`) when you hold an MBID or standard identifier, and **browse** when you need the complete linked set beyond the single page that lookup folds in:
21
+
22
+ | Tool | Description |
23
+ |:---|:---|
24
+ | `musicbrainz_search_entities` | Full-text Lucene search across an entity type (artist, release-group, release, recording, work, label). Returns ranked matches with MBID and a 0–100 relevance score. The first step when starting from a name. |
25
+ | `musicbrainz_get_artist` | Artist profile by MBID — type, country, life span, aliases, tags/genres, discography (release-groups), band-membership relationships, and external links. |
26
+ | `musicbrainz_get_release_group` | Release-group ("the album" above specific pressings) by MBID — primary/secondary type, first-release date, artist credit, editions, and a cover-art availability flag. |
27
+ | `musicbrainz_get_release` | One edition's full detail by MBID — tracklist (media → tracks → recordings), label + catalog number, barcode, packaging, and a cover-art stub. |
28
+ | `musicbrainz_get_recording` | Recording (a specific performance/track) by MBID — length, artist credits, ISRCs, the releases it appears on, the work(s) it performs, and performance/production relationships. |
29
+ | `musicbrainz_get_work` | Work (a composition, distinct from any recording) by MBID — type, languages, ISWCs, writer/composer relationships, and the recordings that perform it. |
30
+ | `musicbrainz_get_label` | Label by MBID — type, country, life span, label code, area, aliases, tags, and external links. |
31
+ | `musicbrainz_lookup_identifier` | Resolve a standard identifier without a name search — ISRC → recordings, ISWC → works, barcode → releases. Output is discriminated on the resolved entity type. |
32
+ | `musicbrainz_browse_entities` | Paginate the complete set of entities linked to a parent MBID — every release on a label, every release-group by an artist, every recording of a work. The only complete-enumeration path. |
33
+ | `musicbrainz_get_cover_art` | Cover Art Archive images for a release or release-group MBID — front/back flags, image types, full-resolution URLs, and 250/500/1200px thumbnails. No art returns an empty set, not an error. |
34
+
35
+ ### `musicbrainz_search_entities`
36
+
37
+ Resolve a name to an MBID with full-text Lucene search.
38
+
39
+ - Searches one entity type per call: artist, release-group, release, recording, work, or label
40
+ - Field-scoped Lucene syntax (e.g. `artist:radiohead AND country:GB`)
41
+ - Surfaces the raw 0–100 relevance `score` per hit (100 = exact); results stay in MusicBrainz score-descending order, not re-ranked
42
+ - Type-specific fields appear only for the relevant entity (ISRCs on recordings, ISWCs on works, artist credit on release-groups/releases/recordings)
43
+ - Pagination via `limit` (1–100) and `offset`; echoes the effective query and the true upstream total
44
+
45
+ ---
46
+
47
+ ### `musicbrainz_get_artist`
48
+
49
+ The 80% artist-detail call.
50
+
51
+ - Folds discography (release-groups), band-membership / collaboration relationships, aliases, and tags/genres into one request via `inc`
52
+ - External links (Wikidata QID, Discogs, official site) surface as `url-rels` — chainable to `wikidata-mcp-server` and friends; this server does not chase them itself
53
+ - `inc_release_groups` and `inc_relationships` toggle the expensive sub-resources
54
+ - Discography and relationships are capped at one page (25); for a prolific artist's complete release-group list, use `musicbrainz_browse_entities` (`target_type=release-group`, artist link)
55
+
56
+ ---
57
+
58
+ ### `musicbrainz_get_release`
59
+
60
+ One edition's full detail, the level with an actual tracklist.
61
+
62
+ - Tracklist as media → tracks → recordings, each with length and recording MBID (lengths rendered `m:ss`, stored as milliseconds upstream)
63
+ - Label + catalog number, barcode, country, release date, format, packaging, and text representation (language/script)
64
+ - Carries a cover-art availability stub from the WS/2 payload; call `musicbrainz_get_cover_art` with the release MBID for the actual image URLs
65
+
66
+ ---
67
+
68
+ ### `musicbrainz_lookup_identifier`
69
+
70
+ The deterministic path when you already hold a standard identifier — no name search.
71
+
72
+ - `id_type=isrc` → recordings (a recording-level code, often shared by several recordings)
73
+ - `id_type=iswc` → works (a composition-level code)
74
+ - `id_type=barcode` → releases (UPC/EAN)
75
+ - ISRC and ISWC hit dedicated exact endpoints; barcode is a Lucene search filter, so its results are ranked (exact match scores 100)
76
+ - The output `kind` field tells you which entity type came back
77
+
78
+ ---
79
+
80
+ ### `musicbrainz_browse_entities`
81
+
82
+ The complete-enumeration path — a correctness tool, not just convenience.
83
+
84
+ - Paginates the full linked set: every release-group by an artist, every release on a label, every recording of a work, every release in a release-group
85
+ - Pages arbitrarily deep via `offset`; `totalCount` is the true upstream total
86
+ - Use it whenever a linked set may exceed a page — the `get_*` tools embed at most one page (25), and a partial list read as complete is a silent correctness gap
87
+ - Provide exactly one `link` MBID matching a valid parent→child relationship for the `target_type`
88
+
89
+ ---
90
+
91
+ ### `musicbrainz_get_cover_art`
92
+
93
+ Cover Art Archive images, kept separate from the release record.
94
+
95
+ - Front/back flags, image types, full-resolution URLs, and 250/500/1200px thumbnail URLs
96
+ - Returns an empty image set (not an error) when the entity has no art — absence of art is information
97
+ - Art is served at the release level; a release-group MBID resolves to a representative release's art automatically
98
+ - Image URLs are linked, never rehosted — image copyright stays with the rights holders (only the MusicBrainz core metadata is CC0)
99
+
100
+ ## Resources
101
+
102
+ | Type | Name | Description |
103
+ |:---|:---|:---|
104
+ | Resource | `musicbrainz://{entity_type}/{mbid}` | A single MusicBrainz entity by type and MBID, with default linked sub-resources folded in. Mirrors the matching `musicbrainz_get_*` tool. `entity_type` ∈ artist, release-group, release, recording, work, label. |
105
+
106
+ All entity data is also reachable via the `get_*` tools, so tool-only clients (the majority) lose nothing. There is no resource `list()` — the corpus is millions of entities; discovery is via `musicbrainz_search_entities`, not resource enumeration.
107
+
108
+ ## Features
109
+
110
+ Built on [`@cyanheads/mcp-ts-core`](https://www.npmjs.com/package/@cyanheads/mcp-ts-core):
111
+
112
+ - Declarative tool and resource definitions — single file per primitive, framework handles registration and validation
113
+ - Unified error handling — handlers throw, framework catches, classifies, and formats
114
+ - Pluggable auth: `none`, `jwt`, `oauth`
115
+ - Swappable storage backends: `in-memory`, `filesystem`, `Supabase`, `Cloudflare KV/R2/D1`
116
+ - Structured logging with optional OpenTelemetry tracing
117
+ - STDIO and Streamable HTTP transports
118
+
119
+ MusicBrainz-specific:
120
+
121
+ - Type-safe client over the MusicBrainz Web Service v2 (`musicbrainz.org/ws/2`, JSON) plus the Cover Art Archive
122
+ - Process-wide ~1 req/sec token-bucket rate limiter — concurrent requests serialize to stay under MusicBrainz's per-IP ceiling, so multi-tenant load shares one budget
123
+ - Response caching keyed on the full request (including the `inc` set) — MBIDs are stable and entity data changes slowly, keeping most repeat lookups off the wire
124
+ - `inc`-driven lookups fold discography, relationships, tracklists, and external IDs into a single call rather than serial requests
125
+ - Retry with backoff over the full fetch + parse pipeline; an HTML error page served under load is classified transient, not as a parse error
126
+
127
+ Agent-friendly output:
128
+
129
+ - Provenance on search/browse — the effective query is echoed and the true upstream total is reported, so an agent can tell a partial window from a complete result
130
+ - Truncation honesty — `get_*` tools disclose when an embedded linked list is capped at one page and name `musicbrainz_browse_entities` as the complete-enumeration path
131
+ - Discriminated outputs — `musicbrainz_lookup_identifier` returns a `kind`-tagged union (recordings | works | releases) so callers branch on data, not string parsing
132
+ - Raw upstream relevance `score` surfaced as-is (not a fabricated confidence metric), and missing upstream fields are preserved as absent rather than invented
133
+
134
+ ## Getting started
135
+
136
+ `musicbrainz-mcp-server` is keyless — no API key or account. MusicBrainz does require a descriptive `User-Agent` with a contact and rate-limits to ~1 request/second per IP; the server ships a default contact so it works out of the box, but operators running a shared or hosted instance should set `MUSICBRAINZ_CONTACT` to their own email or URL.
137
+
138
+ Add the following to your MCP client configuration file.
139
+
140
+ ```json
141
+ {
142
+ "mcpServers": {
143
+ "musicbrainz-mcp-server": {
144
+ "type": "stdio",
145
+ "command": "bunx",
146
+ "args": ["@cyanheads/musicbrainz-mcp-server@latest"],
147
+ "env": {
148
+ "MCP_TRANSPORT_TYPE": "stdio",
149
+ "MCP_LOG_LEVEL": "info",
150
+ "MUSICBRAINZ_CONTACT": "you@example.com"
151
+ }
152
+ }
153
+ }
154
+ }
155
+ ```
156
+
157
+ Or with npx (no Bun required):
158
+
159
+ ```json
160
+ {
161
+ "mcpServers": {
162
+ "musicbrainz-mcp-server": {
163
+ "type": "stdio",
164
+ "command": "npx",
165
+ "args": ["-y", "@cyanheads/musicbrainz-mcp-server@latest"],
166
+ "env": {
167
+ "MCP_TRANSPORT_TYPE": "stdio",
168
+ "MCP_LOG_LEVEL": "info",
169
+ "MUSICBRAINZ_CONTACT": "you@example.com"
170
+ }
171
+ }
172
+ }
173
+ }
174
+ ```
175
+
176
+ Or with Docker:
177
+
178
+ ```json
179
+ {
180
+ "mcpServers": {
181
+ "musicbrainz-mcp-server": {
182
+ "type": "stdio",
183
+ "command": "docker",
184
+ "args": [
185
+ "run", "-i", "--rm",
186
+ "-e", "MCP_TRANSPORT_TYPE=stdio",
187
+ "-e", "MUSICBRAINZ_CONTACT=you@example.com",
188
+ "ghcr.io/cyanheads/musicbrainz-mcp-server:latest"
189
+ ]
190
+ }
191
+ }
192
+ }
193
+ ```
194
+
195
+ For Streamable HTTP, set the transport and start the server:
196
+
197
+ ```sh
198
+ MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 MUSICBRAINZ_CONTACT=you@example.com bun run start:http
199
+ # Server listens at http://localhost:3010/mcp
200
+ ```
201
+
202
+ ### Prerequisites
203
+
204
+ - [Bun v1.3.2](https://bun.sh/) or higher (or Node.js v24+).
205
+ - No API key. Optionally set `MUSICBRAINZ_CONTACT` to your email or URL — recommended for any shared or hosted deployment.
206
+
207
+ ### Installation
208
+
209
+ 1. **Clone the repository:**
210
+
211
+ ```sh
212
+ git clone https://github.com/cyanheads/musicbrainz-mcp-server.git
213
+ ```
214
+
215
+ 2. **Navigate into the directory:**
216
+
217
+ ```sh
218
+ cd musicbrainz-mcp-server
219
+ ```
220
+
221
+ 3. **Install dependencies:**
222
+
223
+ ```sh
224
+ bun install
225
+ ```
226
+
227
+ 4. **Configure environment:**
228
+
229
+ ```sh
230
+ cp .env.example .env
231
+ # edit .env and set MUSICBRAINZ_CONTACT (optional but recommended)
232
+ ```
233
+
234
+ ## Configuration
235
+
236
+ Configuration is validated at startup via Zod schemas in `src/config/server-config.ts`.
237
+
238
+ | Variable | Description | Default |
239
+ |:---|:---|:---|
240
+ | `MUSICBRAINZ_CONTACT` | Contact (email or URL) embedded in the mandatory descriptive `User-Agent`. Not start-blocking — a default is provided — but operators of a shared/hosted instance should set their own so MusicBrainz can reach them about traffic. | repo URL |
241
+ | `MUSICBRAINZ_BASE_URL` | MusicBrainz Web Service v2 base URL. Override for a private mirror or `beta.musicbrainz.org`. | `https://musicbrainz.org/ws/2` |
242
+ | `MUSICBRAINZ_RATE_LIMIT_RPS` | Client-side request-per-second ceiling. ~1 is the documented limit; lower it for shared-hosting headroom. | `1` |
243
+ | `MUSICBRAINZ_CACHE_TTL` | Response cache TTL in seconds. MBIDs are stable, so data changes slowly. `0` disables caching. | `86400` |
244
+ | `MUSICBRAINZ_TIMEOUT_MS` | Per-request HTTP timeout in milliseconds. | `30000` |
245
+ | `MUSICBRAINZ_MAX_RETRIES` | Retry attempts for transient upstream failures (503 / 5xx / HTML error page). | `3` |
246
+ | `COVER_ART_BASE_URL` | Cover Art Archive base URL. | `https://coverartarchive.org` |
247
+ | `MCP_TRANSPORT_TYPE` | Transport: `stdio` or `http`. | `stdio` |
248
+ | `MCP_HTTP_PORT` | Port for the HTTP server. | `3010` |
249
+ | `MCP_AUTH_MODE` | Auth mode: `none`, `jwt`, or `oauth`. | `none` |
250
+ | `MCP_LOG_LEVEL` | Log level (RFC 5424). | `info` |
251
+ | `OTEL_ENABLED` | Enable [OpenTelemetry instrumentation](https://github.com/cyanheads/mcp-ts-core/tree/main/docs/telemetry). | `false` |
252
+
253
+ See [`.env.example`](./.env.example) for the full list of optional overrides.
254
+
255
+ ### Rate limit and User-Agent
256
+
257
+ MusicBrainz enforces a **~1 request/second** average rate limit per IP across the whole hosted instance and **blocks requests without a descriptive `User-Agent`** that identifies the application and a contact. This server satisfies both: it sends `musicbrainz-mcp-server/<version> (<contact>)` as the `User-Agent` and serializes all upstream calls through a process-wide token-bucket limiter, with response caching to keep repeat lookups off the wire. On a shared or hosted instance every client shares the one limiter, so bulk enumeration via `musicbrainz_browse_entities` paces accordingly. Set `MUSICBRAINZ_CONTACT` to your own email or URL when you deploy.
258
+
259
+ ### Attribution and licensing
260
+
261
+ MusicBrainz core entity data is released under **CC0** (public-domain dedication) — see the [MusicBrainz license](https://musicbrainz.org/doc/About/Data_License). This server stays on that core metadata and does not fetch annotation text (which carries a different, non-CC0 license). Cover art is served by the [Cover Art Archive](https://coverartarchive.org/), a joint project of MusicBrainz and the Internet Archive; image URLs are linked, never rehosted, and each image's copyright stays with its rights holders. Cite MusicBrainz and the Cover Art Archive in downstream use.
262
+
263
+ ## Running the server
264
+
265
+ ### Local development
266
+
267
+ - **Build and run:**
268
+
269
+ ```sh
270
+ # One-time build
271
+ bun run rebuild
272
+
273
+ # Run the built server
274
+ bun run start:stdio
275
+ # or
276
+ bun run start:http
277
+ ```
278
+
279
+ - **Run checks and tests:**
280
+
281
+ ```sh
282
+ bun run devcheck # Lint, format, typecheck, security, packaging
283
+ bun run test # Vitest test suite
284
+ bun run lint:mcp # Validate MCP definitions against the linter rules
285
+ ```
286
+
287
+ ### Docker
288
+
289
+ ```sh
290
+ docker build -t musicbrainz-mcp-server .
291
+ docker run --rm -e MUSICBRAINZ_CONTACT=you@example.com -p 3010:3010 musicbrainz-mcp-server
292
+ ```
293
+
294
+ The Dockerfile defaults to HTTP transport, stateless session mode, and logs to `/var/log/musicbrainz-mcp-server`. OpenTelemetry peer dependencies are installed by default — build with `--build-arg OTEL_ENABLED=false` to omit them.
295
+
296
+ ## Project structure
297
+
298
+ | Directory | Purpose |
299
+ |:---|:---|
300
+ | `src/index.ts` | `createApp()` entry point — registers tools and the resource, inits both services. |
301
+ | `src/config` | Server-specific environment variable parsing and validation with Zod. |
302
+ | `src/services/musicbrainz` | MusicBrainz WS/2 client — User-Agent, rate limiter, response cache, retry, and domain types. |
303
+ | `src/services/cover-art` | Cover Art Archive client — maps 404 to an empty image set, follows the release-group redirect. |
304
+ | `src/mcp-server/tools` | Tool definitions (`*.tool.ts`). Ten read-only tools across search, lookup, browse, and cover art. |
305
+ | `src/mcp-server/resources` | Resource definitions. The `musicbrainz://{entity_type}/{mbid}` entity mirror. |
306
+ | `tests/` | Unit and integration tests mirroring `src/`. |
307
+
308
+ ## Development guide
309
+
310
+ See [`CLAUDE.md`/`AGENTS.md`](./CLAUDE.md) for development guidelines and architectural rules. The short version:
311
+
312
+ - Handlers throw, framework catches — no `try/catch` in tool logic
313
+ - Use `ctx.log` for request-scoped logging, `ctx.state` for tenant-scoped storage
314
+ - Register new tools and resources via the barrels in `src/mcp-server/*/definitions/index.ts`
315
+ - All upstream calls route through the services — never `fetch()` MusicBrainz directly, or you bypass the User-Agent, rate limiter, and cache
316
+ - Wrap external API data: validate raw → normalize to domain type → return output schema; never fabricate missing fields
317
+
318
+ ## Contributing
319
+
320
+ Issues and pull requests are welcome. Run checks and tests before submitting:
321
+
322
+ ```sh
323
+ bun run devcheck
324
+ bun run test
325
+ ```
326
+
327
+ ## License
328
+
329
+ Apache-2.0 — see [LICENSE](./LICENSE) for details.
@@ -0,0 +1,27 @@
1
+ ---
2
+ summary: "Initial release: 10 read-only tools over MusicBrainz WS/2 + Cover Art Archive — search, six entity lookups, identifier resolution, browse, cover art — with a ~1 req/sec limiter and response cache."
3
+ breaking: false
4
+ security: false
5
+ ---
6
+
7
+ # 0.1.0 — 2026-06-13
8
+
9
+ Open music metadata over the live MusicBrainz Web Service v2 and the Cover Art Archive. Keyless, read-only, CC0 core data.
10
+
11
+ ## Added
12
+
13
+ - **`musicbrainz_search_entities`** — full-text Lucene search across artist, release-group, release, recording, work, or label; returns ranked MBID + name + 0–100 relevance score. The first step when starting from a name.
14
+ - **`musicbrainz_get_artist`** — artist profile: type, country, life span, aliases, tags/genres, discography (release-groups), band-membership relationships, and external links (Wikidata/Discogs url-rels).
15
+ - **`musicbrainz_get_release_group`** — release-group: primary/secondary type, first-release date, artist credit, editions, tags, cover-art availability stub.
16
+ - **`musicbrainz_get_release`** — one edition: tracklist (media → tracks → recordings), label + catalog number, barcode, packaging, text representation, cover-art stub.
17
+ - **`musicbrainz_get_recording`** — recording: length, artist credits, ISRCs, releases it appears on, work-rels, and performance/production relationships.
18
+ - **`musicbrainz_get_work`** — work (composition): type, languages, ISWCs, writer/composer relationships, recordings that perform it.
19
+ - **`musicbrainz_get_label`** — label: type, country, life span, label code, area, aliases, tags, external links.
20
+ - **`musicbrainz_lookup_identifier`** — resolve ISRC → recordings, ISWC → works, barcode → releases. Output is a discriminated union on the resolved entity type.
21
+ - **`musicbrainz_browse_entities`** — paginate the COMPLETE linked set (every release on a label, every recording of a work) with deep offset and a true total — the complete-enumeration path past the get_* tools' one-page `inc` cap.
22
+ - **`musicbrainz_get_cover_art`** — Cover Art Archive images for a release or release-group: front/back flags, types, full URLs, and 250/500/1200px thumbnails. No art returns an empty set, not an error.
23
+ - **`musicbrainz://{entity_type}/{mbid}`** resource — a single entity by type and MBID, mirroring the get_* lookups with default `inc` sets.
24
+ - **`musicbrainz-service`** — owns the mandatory descriptive `User-Agent`, a process-wide ~1 req/sec rate limiter (concurrent calls serialize to stay under MusicBrainz's per-IP ceiling), a response cache keyed on the full request (`MUSICBRAINZ_CACHE_TTL`, default 24h), and `withRetry` backoff over the fetch + parse pipeline.
25
+ - **`cover-art-service`** — Cover Art Archive client; maps 404 to an empty image set, follows the release-group 307 redirect.
26
+ - Config (`src/config/server-config.ts`): `MUSICBRAINZ_CONTACT`, `MUSICBRAINZ_BASE_URL`, `MUSICBRAINZ_RATE_LIMIT_RPS`, `MUSICBRAINZ_CACHE_TTL`, `COVER_ART_BASE_URL`, plus timeout/retry tuning.
27
+ - Typed error contracts encoding the live 400-vs-404 split. MBID lookups: malformed/zero MBID → `invalid_mbid` (InvalidParams), valid-format-but-nonexistent → `entity_not_found` (NotFound). `lookup_identifier`: malformed ISRC/ISWC → `invalid_identifier`, well-formed-but-unresolved → `identifier_not_found`. `browse_entities`: missing/duplicate/malformed parent link → `invalid_link`, nonexistent parent → `entity_not_found`.