moosetracker-mcp 0.0.0-stage → 1.2.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/LICENSE +21 -0
- package/README.md +39 -2
- package/bin/moosetracker-mcp.js +104 -0
- package/package.json +40 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Kurtis Alexander
|
|
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,40 @@
|
|
|
1
|
-
#
|
|
1
|
+
# moosetracker-mcp
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
This package is the local stdio-to-remote bridge only. The product and setup pages are at https://moosetracker.app/ and https://moosetracker.app/ai.
|
|
4
|
+
|
|
5
|
+
A small local stdio-to-remote bridge for the [Moose Tracker](https://moosetracker.app/) MCP server. It proxies JSON-RPC from a local MCP client to `https://mcp.moosetracker.app/mcp`. It contains no engine code and no secrets.
|
|
6
|
+
|
|
7
|
+
This package is MIT-licensed. Moose Tracker itself is a separate product.
|
|
8
|
+
|
|
9
|
+
## Setup
|
|
10
|
+
|
|
11
|
+
Requires Node.js 18 or later. No sign-in and no API key.
|
|
12
|
+
|
|
13
|
+
The connector URL is `https://mcp.moosetracker.app/mcp` (Streamable HTTP). This bridge is for clients that speak MCP over stdio.
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"mcpServers": {
|
|
18
|
+
"moose-tracker": {
|
|
19
|
+
"command": "npx",
|
|
20
|
+
"args": ["-y", "moosetracker-mcp"]
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
You can also run it directly:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
npx moosetracker-mcp
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Optional: set `MOOSETRACKER_MCP_URL` to a different MCP URL (for tests or a staging host). The default is the live server above.
|
|
33
|
+
|
|
34
|
+
A share link from the `song` tool plays the song in the browser and does not need a render. Use `render` or `sfx` when you want audio files to embed in a game, an app, a presentation or a video.
|
|
35
|
+
|
|
36
|
+
More setup, including adding the remote URL directly in clients that support Streamable HTTP, is at https://moosetracker.app/ai.
|
|
37
|
+
|
|
38
|
+
## License
|
|
39
|
+
|
|
40
|
+
MIT. See `LICENSE`.
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// © 2026 Kurtis Alexander. MIT License.
|
|
3
|
+
// Tiny stdio-to-remote MCP bridge. No engine code, no secrets. Forwards JSON-RPC
|
|
4
|
+
// between a local MCP client (Content-Length stdio) and the live Streamable HTTP server.
|
|
5
|
+
import { readFileSync } from "node:fs";
|
|
6
|
+
import { dirname, join } from "node:path";
|
|
7
|
+
import { fileURLToPath } from "node:url";
|
|
8
|
+
import { stdin, stdout, stderr } from "node:process";
|
|
9
|
+
|
|
10
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
11
|
+
const pkg = JSON.parse(readFileSync(join(here, "../package.json"), "utf8"));
|
|
12
|
+
const DEFAULT_URL = "https://mcp.moosetracker.app/mcp";
|
|
13
|
+
|
|
14
|
+
function argUrl() {
|
|
15
|
+
const i = process.argv.indexOf("--url");
|
|
16
|
+
if (i >= 0 && process.argv[i + 1]) return process.argv[i + 1];
|
|
17
|
+
return process.env.MOOSETRACKER_MCP_URL || DEFAULT_URL;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const url = argUrl();
|
|
21
|
+
let sessionId = null;
|
|
22
|
+
|
|
23
|
+
function writeMessage(obj) {
|
|
24
|
+
const json = JSON.stringify(obj);
|
|
25
|
+
const body = Buffer.from(json, "utf8");
|
|
26
|
+
stdout.write(`Content-Length: ${body.length}\r\n\r\n`);
|
|
27
|
+
stdout.write(body);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function parseSseOrJson(text, contentType) {
|
|
31
|
+
if (contentType && contentType.includes("text/event-stream")) {
|
|
32
|
+
const payloads = [];
|
|
33
|
+
for (const block of text.split(/\n\n/)) {
|
|
34
|
+
const data = block.split("\n").filter(l => l.startsWith("data:")).map(l => l.slice(5).trimStart()).join("\n");
|
|
35
|
+
if (data) {
|
|
36
|
+
try { payloads.push(JSON.parse(data)); } catch { /* ignore keepalives */ }
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return payloads;
|
|
40
|
+
}
|
|
41
|
+
return [JSON.parse(text)];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
async function forward(msg) {
|
|
45
|
+
const headers = {
|
|
46
|
+
"content-type": "application/json",
|
|
47
|
+
"accept": "application/json, text/event-stream",
|
|
48
|
+
"user-agent": `moosetracker-mcp/${pkg.version}`,
|
|
49
|
+
};
|
|
50
|
+
if (sessionId) headers["mcp-session-id"] = sessionId;
|
|
51
|
+
const res = await fetch(url, { method: "POST", headers, body: JSON.stringify(msg) });
|
|
52
|
+
const sid = res.headers.get("mcp-session-id");
|
|
53
|
+
if (sid) sessionId = sid;
|
|
54
|
+
const text = await res.text();
|
|
55
|
+
if (res.status === 204 || text.trim() === "") {
|
|
56
|
+
if (msg.id === undefined) return []; // notification
|
|
57
|
+
return [{ jsonrpc: "2.0", id: msg.id, error: { code: -32000, message: `empty reply from ${url} (HTTP ${res.status})` } }];
|
|
58
|
+
}
|
|
59
|
+
try {
|
|
60
|
+
return parseSseOrJson(text, res.headers.get("content-type") || "");
|
|
61
|
+
} catch (e) {
|
|
62
|
+
if (msg.id === undefined) return [];
|
|
63
|
+
return [{ jsonrpc: "2.0", id: msg.id, error: { code: -32000, message: `bad reply from ${url} (HTTP ${res.status}): ${String(e.message || e).slice(0, 200)}` } }];
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
async function onMessage(msg) {
|
|
68
|
+
try {
|
|
69
|
+
const replies = await forward(msg);
|
|
70
|
+
for (const r of replies) writeMessage(r);
|
|
71
|
+
} catch (e) {
|
|
72
|
+
if (msg && msg.id !== undefined) {
|
|
73
|
+
writeMessage({ jsonrpc: "2.0", id: msg.id, error: { code: -32000, message: String(e.message || e).slice(0, 300) } });
|
|
74
|
+
} else {
|
|
75
|
+
stderr.write(`moosetracker-mcp: ${String(e.message || e)}\n`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
let buf = Buffer.alloc(0);
|
|
81
|
+
stdin.on("data", chunk => {
|
|
82
|
+
buf = Buffer.concat([buf, chunk]);
|
|
83
|
+
for (;;) {
|
|
84
|
+
const headerEnd = buf.indexOf("\r\n\r\n") >= 0 ? buf.indexOf("\r\n\r\n") : buf.indexOf("\n\n");
|
|
85
|
+
const sepLen = buf.indexOf("\r\n\r\n") >= 0 ? 4 : (buf.indexOf("\n\n") >= 0 ? 2 : 0);
|
|
86
|
+
if (headerEnd < 0) break;
|
|
87
|
+
const header = buf.subarray(0, headerEnd).toString("utf8");
|
|
88
|
+
const m = /content-length:\s*(\d+)/i.exec(header);
|
|
89
|
+
if (!m) { buf = buf.subarray(headerEnd + sepLen); continue; }
|
|
90
|
+
const len = Number(m[1]);
|
|
91
|
+
const start = headerEnd + sepLen;
|
|
92
|
+
if (buf.length < start + len) break;
|
|
93
|
+
const json = buf.subarray(start, start + len).toString("utf8");
|
|
94
|
+
buf = buf.subarray(start + len);
|
|
95
|
+
let msg;
|
|
96
|
+
try { msg = JSON.parse(json); } catch (e) {
|
|
97
|
+
writeMessage({ jsonrpc: "2.0", id: null, error: { code: -32700, message: "parse error" } });
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
onMessage(msg);
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
stdin.on("end", () => process.exit(0));
|
|
104
|
+
stdin.resume();
|
package/package.json
CHANGED
|
@@ -1,6 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "moosetracker-mcp",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.2.9",
|
|
4
|
+
"description": "A retro synthesizer and music tracker MCP server: your assistant writes sound effects and songs as notes, and Moose Tracker plays them. Share links play in the browser; render and sfx produce files to embed.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "Kurtis Alexander",
|
|
8
|
+
"email": "moose@moosetracker.app"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://moosetracker.app/ai",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/moose-tracker/moose-tracker-plugin.git"
|
|
14
|
+
},
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://moosetracker.app/about.html"
|
|
17
|
+
},
|
|
18
|
+
"type": "module",
|
|
19
|
+
"bin": {
|
|
20
|
+
"moosetracker-mcp": "bin/moosetracker-mcp.js"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"bin",
|
|
24
|
+
"README.md",
|
|
25
|
+
"LICENSE"
|
|
26
|
+
],
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">=18"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"test": "node --test test/*.test.js",
|
|
32
|
+
"pack:check": "npm pack --dry-run"
|
|
33
|
+
},
|
|
34
|
+
"keywords": [
|
|
35
|
+
"mcp",
|
|
36
|
+
"model-context-protocol",
|
|
37
|
+
"moose-tracker",
|
|
38
|
+
"music",
|
|
39
|
+
"stdio"
|
|
40
|
+
],
|
|
41
|
+
"dependencies": {}
|
|
42
|
+
}
|