tbmlib-cli 0.0.0-stage → 1.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/LICENSE +3 -0
- package/README.md +38 -2
- package/bin/tbmlib.mjs +56 -0
- package/package.json +40 -4
package/LICENSE
ADDED
package/README.md
CHANGED
|
@@ -1,3 +1,39 @@
|
|
|
1
|
-
#
|
|
1
|
+
# tbmlib-cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Official zero-dependency terminal CLI and Model Context Protocol (MCP) client for **[TbmLib (tbmlib.com)](https://tbmlib.com)**.
|
|
4
|
+
|
|
5
|
+
## Quick Usage
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# List all available MCP tools
|
|
9
|
+
npx tbmlib-cli tools
|
|
10
|
+
|
|
11
|
+
# Run a live sample query
|
|
12
|
+
npx tbmlib-cli demo
|
|
13
|
+
|
|
14
|
+
# Call a specific tool with JSON arguments
|
|
15
|
+
npx tbmlib-cli call lookup_trombone_slide_position '{"note":"Bb2"}'
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Connect in Claude Desktop / Cursor / Windsurf
|
|
19
|
+
|
|
20
|
+
```json
|
|
21
|
+
{
|
|
22
|
+
"mcpServers": {
|
|
23
|
+
"tbmlib": {
|
|
24
|
+
"type": "streamable-http",
|
|
25
|
+
"url": "https://tbmlib.com/api/mcp"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Official Web Tools & Documentation
|
|
32
|
+
|
|
33
|
+
- **[TbmLib Official Studio](https://tbmlib.com)** (https://tbmlib.com)
|
|
34
|
+
- **[Trombone F-Attachment Trigger Mechanics & Valve Notes](https://tbmlib.com/f-attachment)** (https://tbmlib.com/f-attachment)
|
|
35
|
+
- **[Trombone Orchestral Excerpts & Clef Reading Guide](https://tbmlib.com/excerpts)** (https://tbmlib.com/excerpts)
|
|
36
|
+
|
|
37
|
+
## License
|
|
38
|
+
|
|
39
|
+
MIT © [TbmLib](https://tbmlib.com)
|
package/bin/tbmlib.mjs
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const ENDPOINT = 'https://tbmlib.com/api/mcp';
|
|
3
|
+
|
|
4
|
+
async function rpc(method, params = {}) {
|
|
5
|
+
const res = await fetch(ENDPOINT, {
|
|
6
|
+
method: 'POST',
|
|
7
|
+
headers: { 'Content-Type': 'application/json', 'Accept': 'application/json, text/event-stream' },
|
|
8
|
+
body: JSON.stringify({ jsonrpc: '2.0', id: 1, method, params })
|
|
9
|
+
});
|
|
10
|
+
if (!res.ok) throw new Error('HTTP ' + res.status + ' from ' + ENDPOINT);
|
|
11
|
+
const txt = await res.text();
|
|
12
|
+
if (txt.startsWith('event:') || txt.includes('\ndata:')) {
|
|
13
|
+
const m = txt.match(/data:\s*(\{.*\})/);
|
|
14
|
+
if (m) return JSON.parse(m[1]);
|
|
15
|
+
}
|
|
16
|
+
return JSON.parse(txt);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
async function main() {
|
|
20
|
+
const [cmd, arg1, arg2] = process.argv.slice(2);
|
|
21
|
+
if (!cmd || cmd === '--help' || cmd === '-h' || cmd === 'help') {
|
|
22
|
+
console.log('TbmLib CLI v1.0.0 — Official Terminal & MCP Client');
|
|
23
|
+
console.log('Website: https://tbmlib.com');
|
|
24
|
+
console.log('MCP URL: ' + ENDPOINT);
|
|
25
|
+
console.log('\nUsage:');
|
|
26
|
+
console.log(' npx tbmlib-cli tools List available MCP tools');
|
|
27
|
+
console.log(' npx tbmlib-cli demo Run live sample calculation');
|
|
28
|
+
console.log(' npx tbmlib-cli call <tool> <jsonArgs> Invoke any MCP tool with JSON arguments');
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (cmd === 'tools') {
|
|
32
|
+
const out = await rpc('tools/list');
|
|
33
|
+
for (const t of out?.result?.tools || []) {
|
|
34
|
+
console.log('- ' + t.name + ': ' + t.description);
|
|
35
|
+
}
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (cmd === 'demo') {
|
|
39
|
+
const out = await rpc('tools/call', { name: "lookup_trombone_slide_position", arguments: {"note":"Bb2"} });
|
|
40
|
+
console.log(out?.result?.content?.[0]?.text || JSON.stringify(out, null, 2));
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (cmd === 'call' && arg1) {
|
|
44
|
+
const parsed = arg2 ? JSON.parse(arg2) : {};
|
|
45
|
+
const out = await rpc('tools/call', { name: arg1, arguments: parsed });
|
|
46
|
+
console.log(out?.result?.content?.[0]?.text || JSON.stringify(out, null, 2));
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
console.error('Unknown command. Run with --help for usage.');
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
main().catch(err => {
|
|
54
|
+
console.error('Error:', err.message);
|
|
55
|
+
process.exit(1);
|
|
56
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tbmlib-cli",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Official CLI & MCP client for TbmLib (tbmlib.com): look up tenor & F-attachment trombone 7 slide positions, overtone intonation partials, bore specs & legato warmups.",
|
|
5
|
+
"homepage": "https://tbmlib.com",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/AbigailDavised/tbmlib-mcp.git"
|
|
9
|
+
},
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/AbigailDavised/tbmlib-mcp/issues",
|
|
12
|
+
"email": "admin@tbmlib.com"
|
|
13
|
+
},
|
|
14
|
+
"funding": {
|
|
15
|
+
"type": "individual",
|
|
16
|
+
"url": "https://tbmlib.com"
|
|
17
|
+
},
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"author": "TbmLib <admin@tbmlib.com> (https://tbmlib.com)",
|
|
20
|
+
"type": "module",
|
|
21
|
+
"bin": {
|
|
22
|
+
"tbmlib": "./bin/tbmlib.mjs",
|
|
23
|
+
"tbmlib-cli": "./bin/tbmlib.mjs"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"bin/",
|
|
27
|
+
"README.md",
|
|
28
|
+
"LICENSE"
|
|
29
|
+
],
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": ">=18.0.0"
|
|
32
|
+
},
|
|
33
|
+
"keywords": [
|
|
34
|
+
"trombone",
|
|
35
|
+
"slide-positions",
|
|
36
|
+
"brass-pedagogy",
|
|
37
|
+
"music-theory",
|
|
38
|
+
"orchestral-excerpts",
|
|
39
|
+
"mcp",
|
|
40
|
+
"cli"
|
|
41
|
+
]
|
|
42
|
+
}
|