mr-magic-mcp-server 0.1.14 → 0.1.16
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/README.md +88 -0
- package/package.json +1 -1
- package/src/transport/mcp-http-server.js +2 -3
package/README.md
CHANGED
|
@@ -12,6 +12,7 @@ automations, and CLI aficionados can all request lyrics from a single toolchain.
|
|
|
12
12
|
- [Export and Download Configuration](#export-and-download-configuration)
|
|
13
13
|
- [Local Deployment](#local-deployment)
|
|
14
14
|
- [Remote Deployment](#remote-deployment)
|
|
15
|
+
- [HTTP Endpoints](#http-endpoints)
|
|
15
16
|
- [MCP Tools](#mcp-tools)
|
|
16
17
|
- [Airtable Integration](#airtable-integration)
|
|
17
18
|
- [MCP Client Configuration](#mcp-client-configuration)
|
|
@@ -320,6 +321,93 @@ Recommended Render service settings:
|
|
|
320
321
|
| JSON HTTP automation | `npm run server:http` | Container / remote automations |
|
|
321
322
|
| CLI | `npm run cli` | Ad-hoc / SSH / CI one-shot commands |
|
|
322
323
|
|
|
324
|
+
## HTTP Endpoints
|
|
325
|
+
|
|
326
|
+
Both HTTP servers expose a set of plain HTTP routes in addition to their primary
|
|
327
|
+
transports. These are accessible without any MCP or JSON-RPC framing.
|
|
328
|
+
|
|
329
|
+
| Endpoint | Method | Server | Description |
|
|
330
|
+
|---|---|---|---|
|
|
331
|
+
| `/health` | `GET` | Both | Liveness / readiness probe. Returns `{ "status": "ok", "providers": [...] }`. |
|
|
332
|
+
| `/downloads/:id/:ext` | `GET` | Both | Serve a Redis-backed export by ID and file extension (e.g. `plain`, `lrc`, `srt`). Returns `200 text/plain` on hit, `404` when the key is expired or missing. |
|
|
333
|
+
| `/mcp` | `POST` | `server:mcp:http` only | MCP Streamable HTTP transport endpoint (JSON-RPC 2.0). |
|
|
334
|
+
| `/` | `POST` | `server:http` only | JSON HTTP automation endpoint (action-based API). |
|
|
335
|
+
|
|
336
|
+
### `/health`
|
|
337
|
+
|
|
338
|
+
Both servers respond to `GET /health` with a JSON object indicating overall status
|
|
339
|
+
and per-provider readiness. Use this as your Render (or container / load-balancer)
|
|
340
|
+
health check path.
|
|
341
|
+
|
|
342
|
+
**Response shape:**
|
|
343
|
+
|
|
344
|
+
```json
|
|
345
|
+
{
|
|
346
|
+
"status": "ok",
|
|
347
|
+
"providers": [
|
|
348
|
+
{ "name": "lrclib", "status": "ok" },
|
|
349
|
+
{ "name": "genius", "status": "ok" },
|
|
350
|
+
{ "name": "musixmatch", "status": "missing_token" },
|
|
351
|
+
{ "name": "melon", "status": "ok" }
|
|
352
|
+
]
|
|
353
|
+
}
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
**MCP HTTP server** (default port `3444`):
|
|
357
|
+
|
|
358
|
+
```bash
|
|
359
|
+
curl -sS http://127.0.0.1:3444/health | jq
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
**JSON HTTP server** (default port `3333`):
|
|
363
|
+
|
|
364
|
+
```bash
|
|
365
|
+
curl -sS http://127.0.0.1:3333/health | jq
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
Provider `status` values:
|
|
369
|
+
|
|
370
|
+
| Value | Meaning |
|
|
371
|
+
|---|---|
|
|
372
|
+
| `ok` | Provider is configured and reachable. |
|
|
373
|
+
| `missing_token` | Required credential env var is not set. |
|
|
374
|
+
| `error` | Provider returned an unexpected error during the status probe. |
|
|
375
|
+
|
|
376
|
+
### `/downloads/:id/:ext`
|
|
377
|
+
|
|
378
|
+
Serves a Redis-backed export file by its download ID and format extension. Both
|
|
379
|
+
servers expose this route so the same `MR_MAGIC_DOWNLOAD_BASE_URL` works regardless
|
|
380
|
+
of which server you are running.
|
|
381
|
+
|
|
382
|
+
**Parameters:**
|
|
383
|
+
|
|
384
|
+
- `:id` — the opaque download ID returned in the `url` field of an export response
|
|
385
|
+
- `:ext` — the file format: `plain`, `lrc`, `srt`, or `romanized`
|
|
386
|
+
|
|
387
|
+
**Example** (MCP HTTP server):
|
|
388
|
+
|
|
389
|
+
```bash
|
|
390
|
+
curl -sS http://127.0.0.1:3444/downloads/coldplay-yellow-1741234567890/plain
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
**Example** (JSON HTTP server):
|
|
394
|
+
|
|
395
|
+
```bash
|
|
396
|
+
curl -sS http://127.0.0.1:3333/downloads/coldplay-yellow-1741234567890/plain
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
Responses:
|
|
400
|
+
|
|
401
|
+
- `200 text/plain` — export content served directly
|
|
402
|
+
- `404` — key expired or never written (`MR_MAGIC_EXPORT_TTL_SECONDS` controls TTL,
|
|
403
|
+
default `3600` seconds)
|
|
404
|
+
- `400` — malformed path (missing ID or extension)
|
|
405
|
+
- `500` — Redis lookup error
|
|
406
|
+
|
|
407
|
+
> Requires `MR_MAGIC_EXPORT_BACKEND=redis` and valid `UPSTASH_*` credentials.
|
|
408
|
+
> For local and inline backends, exports are returned directly in the tool response
|
|
409
|
+
> and this route is not used.
|
|
410
|
+
|
|
323
411
|
## MCP Tools
|
|
324
412
|
|
|
325
413
|
Both the stdio and Streamable HTTP transports expose the same tool registry:
|
package/package.json
CHANGED
|
@@ -117,9 +117,8 @@ export async function startMcpHttpServer(options = {}) {
|
|
|
117
117
|
res.json({ status: 'ok', providers: await getProviderStatus() });
|
|
118
118
|
});
|
|
119
119
|
|
|
120
|
-
app.get('/downloads/:downloadId
|
|
121
|
-
const { downloadId } = req.params;
|
|
122
|
-
const extension = req.params[0] || '';
|
|
120
|
+
app.get('/downloads/:downloadId/:extension', async (req, res) => {
|
|
121
|
+
const { downloadId, extension } = req.params;
|
|
123
122
|
if (!downloadId || !extension) {
|
|
124
123
|
res.status(400).json({ error: 'Invalid download path' });
|
|
125
124
|
return;
|