@bluehive/sdk-mcp 0.1.0-alpha.2
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 +201 -0
- package/README.md +188 -0
- package/compat.d.mts +56 -0
- package/compat.d.mts.map +1 -0
- package/compat.d.ts +56 -0
- package/compat.d.ts.map +1 -0
- package/compat.js +382 -0
- package/compat.js.map +1 -0
- package/compat.mjs +373 -0
- package/compat.mjs.map +1 -0
- package/dynamic-tools.d.mts +12 -0
- package/dynamic-tools.d.mts.map +1 -0
- package/dynamic-tools.d.ts +12 -0
- package/dynamic-tools.d.ts.map +1 -0
- package/dynamic-tools.js +135 -0
- package/dynamic-tools.js.map +1 -0
- package/dynamic-tools.mjs +132 -0
- package/dynamic-tools.mjs.map +1 -0
- package/index.d.mts +3 -0
- package/index.d.mts.map +1 -0
- package/index.d.ts +3 -0
- package/index.d.ts.map +1 -0
- package/index.js +86 -0
- package/index.js.map +1 -0
- package/index.mjs +84 -0
- package/index.mjs.map +1 -0
- package/options.d.mts +14 -0
- package/options.d.mts.map +1 -0
- package/options.d.ts +14 -0
- package/options.d.ts.map +1 -0
- package/options.js +296 -0
- package/options.js.map +1 -0
- package/options.mjs +290 -0
- package/options.mjs.map +1 -0
- package/package.json +121 -0
- package/server.d.mts +47 -0
- package/server.d.mts.map +1 -0
- package/server.d.ts +47 -0
- package/server.d.ts.map +1 -0
- package/server.js +114 -0
- package/server.js.map +1 -0
- package/server.mjs +101 -0
- package/server.mjs.map +1 -0
- package/src/compat.ts +478 -0
- package/src/dynamic-tools.ts +153 -0
- package/src/index.ts +104 -0
- package/src/options.ts +319 -0
- package/src/server.ts +145 -0
- package/src/tools/database/check-health-database.ts +31 -0
- package/src/tools/fax/list-providers-fax.ts +31 -0
- package/src/tools/fax/retrieve-status-fax.ts +36 -0
- package/src/tools/fax/send-fax.ts +76 -0
- package/src/tools/health/check-health.ts +31 -0
- package/src/tools/index.ts +83 -0
- package/src/tools/providers/lookup-providers.ts +49 -0
- package/src/tools/types.ts +103 -0
- package/src/tools/version/retrieve-version.ts +31 -0
- package/src/tools.ts +1 -0
- package/src/tsconfig.json +11 -0
- package/tools/database/check-health-database.d.mts +45 -0
- package/tools/database/check-health-database.d.mts.map +1 -0
- package/tools/database/check-health-database.d.ts +45 -0
- package/tools/database/check-health-database.d.ts.map +1 -0
- package/tools/database/check-health-database.js +27 -0
- package/tools/database/check-health-database.js.map +1 -0
- package/tools/database/check-health-database.mjs +23 -0
- package/tools/database/check-health-database.mjs.map +1 -0
- package/tools/fax/list-providers-fax.d.mts +45 -0
- package/tools/fax/list-providers-fax.d.mts.map +1 -0
- package/tools/fax/list-providers-fax.d.ts +45 -0
- package/tools/fax/list-providers-fax.d.ts.map +1 -0
- package/tools/fax/list-providers-fax.js +27 -0
- package/tools/fax/list-providers-fax.js.map +1 -0
- package/tools/fax/list-providers-fax.mjs +23 -0
- package/tools/fax/list-providers-fax.mjs.map +1 -0
- package/tools/fax/retrieve-status-fax.d.mts +45 -0
- package/tools/fax/retrieve-status-fax.d.mts.map +1 -0
- package/tools/fax/retrieve-status-fax.d.ts +45 -0
- package/tools/fax/retrieve-status-fax.d.ts.map +1 -0
- package/tools/fax/retrieve-status-fax.js +32 -0
- package/tools/fax/retrieve-status-fax.js.map +1 -0
- package/tools/fax/retrieve-status-fax.mjs +28 -0
- package/tools/fax/retrieve-status-fax.mjs.map +1 -0
- package/tools/fax/send-fax.d.mts +45 -0
- package/tools/fax/send-fax.d.mts.map +1 -0
- package/tools/fax/send-fax.d.ts +45 -0
- package/tools/fax/send-fax.d.ts.map +1 -0
- package/tools/fax/send-fax.js +72 -0
- package/tools/fax/send-fax.js.map +1 -0
- package/tools/fax/send-fax.mjs +68 -0
- package/tools/fax/send-fax.mjs.map +1 -0
- package/tools/health/check-health.d.mts +45 -0
- package/tools/health/check-health.d.mts.map +1 -0
- package/tools/health/check-health.d.ts +45 -0
- package/tools/health/check-health.d.ts.map +1 -0
- package/tools/health/check-health.js +27 -0
- package/tools/health/check-health.js.map +1 -0
- package/tools/health/check-health.mjs +23 -0
- package/tools/health/check-health.mjs.map +1 -0
- package/tools/index.d.mts +10 -0
- package/tools/index.d.mts.map +1 -0
- package/tools/index.d.ts +10 -0
- package/tools/index.d.ts.map +1 -0
- package/tools/index.js +67 -0
- package/tools/index.js.map +1 -0
- package/tools/index.mjs +60 -0
- package/tools/index.mjs.map +1 -0
- package/tools/providers/lookup-providers.d.mts +45 -0
- package/tools/providers/lookup-providers.d.mts.map +1 -0
- package/tools/providers/lookup-providers.d.ts +45 -0
- package/tools/providers/lookup-providers.d.ts.map +1 -0
- package/tools/providers/lookup-providers.js +45 -0
- package/tools/providers/lookup-providers.js.map +1 -0
- package/tools/providers/lookup-providers.mjs +41 -0
- package/tools/providers/lookup-providers.mjs.map +1 -0
- package/tools/types.d.mts +51 -0
- package/tools/types.d.mts.map +1 -0
- package/tools/types.d.ts +51 -0
- package/tools/types.d.ts.map +1 -0
- package/tools/types.js +46 -0
- package/tools/types.js.map +1 -0
- package/tools/types.mjs +42 -0
- package/tools/types.mjs.map +1 -0
- package/tools/version/retrieve-version.d.mts +45 -0
- package/tools/version/retrieve-version.d.mts.map +1 -0
- package/tools/version/retrieve-version.d.ts +45 -0
- package/tools/version/retrieve-version.d.ts.map +1 -0
- package/tools/version/retrieve-version.js +27 -0
- package/tools/version/retrieve-version.js.map +1 -0
- package/tools/version/retrieve-version.mjs +23 -0
- package/tools/version/retrieve-version.mjs.map +1 -0
- package/tools.d.mts +2 -0
- package/tools.d.mts.map +1 -0
- package/tools.d.ts +2 -0
- package/tools.d.ts.map +1 -0
- package/tools.js +18 -0
- package/tools.js.map +1 -0
- package/tools.mjs +2 -0
- package/tools.mjs.map +1 -0
package/package.json
ADDED
@@ -0,0 +1,121 @@
|
|
1
|
+
{
|
2
|
+
"name": "@bluehive/sdk-mcp",
|
3
|
+
"version": "0.1.0-alpha.2",
|
4
|
+
"description": "The official MCP Server for the BlueHive API",
|
5
|
+
"author": "BlueHive <wreiske@bluehive.com>",
|
6
|
+
"types": "./index.d.ts",
|
7
|
+
"main": "./index.js",
|
8
|
+
"type": "commonjs",
|
9
|
+
"repository": {
|
10
|
+
"type": "git",
|
11
|
+
"url": "git+https://github.com/bluehive-health/bluehive-sdk-typescript.git",
|
12
|
+
"directory": "packages/mcp-server"
|
13
|
+
},
|
14
|
+
"homepage": "https://github.com/bluehive-health/bluehive-sdk-typescript/tree/main/packages/mcp-server#readme",
|
15
|
+
"license": "Apache-2.0",
|
16
|
+
"packageManager": "yarn@1.22.22",
|
17
|
+
"private": false,
|
18
|
+
"scripts": {
|
19
|
+
"test": "jest",
|
20
|
+
"build": "bash ./build",
|
21
|
+
"format": "prettier --write --cache --cache-strategy metadata . !dist",
|
22
|
+
"tsn": "ts-node -r tsconfig-paths/register",
|
23
|
+
"lint": "eslint --ext ts,js .",
|
24
|
+
"fix": "eslint --fix --ext ts,js ."
|
25
|
+
},
|
26
|
+
"dependencies": {
|
27
|
+
"@bluehive/sdk": "^0.1.0-alpha.2",
|
28
|
+
"@modelcontextprotocol/sdk": "^1.11.5",
|
29
|
+
"yargs": "^17.7.2",
|
30
|
+
"@cloudflare/cabidela": "^0.2.4",
|
31
|
+
"zod": "^3.25.20",
|
32
|
+
"zod-to-json-schema": "^3.24.5"
|
33
|
+
},
|
34
|
+
"bin": {
|
35
|
+
"mcp-server": "./index.js"
|
36
|
+
},
|
37
|
+
"imports": {
|
38
|
+
"@bluehive/sdk-mcp": ".",
|
39
|
+
"@bluehive/sdk-mcp/*": "./src/*"
|
40
|
+
},
|
41
|
+
"exports": {
|
42
|
+
".": {
|
43
|
+
"require": {
|
44
|
+
"types": "./index.d.ts",
|
45
|
+
"default": "./index.js"
|
46
|
+
},
|
47
|
+
"types": "./index.d.mts",
|
48
|
+
"default": "./index.mjs"
|
49
|
+
},
|
50
|
+
"./compat": {
|
51
|
+
"import": "./compat.mjs",
|
52
|
+
"require": "./compat.js"
|
53
|
+
},
|
54
|
+
"./compat.js": {
|
55
|
+
"default": "./compat.js"
|
56
|
+
},
|
57
|
+
"./compat.mjs": {
|
58
|
+
"default": "./compat.mjs"
|
59
|
+
},
|
60
|
+
"./dynamic-tools": {
|
61
|
+
"import": "./dynamic-tools.mjs",
|
62
|
+
"require": "./dynamic-tools.js"
|
63
|
+
},
|
64
|
+
"./dynamic-tools.js": {
|
65
|
+
"default": "./dynamic-tools.js"
|
66
|
+
},
|
67
|
+
"./dynamic-tools.mjs": {
|
68
|
+
"default": "./dynamic-tools.mjs"
|
69
|
+
},
|
70
|
+
"./index": {
|
71
|
+
"import": "./index.mjs",
|
72
|
+
"require": "./index.js"
|
73
|
+
},
|
74
|
+
"./index.js": {
|
75
|
+
"default": "./index.js"
|
76
|
+
},
|
77
|
+
"./index.mjs": {
|
78
|
+
"default": "./index.mjs"
|
79
|
+
},
|
80
|
+
"./options": {
|
81
|
+
"import": "./options.mjs",
|
82
|
+
"require": "./options.js"
|
83
|
+
},
|
84
|
+
"./options.js": {
|
85
|
+
"default": "./options.js"
|
86
|
+
},
|
87
|
+
"./options.mjs": {
|
88
|
+
"default": "./options.mjs"
|
89
|
+
},
|
90
|
+
"./server": {
|
91
|
+
"import": "./server.mjs",
|
92
|
+
"require": "./server.js"
|
93
|
+
},
|
94
|
+
"./server.js": {
|
95
|
+
"default": "./server.js"
|
96
|
+
},
|
97
|
+
"./server.mjs": {
|
98
|
+
"default": "./server.mjs"
|
99
|
+
},
|
100
|
+
"./tools/*.mjs": {
|
101
|
+
"default": "./tools/*.mjs"
|
102
|
+
},
|
103
|
+
"./tools/*.js": {
|
104
|
+
"default": "./tools/*.js"
|
105
|
+
},
|
106
|
+
"./tools/*": {
|
107
|
+
"import": "./tools/*.mjs",
|
108
|
+
"require": "./tools/*.js"
|
109
|
+
},
|
110
|
+
"./tools": {
|
111
|
+
"import": "./tools.mjs",
|
112
|
+
"require": "./tools.js"
|
113
|
+
},
|
114
|
+
"./tools.js": {
|
115
|
+
"default": "./tools.js"
|
116
|
+
},
|
117
|
+
"./tools.mjs": {
|
118
|
+
"default": "./tools.mjs"
|
119
|
+
}
|
120
|
+
}
|
121
|
+
}
|
package/server.d.mts
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
2
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
3
|
+
import { Endpoint, HandlerFunction } from "./tools.mjs";
|
4
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
5
|
+
import { ClientOptions } from '@bluehive/sdk';
|
6
|
+
import BlueHive from '@bluehive/sdk';
|
7
|
+
import { ClientCapabilities } from "./compat.mjs";
|
8
|
+
import { McpOptions } from "./options.mjs";
|
9
|
+
export { McpOptions } from "./options.mjs";
|
10
|
+
export { ClientType } from "./compat.mjs";
|
11
|
+
export { Filter } from "./tools.mjs";
|
12
|
+
export { ClientOptions } from '@bluehive/sdk';
|
13
|
+
export { endpoints } from "./tools.mjs";
|
14
|
+
export declare const server: McpServer;
|
15
|
+
/**
|
16
|
+
* Initializes the provided MCP Server with the given tools and handlers.
|
17
|
+
* If not provided, the default client, tools and handlers will be used.
|
18
|
+
*/
|
19
|
+
export declare function initMcpServer(params: {
|
20
|
+
server: Server | McpServer;
|
21
|
+
clientOptions: ClientOptions;
|
22
|
+
mcpOptions: McpOptions;
|
23
|
+
endpoints?: {
|
24
|
+
tool: Tool;
|
25
|
+
handler: HandlerFunction;
|
26
|
+
}[];
|
27
|
+
}): void;
|
28
|
+
export declare function init(params: {
|
29
|
+
server: Server | McpServer;
|
30
|
+
client?: BlueHive;
|
31
|
+
endpoints?: {
|
32
|
+
tool: Tool;
|
33
|
+
handler: HandlerFunction;
|
34
|
+
}[];
|
35
|
+
capabilities?: Partial<ClientCapabilities>;
|
36
|
+
}): void;
|
37
|
+
/**
|
38
|
+
* Selects the tools to include in the MCP Server based on the provided options.
|
39
|
+
*/
|
40
|
+
export declare function selectTools(endpoints: Endpoint[], options: McpOptions): Endpoint[];
|
41
|
+
/**
|
42
|
+
* Runs the provided handler with the given client and arguments.
|
43
|
+
*/
|
44
|
+
export declare function executeHandler(tool: Tool, handler: HandlerFunction, client: BlueHive, args: Record<string, unknown> | undefined, compatibilityOptions?: Partial<ClientCapabilities>): Promise<import("./tools/types").ToolCallResult>;
|
45
|
+
export declare const readEnv: (env: string) => string | undefined;
|
46
|
+
export declare const readEnvOrError: (env: string) => string;
|
47
|
+
//# sourceMappingURL=server.d.mts.map
|
package/server.d.mts.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"server.d.mts","sourceRoot":"","sources":["src/server.ts"],"names":[],"mappings":"OAEO,EAAE,MAAM,EAAE,MAAM,2CAA2C;OAC3D,EAAE,SAAS,EAAE,MAAM,yCAAyC;OAC5D,EAAE,QAAQ,EAAa,eAAe,EAAS;OAC/C,EAAiD,IAAI,EAAE,MAAM,oCAAoC;OACjG,EAAE,aAAa,EAAE,MAAM,eAAe;OACtC,QAAQ,MAAM,eAAe;OAC7B,EAEL,kBAAkB,EAInB;OAEM,EAAE,UAAU,EAAE;OAEd,EAAE,UAAU,EAAE;OACd,EAAE,UAAU,EAAE;OACd,EAAE,MAAM,EAAE;OACV,EAAE,aAAa,EAAE,MAAM,eAAe;OACtC,EAAE,SAAS,EAAE;AAGpB,eAAO,MAAM,MAAM,WAUlB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE;IACpC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,aAAa,EAAE,aAAa,CAAC;IAC7B,UAAU,EAAE,UAAU,CAAC;IACvB,SAAS,CAAC,EAAE;QAAE,IAAI,EAAE,IAAI,CAAC;QAAC,OAAO,EAAE,eAAe,CAAA;KAAE,EAAE,CAAC;CACxD,QAQA;AAED,wBAAgB,IAAI,CAAC,MAAM,EAAE;IAC3B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,QAAQ,CAAC;IAClB,SAAS,CAAC,EAAE;QAAE,IAAI,EAAE,IAAI,CAAC;QAAC,OAAO,EAAE,eAAe,CAAA;KAAE,EAAE,CAAC;IACvD,YAAY,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAC5C,QAuBA;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,UAAU,cAqBrE;AAED;;GAEG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,eAAe,EACxB,MAAM,EAAE,QAAQ,EAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EACzC,oBAAoB,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,mDAOnD;AAED,eAAO,MAAM,OAAO,GAAI,KAAK,MAAM,KAAG,MAAM,GAAG,SAO9C,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,KAAK,MAAM,KAAG,MAM5C,CAAC"}
|
package/server.d.ts
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
2
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
3
|
+
import { Endpoint, HandlerFunction } from "./tools.js";
|
4
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
5
|
+
import { ClientOptions } from '@bluehive/sdk';
|
6
|
+
import BlueHive from '@bluehive/sdk';
|
7
|
+
import { ClientCapabilities } from "./compat.js";
|
8
|
+
import { McpOptions } from "./options.js";
|
9
|
+
export { McpOptions } from "./options.js";
|
10
|
+
export { ClientType } from "./compat.js";
|
11
|
+
export { Filter } from "./tools.js";
|
12
|
+
export { ClientOptions } from '@bluehive/sdk';
|
13
|
+
export { endpoints } from "./tools.js";
|
14
|
+
export declare const server: McpServer;
|
15
|
+
/**
|
16
|
+
* Initializes the provided MCP Server with the given tools and handlers.
|
17
|
+
* If not provided, the default client, tools and handlers will be used.
|
18
|
+
*/
|
19
|
+
export declare function initMcpServer(params: {
|
20
|
+
server: Server | McpServer;
|
21
|
+
clientOptions: ClientOptions;
|
22
|
+
mcpOptions: McpOptions;
|
23
|
+
endpoints?: {
|
24
|
+
tool: Tool;
|
25
|
+
handler: HandlerFunction;
|
26
|
+
}[];
|
27
|
+
}): void;
|
28
|
+
export declare function init(params: {
|
29
|
+
server: Server | McpServer;
|
30
|
+
client?: BlueHive;
|
31
|
+
endpoints?: {
|
32
|
+
tool: Tool;
|
33
|
+
handler: HandlerFunction;
|
34
|
+
}[];
|
35
|
+
capabilities?: Partial<ClientCapabilities>;
|
36
|
+
}): void;
|
37
|
+
/**
|
38
|
+
* Selects the tools to include in the MCP Server based on the provided options.
|
39
|
+
*/
|
40
|
+
export declare function selectTools(endpoints: Endpoint[], options: McpOptions): Endpoint[];
|
41
|
+
/**
|
42
|
+
* Runs the provided handler with the given client and arguments.
|
43
|
+
*/
|
44
|
+
export declare function executeHandler(tool: Tool, handler: HandlerFunction, client: BlueHive, args: Record<string, unknown> | undefined, compatibilityOptions?: Partial<ClientCapabilities>): Promise<import("./tools/types").ToolCallResult>;
|
45
|
+
export declare const readEnv: (env: string) => string | undefined;
|
46
|
+
export declare const readEnvOrError: (env: string) => string;
|
47
|
+
//# sourceMappingURL=server.d.ts.map
|
package/server.d.ts.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["src/server.ts"],"names":[],"mappings":"OAEO,EAAE,MAAM,EAAE,MAAM,2CAA2C;OAC3D,EAAE,SAAS,EAAE,MAAM,yCAAyC;OAC5D,EAAE,QAAQ,EAAa,eAAe,EAAS;OAC/C,EAAiD,IAAI,EAAE,MAAM,oCAAoC;OACjG,EAAE,aAAa,EAAE,MAAM,eAAe;OACtC,QAAQ,MAAM,eAAe;OAC7B,EAEL,kBAAkB,EAInB;OAEM,EAAE,UAAU,EAAE;OAEd,EAAE,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";
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
5
|
+
};
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
7
|
+
exports.readEnvOrError = exports.readEnv = exports.server = exports.endpoints = void 0;
|
8
|
+
exports.initMcpServer = initMcpServer;
|
9
|
+
exports.init = init;
|
10
|
+
exports.selectTools = selectTools;
|
11
|
+
exports.executeHandler = executeHandler;
|
12
|
+
const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
|
13
|
+
const tools_1 = require("./tools.js");
|
14
|
+
const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
|
15
|
+
const sdk_1 = __importDefault(require("@bluehive/sdk"));
|
16
|
+
const compat_1 = require("./compat.js");
|
17
|
+
const dynamic_tools_1 = require("./dynamic-tools.js");
|
18
|
+
var tools_2 = require("./tools.js");
|
19
|
+
Object.defineProperty(exports, "endpoints", { enumerable: true, get: function () { return tools_2.endpoints; } });
|
20
|
+
// Create server instance
|
21
|
+
exports.server = new mcp_js_1.McpServer({
|
22
|
+
name: 'blue_hive_sdk_api',
|
23
|
+
version: '0.1.0-alpha.2',
|
24
|
+
}, {
|
25
|
+
capabilities: {
|
26
|
+
tools: {},
|
27
|
+
},
|
28
|
+
});
|
29
|
+
/**
|
30
|
+
* Initializes the provided MCP Server with the given tools and handlers.
|
31
|
+
* If not provided, the default client, tools and handlers will be used.
|
32
|
+
*/
|
33
|
+
function initMcpServer(params) {
|
34
|
+
const transformedEndpoints = selectTools(tools_1.endpoints, params.mcpOptions);
|
35
|
+
const client = new sdk_1.default(params.clientOptions);
|
36
|
+
const capabilities = {
|
37
|
+
...compat_1.defaultClientCapabilities,
|
38
|
+
...(params.mcpOptions.client ? compat_1.knownClients[params.mcpOptions.client] : params.mcpOptions.capabilities),
|
39
|
+
};
|
40
|
+
init({ server: params.server, client, endpoints: transformedEndpoints, capabilities });
|
41
|
+
}
|
42
|
+
function init(params) {
|
43
|
+
const server = params.server instanceof mcp_js_1.McpServer ? params.server.server : params.server;
|
44
|
+
const providedEndpoints = params.endpoints || tools_1.endpoints;
|
45
|
+
const endpointMap = Object.fromEntries(providedEndpoints.map((endpoint) => [endpoint.tool.name, endpoint]));
|
46
|
+
const client = params.client || new sdk_1.default({ defaultHeaders: { 'X-Stainless-MCP': 'true' } });
|
47
|
+
server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => {
|
48
|
+
return {
|
49
|
+
tools: providedEndpoints.map((endpoint) => endpoint.tool),
|
50
|
+
};
|
51
|
+
});
|
52
|
+
server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
|
53
|
+
const { name, arguments: args } = request.params;
|
54
|
+
const endpoint = endpointMap[name];
|
55
|
+
if (!endpoint) {
|
56
|
+
throw new Error(`Unknown tool: ${name}`);
|
57
|
+
}
|
58
|
+
return executeHandler(endpoint.tool, endpoint.handler, client, args, params.capabilities);
|
59
|
+
});
|
60
|
+
}
|
61
|
+
/**
|
62
|
+
* Selects the tools to include in the MCP Server based on the provided options.
|
63
|
+
*/
|
64
|
+
function selectTools(endpoints, options) {
|
65
|
+
const filteredEndpoints = (0, tools_1.query)(options.filters, endpoints);
|
66
|
+
let includedTools = filteredEndpoints;
|
67
|
+
if (includedTools.length > 0) {
|
68
|
+
if (options.includeDynamicTools) {
|
69
|
+
includedTools = (0, dynamic_tools_1.dynamicTools)(includedTools);
|
70
|
+
}
|
71
|
+
}
|
72
|
+
else {
|
73
|
+
if (options.includeAllTools) {
|
74
|
+
includedTools = endpoints;
|
75
|
+
}
|
76
|
+
else if (options.includeDynamicTools) {
|
77
|
+
includedTools = (0, dynamic_tools_1.dynamicTools)(endpoints);
|
78
|
+
}
|
79
|
+
else {
|
80
|
+
includedTools = endpoints;
|
81
|
+
}
|
82
|
+
}
|
83
|
+
const capabilities = { ...compat_1.defaultClientCapabilities, ...options.capabilities };
|
84
|
+
return (0, compat_1.applyCompatibilityTransformations)(includedTools, capabilities);
|
85
|
+
}
|
86
|
+
/**
|
87
|
+
* Runs the provided handler with the given client and arguments.
|
88
|
+
*/
|
89
|
+
async function executeHandler(tool, handler, client, args, compatibilityOptions) {
|
90
|
+
const options = { ...compat_1.defaultClientCapabilities, ...compatibilityOptions };
|
91
|
+
if (options.validJson && args) {
|
92
|
+
args = (0, compat_1.parseEmbeddedJSON)(args, tool.inputSchema);
|
93
|
+
}
|
94
|
+
return await handler(client, args || {});
|
95
|
+
}
|
96
|
+
const readEnv = (env) => {
|
97
|
+
if (typeof globalThis.process !== 'undefined') {
|
98
|
+
return globalThis.process.env?.[env]?.trim();
|
99
|
+
}
|
100
|
+
else if (typeof globalThis.Deno !== 'undefined') {
|
101
|
+
return globalThis.Deno.env?.get?.(env)?.trim();
|
102
|
+
}
|
103
|
+
return;
|
104
|
+
};
|
105
|
+
exports.readEnv = readEnv;
|
106
|
+
const readEnvOrError = (env) => {
|
107
|
+
let envValue = (0, exports.readEnv)(env);
|
108
|
+
if (envValue === undefined) {
|
109
|
+
throw new Error(`Environment variable ${env} is not set`);
|
110
|
+
}
|
111
|
+
return envValue;
|
112
|
+
};
|
113
|
+
exports.readEnvOrError = readEnvOrError;
|
114
|
+
//# sourceMappingURL=server.js.map
|
package/server.js.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["src/server.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;AAyCtF,sCAaC;AAED,oBA4BC;AAKD,kCAqBC;AAKD,wCAYC;AA5HD,oEAAoE;AACpE,sCAAsE;AACtE,iEAAyG;AAEzG,wDAAqC;AACrC,wCAMkB;AAClB,sDAA+C;AAO/C,oCAAoC;AAA3B,kGAAA,SAAS,OAAA;AAElB,yBAAyB;AACZ,QAAA,MAAM,GAAG,IAAI,kBAAS,CACjC;IACE,IAAI,EAAE,mBAAmB;IACzB,OAAO,EAAE,eAAe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,SAAS,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,wBAAwB,GAAG,aAAa,CAAC,CAAC;IAC5D,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AANW,QAAA,cAAc,kBAMzB"}
|
package/server.mjs
ADDED
@@ -0,0 +1,101 @@
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
3
|
+
import { endpoints, query } from "./tools.mjs";
|
4
|
+
import { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js';
|
5
|
+
import BlueHive from '@bluehive/sdk';
|
6
|
+
import { applyCompatibilityTransformations, defaultClientCapabilities, knownClients, parseEmbeddedJSON, } from "./compat.mjs";
|
7
|
+
import { dynamicTools } from "./dynamic-tools.mjs";
|
8
|
+
export { endpoints } from "./tools.mjs";
|
9
|
+
// Create server instance
|
10
|
+
export const server = new McpServer({
|
11
|
+
name: 'blue_hive_sdk_api',
|
12
|
+
version: '0.1.0-alpha.2',
|
13
|
+
}, {
|
14
|
+
capabilities: {
|
15
|
+
tools: {},
|
16
|
+
},
|
17
|
+
});
|
18
|
+
/**
|
19
|
+
* Initializes the provided MCP Server with the given tools and handlers.
|
20
|
+
* If not provided, the default client, tools and handlers will be used.
|
21
|
+
*/
|
22
|
+
export function initMcpServer(params) {
|
23
|
+
const transformedEndpoints = selectTools(endpoints, params.mcpOptions);
|
24
|
+
const client = new BlueHive(params.clientOptions);
|
25
|
+
const capabilities = {
|
26
|
+
...defaultClientCapabilities,
|
27
|
+
...(params.mcpOptions.client ? knownClients[params.mcpOptions.client] : params.mcpOptions.capabilities),
|
28
|
+
};
|
29
|
+
init({ server: params.server, client, endpoints: transformedEndpoints, capabilities });
|
30
|
+
}
|
31
|
+
export function init(params) {
|
32
|
+
const server = params.server instanceof McpServer ? params.server.server : params.server;
|
33
|
+
const providedEndpoints = params.endpoints || endpoints;
|
34
|
+
const endpointMap = Object.fromEntries(providedEndpoints.map((endpoint) => [endpoint.tool.name, endpoint]));
|
35
|
+
const client = params.client || new BlueHive({ defaultHeaders: { 'X-Stainless-MCP': 'true' } });
|
36
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
37
|
+
return {
|
38
|
+
tools: providedEndpoints.map((endpoint) => endpoint.tool),
|
39
|
+
};
|
40
|
+
});
|
41
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
42
|
+
const { name, arguments: args } = request.params;
|
43
|
+
const endpoint = endpointMap[name];
|
44
|
+
if (!endpoint) {
|
45
|
+
throw new Error(`Unknown tool: ${name}`);
|
46
|
+
}
|
47
|
+
return executeHandler(endpoint.tool, endpoint.handler, client, args, params.capabilities);
|
48
|
+
});
|
49
|
+
}
|
50
|
+
/**
|
51
|
+
* Selects the tools to include in the MCP Server based on the provided options.
|
52
|
+
*/
|
53
|
+
export function selectTools(endpoints, options) {
|
54
|
+
const filteredEndpoints = query(options.filters, endpoints);
|
55
|
+
let includedTools = filteredEndpoints;
|
56
|
+
if (includedTools.length > 0) {
|
57
|
+
if (options.includeDynamicTools) {
|
58
|
+
includedTools = dynamicTools(includedTools);
|
59
|
+
}
|
60
|
+
}
|
61
|
+
else {
|
62
|
+
if (options.includeAllTools) {
|
63
|
+
includedTools = endpoints;
|
64
|
+
}
|
65
|
+
else if (options.includeDynamicTools) {
|
66
|
+
includedTools = dynamicTools(endpoints);
|
67
|
+
}
|
68
|
+
else {
|
69
|
+
includedTools = endpoints;
|
70
|
+
}
|
71
|
+
}
|
72
|
+
const capabilities = { ...defaultClientCapabilities, ...options.capabilities };
|
73
|
+
return applyCompatibilityTransformations(includedTools, capabilities);
|
74
|
+
}
|
75
|
+
/**
|
76
|
+
* Runs the provided handler with the given client and arguments.
|
77
|
+
*/
|
78
|
+
export async function executeHandler(tool, handler, client, args, compatibilityOptions) {
|
79
|
+
const options = { ...defaultClientCapabilities, ...compatibilityOptions };
|
80
|
+
if (options.validJson && args) {
|
81
|
+
args = parseEmbeddedJSON(args, tool.inputSchema);
|
82
|
+
}
|
83
|
+
return await handler(client, args || {});
|
84
|
+
}
|
85
|
+
export const readEnv = (env) => {
|
86
|
+
if (typeof globalThis.process !== 'undefined') {
|
87
|
+
return globalThis.process.env?.[env]?.trim();
|
88
|
+
}
|
89
|
+
else if (typeof globalThis.Deno !== 'undefined') {
|
90
|
+
return globalThis.Deno.env?.get?.(env)?.trim();
|
91
|
+
}
|
92
|
+
return;
|
93
|
+
};
|
94
|
+
export const readEnvOrError = (env) => {
|
95
|
+
let envValue = readEnv(env);
|
96
|
+
if (envValue === undefined) {
|
97
|
+
throw new Error(`Environment variable ${env} is not set`);
|
98
|
+
}
|
99
|
+
return envValue;
|
100
|
+
};
|
101
|
+
//# sourceMappingURL=server.mjs.map
|
package/server.mjs.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"server.mjs","sourceRoot":"","sources":["src/server.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAG/E,EAAE,SAAS,EAAE,MAAM,yCAAyC;OAC5D,EAAY,SAAS,EAAmB,KAAK,EAAE;OAC/C,EAAE,qBAAqB,EAAE,sBAAsB,EAAQ,MAAM,oCAAoC;OAEjG,QAAQ,MAAM,eAAe;OAC7B,EACL,iCAAiC,EAEjC,yBAAyB,EACzB,YAAY,EACZ,iBAAiB,GAClB;OACM,EAAE,YAAY,EAAE;OAOhB,EAAE,SAAS,EAAE;AAEpB,yBAAyB;AACzB,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,SAAS,CACjC;IACE,IAAI,EAAE,mBAAmB;IACzB,OAAO,EAAE,eAAe;CACzB,EACD;IACE,YAAY,EAAE;QACZ,KAAK,EAAE,EAAE;KACV;CACF,CACF,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,MAK7B;IACC,MAAM,oBAAoB,GAAG,WAAW,CAAC,SAAS,EAAE,MAAM,CAAC,UAAU,C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