navidrome-mcp 1.0.1
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 +661 -0
- package/README.md +397 -0
- package/dist/capabilities.d.ts +20 -0
- package/dist/capabilities.d.ts.map +1 -0
- package/dist/capabilities.js +25 -0
- package/dist/capabilities.js.map +1 -0
- package/dist/client/auth-manager.d.ts +27 -0
- package/dist/client/auth-manager.d.ts.map +1 -0
- package/dist/client/auth-manager.js +54 -0
- package/dist/client/auth-manager.js.map +1 -0
- package/dist/client/navidrome-client.d.ts +28 -0
- package/dist/client/navidrome-client.d.ts.map +1 -0
- package/dist/client/navidrome-client.js +84 -0
- package/dist/client/navidrome-client.js.map +1 -0
- package/dist/config.d.ts +41 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +132 -0
- package/dist/config.js.map +1 -0
- package/dist/constants/defaults.d.ts +29 -0
- package/dist/constants/defaults.d.ts.map +1 -0
- package/dist/constants/defaults.js +37 -0
- package/dist/constants/defaults.js.map +1 -0
- package/dist/constants/timeouts.d.ts +66 -0
- package/dist/constants/timeouts.d.ts.map +1 -0
- package/dist/constants/timeouts.js +66 -0
- package/dist/constants/timeouts.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +70 -0
- package/dist/index.js.map +1 -0
- package/dist/resources/index.d.ts +21 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +83 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/schemas/common.d.ts +68 -0
- package/dist/schemas/common.d.ts.map +1 -0
- package/dist/schemas/common.js +69 -0
- package/dist/schemas/common.js.map +1 -0
- package/dist/schemas/index.d.ts +21 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +24 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/pagination.d.ts +153 -0
- package/dist/schemas/pagination.d.ts.map +1 -0
- package/dist/schemas/pagination.js +93 -0
- package/dist/schemas/pagination.js.map +1 -0
- package/dist/schemas/validation.d.ts +147 -0
- package/dist/schemas/validation.d.ts.map +1 -0
- package/dist/schemas/validation.js +143 -0
- package/dist/schemas/validation.js.map +1 -0
- package/dist/tools/handlers/lastfm-handlers.d.ts +5 -0
- package/dist/tools/handlers/lastfm-handlers.d.ts.map +1 -0
- package/dist/tools/handlers/lastfm-handlers.js +143 -0
- package/dist/tools/handlers/lastfm-handlers.js.map +1 -0
- package/dist/tools/handlers/lyrics-handlers.d.ts +5 -0
- package/dist/tools/handlers/lyrics-handlers.d.ts.map +1 -0
- package/dist/tools/handlers/lyrics-handlers.js +51 -0
- package/dist/tools/handlers/lyrics-handlers.js.map +1 -0
- package/dist/tools/handlers/playlist-handlers.d.ts +5 -0
- package/dist/tools/handlers/playlist-handlers.d.ts.map +1 -0
- package/dist/tools/handlers/playlist-handlers.js +316 -0
- package/dist/tools/handlers/playlist-handlers.js.map +1 -0
- package/dist/tools/handlers/queue-handlers.d.ts +5 -0
- package/dist/tools/handlers/queue-handlers.d.ts.map +1 -0
- package/dist/tools/handlers/queue-handlers.js +135 -0
- package/dist/tools/handlers/queue-handlers.js.map +1 -0
- package/dist/tools/handlers/radio-handlers.d.ts +5 -0
- package/dist/tools/handlers/radio-handlers.d.ts.map +1 -0
- package/dist/tools/handlers/radio-handlers.js +323 -0
- package/dist/tools/handlers/radio-handlers.js.map +1 -0
- package/dist/tools/handlers/registry.d.ts +26 -0
- package/dist/tools/handlers/registry.d.ts.map +1 -0
- package/dist/tools/handlers/registry.js +77 -0
- package/dist/tools/handlers/registry.js.map +1 -0
- package/dist/tools/handlers/search-handlers.d.ts +5 -0
- package/dist/tools/handlers/search-handlers.d.ts.map +1 -0
- package/dist/tools/handlers/search-handlers.js +125 -0
- package/dist/tools/handlers/search-handlers.js.map +1 -0
- package/dist/tools/handlers/tag-handlers.d.ts +5 -0
- package/dist/tools/handlers/tag-handlers.d.ts.map +1 -0
- package/dist/tools/handlers/tag-handlers.js +155 -0
- package/dist/tools/handlers/tag-handlers.js.map +1 -0
- package/dist/tools/handlers/user-preferences-handlers.d.ts +5 -0
- package/dist/tools/handlers/user-preferences-handlers.d.ts.map +1 -0
- package/dist/tools/handlers/user-preferences-handlers.js +155 -0
- package/dist/tools/handlers/user-preferences-handlers.js.map +1 -0
- package/dist/tools/index.d.ts +19 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +20 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/lastfm-discovery.d.ts +107 -0
- package/dist/tools/lastfm-discovery.d.ts.map +1 -0
- package/dist/tools/lastfm-discovery.js +238 -0
- package/dist/tools/lastfm-discovery.js.map +1 -0
- package/dist/tools/library.d.ts +31 -0
- package/dist/tools/library.d.ts.map +1 -0
- package/dist/tools/library.js +272 -0
- package/dist/tools/library.js.map +1 -0
- package/dist/tools/listening-history.d.ts +51 -0
- package/dist/tools/listening-history.d.ts.map +1 -0
- package/dist/tools/listening-history.js +126 -0
- package/dist/tools/listening-history.js.map +1 -0
- package/dist/tools/lyrics.d.ts +35 -0
- package/dist/tools/lyrics.d.ts.map +1 -0
- package/dist/tools/lyrics.js +222 -0
- package/dist/tools/lyrics.js.map +1 -0
- package/dist/tools/media-library.d.ts +46 -0
- package/dist/tools/media-library.d.ts.map +1 -0
- package/dist/tools/media-library.js +179 -0
- package/dist/tools/media-library.js.map +1 -0
- package/dist/tools/playlist-management.d.ts +80 -0
- package/dist/tools/playlist-management.d.ts.map +1 -0
- package/dist/tools/playlist-management.js +384 -0
- package/dist/tools/playlist-management.js.map +1 -0
- package/dist/tools/queue-management.d.ts +48 -0
- package/dist/tools/queue-management.d.ts.map +1 -0
- package/dist/tools/queue-management.js +83 -0
- package/dist/tools/queue-management.js.map +1 -0
- package/dist/tools/radio-discovery.d.ts +95 -0
- package/dist/tools/radio-discovery.d.ts.map +1 -0
- package/dist/tools/radio-discovery.js +352 -0
- package/dist/tools/radio-discovery.js.map +1 -0
- package/dist/tools/radio-validation.d.ts +49 -0
- package/dist/tools/radio-validation.d.ts.map +1 -0
- package/dist/tools/radio-validation.js +463 -0
- package/dist/tools/radio-validation.js.map +1 -0
- package/dist/tools/radio.d.ts +38 -0
- package/dist/tools/radio.d.ts.map +1 -0
- package/dist/tools/radio.js +315 -0
- package/dist/tools/radio.js.map +1 -0
- package/dist/tools/search.d.ts +54 -0
- package/dist/tools/search.d.ts.map +1 -0
- package/dist/tools/search.js +165 -0
- package/dist/tools/search.js.map +1 -0
- package/dist/tools/tags.d.ts +63 -0
- package/dist/tools/tags.d.ts.map +1 -0
- package/dist/tools/tags.js +260 -0
- package/dist/tools/tags.js.map +1 -0
- package/dist/tools/test.d.ts +50 -0
- package/dist/tools/test.d.ts.map +1 -0
- package/dist/tools/test.js +121 -0
- package/dist/tools/test.js.map +1 -0
- package/dist/tools/user-preferences.d.ts +73 -0
- package/dist/tools/user-preferences.d.ts.map +1 -0
- package/dist/tools/user-preferences.js +231 -0
- package/dist/tools/user-preferences.js.map +1 -0
- package/dist/transformers/song-transformer.d.ts +122 -0
- package/dist/transformers/song-transformer.d.ts.map +1 -0
- package/dist/transformers/song-transformer.js +232 -0
- package/dist/transformers/song-transformer.js.map +1 -0
- package/dist/types/core.d.ts +147 -0
- package/dist/types/core.d.ts.map +1 -0
- package/dist/types/core.js +19 -0
- package/dist/types/core.js.map +1 -0
- package/dist/types/index.d.ts +23 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +19 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/lyrics.d.ts +58 -0
- package/dist/types/lyrics.d.ts.map +1 -0
- package/dist/types/lyrics.js +19 -0
- package/dist/types/lyrics.js.map +1 -0
- package/dist/types/playlists.d.ts +150 -0
- package/dist/types/playlists.d.ts.map +1 -0
- package/dist/types/playlists.js +19 -0
- package/dist/types/playlists.js.map +1 -0
- package/dist/types/radio.d.ts +192 -0
- package/dist/types/radio.d.ts.map +1 -0
- package/dist/types/radio.js +19 -0
- package/dist/types/radio.js.map +1 -0
- package/dist/types/tags.d.ts +72 -0
- package/dist/types/tags.d.ts.map +1 -0
- package/dist/types/tags.js +19 -0
- package/dist/types/tags.js.map +1 -0
- package/dist/utils/cache.d.ts +32 -0
- package/dist/utils/cache.d.ts.map +1 -0
- package/dist/utils/cache.js +84 -0
- package/dist/utils/cache.js.map +1 -0
- package/dist/utils/error-formatter.d.ts +108 -0
- package/dist/utils/error-formatter.d.ts.map +1 -0
- package/dist/utils/error-formatter.js +161 -0
- package/dist/utils/error-formatter.js.map +1 -0
- package/dist/utils/logger.d.ts +33 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +52 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/message-manager.d.ts +74 -0
- package/dist/utils/message-manager.d.ts.map +1 -0
- package/dist/utils/message-manager.js +134 -0
- package/dist/utils/message-manager.js.map +1 -0
- package/dist/utils/version.d.ts +5 -0
- package/dist/utils/version.d.ts.map +1 -0
- package/dist/utils/version.js +19 -0
- package/dist/utils/version.js.map +1 -0
- package/package.json +78 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Navidrome MCP Server - Error Formatting Utility
|
|
3
|
+
* Copyright (C) 2025
|
|
4
|
+
*
|
|
5
|
+
* This program is free software: you can redistribute it and/or modify
|
|
6
|
+
* it under the terms of the GNU Affero General Public License as published
|
|
7
|
+
* by the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
* (at your option) any later version.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Standardized error message formatting utilities
|
|
20
|
+
* Provides consistent error messages across the MCP application
|
|
21
|
+
*/
|
|
22
|
+
export class ErrorFormatter {
|
|
23
|
+
/**
|
|
24
|
+
* Extract message from unknown error type
|
|
25
|
+
*/
|
|
26
|
+
static extractMessage(error) {
|
|
27
|
+
return error instanceof Error ? error.message : 'Unknown error';
|
|
28
|
+
}
|
|
29
|
+
// === HTTP/API ERRORS ===
|
|
30
|
+
/**
|
|
31
|
+
* Format HTTP request failures (network issues, 404, 500, etc.)
|
|
32
|
+
*/
|
|
33
|
+
static httpRequest(operation, response, errorText) {
|
|
34
|
+
const base = `API request failed: ${operation} - ${response.status} ${response.statusText}`;
|
|
35
|
+
return errorText ? `${base} - ${errorText}` : base;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Format Subsonic API specific errors
|
|
39
|
+
*/
|
|
40
|
+
static subsonicApi(response) {
|
|
41
|
+
return `Subsonic API request failed: ${response.status} ${response.statusText}`;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Format Subsonic API response errors (when subsonic-response.status !== 'ok')
|
|
45
|
+
*/
|
|
46
|
+
static subsonicResponse(errorMessage) {
|
|
47
|
+
return `Subsonic API error: ${errorMessage || 'Unknown error'}`;
|
|
48
|
+
}
|
|
49
|
+
// === MCP TOOL ERRORS ===
|
|
50
|
+
/**
|
|
51
|
+
* Format MCP tool execution failures
|
|
52
|
+
*/
|
|
53
|
+
static toolExecution(toolName, error) {
|
|
54
|
+
const message = this.extractMessage(error);
|
|
55
|
+
return `Tool '${toolName}' failed: ${message}`;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Format tool parameter validation errors
|
|
59
|
+
*/
|
|
60
|
+
static toolValidation(toolName, field, issue) {
|
|
61
|
+
return `Tool '${toolName}' validation error: ${field} ${issue}`;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Format tool resource not found errors
|
|
65
|
+
*/
|
|
66
|
+
static toolNotFound(resourceType, identifier) {
|
|
67
|
+
const base = `${resourceType} not found`;
|
|
68
|
+
return identifier ? `${base}: ${identifier}` : base;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Format unknown tool errors
|
|
72
|
+
*/
|
|
73
|
+
static toolUnknown(toolName) {
|
|
74
|
+
return `Unknown tool: ${toolName}`;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Format not found errors
|
|
78
|
+
*/
|
|
79
|
+
static notFound(resourceType, identifier) {
|
|
80
|
+
return `${resourceType} not found: ${identifier}`;
|
|
81
|
+
}
|
|
82
|
+
// === AUTHENTICATION & AUTHORIZATION ===
|
|
83
|
+
/**
|
|
84
|
+
* Format authentication failures
|
|
85
|
+
*/
|
|
86
|
+
static authentication(details) {
|
|
87
|
+
const base = 'Authentication failed';
|
|
88
|
+
return details ? `${base}: ${details}` : base;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Format authorization failures
|
|
92
|
+
*/
|
|
93
|
+
static authorization(operation) {
|
|
94
|
+
return `Authorization failed: insufficient permissions for ${operation}`;
|
|
95
|
+
}
|
|
96
|
+
// === EXTERNAL SERVICE ERRORS ===
|
|
97
|
+
/**
|
|
98
|
+
* Format Last.fm API errors
|
|
99
|
+
*/
|
|
100
|
+
static lastfmApi(response) {
|
|
101
|
+
return `Last.fm API error: ${response.status} ${response.statusText}`;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Format Last.fm API response errors
|
|
105
|
+
*/
|
|
106
|
+
static lastfmResponse(message) {
|
|
107
|
+
return `Last.fm API error: ${message || 'Unknown error'}`;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Format Radio Browser API errors
|
|
111
|
+
*/
|
|
112
|
+
static radioBrowserApi(response) {
|
|
113
|
+
return `Radio Browser API error: ${response.status} ${response.statusText}`;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Format generic API request errors
|
|
117
|
+
*/
|
|
118
|
+
static apiRequest(apiName, response) {
|
|
119
|
+
return `${apiName} request failed: ${response.status} ${response.statusText}`;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Format generic API response errors
|
|
123
|
+
*/
|
|
124
|
+
static apiResponse(apiName, message) {
|
|
125
|
+
return `${apiName} error: ${message || 'Unknown error'}`;
|
|
126
|
+
}
|
|
127
|
+
// === CONFIGURATION ERRORS ===
|
|
128
|
+
/**
|
|
129
|
+
* Format configuration validation failures
|
|
130
|
+
*/
|
|
131
|
+
static configValidation(messages) {
|
|
132
|
+
return `Configuration validation failed:\n${messages.join('\n')}`;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Format missing configuration errors
|
|
136
|
+
*/
|
|
137
|
+
static configMissing(service, configKey) {
|
|
138
|
+
return `${service} not configured: missing ${configKey}`;
|
|
139
|
+
}
|
|
140
|
+
// === GENERIC OPERATION ERRORS ===
|
|
141
|
+
/**
|
|
142
|
+
* Format general operation failures with context
|
|
143
|
+
*/
|
|
144
|
+
static operationFailed(operation, error) {
|
|
145
|
+
const message = this.extractMessage(error);
|
|
146
|
+
return `Operation failed: ${operation} - ${message}`;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Format unknown resource errors (for MCP resources)
|
|
150
|
+
*/
|
|
151
|
+
static unknownResource(resourceUri) {
|
|
152
|
+
return `Unknown resource: ${resourceUri}`;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Format validation stream/URL errors
|
|
156
|
+
*/
|
|
157
|
+
static streamValidation(url, issue) {
|
|
158
|
+
return `Stream validation failed: ${url} - ${issue}`;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingURL=error-formatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-formatter.js","sourceRoot":"","sources":["../../src/utils/error-formatter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;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EAAE,OAAgB;QAClD,OAAO,GAAG,OAAO,WAAW,OAAO,IAAI,eAAe,EAAE,CAAC;IAC3D,CAAC;IAED,+BAA+B;IAE/B;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,QAAkB;QACxC,OAAO,qCAAqC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;IACpE,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,aAAa,CAAC,OAAe,EAAE,SAAiB;QACrD,OAAO,GAAG,OAAO,4BAA4B,SAAS,EAAE,CAAC;IAC3D,CAAC;IAED,mCAAmC;IAEnC;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,SAAiB,EAAE,KAAc;QACtD,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAC3C,OAAO,qBAAqB,SAAS,MAAM,OAAO,EAAE,CAAC;IACvD,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,WAAmB;QACxC,OAAO,qBAAqB,WAAW,EAAE,CAAC;IAC5C,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,GAAW,EAAE,KAAa;QAChD,OAAO,6BAA6B,GAAG,MAAM,KAAK,EAAE,CAAC;IACvD,CAAC;CACF"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Navidrome MCP Server - Logger Utility
|
|
3
|
+
* Copyright (C) 2025
|
|
4
|
+
*
|
|
5
|
+
* This program is free software: you can redistribute it and/or modify
|
|
6
|
+
* it under the terms of the GNU Affero General Public License as published
|
|
7
|
+
* by the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
* (at your option) any later version.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
declare class Logger {
|
|
19
|
+
private debugMode;
|
|
20
|
+
setDebug(enabled: boolean): void;
|
|
21
|
+
/**
|
|
22
|
+
* Sanitize URLs and other sensitive data from log messages
|
|
23
|
+
* Removes credentials from URLs to prevent accidental exposure
|
|
24
|
+
*/
|
|
25
|
+
private sanitizeArgs;
|
|
26
|
+
debug(...args: unknown[]): void;
|
|
27
|
+
info(...args: unknown[]): void;
|
|
28
|
+
warn(...args: unknown[]): void;
|
|
29
|
+
error(...args: unknown[]): void;
|
|
30
|
+
}
|
|
31
|
+
export declare const logger: Logger;
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,cAAM,MAAM;IACV,OAAO,CAAC,SAAS,CAAS;IAE1B,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAIhC;;;OAGG;IACH,OAAO,CAAC,YAAY;IAgBpB,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAM/B,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAI9B,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAI9B,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;CAGhC;AAED,eAAO,MAAM,MAAM,QAAe,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Navidrome MCP Server - Logger Utility
|
|
3
|
+
* Copyright (C) 2025
|
|
4
|
+
*
|
|
5
|
+
* This program is free software: you can redistribute it and/or modify
|
|
6
|
+
* it under the terms of the GNU Affero General Public License as published
|
|
7
|
+
* by the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
* (at your option) any later version.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
class Logger {
|
|
19
|
+
debugMode = false;
|
|
20
|
+
setDebug(enabled) {
|
|
21
|
+
this.debugMode = enabled;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Sanitize URLs and other sensitive data from log messages
|
|
25
|
+
* Removes credentials from URLs to prevent accidental exposure
|
|
26
|
+
*/
|
|
27
|
+
sanitizeArgs(args) {
|
|
28
|
+
return args.map(arg => {
|
|
29
|
+
if (typeof arg === 'string' && arg.includes('://')) {
|
|
30
|
+
// Check if string contains URL with potential credentials
|
|
31
|
+
return arg.replace(/(https?:\/\/)[^:/\s]*:[^@/\s]*@/g, '$1[CREDENTIALS_REDACTED]@').replace(/([?&])[up]=[^&\s]*/g, '$1[CREDENTIAL_REDACTED]');
|
|
32
|
+
}
|
|
33
|
+
return arg;
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
debug(...args) {
|
|
37
|
+
if (this.debugMode) {
|
|
38
|
+
console.error('[DEBUG]', ...this.sanitizeArgs(args));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
info(...args) {
|
|
42
|
+
console.error('[INFO]', ...this.sanitizeArgs(args));
|
|
43
|
+
}
|
|
44
|
+
warn(...args) {
|
|
45
|
+
console.error('[WARN]', ...this.sanitizeArgs(args));
|
|
46
|
+
}
|
|
47
|
+
error(...args) {
|
|
48
|
+
console.error('[ERROR]', ...this.sanitizeArgs(args));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
export const logger = new Logger();
|
|
52
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,MAAM;IACF,SAAS,GAAG,KAAK,CAAC;IAE1B,QAAQ,CAAC,OAAgB;QACvB,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC;IAC3B,CAAC;IAED;;;OAGG;IACK,YAAY,CAAC,IAAe;QAClC,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;YACpB,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;gBACnD,0DAA0D;gBAC1D,OAAO,GAAG,CAAC,OAAO,CAChB,kCAAkC,EAClC,2BAA2B,CAC5B,CAAC,OAAO,CACP,qBAAqB,EACrB,yBAAyB,CAC1B,CAAC;YACJ,CAAC;YACD,OAAO,GAAG,CAAC;QACb,CAAC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,GAAG,IAAe;QACtB,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,OAAO,CAAC,KAAK,CAAC,SAAS,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;QACvD,CAAC;IACH,CAAC;IAED,IAAI,CAAC,GAAG,IAAe;QACrB,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;IACtD,CAAC;IAED,IAAI,CAAC,GAAG,IAAe;QACrB,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,GAAG,IAAe;QACtB,OAAO,CAAC,KAAK,CAAC,SAAS,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;IACvD,CAAC;CACF;AAED,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Navidrome MCP Server - One-Time Message Manager
|
|
3
|
+
* Copyright (C) 2025
|
|
4
|
+
*
|
|
5
|
+
* This program is free software: you can redistribute it and/or modify
|
|
6
|
+
* it under the terms of the GNU Affero General Public License as published
|
|
7
|
+
* by the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
* (at your option) any later version.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Manages one-time messages for LLM assistants
|
|
20
|
+
* Ensures tips, reminders, and helpful messages are shown only once per session
|
|
21
|
+
*/
|
|
22
|
+
export declare class MessageManager {
|
|
23
|
+
private static instance;
|
|
24
|
+
private shownMessages;
|
|
25
|
+
private messageTemplates;
|
|
26
|
+
private constructor();
|
|
27
|
+
/**
|
|
28
|
+
* Get the singleton instance of MessageManager
|
|
29
|
+
*/
|
|
30
|
+
static getInstance(): MessageManager;
|
|
31
|
+
/**
|
|
32
|
+
* Initialize predefined message templates
|
|
33
|
+
*/
|
|
34
|
+
private initializeMessages;
|
|
35
|
+
/**
|
|
36
|
+
* Get a message if it hasn't been shown yet
|
|
37
|
+
* @param messageKey The unique key for the message
|
|
38
|
+
* @param customMessage Optional custom message to use instead of template
|
|
39
|
+
* @returns The message if not shown before, null otherwise
|
|
40
|
+
*/
|
|
41
|
+
getMessage(messageKey: string, customMessage?: string): string | null;
|
|
42
|
+
/**
|
|
43
|
+
* Check if a message has been shown
|
|
44
|
+
* @param messageKey The unique key for the message
|
|
45
|
+
*/
|
|
46
|
+
hasShownMessage(messageKey: string): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Manually mark a message as shown without returning it
|
|
49
|
+
* @param messageKey The unique key for the message
|
|
50
|
+
*/
|
|
51
|
+
markAsShown(messageKey: string): void;
|
|
52
|
+
/**
|
|
53
|
+
* Reset all shown messages (useful for testing)
|
|
54
|
+
*/
|
|
55
|
+
reset(): void;
|
|
56
|
+
/**
|
|
57
|
+
* Get all available message keys (for debugging)
|
|
58
|
+
*/
|
|
59
|
+
getAvailableMessageKeys(): string[];
|
|
60
|
+
/**
|
|
61
|
+
* Add a new message template at runtime
|
|
62
|
+
* @param key The unique key for the message
|
|
63
|
+
* @param message The message content
|
|
64
|
+
*/
|
|
65
|
+
addMessageTemplate(key: string, message: string): void;
|
|
66
|
+
/**
|
|
67
|
+
* Format a message with dynamic values
|
|
68
|
+
* @param messageKey The message key
|
|
69
|
+
* @param values Object with key-value pairs to replace in message
|
|
70
|
+
*/
|
|
71
|
+
getFormattedMessage(messageKey: string, values: Record<string, string | number>, customMessage?: string): string | null;
|
|
72
|
+
}
|
|
73
|
+
export declare function getMessageManager(): MessageManager;
|
|
74
|
+
//# sourceMappingURL=message-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-manager.d.ts","sourceRoot":"","sources":["../../src/utils/message-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;;;GAGG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAA+B;IACtD,OAAO,CAAC,aAAa,CAAc;IACnC,OAAO,CAAC,gBAAgB,CAAsB;IAE9C,OAAO;IAMP;;OAEG;WACW,WAAW,IAAI,cAAc;IAO3C;;OAEG;IACH,OAAO,CAAC,kBAAkB;IA2B1B;;;;;OAKG;IACI,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAiB5E;;;OAGG;IACI,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;IAInD;;;OAGG;IACI,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAI5C;;OAEG;IACI,KAAK,IAAI,IAAI;IAIpB;;OAEG;IACI,uBAAuB,IAAI,MAAM,EAAE;IAI1C;;;;OAIG;IACI,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAI7D;;;;OAIG;IACI,mBAAmB,CACxB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,EACvC,aAAa,CAAC,EAAE,MAAM,GACrB,MAAM,GAAG,IAAI;CAUjB;AAGD,wBAAgB,iBAAiB,IAAI,cAAc,CAElD"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Navidrome MCP Server - One-Time Message Manager
|
|
3
|
+
* Copyright (C) 2025
|
|
4
|
+
*
|
|
5
|
+
* This program is free software: you can redistribute it and/or modify
|
|
6
|
+
* it under the terms of the GNU Affero General Public License as published
|
|
7
|
+
* by the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
* (at your option) any later version.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Manages one-time messages for LLM assistants
|
|
20
|
+
* Ensures tips, reminders, and helpful messages are shown only once per session
|
|
21
|
+
*/
|
|
22
|
+
export class MessageManager {
|
|
23
|
+
static instance = null;
|
|
24
|
+
shownMessages;
|
|
25
|
+
messageTemplates;
|
|
26
|
+
constructor() {
|
|
27
|
+
this.shownMessages = new Set();
|
|
28
|
+
this.messageTemplates = new Map();
|
|
29
|
+
this.initializeMessages();
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Get the singleton instance of MessageManager
|
|
33
|
+
*/
|
|
34
|
+
static getInstance() {
|
|
35
|
+
if (!MessageManager.instance) {
|
|
36
|
+
MessageManager.instance = new MessageManager();
|
|
37
|
+
}
|
|
38
|
+
return MessageManager.instance;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Initialize predefined message templates
|
|
42
|
+
*/
|
|
43
|
+
initializeMessages() {
|
|
44
|
+
// Radio validation reminder
|
|
45
|
+
this.messageTemplates.set('radio.validation_reminder', `
|
|
46
|
+
🎵 STREAM VALIDATION RECOMMENDED
|
|
47
|
+
Use 'validate_radio_stream' tool first to test your URL
|
|
48
|
+
Many internet radio URLs change frequently
|
|
49
|
+
Validation checks: accessibility, audio format, streaming headers
|
|
50
|
+
|
|
51
|
+
💡 TIP: Find reliable streams at radio-browser.info or somafm.com`);
|
|
52
|
+
// Radio list tip
|
|
53
|
+
this.messageTemplates.set('radio.list_tip', "💡 TIP: Use 'validate_radio_stream' to test station URLs if playback issues occur");
|
|
54
|
+
// Radio creation success
|
|
55
|
+
this.messageTemplates.set('radio.creation_success', "✅ Station created successfully! Remember to validate streams periodically as URLs may change.");
|
|
56
|
+
// General validation advice
|
|
57
|
+
this.messageTemplates.set('radio.validation_advice', "🔍 Pro tip: Radio streams can go offline. Validate regularly for best experience.");
|
|
58
|
+
// Add more message templates as needed
|
|
59
|
+
this.messageTemplates.set('general.welcome', "🎶 Welcome to Navidrome MCP! Type 'test_connection' to verify your setup.");
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Get a message if it hasn't been shown yet
|
|
63
|
+
* @param messageKey The unique key for the message
|
|
64
|
+
* @param customMessage Optional custom message to use instead of template
|
|
65
|
+
* @returns The message if not shown before, null otherwise
|
|
66
|
+
*/
|
|
67
|
+
getMessage(messageKey, customMessage) {
|
|
68
|
+
// Check if message was already shown
|
|
69
|
+
if (this.shownMessages.has(messageKey)) {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
// Mark as shown
|
|
73
|
+
this.shownMessages.add(messageKey);
|
|
74
|
+
// Return custom message or template
|
|
75
|
+
if (customMessage) {
|
|
76
|
+
return customMessage;
|
|
77
|
+
}
|
|
78
|
+
return this.messageTemplates.get(messageKey) || null;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Check if a message has been shown
|
|
82
|
+
* @param messageKey The unique key for the message
|
|
83
|
+
*/
|
|
84
|
+
hasShownMessage(messageKey) {
|
|
85
|
+
return this.shownMessages.has(messageKey);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Manually mark a message as shown without returning it
|
|
89
|
+
* @param messageKey The unique key for the message
|
|
90
|
+
*/
|
|
91
|
+
markAsShown(messageKey) {
|
|
92
|
+
this.shownMessages.add(messageKey);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Reset all shown messages (useful for testing)
|
|
96
|
+
*/
|
|
97
|
+
reset() {
|
|
98
|
+
this.shownMessages.clear();
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Get all available message keys (for debugging)
|
|
102
|
+
*/
|
|
103
|
+
getAvailableMessageKeys() {
|
|
104
|
+
return Array.from(this.messageTemplates.keys());
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Add a new message template at runtime
|
|
108
|
+
* @param key The unique key for the message
|
|
109
|
+
* @param message The message content
|
|
110
|
+
*/
|
|
111
|
+
addMessageTemplate(key, message) {
|
|
112
|
+
this.messageTemplates.set(key, message);
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Format a message with dynamic values
|
|
116
|
+
* @param messageKey The message key
|
|
117
|
+
* @param values Object with key-value pairs to replace in message
|
|
118
|
+
*/
|
|
119
|
+
getFormattedMessage(messageKey, values, customMessage) {
|
|
120
|
+
const message = this.getMessage(messageKey, customMessage);
|
|
121
|
+
if (!message)
|
|
122
|
+
return null;
|
|
123
|
+
let formatted = message;
|
|
124
|
+
for (const [key, value] of Object.entries(values)) {
|
|
125
|
+
formatted = formatted.replace(new RegExp(`{{${key}}}`, 'g'), String(value));
|
|
126
|
+
}
|
|
127
|
+
return formatted;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
// Export singleton getter for convenience
|
|
131
|
+
export function getMessageManager() {
|
|
132
|
+
return MessageManager.getInstance();
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=message-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-manager.js","sourceRoot":"","sources":["../../src/utils/message-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;;;GAGG;AACH,MAAM,OAAO,cAAc;IACjB,MAAM,CAAC,QAAQ,GAA0B,IAAI,CAAC;IAC9C,aAAa,CAAc;IAC3B,gBAAgB,CAAsB;IAE9C;QACE,IAAI,CAAC,aAAa,GAAG,IAAI,GAAG,EAAE,CAAC;QAC/B,IAAI,CAAC,gBAAgB,GAAG,IAAI,GAAG,EAAE,CAAC;QAClC,IAAI,CAAC,kBAAkB,EAAE,CAAC;IAC5B,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,WAAW;QACvB,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC;YAC7B,cAAc,CAAC,QAAQ,GAAG,IAAI,cAAc,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,CAAC;IAED;;OAEG;IACI,KAAK;QACV,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;IAC7B,CAAC;IAED;;OAEG;IACI,uBAAuB;QAC5B,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC,CAAC;IAClD,CAAC;IAED;;;;OAIG;IACI,kBAAkB,CAAC,GAAW,EAAE,OAAe;QACpD,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAC1C,CAAC;IAED;;;;OAIG;IACI,mBAAmB,CACxB,UAAkB,EAClB,MAAuC,EACvC,aAAsB;QAEtB,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;QAC3D,IAAI,CAAC,OAAO;YAAE,OAAO,IAAI,CAAC;QAE1B,IAAI,SAAS,GAAG,OAAO,CAAC;QACxB,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YAClD,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,KAAK,GAAG,IAAI,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC9E,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;;AAGH,0CAA0C;AAC1C,MAAM,UAAU,iBAAiB;IAC/B,OAAO,cAAc,CAAC,WAAW,EAAE,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/utils/version.ts"],"names":[],"mappings":"AAAA;;GAEG;AAQH,wBAAgB,iBAAiB,IAAI,MAAM,CAS1C"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Version utility to read version from package.json
|
|
3
|
+
*/
|
|
4
|
+
import { readFileSync } from 'fs';
|
|
5
|
+
import { join, dirname } from 'path';
|
|
6
|
+
import { fileURLToPath } from 'url';
|
|
7
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
export function getPackageVersion() {
|
|
9
|
+
try {
|
|
10
|
+
const packageJsonPath = join(__dirname, '../../package.json');
|
|
11
|
+
const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'));
|
|
12
|
+
return packageJson.version;
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
// Fallback version if package.json can't be read
|
|
16
|
+
return '1.0.1';
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/utils/version.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE1D,MAAM,UAAU,iBAAiB;IAC/B,IAAI,CAAC;QACH,MAAM,eAAe,GAAG,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;QAC9D,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,CAAC;QACtE,OAAO,WAAW,CAAC,OAAO,CAAC;IAC7B,CAAC;IAAC,MAAM,CAAC;QACP,iDAAiD;QACjD,OAAO,OAAO,CAAC;IACjB,CAAC;AACH,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "navidrome-mcp",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "MCP server for interacting with Navidrome music server",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"mcp",
|
|
9
|
+
"navidrome",
|
|
10
|
+
"music",
|
|
11
|
+
"subsonic",
|
|
12
|
+
"api",
|
|
13
|
+
"server"
|
|
14
|
+
],
|
|
15
|
+
"author": "",
|
|
16
|
+
"license": "AGPL-3.0",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/Blakeem/Navidrome-MCP.git"
|
|
20
|
+
},
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/Blakeem/Navidrome-MCP/issues"
|
|
23
|
+
},
|
|
24
|
+
"homepage": "https://github.com/Blakeem/Navidrome-MCP#readme",
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist",
|
|
30
|
+
"README.md",
|
|
31
|
+
"LICENSE",
|
|
32
|
+
"package.json"
|
|
33
|
+
],
|
|
34
|
+
"bin": {
|
|
35
|
+
"navidrome-mcp": "./dist/index.js"
|
|
36
|
+
},
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=18.0.0"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@modelcontextprotocol/sdk": "^1.17.4",
|
|
42
|
+
"dotenv": "^16.4.7",
|
|
43
|
+
"file-type": "^19.5.0",
|
|
44
|
+
"zod": "^4.1.4"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@eslint/js": "^9.34.0",
|
|
48
|
+
"@types/node": "^24.3.0",
|
|
49
|
+
"@typescript-eslint/eslint-plugin": "^8.41.0",
|
|
50
|
+
"@typescript-eslint/parser": "^8.41.0",
|
|
51
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
52
|
+
"@vitest/ui": "^3.2.4",
|
|
53
|
+
"eslint": "^9.34.0",
|
|
54
|
+
"eslint-config-prettier": "^9.1.0",
|
|
55
|
+
"nodemon": "^3.1.10",
|
|
56
|
+
"prettier": "^3.6.2",
|
|
57
|
+
"tsx": "^4.20.5",
|
|
58
|
+
"typescript": "^5.9.2",
|
|
59
|
+
"vitest": "^3.2.4"
|
|
60
|
+
},
|
|
61
|
+
"scripts": {
|
|
62
|
+
"dev": "tsx watch src/index.ts",
|
|
63
|
+
"build": "tsc",
|
|
64
|
+
"start": "node dist/index.js",
|
|
65
|
+
"test": "vitest",
|
|
66
|
+
"test:run": "vitest run",
|
|
67
|
+
"test:ci": "SKIP_INTEGRATION_TESTS=true MOCK_ONLY_TESTS=true NAVIDROME_URL=http://ci-dummy:4533 NAVIDROME_USERNAME=ci-user NAVIDROME_PASSWORD=ci-pass vitest run",
|
|
68
|
+
"test:ui": "vitest --ui",
|
|
69
|
+
"test:coverage": "vitest run --coverage",
|
|
70
|
+
"lint": "eslint src --ext .ts",
|
|
71
|
+
"lint:fix": "eslint src --ext .ts --fix",
|
|
72
|
+
"format": "prettier --write \"src/**/*.ts\"",
|
|
73
|
+
"format:check": "prettier --check \"src/**/*.ts\"",
|
|
74
|
+
"typecheck": "tsc --noEmit",
|
|
75
|
+
"inspector": "npx @modelcontextprotocol/inspector node dist/index.js",
|
|
76
|
+
"inspector:dev": "npx @modelcontextprotocol/inspector tsx src/index.ts"
|
|
77
|
+
}
|
|
78
|
+
}
|