mr-magic-mcp-server 0.1.7 → 0.1.9
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 +33 -15
- package/package.json +1 -1
- package/src/transport/mcp-http-server.js +5 -0
package/README.md
CHANGED
|
@@ -787,13 +787,31 @@ Start MCP HTTP server in one terminal:
|
|
|
787
787
|
npm run server:mcp:http
|
|
788
788
|
```
|
|
789
789
|
|
|
790
|
-
Default
|
|
791
|
-
|
|
790
|
+
Default endpoins:
|
|
792
791
|
- `http://127.0.0.1:3444/mcp`
|
|
793
792
|
|
|
794
793
|
All manual calls are JSON-RPC 2.0 requests.
|
|
795
794
|
|
|
796
|
-
|
|
795
|
+
The MCP API also accepts:
|
|
796
|
+
|
|
797
|
+
- `GET /health`
|
|
798
|
+
- `POST /` with body shape:
|
|
799
|
+
|
|
800
|
+
```json
|
|
801
|
+
{
|
|
802
|
+
"action": "find | findSynced | search",
|
|
803
|
+
"track": { "artist": "...", "title": "...", "album": "..." },
|
|
804
|
+
"options": { "...": "..." }
|
|
805
|
+
}
|
|
806
|
+
```
|
|
807
|
+
|
|
808
|
+
##### A. Health check
|
|
809
|
+
|
|
810
|
+
```bash
|
|
811
|
+
curl -sS http://127.0.0.1:3333/health | jq
|
|
812
|
+
```
|
|
813
|
+
|
|
814
|
+
##### B. List tools (`tools/list`)
|
|
797
815
|
|
|
798
816
|
```bash
|
|
799
817
|
curl -sS -X POST http://127.0.0.1:3444/mcp \
|
|
@@ -802,7 +820,7 @@ curl -sS -X POST http://127.0.0.1:3444/mcp \
|
|
|
802
820
|
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | jq
|
|
803
821
|
```
|
|
804
822
|
|
|
805
|
-
#####
|
|
823
|
+
##### C. Call `find_lyrics`
|
|
806
824
|
|
|
807
825
|
```bash
|
|
808
826
|
curl -sS -X POST http://127.0.0.1:3444/mcp \
|
|
@@ -819,7 +837,7 @@ curl -sS -X POST http://127.0.0.1:3444/mcp \
|
|
|
819
837
|
}' | jq
|
|
820
838
|
```
|
|
821
839
|
|
|
822
|
-
#####
|
|
840
|
+
##### D. Call `find_synced_lyrics`
|
|
823
841
|
|
|
824
842
|
```bash
|
|
825
843
|
curl -sS -X POST http://127.0.0.1:3444/mcp \
|
|
@@ -836,7 +854,7 @@ curl -sS -X POST http://127.0.0.1:3444/mcp \
|
|
|
836
854
|
}' | jq
|
|
837
855
|
```
|
|
838
856
|
|
|
839
|
-
#####
|
|
857
|
+
##### E. Call `build_catalog_payload` (default — inline lyrics)
|
|
840
858
|
|
|
841
859
|
```bash
|
|
842
860
|
curl -sS -X POST http://127.0.0.1:3444/mcp \
|
|
@@ -856,7 +874,7 @@ curl -sS -X POST http://127.0.0.1:3444/mcp \
|
|
|
856
874
|
}' | jq
|
|
857
875
|
```
|
|
858
876
|
|
|
859
|
-
#####
|
|
877
|
+
##### F. Call `build_catalog_payload` (compact Airtable-safe mode)
|
|
860
878
|
|
|
861
879
|
```bash
|
|
862
880
|
curl -sS -X POST http://127.0.0.1:3444/mcp \
|
|
@@ -880,7 +898,7 @@ curl -sS -X POST http://127.0.0.1:3444/mcp \
|
|
|
880
898
|
}' | jq
|
|
881
899
|
```
|
|
882
900
|
|
|
883
|
-
#####
|
|
901
|
+
##### G. Call `search_lyrics` (all providers, no hydration)
|
|
884
902
|
|
|
885
903
|
```bash
|
|
886
904
|
curl -sS -X POST http://127.0.0.1:3444/mcp \
|
|
@@ -897,7 +915,7 @@ curl -sS -X POST http://127.0.0.1:3444/mcp \
|
|
|
897
915
|
}' | jq
|
|
898
916
|
```
|
|
899
917
|
|
|
900
|
-
#####
|
|
918
|
+
##### H. Call `search_provider` (single provider)
|
|
901
919
|
|
|
902
920
|
```bash
|
|
903
921
|
curl -sS -X POST http://127.0.0.1:3444/mcp \
|
|
@@ -917,7 +935,7 @@ curl -sS -X POST http://127.0.0.1:3444/mcp \
|
|
|
917
935
|
}' | jq
|
|
918
936
|
```
|
|
919
937
|
|
|
920
|
-
#####
|
|
938
|
+
##### I. Call `format_lyrics` (in-memory with romanization)
|
|
921
939
|
|
|
922
940
|
```bash
|
|
923
941
|
curl -sS -X POST http://127.0.0.1:3444/mcp \
|
|
@@ -937,7 +955,7 @@ curl -sS -X POST http://127.0.0.1:3444/mcp \
|
|
|
937
955
|
}' | jq
|
|
938
956
|
```
|
|
939
957
|
|
|
940
|
-
#####
|
|
958
|
+
##### J. Call `export_lyrics`
|
|
941
959
|
|
|
942
960
|
```bash
|
|
943
961
|
curl -sS -X POST http://127.0.0.1:3444/mcp \
|
|
@@ -957,7 +975,7 @@ curl -sS -X POST http://127.0.0.1:3444/mcp \
|
|
|
957
975
|
}' | jq
|
|
958
976
|
```
|
|
959
977
|
|
|
960
|
-
#####
|
|
978
|
+
##### K. Call `get_provider_status`
|
|
961
979
|
|
|
962
980
|
```bash
|
|
963
981
|
curl -sS -X POST http://127.0.0.1:3444/mcp \
|
|
@@ -971,7 +989,7 @@ curl -sS -X POST http://127.0.0.1:3444/mcp \
|
|
|
971
989
|
}' | jq
|
|
972
990
|
```
|
|
973
991
|
|
|
974
|
-
#####
|
|
992
|
+
##### K2. Call `runtime_status`
|
|
975
993
|
|
|
976
994
|
```bash
|
|
977
995
|
curl -sS -X POST http://127.0.0.1:3444/mcp \
|
|
@@ -985,7 +1003,7 @@ curl -sS -X POST http://127.0.0.1:3444/mcp \
|
|
|
985
1003
|
}' | jq
|
|
986
1004
|
```
|
|
987
1005
|
|
|
988
|
-
#####
|
|
1006
|
+
##### M. Call `push_catalog_to_airtable` (server-side Airtable lyrics write)
|
|
989
1007
|
|
|
990
1008
|
First call `build_catalog_payload` (section D or E above) to populate the
|
|
991
1009
|
lyric cache and capture the returned `lyricsCacheKey`. Then use that key here
|
|
@@ -1019,7 +1037,7 @@ curl -sS -X POST http://127.0.0.1:3444/mcp \
|
|
|
1019
1037
|
> with real values from your Airtable base and the `build_catalog_payload`
|
|
1020
1038
|
> response. Requires `AIRTABLE_PERSONAL_ACCESS_TOKEN` to be set in `.env`.
|
|
1021
1039
|
|
|
1022
|
-
#####
|
|
1040
|
+
##### N. Call `select_match` (pick from a prior search result)
|
|
1023
1041
|
|
|
1024
1042
|
First run `search_lyrics` (section F above) and capture the matches, then
|
|
1025
1043
|
pick the first synced result:
|
package/package.json
CHANGED
|
@@ -13,6 +13,7 @@ import { mcpToolDefinitions, handleMcpTool } from './mcp-tools.js';
|
|
|
13
13
|
import { buildMcpResponse } from './mcp-response.js';
|
|
14
14
|
import { logTokenStatus } from './token-startup-log.js';
|
|
15
15
|
import { normalizeToolArgs } from './tool-args.js';
|
|
16
|
+
import { getProviderStatus } from '../index.js';
|
|
16
17
|
|
|
17
18
|
function getBodyShape(body) {
|
|
18
19
|
if (body == null) return 'nullish';
|
|
@@ -91,6 +92,10 @@ export async function startMcpHttpServer(options = {}) {
|
|
|
91
92
|
await logTokenStatus({ context: 'http-mcp' });
|
|
92
93
|
|
|
93
94
|
const app = createMcpExpressApp({ host });
|
|
95
|
+
app.get('/health', async (_req, res) => {
|
|
96
|
+
res.json({ status: 'ok', providers: await getProviderStatus() });
|
|
97
|
+
});
|
|
98
|
+
|
|
94
99
|
app.all('/mcp', async (req, res) => {
|
|
95
100
|
const normalizedBody = normalizeIncomingRpcBody(req.body);
|
|
96
101
|
const requestId = randomUUID();
|