midi-mcp 0.0.0
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 +6 -0
- package/midi-mcp.js +42 -0
- package/package.json +31 -0
package/README.md
ADDED
package/midi-mcp.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const { McpServer } = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
3
|
+
const { StdioServerTransport } = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
4
|
+
const { z } = require("zod");
|
|
5
|
+
const JZZ = require('jzz');
|
|
6
|
+
|
|
7
|
+
const server = new McpServer({
|
|
8
|
+
name: "midi-mcp",
|
|
9
|
+
version: "0.0.0"
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
server.registerTool(
|
|
13
|
+
"list_midi_out",
|
|
14
|
+
{ description: "Get the list of MIDI-Out ports", inputinputSchema: {} },
|
|
15
|
+
list_midi_out
|
|
16
|
+
);
|
|
17
|
+
server.registerTool(
|
|
18
|
+
"list_midi_in",
|
|
19
|
+
{ description: "Get the list of MIDI-In ports", inputinputSchema: {} },
|
|
20
|
+
list_midi_in
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
async function list_midi_out() {
|
|
24
|
+
const result = await JZZ().info().outputs.map(x => x.name);
|
|
25
|
+
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
26
|
+
}
|
|
27
|
+
async function list_midi_in() {
|
|
28
|
+
const result = await JZZ().info().inputs.map(x => x.name);
|
|
29
|
+
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (require.main === module) {
|
|
33
|
+
const main = async function() {
|
|
34
|
+
const transport = new StdioServerTransport();
|
|
35
|
+
await server.connect(transport);
|
|
36
|
+
console.error('MIDI MCP Server is running on stdio');
|
|
37
|
+
}
|
|
38
|
+
main();
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
module.exports = { list_midi_out, list_midi_in };
|
|
42
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "midi-mcp",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "coming soon...",
|
|
5
|
+
"main": "./midi-mcp.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"midi-mcp": "midi-mcp.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"mcp",
|
|
14
|
+
"midi"
|
|
15
|
+
],
|
|
16
|
+
"author": "jazz-soft (https://jazz-soft.net/)",
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
19
|
+
"jzz": "^1.9.6",
|
|
20
|
+
"zod": "^4.3.6"
|
|
21
|
+
},
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/jazz-soft/midi-mcp.git"
|
|
25
|
+
},
|
|
26
|
+
"homepage": "https://github.com/jazz-soft/midi-mcp#readme",
|
|
27
|
+
"bugs": {
|
|
28
|
+
"url": "https://github.com/jazz-soft/midi-mcp/issues"
|
|
29
|
+
},
|
|
30
|
+
"license": "MIT"
|
|
31
|
+
}
|