discogs-mcp-server 0.2.0 → 0.4.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 +21 -0
- package/README.md +9 -4
- package/dist/index.js +64 -7
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Christopher Kim
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
[](LICENSE)
|
|
2
|
+
[](https://github.com/cswkim/discogs-mcp-server/releases)
|
|
3
|
+
[](https://github.com/cswkim/discogs-mcp-server/actions/workflows/check-pr.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/discogs-mcp-server)
|
|
5
|
+
[](https://github.com/sponsors/cswkim)
|
|
6
|
+
|
|
1
7
|
# Discogs MCP Server
|
|
2
8
|
|
|
3
9
|
MCP Server for the Discogs API, enabling music catalog operations, search functionality, and more.
|
|
@@ -68,7 +74,7 @@ The other environment variables in `.env.example` are optional and have sensible
|
|
|
68
74
|
|
|
69
75
|
2. Available commands:
|
|
70
76
|
- `pnpm run dev`: Start the development server with hot reloading
|
|
71
|
-
- `pnpm run dev:
|
|
77
|
+
- `pnpm run dev:stream`: Start the development server with hot reloading in HTTP streaming mode
|
|
72
78
|
- `pnpm run build`: Build the production version
|
|
73
79
|
- `pnpm run start`: Run the production build
|
|
74
80
|
- `pnpm run inspect`: Run the MCP Inspector (see [Inspection](#inspection) section)
|
|
@@ -90,10 +96,10 @@ The other environment variables in `.env.example` are optional and have sensible
|
|
|
90
96
|
docker run --env-file .env discogs-mcp-server:latest
|
|
91
97
|
```
|
|
92
98
|
|
|
93
|
-
For
|
|
99
|
+
For HTTP Streaming transport mode:
|
|
94
100
|
```bash
|
|
95
101
|
# The port should match what is in your .env file
|
|
96
|
-
docker run --env-file .env -p 3001:3001 discogs-mcp-server:latest
|
|
102
|
+
docker run --env-file .env -p 3001:3001 discogs-mcp-server:latest stream
|
|
97
103
|
```
|
|
98
104
|
|
|
99
105
|
## Inspection
|
|
@@ -187,7 +193,6 @@ Any changes to local code will require Claude to be restarted to take effect. Al
|
|
|
187
193
|
- OAuth support
|
|
188
194
|
- Missing tools:
|
|
189
195
|
- Inventory uploading
|
|
190
|
-
- Editing collection custom fields
|
|
191
196
|
|
|
192
197
|
## License
|
|
193
198
|
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import dotenv from 'dotenv';
|
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
|
|
6
6
|
// src/version.ts
|
|
7
|
-
var VERSION = "0.
|
|
7
|
+
var VERSION = "0.4.0";
|
|
8
8
|
|
|
9
9
|
// src/config.ts
|
|
10
10
|
dotenv.config();
|
|
@@ -1757,6 +1757,14 @@ var UserCollectionCustomFieldsSchema = z.object({
|
|
|
1757
1757
|
})
|
|
1758
1758
|
)
|
|
1759
1759
|
});
|
|
1760
|
+
var UserCollectionCustomFieldEditParamsSchema = UsernameInputSchema.merge(
|
|
1761
|
+
FolderIdParamSchema().extend({
|
|
1762
|
+
value: z.string(),
|
|
1763
|
+
release_id: z.union([z.number(), z.string()]),
|
|
1764
|
+
instance_id: z.union([z.number(), z.string()]),
|
|
1765
|
+
field_id: z.number()
|
|
1766
|
+
})
|
|
1767
|
+
);
|
|
1760
1768
|
var UserCollectionFolderSchema = z.object({
|
|
1761
1769
|
id: z.number(),
|
|
1762
1770
|
count: z.number(),
|
|
@@ -2248,6 +2256,39 @@ var UserCollectionService = class extends BaseUserService {
|
|
|
2248
2256
|
throw new Error(`Failed to delete release from folder: ${String(error)}`);
|
|
2249
2257
|
}
|
|
2250
2258
|
}
|
|
2259
|
+
/**
|
|
2260
|
+
* Edit a custom field value for a release in a user's collection
|
|
2261
|
+
*
|
|
2262
|
+
* @param params The parameters for the custom field value edit
|
|
2263
|
+
* @throws {DiscogsAuthenticationError} If authentication fails
|
|
2264
|
+
* @throws {DiscogsPermissionError} If trying to edit a custom field value of another user
|
|
2265
|
+
* @throws {DiscogsResourceNotFoundError} If the username, folder_id, release_id, or instance_id cannot be found
|
|
2266
|
+
* @throws {DiscogsValidationFailedError} If the field is a dropdown and the value is not in the list of options
|
|
2267
|
+
* @throws {Error} If there's an unexpected error
|
|
2268
|
+
*/
|
|
2269
|
+
async editCustomFieldValue({
|
|
2270
|
+
username,
|
|
2271
|
+
folder_id,
|
|
2272
|
+
release_id,
|
|
2273
|
+
instance_id,
|
|
2274
|
+
field_id,
|
|
2275
|
+
value
|
|
2276
|
+
}) {
|
|
2277
|
+
try {
|
|
2278
|
+
await this.request(
|
|
2279
|
+
`/${username}/collection/folders/${folder_id}/releases/${release_id}/instances/${instance_id}/fields/${field_id}`,
|
|
2280
|
+
{
|
|
2281
|
+
method: "POST",
|
|
2282
|
+
body: { value }
|
|
2283
|
+
}
|
|
2284
|
+
);
|
|
2285
|
+
} catch (error) {
|
|
2286
|
+
if (isDiscogsError(error)) {
|
|
2287
|
+
throw error;
|
|
2288
|
+
}
|
|
2289
|
+
throw new Error(`Failed to edit custom field value: ${String(error)}`);
|
|
2290
|
+
}
|
|
2291
|
+
}
|
|
2251
2292
|
/**
|
|
2252
2293
|
* Edit a folder's metadata. Folders 0 and 1 cannot be renamed.
|
|
2253
2294
|
*
|
|
@@ -2756,6 +2797,20 @@ var deleteUserCollectionFolderTool = {
|
|
|
2756
2797
|
}
|
|
2757
2798
|
}
|
|
2758
2799
|
};
|
|
2800
|
+
var editUserCollectionCustomFieldValueTool = {
|
|
2801
|
+
name: "edit_user_collection_custom_field_value",
|
|
2802
|
+
description: `Edit a custom field value for a release in a user's collection`,
|
|
2803
|
+
parameters: UserCollectionCustomFieldEditParamsSchema,
|
|
2804
|
+
execute: async (args) => {
|
|
2805
|
+
try {
|
|
2806
|
+
const userService = new UserService();
|
|
2807
|
+
await userService.collection.editCustomFieldValue(args);
|
|
2808
|
+
return "Custom field value edited successfully";
|
|
2809
|
+
} catch (error) {
|
|
2810
|
+
throw formatDiscogsError(error);
|
|
2811
|
+
}
|
|
2812
|
+
}
|
|
2813
|
+
};
|
|
2759
2814
|
var editUserCollectionFolderTool = {
|
|
2760
2815
|
name: "edit_user_collection_folder",
|
|
2761
2816
|
description: `Edit a folder's metadata. Folders 0 and 1 cannot be renamed.`,
|
|
@@ -2895,6 +2950,7 @@ function registerUserCollectionTools(server) {
|
|
|
2895
2950
|
server.addTool(moveReleaseInUserCollectionTool);
|
|
2896
2951
|
server.addTool(deleteReleaseFromUserCollectionFolderTool);
|
|
2897
2952
|
server.addTool(getUserCollectionCustomFieldsTool);
|
|
2953
|
+
server.addTool(editUserCollectionCustomFieldValueTool);
|
|
2898
2954
|
server.addTool(getUserCollectionValueTool);
|
|
2899
2955
|
}
|
|
2900
2956
|
var DiscogsUserIdentitySchema = z.object({
|
|
@@ -3257,13 +3313,15 @@ function registerTools(server) {
|
|
|
3257
3313
|
|
|
3258
3314
|
// src/index.ts
|
|
3259
3315
|
function assertTransportType(transportType) {
|
|
3260
|
-
return transportType === "stdio" || transportType === "
|
|
3316
|
+
return transportType === "stdio" || transportType === "stream";
|
|
3261
3317
|
}
|
|
3262
3318
|
try {
|
|
3263
3319
|
validateConfig();
|
|
3264
3320
|
const transportType = process.argv[2] ?? "stdio";
|
|
3265
3321
|
if (!assertTransportType(transportType)) {
|
|
3266
|
-
throw Error(
|
|
3322
|
+
throw Error(
|
|
3323
|
+
`Invalid transport type: "${transportType}". Allowed: 'stdio' (default) or 'stream'.`
|
|
3324
|
+
);
|
|
3267
3325
|
}
|
|
3268
3326
|
const server = new FastMCP({
|
|
3269
3327
|
name: config.server.name,
|
|
@@ -3272,11 +3330,10 @@ try {
|
|
|
3272
3330
|
registerTools(server);
|
|
3273
3331
|
if (transportType === "stdio") {
|
|
3274
3332
|
server.start({ transportType });
|
|
3275
|
-
} else if (transportType === "
|
|
3333
|
+
} else if (transportType === "stream") {
|
|
3276
3334
|
server.start({
|
|
3277
|
-
transportType,
|
|
3278
|
-
|
|
3279
|
-
endpoint: "/sse",
|
|
3335
|
+
transportType: "httpStream",
|
|
3336
|
+
httpStream: {
|
|
3280
3337
|
port: config.server.port
|
|
3281
3338
|
}
|
|
3282
3339
|
});
|