@boomstream/mcp 0.1.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 +21 -0
- package/README.md +73 -0
- package/dist/core/api-client.d.ts +5 -0
- package/dist/core/api-client.js +103 -0
- package/dist/core/api-client.js.map +1 -0
- package/dist/core/auth.d.ts +9 -0
- package/dist/core/auth.js +14 -0
- package/dist/core/auth.js.map +1 -0
- package/dist/core/logger.d.ts +2 -0
- package/dist/core/logger.js +22 -0
- package/dist/core/logger.js.map +1 -0
- package/dist/core/schema.d.ts +22 -0
- package/dist/core/schema.js +14 -0
- package/dist/core/schema.js.map +1 -0
- package/dist/core/server.d.ts +3 -0
- package/dist/core/server.js +24 -0
- package/dist/core/server.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/registry.d.ts +7 -0
- package/dist/tools/registry.js +74 -0
- package/dist/tools/registry.js.map +1 -0
- package/dist/transports/stdio.d.ts +2 -0
- package/dist/transports/stdio.js +64 -0
- package/dist/transports/stdio.js.map +1 -0
- package/package.json +57 -0
- package/schemas/.gitkeep +0 -0
- package/schemas/boomstream.json +3774 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024-2026 Boomstream
|
|
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
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# @boomstream/mcp
|
|
2
|
+
|
|
3
|
+
MCP server (Model Context Protocol) providing **Boomstream API as tools** for LLM agents: Claude Desktop, claude.ai, VS Code MCP extension, and any compatible client.
|
|
4
|
+
|
|
5
|
+
> **v0.1.0** — stdio transport is live. SSE (remote hosting) coming in Phase B; OAuth in Phase C.
|
|
6
|
+
|
|
7
|
+
## What it does
|
|
8
|
+
|
|
9
|
+
LLM agents call tools like `boomstream_media_info`, `boomstream_ppv_list_buyers`, `boomstream_live_create` — the server translates them to HTTP calls against `https://boomstream.com/api/`, parses the responses, and returns structured JSON. ~100 tools across 17 API sections: media, live, ppv, conference, folder, playlist, stats, chat, screenshot, subtitles, timecodes, webhooks, project, record-live, live-ipcamera, player-api, general.
|
|
10
|
+
|
|
11
|
+
Transports:
|
|
12
|
+
- **stdio** — for Claude Desktop (local child process). ✅ Available in v0.1.0.
|
|
13
|
+
- **SSE** — for claude.ai web and remote clients (hosted at `mcp.boomstream.com`). Planned for Phase B.
|
|
14
|
+
|
|
15
|
+
## Quick start
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
BOOMSTREAM_API_KEY=your-key npx -y @boomstream/mcp stdio
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Or install globally:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install -g @boomstream/mcp
|
|
25
|
+
BOOMSTREAM_API_KEY=your-key boomstream-mcp
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Claude Desktop
|
|
29
|
+
|
|
30
|
+
Add to your Claude Desktop config file:
|
|
31
|
+
|
|
32
|
+
- **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
33
|
+
- **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
|
|
34
|
+
- **Linux:** `~/.config/Claude/claude_desktop_config.json`
|
|
35
|
+
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"mcpServers": {
|
|
39
|
+
"boomstream": {
|
|
40
|
+
"command": "npx",
|
|
41
|
+
"args": ["-y", "@boomstream/mcp", "stdio"],
|
|
42
|
+
"env": {
|
|
43
|
+
"BOOMSTREAM_API_KEY": "your-api-key"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
After saving, restart Claude Desktop.
|
|
51
|
+
|
|
52
|
+
## CLI reference
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
boomstream-mcp [stdio] Start MCP server (stdio transport)
|
|
56
|
+
boomstream-mcp --version, -v Print version
|
|
57
|
+
boomstream-mcp --help, -h Show help
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
`boomstream-mcp` with no arguments is equivalent to `boomstream-mcp stdio`.
|
|
61
|
+
|
|
62
|
+
## Requirements
|
|
63
|
+
|
|
64
|
+
- Node.js >= 20
|
|
65
|
+
- A Boomstream account with API access. Get your API key in your project settings.
|
|
66
|
+
|
|
67
|
+
## How tool schemas are generated
|
|
68
|
+
|
|
69
|
+
JSONSchema for each tool is **not hand-written**. The source of truth is the Boomstream API documentation database (`hwdmedia.documents`). The script `scripts/build-schema.mjs` parses the markdown and produces `schemas/boomstream.json` covering all ~100 methods in a single run. The generated file is committed to the repository and shipped in the npm package.
|
|
70
|
+
|
|
71
|
+
## License
|
|
72
|
+
|
|
73
|
+
MIT — see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { XMLParser } from 'fast-xml-parser';
|
|
2
|
+
import { logger } from './logger.js';
|
|
3
|
+
export class ApiError extends Error {
|
|
4
|
+
constructor(message) {
|
|
5
|
+
super(message);
|
|
6
|
+
this.name = 'ApiError';
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
const BACKOFF_MS = [100, 400, 1600];
|
|
10
|
+
const MAX_ATTEMPTS = 3;
|
|
11
|
+
const TIMEOUT_MS = 30_000;
|
|
12
|
+
const xmlParser = new XMLParser({ ignoreAttributes: false });
|
|
13
|
+
async function parseResponse(response) {
|
|
14
|
+
const contentType = response.headers.get('content-type') ?? '';
|
|
15
|
+
const text = await response.text();
|
|
16
|
+
let parsed;
|
|
17
|
+
if (contentType.includes('application/xml') || contentType.includes('text/xml')) {
|
|
18
|
+
parsed = xmlParser.parse(text);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
try {
|
|
22
|
+
parsed = JSON.parse(text);
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
parsed = xmlParser.parse(text);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
if (parsed !== null &&
|
|
29
|
+
typeof parsed === 'object' &&
|
|
30
|
+
'Status' in parsed &&
|
|
31
|
+
parsed.Status === 'Failed') {
|
|
32
|
+
const message = String(parsed.Message ?? 'API request failed');
|
|
33
|
+
throw new ApiError(message);
|
|
34
|
+
}
|
|
35
|
+
return parsed;
|
|
36
|
+
}
|
|
37
|
+
function sleep(ms) {
|
|
38
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
39
|
+
}
|
|
40
|
+
export async function execute(schema, args, apikey) {
|
|
41
|
+
const { _ver, ...restArgs } = args;
|
|
42
|
+
const ver = typeof _ver === 'string' ? _ver : '1.2';
|
|
43
|
+
const baseUrl = `https://boomstream.com${schema.endpoint}`;
|
|
44
|
+
let lastError;
|
|
45
|
+
for (let attempt = 0; attempt < MAX_ATTEMPTS; attempt++) {
|
|
46
|
+
if (attempt > 0) {
|
|
47
|
+
await sleep(BACKOFF_MS[attempt - 1]);
|
|
48
|
+
}
|
|
49
|
+
try {
|
|
50
|
+
const signal = AbortSignal.timeout(TIMEOUT_MS);
|
|
51
|
+
let response;
|
|
52
|
+
if (schema.httpMethod === 'GET') {
|
|
53
|
+
const params = new URLSearchParams();
|
|
54
|
+
params.set('format', 'json');
|
|
55
|
+
params.set('ver', ver);
|
|
56
|
+
params.set('apikey', apikey);
|
|
57
|
+
for (const [key, value] of Object.entries(restArgs)) {
|
|
58
|
+
if (value === undefined || value === null)
|
|
59
|
+
continue;
|
|
60
|
+
if (Array.isArray(value)) {
|
|
61
|
+
for (const item of value)
|
|
62
|
+
params.append(key, String(item));
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
params.set(key, String(value));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
response = await fetch(`${baseUrl}?${params.toString()}`, { signal });
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
const body = { ...restArgs, format: 'json', ver, apikey };
|
|
72
|
+
response = await fetch(baseUrl, {
|
|
73
|
+
method: 'POST',
|
|
74
|
+
headers: { 'Content-Type': 'application/json' },
|
|
75
|
+
body: JSON.stringify(body),
|
|
76
|
+
signal,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
if (response.status >= 500) {
|
|
80
|
+
logger.warn({ status: response.status, attempt, tool: schema.name }, 'server error, will retry');
|
|
81
|
+
lastError = new ApiError(`Server error: HTTP ${response.status}`);
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
return await parseResponse(response);
|
|
85
|
+
}
|
|
86
|
+
catch (err) {
|
|
87
|
+
if (err instanceof ApiError)
|
|
88
|
+
throw err;
|
|
89
|
+
const isDomTimeout = err instanceof DOMException && (err.name === 'TimeoutError' || err.name === 'AbortError');
|
|
90
|
+
if (isDomTimeout)
|
|
91
|
+
throw err;
|
|
92
|
+
lastError = err;
|
|
93
|
+
logger.warn({
|
|
94
|
+
errName: err instanceof Error ? err.name : 'Unknown',
|
|
95
|
+
errCode: err?.cause?.code,
|
|
96
|
+
attempt,
|
|
97
|
+
tool: schema.name,
|
|
98
|
+
}, 'request error, will retry');
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
throw lastError;
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=api-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-client.js","sourceRoot":"","sources":["../../src/core/api-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGrC,MAAM,OAAO,QAAS,SAAQ,KAAK;IACjC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;IACzB,CAAC;CACF;AAED,MAAM,UAAU,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;AACpC,MAAM,YAAY,GAAG,CAAC,CAAC;AACvB,MAAM,UAAU,GAAG,MAAM,CAAC;AAE1B,MAAM,SAAS,GAAG,IAAI,SAAS,CAAC,EAAE,gBAAgB,EAAE,KAAK,EAAE,CAAC,CAAC;AAE7D,KAAK,UAAU,aAAa,CAAC,QAAkB;IAC7C,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC;IAC/D,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IAEnC,IAAI,MAAe,CAAC;IACpB,IAAI,WAAW,CAAC,QAAQ,CAAC,iBAAiB,CAAC,IAA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
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface AuthContext {
|
|
2
|
+
/** Phase A: static API key from env. Phase C: OAuth bearer token. */
|
|
3
|
+
getApiKey(): Promise<string> | string;
|
|
4
|
+
}
|
|
5
|
+
export declare class EnvAuthContext implements AuthContext {
|
|
6
|
+
getApiKey(): string;
|
|
7
|
+
}
|
|
8
|
+
export declare function getApiKey(ctx: AuthContext): Promise<string>;
|
|
9
|
+
export declare const defaultAuth: AuthContext;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export class EnvAuthContext {
|
|
2
|
+
getApiKey() {
|
|
3
|
+
const key = process.env.BOOMSTREAM_API_KEY;
|
|
4
|
+
if (!key) {
|
|
5
|
+
throw new Error('BOOMSTREAM_API_KEY env required for Phase A');
|
|
6
|
+
}
|
|
7
|
+
return key;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export async function getApiKey(ctx) {
|
|
11
|
+
return ctx.getApiKey();
|
|
12
|
+
}
|
|
13
|
+
export const defaultAuth = new EnvAuthContext();
|
|
14
|
+
//# sourceMappingURL=auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/core/auth.ts"],"names":[],"mappings":"AAKA,MAAM,OAAO,cAAc;IACzB,SAAS;QACP,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC;QAC3C,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;QACjE,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AAED,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,GAAgB;IAC9C,OAAO,GAAG,CAAC,SAAS,EAAE,CAAC;AACzB,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAgB,IAAI,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import pino from 'pino';
|
|
2
|
+
export const logger = pino({
|
|
3
|
+
redact: {
|
|
4
|
+
paths: [
|
|
5
|
+
'apikey',
|
|
6
|
+
'Authorization',
|
|
7
|
+
'*.apikey',
|
|
8
|
+
'headers.authorization',
|
|
9
|
+
'headers.Authorization',
|
|
10
|
+
'body.apikey',
|
|
11
|
+
'bearer',
|
|
12
|
+
'token',
|
|
13
|
+
'url',
|
|
14
|
+
'*.url',
|
|
15
|
+
'req.url',
|
|
16
|
+
'request.url',
|
|
17
|
+
'cause.url',
|
|
18
|
+
],
|
|
19
|
+
censor: '[REDACTED]',
|
|
20
|
+
},
|
|
21
|
+
}, process.stderr);
|
|
22
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/core/logger.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,CACxB;IACE,MAAM,EAAE;QACN,KAAK,EAAE;YACL,QAAQ;YACR,eAAe;YACf,UAAU;YACV,uBAAuB;YACvB,uBAAuB;YACvB,aAAa;YACb,QAAQ;YACR,OAAO;YACP,KAAK;YACL,OAAO;YACP,SAAS;YACT,aAAa;YACb,WAAW;SACZ;QACD,MAAM,EAAE,YAAY;KACrB;CACF,EACD,OAAO,CAAC,MAAM,CACf,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface ToolSchema {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
inputSchema: {
|
|
5
|
+
type: 'object';
|
|
6
|
+
properties: Record<string, JsonSchemaProperty>;
|
|
7
|
+
required?: string[];
|
|
8
|
+
};
|
|
9
|
+
endpoint: string;
|
|
10
|
+
httpMethod: 'GET' | 'POST';
|
|
11
|
+
versions: string[];
|
|
12
|
+
}
|
|
13
|
+
export interface JsonSchemaProperty {
|
|
14
|
+
type: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
default?: unknown;
|
|
17
|
+
items?: JsonSchemaProperty;
|
|
18
|
+
properties?: Record<string, JsonSchemaProperty>;
|
|
19
|
+
required?: string[];
|
|
20
|
+
enum?: unknown[];
|
|
21
|
+
}
|
|
22
|
+
export declare function loadSchemas(): ToolSchema[];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { readFileSync } from 'fs';
|
|
2
|
+
import { dirname, join } from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
5
|
+
const schemasPath = join(__dirname, '../../schemas/boomstream.json');
|
|
6
|
+
let _cache = null;
|
|
7
|
+
export function loadSchemas() {
|
|
8
|
+
if (_cache)
|
|
9
|
+
return _cache;
|
|
10
|
+
const raw = readFileSync(schemasPath, 'utf8');
|
|
11
|
+
_cache = JSON.parse(raw);
|
|
12
|
+
return _cache;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/core/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAyBpC,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC1D,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,EAAE,+BAA+B,CAAC,CAAC;AAErE,IAAI,MAAM,GAAwB,IAAI,CAAC;AAEvC,MAAM,UAAU,WAAW;IACzB,IAAI,MAAM;QAAE,OAAO,MAAM,CAAC;IAC1B,MAAM,GAAG,GAAG,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IAC9C,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAiB,CAAC;IACzC,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
2
|
+
import { ListToolsRequestSchema, CallToolRequestSchema } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
+
import { loadSchemas } from './schema.js';
|
|
4
|
+
import { handleToolCall } from '../tools/registry.js';
|
|
5
|
+
import { defaultAuth } from './auth.js';
|
|
6
|
+
export function createServer(auth = defaultAuth) {
|
|
7
|
+
const server = new Server({ name: 'boomstream-mcp', version: '1.0.0' }, { capabilities: { tools: {} } });
|
|
8
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
9
|
+
const schemas = loadSchemas();
|
|
10
|
+
return {
|
|
11
|
+
tools: schemas.map((s) => ({
|
|
12
|
+
name: s.name,
|
|
13
|
+
description: s.description,
|
|
14
|
+
inputSchema: s.inputSchema,
|
|
15
|
+
})),
|
|
16
|
+
};
|
|
17
|
+
});
|
|
18
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
19
|
+
const { name, arguments: args } = request.params;
|
|
20
|
+
return handleToolCall(name, args, auth);
|
|
21
|
+
});
|
|
22
|
+
return server;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/core/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AACnG,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAoB,MAAM,WAAW,CAAC;AAE1D,MAAM,UAAU,YAAY,CAAC,OAAoB,WAAW;IAC1D,MAAM,MAAM,GAAG,IAAI,MAAM,CACvB,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,OAAO,EAAE,EAC5C,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,CAChC,CAAC;IAEF,MAAM,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QAC1D,MAAM,OAAO,GAAG,WAAW,EAAE,CAAC;QAC9B,OAAO;YACL,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBACzB,IAAI,EAAE,CAAC,CAAC,IAAI;gBACZ,WAAW,EAAE,CAAC,CAAC,WAAW;gBAC1B,WAAW,EAAE,CAAC,CAAC,WAAW;aAC3B,CAAC,CAAC;SACJ,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,iBAAiB,CAAC,qBAAqB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;QAChE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC;QACjD,OAAO,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { execute, ApiError } from '../core/api-client.js';
|
|
4
|
+
import { getApiKey } from '../core/auth.js';
|
|
5
|
+
import { loadSchemas } from '../core/schema.js';
|
|
6
|
+
function jsonSchemaPropertyToZod(prop) {
|
|
7
|
+
switch (prop.type) {
|
|
8
|
+
case 'string':
|
|
9
|
+
return z.string();
|
|
10
|
+
case 'integer':
|
|
11
|
+
return z.number().int();
|
|
12
|
+
case 'number':
|
|
13
|
+
return z.number();
|
|
14
|
+
case 'boolean':
|
|
15
|
+
return z.boolean();
|
|
16
|
+
case 'array': {
|
|
17
|
+
const items = prop.items ? jsonSchemaPropertyToZod(prop.items) : z.unknown();
|
|
18
|
+
return z.array(items);
|
|
19
|
+
}
|
|
20
|
+
case 'object': {
|
|
21
|
+
if (prop.properties) {
|
|
22
|
+
const required = new Set(prop.required ?? []);
|
|
23
|
+
const shape = {};
|
|
24
|
+
for (const [k, v] of Object.entries(prop.properties)) {
|
|
25
|
+
shape[k] = required.has(k) ? jsonSchemaPropertyToZod(v) : jsonSchemaPropertyToZod(v).optional();
|
|
26
|
+
}
|
|
27
|
+
return z.object(shape).passthrough();
|
|
28
|
+
}
|
|
29
|
+
return z.record(z.string(), z.unknown());
|
|
30
|
+
}
|
|
31
|
+
default:
|
|
32
|
+
return z.unknown();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function buildZodSchema(schema) {
|
|
36
|
+
const required = new Set(schema.required ?? []);
|
|
37
|
+
const shape = {};
|
|
38
|
+
for (const [key, prop] of Object.entries(schema.properties)) {
|
|
39
|
+
const zType = jsonSchemaPropertyToZod(prop);
|
|
40
|
+
shape[key] = required.has(key) ? zType : zType.optional();
|
|
41
|
+
}
|
|
42
|
+
return z.object(shape);
|
|
43
|
+
}
|
|
44
|
+
export async function handleToolCall(name, args, ctx) {
|
|
45
|
+
const schemas = loadSchemas();
|
|
46
|
+
const schema = schemas.find((s) => s.name === name);
|
|
47
|
+
if (!schema) {
|
|
48
|
+
throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
|
|
49
|
+
}
|
|
50
|
+
const zodSchema = buildZodSchema(schema.inputSchema);
|
|
51
|
+
const parsed = zodSchema.safeParse(args ?? {});
|
|
52
|
+
if (!parsed.success) {
|
|
53
|
+
const message = parsed.error.issues
|
|
54
|
+
.map((i) => `${i.path.join('.') || '<root>'}: ${i.message}`)
|
|
55
|
+
.join('; ');
|
|
56
|
+
throw new McpError(ErrorCode.InvalidParams, `Invalid arguments: ${message}`);
|
|
57
|
+
}
|
|
58
|
+
const validatedArgs = parsed.data;
|
|
59
|
+
const apikey = await getApiKey(ctx);
|
|
60
|
+
let result;
|
|
61
|
+
try {
|
|
62
|
+
result = await execute(schema, validatedArgs, apikey);
|
|
63
|
+
}
|
|
64
|
+
catch (err) {
|
|
65
|
+
if (err instanceof ApiError) {
|
|
66
|
+
throw new McpError(-32000, err.message);
|
|
67
|
+
}
|
|
68
|
+
throw err;
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/tools/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAoB,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAA2B,MAAM,mBAAmB,CAAC;AAEzE,SAAS,uBAAuB,CAAC,IAAwB;IACvD,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;QAClB,KAAK,QAAQ;YACX,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC;QACpB,KAAK,SAAS;YACZ,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC;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C,OAAO,EAAE,CAAC;aAC3D,IAAI,CAAC,IAAI,CAAC,CAAC;QACd,MAAM,IAAI,QAAQ,CAAC,SAAS,CAAC,aAAa,EAAE,sBAAsB,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;IAED,MAAM,aAAa,GAAG,MAAM,CAAC,IAA+B,CAAC;IAC7D,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,GAAG,CAAC,CAAC;IAEpC,IAAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,GAAG,MAAM,OAAO,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC;IACxD,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,GAAG,YAAY,QAAQ,EAAE,CAAC;YAC5B,MAAM,IAAI,QAAQ,CAAC,CAAC,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;QAC1C,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC;IAED,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;KACnE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
3
|
+
import { createServer } from '../core/server.js';
|
|
4
|
+
import { readFileSync } from 'node:fs';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
import { dirname, resolve } from 'node:path';
|
|
7
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
function getVersion() {
|
|
9
|
+
try {
|
|
10
|
+
const pkg = JSON.parse(readFileSync(resolve(__dirname, '../../package.json'), 'utf8'));
|
|
11
|
+
return pkg.version;
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
return 'unknown';
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
const HELP = `boomstream-mcp — Boomstream API MCP server
|
|
18
|
+
|
|
19
|
+
Usage:
|
|
20
|
+
boomstream-mcp [stdio] Start MCP server (stdio transport)
|
|
21
|
+
boomstream-mcp --version, -v Print version
|
|
22
|
+
boomstream-mcp --help, -h Show this help
|
|
23
|
+
|
|
24
|
+
Claude Desktop config:
|
|
25
|
+
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
|
|
26
|
+
Windows: %APPDATA%\\Claude\\claude_desktop_config.json
|
|
27
|
+
Linux: ~/.config/Claude/claude_desktop_config.json
|
|
28
|
+
|
|
29
|
+
{
|
|
30
|
+
"mcpServers": {
|
|
31
|
+
"boomstream": {
|
|
32
|
+
"command": "npx",
|
|
33
|
+
"args": ["-y", "@boomstream/mcp", "stdio"],
|
|
34
|
+
"env": { "BOOMSTREAM_API_KEY": "your-api-key" }
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
Environment:
|
|
40
|
+
BOOMSTREAM_API_KEY Your Boomstream API key (required)`.trim();
|
|
41
|
+
const [cmd] = process.argv.slice(2);
|
|
42
|
+
if (cmd === '--version' || cmd === '-v') {
|
|
43
|
+
process.stdout.write(getVersion() + '\n');
|
|
44
|
+
process.exit(0);
|
|
45
|
+
}
|
|
46
|
+
if (cmd === '--help' || cmd === '-h') {
|
|
47
|
+
process.stdout.write(HELP + '\n');
|
|
48
|
+
process.exit(0);
|
|
49
|
+
}
|
|
50
|
+
if (cmd !== undefined && cmd !== 'stdio') {
|
|
51
|
+
process.stderr.write(`Unknown command: ${cmd}\n`);
|
|
52
|
+
process.stderr.write('Run with --help for usage.\n');
|
|
53
|
+
process.exit(1);
|
|
54
|
+
}
|
|
55
|
+
if (!process.env.BOOMSTREAM_API_KEY) {
|
|
56
|
+
process.stderr.write('Error: BOOMSTREAM_API_KEY environment variable is not set.\n' +
|
|
57
|
+
'Set it to your Boomstream API key and retry.\n' +
|
|
58
|
+
'Example: BOOMSTREAM_API_KEY=your-key npx @boomstream/mcp stdio\n');
|
|
59
|
+
process.exit(1);
|
|
60
|
+
}
|
|
61
|
+
const server = createServer();
|
|
62
|
+
const transport = new StdioServerTransport();
|
|
63
|
+
await server.connect(transport);
|
|
64
|
+
//# sourceMappingURL=stdio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stdio.js","sourceRoot":"","sources":["../../src/transports/stdio.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE7C,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE1D,SAAS,UAAU;IACjB,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CACpB,YAAY,CAAC,OAAO,CAAC,SAAS,EAAE,oBAAoB,CAAC,EAAE,MAAM,CAAC,CACxC,CAAC;QACzB,OAAO,GAAG,CAAC,OAAO,CAAC;IACrB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED,MAAM,IAAI,GAAG;;;;;;;;;;;;;;;;;;;;;;;0DAuB6C,CAAC,IAAI,EAAE,CAAC;AAElE,MAAM,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAEpC,IAAI,GAAG,KAAK,WAAW,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;IACxC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,EAAE,GAAG,IAAI,CAAC,CAAC;IAC1C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,IAAI,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;IACrC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;IAClC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,OAAO,EAAE,CAAC;IACzC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC;IAClD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC;IACrD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,CAAC;IACpC,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,8DAA8D;QAC5D,gDAAgD;QAChD,kEAAkE,CACrE,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;AAC9B,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@boomstream/mcp",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "MCP server providing Boomstream API as tools for LLM agents",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=20"
|
|
9
|
+
},
|
|
10
|
+
"sideEffects": false,
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public"
|
|
13
|
+
},
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://gitlab.boomstream.com/boomstream-ai/boomstream-mcp.git"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"schemas",
|
|
21
|
+
"README.md",
|
|
22
|
+
"LICENSE"
|
|
23
|
+
],
|
|
24
|
+
"bin": {
|
|
25
|
+
"boomstream-mcp": "dist/transports/stdio.js"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
29
|
+
"fast-xml-parser": "^5.8.0",
|
|
30
|
+
"pino": "^10.3.1",
|
|
31
|
+
"zod": "^4.4.3"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/node": "^25.9.1",
|
|
35
|
+
"@typescript-eslint/eslint-plugin": "^8.60.0",
|
|
36
|
+
"@typescript-eslint/parser": "^8.60.0",
|
|
37
|
+
"eslint": "^10.4.0",
|
|
38
|
+
"mysql2": "^3.11.5",
|
|
39
|
+
"tsx": "^4.22.3",
|
|
40
|
+
"typescript": "^6.0.3",
|
|
41
|
+
"vitest": "^3.2.3"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "tsc",
|
|
45
|
+
"postbuild": "node scripts/post-build.mjs",
|
|
46
|
+
"build-schema": "node scripts/build-schema.mjs",
|
|
47
|
+
"build-schema:dry": "node scripts/build-schema.mjs --dry-run",
|
|
48
|
+
"build-schema:db": "node scripts/build-schema.mjs --from-db",
|
|
49
|
+
"dev:stdio": "tsx src/transports/stdio.ts",
|
|
50
|
+
"dev:sse": "tsx src/transports/sse.ts",
|
|
51
|
+
"test": "vitest run",
|
|
52
|
+
"test:watch": "vitest",
|
|
53
|
+
"test:smoke": "echo 'TBD: requires BOOMSTREAM_API_KEY'",
|
|
54
|
+
"lint": "eslint .",
|
|
55
|
+
"typecheck": "tsc --noEmit"
|
|
56
|
+
}
|
|
57
|
+
}
|
package/schemas/.gitkeep
ADDED
|
File without changes
|