mr-magic-mcp-server 0.1.5
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/.env.example +26 -0
- package/LICENSE +21 -0
- package/README.md +1118 -0
- package/package.json +75 -0
- package/prompts/airtable-song-importer.md +239 -0
- package/src/bin/cli.js +9 -0
- package/src/bin/http-server.js +7 -0
- package/src/bin/mcp-http-server.js +7 -0
- package/src/bin/mcp-server.js +6 -0
- package/src/core/export.js +83 -0
- package/src/core/find-service.js +66 -0
- package/src/core/formatting.js +39 -0
- package/src/core/preview.js +54 -0
- package/src/index.js +138 -0
- package/src/provider-result-schema.js +63 -0
- package/src/providers/genius.js +250 -0
- package/src/providers/lrclib.js +73 -0
- package/src/providers/melon.js +201 -0
- package/src/providers/musixmatch.js +165 -0
- package/src/services/airtable-writer.js +246 -0
- package/src/services/lyrics-service.js +372 -0
- package/src/tools/cli.js +695 -0
- package/src/transport/http-server.js +151 -0
- package/src/transport/mcp-http-server.js +202 -0
- package/src/transport/mcp-response.js +44 -0
- package/src/transport/mcp-server.js +77 -0
- package/src/transport/mcp-tools.js +513 -0
- package/src/transport/token-startup-log.js +133 -0
- package/src/transport/tool-args.js +113 -0
- package/src/utils/config.js +57 -0
- package/src/utils/export-storage/inline-storage.js +7 -0
- package/src/utils/export-storage/local-storage.js +39 -0
- package/src/utils/export-storage/redis-storage.js +36 -0
- package/src/utils/export-storage/shared-redis-client.js +69 -0
- package/src/utils/export-storage.js +29 -0
- package/src/utils/logger.js +74 -0
- package/src/utils/lyrics-format.js +170 -0
- package/src/utils/slugify.js +18 -0
- package/src/utils/storage-cache.js +29 -0
- package/src/utils/tokens/genius-token-manager.js +119 -0
- package/src/utils/tokens/musixmatch-token-manager.js +130 -0
package/.env.example
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
PORT= # Override all server ports, or leave blank to default to 3444 for MCP, 3333 the JSON HTTP automation server.
|
|
2
|
+
LOG_LEVEL= # Optional. error|warn|info|debug. Defaults to info.
|
|
3
|
+
MR_MAGIC_ROOT= # Optional. Force the project root used for resolving .env/.cache paths.
|
|
4
|
+
MR_MAGIC_ENV_PATH= # Optional. Custom path to an env file when the default isn't desired.
|
|
5
|
+
GENIUS_CLIENT_ID= # Get from https://genius.com/api-clients, required for Genius lyrics support.
|
|
6
|
+
GENIUS_CLIENT_SECRET= # Get from https://genius.com/api-clients, required for Genius lyrics support.
|
|
7
|
+
GENIUS_ACCESS_TOKEN= # Get from https://genius.com/api-clients, required for Genius lyrics support.
|
|
8
|
+
MUSIXMATCH_AUTO_FETCH=0 # Optional. When 1, provider will attempt to rerun the fetch script automatically (headless) if no token is available.
|
|
9
|
+
MUSIXMATCH_TOKEN= # Get from https://developer.musixmatch.com or see README for fetching from Public API. WARNING: Unauthorized Public API usage can result in a ban of your account!
|
|
10
|
+
MUSIXMATCH_USER_TOKEN= # Optional. Musixmatch user token captured via the fetch script (stored in the token cache). Surfaced by runtime_status diagnostics.
|
|
11
|
+
MUSIXMATCH_TOKEN_CACHE=.cache/musixmatch-token.json
|
|
12
|
+
MELON_COOKIE= # Optional. Pin a browser session cookie for consistent Melon results; anonymous access generally works without it.
|
|
13
|
+
MR_MAGIC_EXPORT_BACKEND= # local|inline|redis
|
|
14
|
+
MR_MAGIC_EXPORT_DIR=/absolute/path/to/exports # Required if MR_MAGIC_EXPORT_BACKEND=local
|
|
15
|
+
MR_MAGIC_EXPORT_TTL_SECONDS=3600 # Optional, default 3600 (1 hour). Only applies to local and redis backends, ignored for inline.
|
|
16
|
+
MR_MAGIC_DOWNLOAD_BASE_URL=https://yourserver.com|http://localhost:GIVEN_PORT # Used for generating download links for exported files. See README for details.
|
|
17
|
+
MR_MAGIC_INLINE_PAYLOAD_MAX_CHARS=1500 # Optional, default 1500. build_catalog_payload auto-promotes payload transport to reference when omitInlineLyrics is true and lyrics exceed this threshold.
|
|
18
|
+
MR_MAGIC_QUIET_STDIO=0 # Optional, default 0. If set to 1, suppresses all non-error logs to stdout. Recommended when running under MCP clients that read stdio (forces LOG_LEVEL=error).
|
|
19
|
+
MR_MAGIC_HTTP_TIMEOUT_MS=10000 # Optional, default 10000. Global outbound HTTP timeout (ms) to prevent hanging provider/storage requests.
|
|
20
|
+
MR_MAGIC_LOG_TOOL_ARGS_CHUNKS=0 # Optional, default 0. Set to 1/true to emit chunk-by-chunk MCP tool argument previews for truncation debugging.
|
|
21
|
+
MR_MAGIC_TOOL_ARG_CHUNK_SIZE=400 # Optional, default 400. Chunk size used when MR_MAGIC_LOG_TOOL_ARGS_CHUNKS is enabled.
|
|
22
|
+
MR_MAGIC_MCP_HTTP_DIAGNOSTICS=0 # Optional, default 0. Set to 1 to log enriched Streamable HTTP MCP request diagnostics at transport ingress.
|
|
23
|
+
MR_MAGIC_SDK_REPRO_HTTP_DEBUG=0 # Optional, default 0. Set to 1 for verbose HTTP request/response previews in the SDK repro harness script.
|
|
24
|
+
UPSTASH_REDIS_REST_URL= # Get from https://console.upstash.com/redis/rest, required if MR_MAGIC_EXPORT_BACKEND=redis
|
|
25
|
+
UPSTASH_REDIS_REST_TOKEN= # Get from https://console.upstash.com/redis/rest, required if MR_MAGIC_EXPORT_BACKEND=redis
|
|
26
|
+
AIRTABLE_PERSONAL_ACCESS_TOKEN= # Required for push_catalog_to_airtable tool. Get from https://airtable.com/create/tokens
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Kenyatta Naji Johnson-Adams
|
|
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.
|