@henrylabs/mcp 0.23.0 → 0.25.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 +3 -3
- package/code-tool.d.mts +4 -1
- package/code-tool.d.mts.map +1 -1
- package/code-tool.d.ts +4 -1
- package/code-tool.d.ts.map +1 -1
- package/code-tool.js +19 -4
- package/code-tool.js.map +1 -1
- package/code-tool.mjs +20 -5
- package/code-tool.mjs.map +1 -1
- package/headers.d.mts +1 -1
- package/headers.d.mts.map +1 -1
- package/headers.d.ts +1 -1
- package/headers.d.ts.map +1 -1
- package/headers.js +1 -1
- package/headers.js.map +1 -1
- package/headers.mjs +1 -1
- package/headers.mjs.map +1 -1
- package/http.d.mts +8 -3
- package/http.d.mts.map +1 -1
- package/http.d.ts +8 -3
- package/http.d.ts.map +1 -1
- package/http.js +27 -10
- package/http.js.map +1 -1
- package/http.mjs +27 -10
- package/http.mjs.map +1 -1
- package/index.js +6 -2
- package/index.js.map +1 -1
- package/index.mjs +6 -2
- package/index.mjs.map +1 -1
- package/methods.d.mts +10 -0
- package/methods.d.mts.map +1 -0
- package/methods.d.ts +10 -0
- package/methods.d.ts.map +1 -0
- package/methods.js +226 -0
- package/methods.js.map +1 -0
- package/methods.mjs +222 -0
- package/methods.mjs.map +1 -0
- package/options.d.mts +4 -0
- package/options.d.mts.map +1 -1
- package/options.d.ts +4 -0
- package/options.d.ts.map +1 -1
- package/options.js +31 -12
- package/options.js.map +1 -1
- package/options.mjs +31 -12
- package/options.mjs.map +1 -1
- package/package.json +15 -2
- package/server.d.mts +3 -3
- package/server.d.mts.map +1 -1
- package/server.d.ts +3 -3
- package/server.d.ts.map +1 -1
- package/server.js +47 -8
- package/server.js.map +1 -1
- package/server.mjs +45 -7
- package/server.mjs.map +1 -1
- package/src/code-tool.ts +31 -5
- package/src/headers.ts +1 -1
- package/src/http.ts +37 -13
- package/src/index.ts +6 -2
- package/src/methods.ts +246 -0
- package/src/options.ts +38 -12
- package/src/server.ts +56 -8
- package/src/stdio.ts +4 -3
- package/stdio.d.mts +2 -1
- package/stdio.d.mts.map +1 -1
- package/stdio.d.ts +2 -1
- package/stdio.d.ts.map +1 -1
- package/stdio.js +3 -3
- package/stdio.js.map +1 -1
- package/stdio.mjs +3 -3
- package/stdio.mjs.map +1 -1
package/README.md
CHANGED
|
@@ -41,14 +41,14 @@ For clients with a configuration JSON, it might look something like this:
|
|
|
41
41
|
If you use Cursor, you can install the MCP server by using the button below. You will need to set your environment variables
|
|
42
42
|
in Cursor's `mcp.json`, which can be found in Cursor Settings > Tools & MCP > New MCP Server.
|
|
43
43
|
|
|
44
|
-
[](https://cursor.com/en-US/install-mcp?name=%40henrylabs%2Fmcp&config=
|
|
44
|
+
[](https://cursor.com/en-US/install-mcp?name=%40henrylabs%2Fmcp&config=eyJuYW1lIjoiQGhlbnJ5bGFicy9tY3AiLCJ0cmFuc3BvcnQiOiJodHRwIiwidXJsIjoiaHR0cHM6Ly9oZW5yeS1zZGsuc3RsbWNwLmNvbSIsImhlYWRlcnMiOnsieC1hcGkta2V5IjoiTXkgQVBJIEtleSJ9fQ)
|
|
45
45
|
|
|
46
46
|
### VS Code
|
|
47
47
|
|
|
48
48
|
If you use MCP, you can install the MCP server by clicking the link below. You will need to set your environment variables
|
|
49
49
|
in VS Code's `mcp.json`, which can be found via Command Palette > MCP: Open User Configuration.
|
|
50
50
|
|
|
51
|
-
[Open VS Code](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40henrylabs%2Fmcp%22%2C%22type%22%3A%
|
|
51
|
+
[Open VS Code](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40henrylabs%2Fmcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fhenry-sdk.stlmcp.com%22%2C%22headers%22%3A%7B%22x-api-key%22%3A%22My%20API%20Key%22%7D%7D)
|
|
52
52
|
|
|
53
53
|
### Claude Code
|
|
54
54
|
|
|
@@ -56,7 +56,7 @@ If you use Claude Code, you can install the MCP server by running the command be
|
|
|
56
56
|
environment variables in Claude Code's `.claude.json`, which can be found in your home directory.
|
|
57
57
|
|
|
58
58
|
```
|
|
59
|
-
claude mcp add henrylabs_mcp_api --
|
|
59
|
+
claude mcp add henrylabs_mcp_api --header "x-api-key: My API Key" --transport http https://henry-sdk.stlmcp.com
|
|
60
60
|
```
|
|
61
61
|
|
|
62
62
|
## Code Mode
|
package/code-tool.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { McpTool } from "./types.mjs";
|
|
2
|
+
import { SdkMethod } from "./methods.mjs";
|
|
2
3
|
/**
|
|
3
4
|
* A tool that runs code against a copy of the SDK.
|
|
4
5
|
*
|
|
@@ -8,5 +9,7 @@ import { McpTool } from "./types.mjs";
|
|
|
8
9
|
*
|
|
9
10
|
* @param endpoints - The endpoints to include in the list.
|
|
10
11
|
*/
|
|
11
|
-
export declare function codeTool(
|
|
12
|
+
export declare function codeTool(params: {
|
|
13
|
+
blockedMethods: SdkMethod[] | undefined;
|
|
14
|
+
}): McpTool;
|
|
12
15
|
//# sourceMappingURL=code-tool.d.mts.map
|
package/code-tool.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-tool.d.mts","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":"OAEO,EAAE,OAAO,EAAgE;
|
|
1
|
+
{"version":3,"file":"code-tool.d.mts","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":"OAEO,EAAE,OAAO,EAAgE;OAIzE,EAAE,SAAS,EAAE;AAuBpB;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE;IAAE,cAAc,EAAE,SAAS,EAAE,GAAG,SAAS,CAAA;CAAE,GAAG,OAAO,CA8FrF"}
|
package/code-tool.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { McpTool } from "./types.js";
|
|
2
|
+
import { SdkMethod } from "./methods.js";
|
|
2
3
|
/**
|
|
3
4
|
* A tool that runs code against a copy of the SDK.
|
|
4
5
|
*
|
|
@@ -8,5 +9,7 @@ import { McpTool } from "./types.js";
|
|
|
8
9
|
*
|
|
9
10
|
* @param endpoints - The endpoints to include in the list.
|
|
10
11
|
*/
|
|
11
|
-
export declare function codeTool(
|
|
12
|
+
export declare function codeTool(params: {
|
|
13
|
+
blockedMethods: SdkMethod[] | undefined;
|
|
14
|
+
}): McpTool;
|
|
12
15
|
//# sourceMappingURL=code-tool.d.ts.map
|
package/code-tool.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-tool.d.ts","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":"OAEO,EAAE,OAAO,EAAgE;
|
|
1
|
+
{"version":3,"file":"code-tool.d.ts","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":"OAEO,EAAE,OAAO,EAAgE;OAIzE,EAAE,SAAS,EAAE;AAuBpB;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE;IAAE,cAAc,EAAE,SAAS,EAAE,GAAG,SAAS,CAAA;CAAE,GAAG,OAAO,CA8FrF"}
|
package/code-tool.js
CHANGED
|
@@ -32,7 +32,7 @@ Variables will not persist between calls, so make sure to return or log any data
|
|
|
32
32
|
*
|
|
33
33
|
* @param endpoints - The endpoints to include in the list.
|
|
34
34
|
*/
|
|
35
|
-
function codeTool() {
|
|
35
|
+
function codeTool(params) {
|
|
36
36
|
const metadata = { resource: 'all', operation: 'write', tags: [] };
|
|
37
37
|
const tool = {
|
|
38
38
|
name: 'execute',
|
|
@@ -52,9 +52,22 @@ function codeTool() {
|
|
|
52
52
|
required: ['code'],
|
|
53
53
|
},
|
|
54
54
|
};
|
|
55
|
-
const handler = async (
|
|
55
|
+
const handler = async (client, args) => {
|
|
56
56
|
const code = args.code;
|
|
57
57
|
const intent = args.intent;
|
|
58
|
+
// Do very basic blocking of code that includes forbidden method names.
|
|
59
|
+
//
|
|
60
|
+
// WARNING: This is not secure against obfuscation and other evasion methods. If
|
|
61
|
+
// stronger security blocks are required, then these should be enforced in the downstream
|
|
62
|
+
// API (e.g., by having users call the MCP server with API keys with limited permissions).
|
|
63
|
+
if (params.blockedMethods) {
|
|
64
|
+
const blockedMatches = params.blockedMethods.filter((method) => code.includes(method.fullyQualifiedName));
|
|
65
|
+
if (blockedMatches.length > 0) {
|
|
66
|
+
return (0, types_1.asErrorResult)(`The following methods have been blocked by the MCP server and cannot be used in code execution: ${blockedMatches
|
|
67
|
+
.map((m) => m.fullyQualifiedName)
|
|
68
|
+
.join(', ')}`);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
58
71
|
// this is not required, but passing a Stainless API key for the matching project_name
|
|
59
72
|
// will allow you to run code-mode queries against non-published versions of your SDK.
|
|
60
73
|
const stainlessAPIKey = (0, server_1.readEnv)('STAINLESS_API_KEY');
|
|
@@ -65,8 +78,10 @@ function codeTool() {
|
|
|
65
78
|
...(stainlessAPIKey && { Authorization: stainlessAPIKey }),
|
|
66
79
|
'Content-Type': 'application/json',
|
|
67
80
|
client_envs: JSON.stringify({
|
|
68
|
-
HENRY_SDK_API_KEY: (0, server_1.
|
|
69
|
-
HENRY_SDK_BASE_URL: (0, server_1.readEnv)('HENRY_SDK_BASE_URL'),
|
|
81
|
+
HENRY_SDK_API_KEY: (0, server_1.requireValue)((0, server_1.readEnv)('HENRY_SDK_API_KEY') ?? client.apiKey, 'set HENRY_SDK_API_KEY environment variable or provide apiKey client option'),
|
|
82
|
+
HENRY_SDK_BASE_URL: (0, server_1.readEnv)('HENRY_SDK_BASE_URL') ?? (0, server_1.readEnv)('HENRY_SDK_ENVIRONMENT') ?
|
|
83
|
+
undefined
|
|
84
|
+
: client.baseURL ?? undefined,
|
|
70
85
|
}),
|
|
71
86
|
},
|
|
72
87
|
body: JSON.stringify({
|
package/code-tool.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-tool.js","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":";AAAA,sFAAsF;;
|
|
1
|
+
{"version":3,"file":"code-tool.js","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":";AAAA,sFAAsF;;AAsCtF,4BA8FC;AAlID,sCAAgG;AAEhG,wCAAiD;AAKjD,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;uGAkBwF,CAAC;AAExG;;;;;;;;GAQG;AACH,SAAgB,QAAQ,CAAC,MAAmD;IAC1E,MAAM,QAAQ,GAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;IAC7E,MAAM,IAAI,GAAS;QACjB,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,MAAM;QACnB,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,kBAAkB;iBAChC;gBACD,MAAM,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,iEAAiE;iBAC/E;aACF;YACD,QAAQ,EAAE,CAAC,MAAM,CAAC;SACnB;KACF,CAAC;IACF,MAAM,OAAO,GAAG,KAAK,EAAE,MAAgB,EAAE,IAAS,EAA2B,EAAE;QAC7E,MAAM,IAAI,GAAG,IAAI,CAAC,IAAc,CAAC;QACjC,MAAM,MAAM,GAAG,IAAI,CAAC,MAA4B,CAAC;QAEjD,uEAAuE;QACvE,EAAE;QACF,gFAAgF;QAChF,yFAAyF;QACzF,0FAA0F;QAC1F,IAAI,MAAM,CAAC,cAAc,EAAE,CAAC;YAC1B,MAAM,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAC7D,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,kBAAkB,CAAC,CACzC,CAAC;YACF,IAAI,cAAc,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AAM,IAAI,KAAK,CACb,GAAG,GAAG,CAAC,MAAM,KACX,GAAG,CAAC,UACN,4DAA4D,MAAM,GAAG,CAAC,IAAI,EAAE,EAAE,CAC/E,CAAC;QACJ,CAAC;QAED,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAiB,CAAC;QACtF,MAAM,OAAO,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;QAC7D,MAAM,MAAM,GAAG;YACb,MAAM;YACN,GAAG,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC;YAC1C,GAAG,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC;SAC3C,CAAC;QACF,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,IAAA,qBAAa,EAAC,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAC1G,CAAC;QACD,OAAO,IAAA,2BAAmB,EAAC,MAAM,CAAC,CAAC;IACrC,CAAC,CAAC;IAEF,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AACrC,CAAC"}
|
package/code-tool.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
import { asErrorResult, asTextContentResult } from "./types.mjs";
|
|
3
|
-
import { readEnv,
|
|
3
|
+
import { readEnv, requireValue } from "./server.mjs";
|
|
4
4
|
const prompt = `Runs JavaScript code to interact with the Henry SDK API.
|
|
5
5
|
|
|
6
6
|
You are a skilled programmer writing code to interface with the service.
|
|
@@ -29,7 +29,7 @@ Variables will not persist between calls, so make sure to return or log any data
|
|
|
29
29
|
*
|
|
30
30
|
* @param endpoints - The endpoints to include in the list.
|
|
31
31
|
*/
|
|
32
|
-
export function codeTool() {
|
|
32
|
+
export function codeTool(params) {
|
|
33
33
|
const metadata = { resource: 'all', operation: 'write', tags: [] };
|
|
34
34
|
const tool = {
|
|
35
35
|
name: 'execute',
|
|
@@ -49,9 +49,22 @@ export function codeTool() {
|
|
|
49
49
|
required: ['code'],
|
|
50
50
|
},
|
|
51
51
|
};
|
|
52
|
-
const handler = async (
|
|
52
|
+
const handler = async (client, args) => {
|
|
53
53
|
const code = args.code;
|
|
54
54
|
const intent = args.intent;
|
|
55
|
+
// Do very basic blocking of code that includes forbidden method names.
|
|
56
|
+
//
|
|
57
|
+
// WARNING: This is not secure against obfuscation and other evasion methods. If
|
|
58
|
+
// stronger security blocks are required, then these should be enforced in the downstream
|
|
59
|
+
// API (e.g., by having users call the MCP server with API keys with limited permissions).
|
|
60
|
+
if (params.blockedMethods) {
|
|
61
|
+
const blockedMatches = params.blockedMethods.filter((method) => code.includes(method.fullyQualifiedName));
|
|
62
|
+
if (blockedMatches.length > 0) {
|
|
63
|
+
return asErrorResult(`The following methods have been blocked by the MCP server and cannot be used in code execution: ${blockedMatches
|
|
64
|
+
.map((m) => m.fullyQualifiedName)
|
|
65
|
+
.join(', ')}`);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
55
68
|
// this is not required, but passing a Stainless API key for the matching project_name
|
|
56
69
|
// will allow you to run code-mode queries against non-published versions of your SDK.
|
|
57
70
|
const stainlessAPIKey = readEnv('STAINLESS_API_KEY');
|
|
@@ -62,8 +75,10 @@ export function codeTool() {
|
|
|
62
75
|
...(stainlessAPIKey && { Authorization: stainlessAPIKey }),
|
|
63
76
|
'Content-Type': 'application/json',
|
|
64
77
|
client_envs: JSON.stringify({
|
|
65
|
-
HENRY_SDK_API_KEY:
|
|
66
|
-
HENRY_SDK_BASE_URL: readEnv('HENRY_SDK_BASE_URL')
|
|
78
|
+
HENRY_SDK_API_KEY: requireValue(readEnv('HENRY_SDK_API_KEY') ?? client.apiKey, 'set HENRY_SDK_API_KEY environment variable or provide apiKey client option'),
|
|
79
|
+
HENRY_SDK_BASE_URL: readEnv('HENRY_SDK_BASE_URL') ?? readEnv('HENRY_SDK_ENVIRONMENT') ?
|
|
80
|
+
undefined
|
|
81
|
+
: client.baseURL ?? undefined,
|
|
67
82
|
}),
|
|
68
83
|
},
|
|
69
84
|
body: JSON.stringify({
|
package/code-tool.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-tool.mjs","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAqC,aAAa,EAAE,mBAAmB,EAAE;OAEzE,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"code-tool.mjs","sourceRoot":"","sources":["src/code-tool.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAqC,aAAa,EAAE,mBAAmB,EAAE;OAEzE,EAAE,OAAO,EAAE,YAAY,EAAE;AAKhC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;uGAkBwF,CAAC;AAExG;;;;;;;;GAQG;AACH,MAAM,UAAU,QAAQ,CAAC,MAAmD;IAC1E,MAAM,QAAQ,GAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;IAC7E,MAAM,IAAI,GAAS;QACjB,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,MAAM;QACnB,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,kBAAkB;iBAChC;gBACD,MAAM,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,iEAAiE;iBAC/E;aACF;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QACD,OAAO,mBAAmB,CAAC,MAAM,CAAC,CAAC;IACrC,CAAC,CAAC;IAEF,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AACrC,CAAC"}
|
package/headers.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { IncomingMessage } from 'node:http';
|
|
2
2
|
import { ClientOptions } from '@henrylabs/sdk';
|
|
3
|
-
export declare const parseAuthHeaders: (req: IncomingMessage) => Partial<ClientOptions>;
|
|
3
|
+
export declare const parseAuthHeaders: (req: IncomingMessage, required?: boolean) => Partial<ClientOptions>;
|
|
4
4
|
//# sourceMappingURL=headers.d.mts.map
|
package/headers.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"headers.d.mts","sourceRoot":"","sources":["src/headers.ts"],"names":[],"mappings":"OAEO,EAAE,eAAe,EAAE,MAAM,WAAW;OACpC,EAAE,aAAa,EAAE,MAAM,gBAAgB;AAE9C,eAAO,MAAM,gBAAgB,GAAI,KAAK,eAAe,KAAG,OAAO,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"headers.d.mts","sourceRoot":"","sources":["src/headers.ts"],"names":[],"mappings":"OAEO,EAAE,eAAe,EAAE,MAAM,WAAW;OACpC,EAAE,aAAa,EAAE,MAAM,gBAAgB;AAE9C,eAAO,MAAM,gBAAgB,GAAI,KAAK,eAAe,EAAE,WAAW,OAAO,KAAG,OAAO,CAAC,aAAa,CAIhG,CAAC"}
|
package/headers.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { IncomingMessage } from 'node:http';
|
|
2
2
|
import { ClientOptions } from '@henrylabs/sdk';
|
|
3
|
-
export declare const parseAuthHeaders: (req: IncomingMessage) => Partial<ClientOptions>;
|
|
3
|
+
export declare const parseAuthHeaders: (req: IncomingMessage, required?: boolean) => Partial<ClientOptions>;
|
|
4
4
|
//# sourceMappingURL=headers.d.ts.map
|
package/headers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"headers.d.ts","sourceRoot":"","sources":["src/headers.ts"],"names":[],"mappings":"OAEO,EAAE,eAAe,EAAE,MAAM,WAAW;OACpC,EAAE,aAAa,EAAE,MAAM,gBAAgB;AAE9C,eAAO,MAAM,gBAAgB,GAAI,KAAK,eAAe,KAAG,OAAO,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"headers.d.ts","sourceRoot":"","sources":["src/headers.ts"],"names":[],"mappings":"OAEO,EAAE,eAAe,EAAE,MAAM,WAAW;OACpC,EAAE,aAAa,EAAE,MAAM,gBAAgB;AAE9C,eAAO,MAAM,gBAAgB,GAAI,KAAK,eAAe,EAAE,WAAW,OAAO,KAAG,OAAO,CAAC,aAAa,CAIhG,CAAC"}
|
package/headers.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.parseAuthHeaders = void 0;
|
|
5
|
-
const parseAuthHeaders = (req) => {
|
|
5
|
+
const parseAuthHeaders = (req, required) => {
|
|
6
6
|
const apiKey = Array.isArray(req.headers['x-api-key']) ? req.headers['x-api-key'][0] : req.headers['x-api-key'];
|
|
7
7
|
return { apiKey };
|
|
8
8
|
};
|
package/headers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"headers.js","sourceRoot":"","sources":["src/headers.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAK/E,MAAM,gBAAgB,GAAG,CAAC,GAAoB,EAA0B,EAAE;
|
|
1
|
+
{"version":3,"file":"headers.js","sourceRoot":"","sources":["src/headers.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAK/E,MAAM,gBAAgB,GAAG,CAAC,GAAoB,EAAE,QAAkB,EAA0B,EAAE;IACnG,MAAM,MAAM,GACV,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IACnG,OAAO,EAAE,MAAM,EAAE,CAAC;AACpB,CAAC,CAAC;AAJW,QAAA,gBAAgB,oBAI3B"}
|
package/headers.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
export const parseAuthHeaders = (req) => {
|
|
2
|
+
export const parseAuthHeaders = (req, required) => {
|
|
3
3
|
const apiKey = Array.isArray(req.headers['x-api-key']) ? req.headers['x-api-key'][0] : req.headers['x-api-key'];
|
|
4
4
|
return { apiKey };
|
|
5
5
|
};
|
package/headers.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"headers.mjs","sourceRoot":"","sources":["src/headers.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAKtF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,GAAoB,EAA0B,EAAE;
|
|
1
|
+
{"version":3,"file":"headers.mjs","sourceRoot":"","sources":["src/headers.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAKtF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,GAAoB,EAAE,QAAkB,EAA0B,EAAE;IACnG,MAAM,MAAM,GACV,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IACnG,OAAO,EAAE,MAAM,EAAE,CAAC;AACpB,CAAC,CAAC"}
|
package/http.d.mts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
2
|
import { McpOptions } from "./options.mjs";
|
|
3
3
|
import { ClientOptions } from "./server.mjs";
|
|
4
|
-
export declare const streamableHTTPApp: ({ clientOptions, mcpOptions, }: {
|
|
4
|
+
export declare const streamableHTTPApp: ({ clientOptions, mcpOptions, debug, }: {
|
|
5
5
|
clientOptions?: ClientOptions;
|
|
6
|
-
mcpOptions
|
|
6
|
+
mcpOptions: McpOptions;
|
|
7
|
+
debug: boolean;
|
|
7
8
|
}) => express.Express;
|
|
8
|
-
export declare const launchStreamableHTTPServer: (
|
|
9
|
+
export declare const launchStreamableHTTPServer: (params: {
|
|
10
|
+
mcpOptions: McpOptions;
|
|
11
|
+
debug: boolean;
|
|
12
|
+
port: number | string | undefined;
|
|
13
|
+
}) => Promise<void>;
|
|
9
14
|
//# sourceMappingURL=http.d.mts.map
|
package/http.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.mts","sourceRoot":"","sources":["src/http.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"http.d.mts","sourceRoot":"","sources":["src/http.ts"],"names":[],"mappings":"OAIO,OAAO,MAAM,SAAS;OAGtB,EAAE,UAAU,EAAE;OACd,EAAE,aAAa,EAA+B;AAuErD,eAAO,MAAM,iBAAiB,GAAI,uCAI/B;IACD,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,EAAE,OAAO,CAAC;CAChB,KAAG,OAAO,CAAC,OAwBX,CAAC;AAEF,eAAO,MAAM,0BAA0B,GAAU,QAAQ;IACvD,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CACnC,kBAYA,CAAC"}
|
package/http.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
2
|
import { McpOptions } from "./options.js";
|
|
3
3
|
import { ClientOptions } from "./server.js";
|
|
4
|
-
export declare const streamableHTTPApp: ({ clientOptions, mcpOptions, }: {
|
|
4
|
+
export declare const streamableHTTPApp: ({ clientOptions, mcpOptions, debug, }: {
|
|
5
5
|
clientOptions?: ClientOptions;
|
|
6
|
-
mcpOptions
|
|
6
|
+
mcpOptions: McpOptions;
|
|
7
|
+
debug: boolean;
|
|
7
8
|
}) => express.Express;
|
|
8
|
-
export declare const launchStreamableHTTPServer: (
|
|
9
|
+
export declare const launchStreamableHTTPServer: (params: {
|
|
10
|
+
mcpOptions: McpOptions;
|
|
11
|
+
debug: boolean;
|
|
12
|
+
port: number | string | undefined;
|
|
13
|
+
}) => Promise<void>;
|
|
9
14
|
//# sourceMappingURL=http.d.ts.map
|
package/http.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["src/http.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["src/http.ts"],"names":[],"mappings":"OAIO,OAAO,MAAM,SAAS;OAGtB,EAAE,UAAU,EAAE;OACd,EAAE,aAAa,EAA+B;AAuErD,eAAO,MAAM,iBAAiB,GAAI,uCAI/B;IACD,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,EAAE,OAAO,CAAC;CAChB,KAAG,OAAO,CAAC,OAwBX,CAAC;AAEF,eAAO,MAAM,0BAA0B,GAAU,QAAQ;IACvD,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CACnC,kBAYA,CAAC"}
|
package/http.js
CHANGED
|
@@ -7,14 +7,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
exports.launchStreamableHTTPServer = exports.streamableHTTPApp = void 0;
|
|
8
8
|
const streamableHttp_js_1 = require("@modelcontextprotocol/sdk/server/streamableHttp.js");
|
|
9
9
|
const express_1 = __importDefault(require("express"));
|
|
10
|
+
const morgan_1 = __importDefault(require("morgan"));
|
|
11
|
+
const morgan_body_1 = __importDefault(require("morgan-body"));
|
|
10
12
|
const server_1 = require("./server.js");
|
|
11
13
|
const headers_1 = require("./headers.js");
|
|
12
|
-
const newServer = ({ clientOptions, req, res, }) => {
|
|
13
|
-
const server = (0, server_1.newMcpServer)();
|
|
14
|
+
const newServer = async ({ clientOptions, mcpOptions, req, res, }) => {
|
|
15
|
+
const server = await (0, server_1.newMcpServer)();
|
|
14
16
|
try {
|
|
15
|
-
const authOptions = (0, headers_1.parseAuthHeaders)(req);
|
|
16
|
-
(0, server_1.initMcpServer)({
|
|
17
|
+
const authOptions = (0, headers_1.parseAuthHeaders)(req, false);
|
|
18
|
+
await (0, server_1.initMcpServer)({
|
|
17
19
|
server: server,
|
|
20
|
+
mcpOptions: mcpOptions,
|
|
18
21
|
clientOptions: {
|
|
19
22
|
...clientOptions,
|
|
20
23
|
...authOptions,
|
|
@@ -34,7 +37,7 @@ const newServer = ({ clientOptions, req, res, }) => {
|
|
|
34
37
|
return server;
|
|
35
38
|
};
|
|
36
39
|
const post = (options) => async (req, res) => {
|
|
37
|
-
const server = newServer({ ...options, req, res });
|
|
40
|
+
const server = await newServer({ ...options, req, res });
|
|
38
41
|
// If we return null, we already set the authorization error.
|
|
39
42
|
if (server === null)
|
|
40
43
|
return;
|
|
@@ -60,19 +63,33 @@ const del = async (req, res) => {
|
|
|
60
63
|
},
|
|
61
64
|
});
|
|
62
65
|
};
|
|
63
|
-
const streamableHTTPApp = ({ clientOptions = {}, mcpOptions
|
|
66
|
+
const streamableHTTPApp = ({ clientOptions = {}, mcpOptions, debug, }) => {
|
|
64
67
|
const app = (0, express_1.default)();
|
|
65
68
|
app.set('query parser', 'extended');
|
|
66
69
|
app.use(express_1.default.json());
|
|
70
|
+
if (debug) {
|
|
71
|
+
(0, morgan_body_1.default)(app, {
|
|
72
|
+
logAllReqHeader: true,
|
|
73
|
+
logAllResHeader: true,
|
|
74
|
+
logRequestBody: true,
|
|
75
|
+
logResponseBody: true,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
app.use((0, morgan_1.default)('combined'));
|
|
80
|
+
}
|
|
81
|
+
app.get('/health', async (req, res) => {
|
|
82
|
+
res.status(200).send('OK');
|
|
83
|
+
});
|
|
67
84
|
app.get('/', get);
|
|
68
85
|
app.post('/', post({ clientOptions, mcpOptions }));
|
|
69
86
|
app.delete('/', del);
|
|
70
87
|
return app;
|
|
71
88
|
};
|
|
72
89
|
exports.streamableHTTPApp = streamableHTTPApp;
|
|
73
|
-
const launchStreamableHTTPServer = async (
|
|
74
|
-
const app = (0, exports.streamableHTTPApp)({ mcpOptions:
|
|
75
|
-
const server = app.listen(port);
|
|
90
|
+
const launchStreamableHTTPServer = async (params) => {
|
|
91
|
+
const app = (0, exports.streamableHTTPApp)({ mcpOptions: params.mcpOptions, debug: params.debug });
|
|
92
|
+
const server = app.listen(params.port);
|
|
76
93
|
const address = server.address();
|
|
77
94
|
if (typeof address === 'string') {
|
|
78
95
|
console.error(`MCP Server running on streamable HTTP at ${address}`);
|
|
@@ -81,7 +98,7 @@ const launchStreamableHTTPServer = async (options, port) => {
|
|
|
81
98
|
console.error(`MCP Server running on streamable HTTP on port ${address.port}`);
|
|
82
99
|
}
|
|
83
100
|
else {
|
|
84
|
-
console.error(`MCP Server running on streamable HTTP on port ${port}`);
|
|
101
|
+
console.error(`MCP Server running on streamable HTTP on port ${params.port}`);
|
|
85
102
|
}
|
|
86
103
|
};
|
|
87
104
|
exports.launchStreamableHTTPServer = launchStreamableHTTPServer;
|
package/http.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.js","sourceRoot":"","sources":["src/http.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;AAGtF,0FAAmG;
|
|
1
|
+
{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AAhBW,QAAA,0BAA0B,8BAgBrC"}
|
package/http.mjs
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
3
3
|
import express from 'express';
|
|
4
|
+
import morgan from 'morgan';
|
|
5
|
+
import morganBody from 'morgan-body';
|
|
4
6
|
import { initMcpServer, newMcpServer } from "./server.mjs";
|
|
5
7
|
import { parseAuthHeaders } from "./headers.mjs";
|
|
6
|
-
const newServer = ({ clientOptions, req, res, }) => {
|
|
7
|
-
const server = newMcpServer();
|
|
8
|
+
const newServer = async ({ clientOptions, mcpOptions, req, res, }) => {
|
|
9
|
+
const server = await newMcpServer();
|
|
8
10
|
try {
|
|
9
|
-
const authOptions = parseAuthHeaders(req);
|
|
10
|
-
initMcpServer({
|
|
11
|
+
const authOptions = parseAuthHeaders(req, false);
|
|
12
|
+
await initMcpServer({
|
|
11
13
|
server: server,
|
|
14
|
+
mcpOptions: mcpOptions,
|
|
12
15
|
clientOptions: {
|
|
13
16
|
...clientOptions,
|
|
14
17
|
...authOptions,
|
|
@@ -28,7 +31,7 @@ const newServer = ({ clientOptions, req, res, }) => {
|
|
|
28
31
|
return server;
|
|
29
32
|
};
|
|
30
33
|
const post = (options) => async (req, res) => {
|
|
31
|
-
const server = newServer({ ...options, req, res });
|
|
34
|
+
const server = await newServer({ ...options, req, res });
|
|
32
35
|
// If we return null, we already set the authorization error.
|
|
33
36
|
if (server === null)
|
|
34
37
|
return;
|
|
@@ -54,18 +57,32 @@ const del = async (req, res) => {
|
|
|
54
57
|
},
|
|
55
58
|
});
|
|
56
59
|
};
|
|
57
|
-
export const streamableHTTPApp = ({ clientOptions = {}, mcpOptions
|
|
60
|
+
export const streamableHTTPApp = ({ clientOptions = {}, mcpOptions, debug, }) => {
|
|
58
61
|
const app = express();
|
|
59
62
|
app.set('query parser', 'extended');
|
|
60
63
|
app.use(express.json());
|
|
64
|
+
if (debug) {
|
|
65
|
+
morganBody(app, {
|
|
66
|
+
logAllReqHeader: true,
|
|
67
|
+
logAllResHeader: true,
|
|
68
|
+
logRequestBody: true,
|
|
69
|
+
logResponseBody: true,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
app.use(morgan('combined'));
|
|
74
|
+
}
|
|
75
|
+
app.get('/health', async (req, res) => {
|
|
76
|
+
res.status(200).send('OK');
|
|
77
|
+
});
|
|
61
78
|
app.get('/', get);
|
|
62
79
|
app.post('/', post({ clientOptions, mcpOptions }));
|
|
63
80
|
app.delete('/', del);
|
|
64
81
|
return app;
|
|
65
82
|
};
|
|
66
|
-
export const launchStreamableHTTPServer = async (
|
|
67
|
-
const app = streamableHTTPApp({ mcpOptions:
|
|
68
|
-
const server = app.listen(port);
|
|
83
|
+
export const launchStreamableHTTPServer = async (params) => {
|
|
84
|
+
const app = streamableHTTPApp({ mcpOptions: params.mcpOptions, debug: params.debug });
|
|
85
|
+
const server = app.listen(params.port);
|
|
69
86
|
const address = server.address();
|
|
70
87
|
if (typeof address === 'string') {
|
|
71
88
|
console.error(`MCP Server running on streamable HTTP at ${address}`);
|
|
@@ -74,7 +91,7 @@ export const launchStreamableHTTPServer = async (options, port) => {
|
|
|
74
91
|
console.error(`MCP Server running on streamable HTTP on port ${address.port}`);
|
|
75
92
|
}
|
|
76
93
|
else {
|
|
77
|
-
console.error(`MCP Server running on streamable HTTP on port ${port}`);
|
|
94
|
+
console.error(`MCP Server running on streamable HTTP on port ${params.port}`);
|
|
78
95
|
}
|
|
79
96
|
};
|
|
80
97
|
//# sourceMappingURL=http.mjs.map
|
package/http.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.mjs","sourceRoot":"","sources":["src/http.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAG/E,EAAE,6BAA6B,EAAE,MAAM,oDAAoD;
|
|
1
|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C,CAAC;IAChF,CAAC;AACH,CAAC,CAAC"}
|
package/index.js
CHANGED
|
@@ -11,10 +11,14 @@ async function main() {
|
|
|
11
11
|
console.error(`MCP Server starting with ${selectedTools.length} tools:`, selectedTools.map((e) => e.tool.name));
|
|
12
12
|
switch (options.transport) {
|
|
13
13
|
case 'stdio':
|
|
14
|
-
await (0, stdio_1.launchStdioServer)();
|
|
14
|
+
await (0, stdio_1.launchStdioServer)(options);
|
|
15
15
|
break;
|
|
16
16
|
case 'http':
|
|
17
|
-
await (0, http_1.launchStreamableHTTPServer)(
|
|
17
|
+
await (0, http_1.launchStreamableHTTPServer)({
|
|
18
|
+
mcpOptions: options,
|
|
19
|
+
debug: options.debug,
|
|
20
|
+
port: options.port ?? options.socket,
|
|
21
|
+
});
|
|
18
22
|
break;
|
|
19
23
|
}
|
|
20
24
|
}
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":";;;AAEA,wCAAuC;AACvC,0CAAwD;AACxD,sCAA4C;AAC5C,oCAAoD;AAGpD,KAAK,UAAU,IAAI;IACjB,MAAM,OAAO,GAAG,mBAAmB,EAAE,CAAC;IAEtC,MAAM,aAAa,GAAG,MAAM,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAExD,OAAO,CAAC,KAAK,CACX,4BAA4B,aAAa,CAAC,MAAM,SAAS,EACzD,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CACtC,CAAC;IAEF,QAAQ,OAAO,CAAC,SAAS,EAAE,CAAC;QAC1B,KAAK,OAAO;YACV,MAAM,IAAA,yBAAiB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":";;;AAEA,wCAAuC;AACvC,0CAAwD;AACxD,sCAA4C;AAC5C,oCAAoD;AAGpD,KAAK,UAAU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BAAW,EAAC,OAAO,CAAC,CAAC;QAC3C,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC/B,OAAO,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;YACtD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QACD,OAAO,aAAa,CAAC;IACvB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;YAC3B,OAAO,CAAC,KAAK,CAAC,wBAAwB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QACzD,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,KAAK,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;QACjD,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
|
package/index.mjs
CHANGED
|
@@ -9,10 +9,14 @@ async function main() {
|
|
|
9
9
|
console.error(`MCP Server starting with ${selectedTools.length} tools:`, selectedTools.map((e) => e.tool.name));
|
|
10
10
|
switch (options.transport) {
|
|
11
11
|
case 'stdio':
|
|
12
|
-
await launchStdioServer();
|
|
12
|
+
await launchStdioServer(options);
|
|
13
13
|
break;
|
|
14
14
|
case 'http':
|
|
15
|
-
await launchStreamableHTTPServer(
|
|
15
|
+
await launchStreamableHTTPServer({
|
|
16
|
+
mcpOptions: options,
|
|
17
|
+
debug: options.debug,
|
|
18
|
+
port: options.port ?? options.socket,
|
|
19
|
+
});
|
|
16
20
|
break;
|
|
17
21
|
}
|
|
18
22
|
}
|
package/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":";OAEO,EAAE,WAAW,EAAE;OACf,EAAc,eAAe,EAAE;OAC/B,EAAE,iBAAiB,EAAE;OACrB,EAAE,0BAA0B,EAAE;AAGrC,KAAK,UAAU,IAAI;I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AI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QACrB,OAAO,CAAC,KAAK,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;QAC/C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,mBAAmB;IAC1B,IAAI,CAAC;QACH,OAAO,eAAe,EAAE,CAAC;IAC3B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;QAC/C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,KAAK,UAAU,kBAAkB,CAAC,OAAmB;IACnD,IAAI,CAAC;QACH,MAAM,aAAa,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;QAC3C,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC/B,OAAO,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;YACtD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QACD,OAAO,aAAa,CAAC;IACvB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;YAC3B,OAAO,CAAC,KAAK,CAAC,wBAAwB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QACzD,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,KAAK,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;QACjD,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
|
package/methods.d.mts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { McpOptions } from "./options.mjs";
|
|
2
|
+
export type SdkMethod = {
|
|
3
|
+
clientCallName: string;
|
|
4
|
+
fullyQualifiedName: string;
|
|
5
|
+
httpMethod?: 'get' | 'post' | 'put' | 'patch' | 'delete' | 'query';
|
|
6
|
+
httpPath?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const sdkMethods: SdkMethod[];
|
|
9
|
+
export declare function blockedMethodsForCodeTool(options: McpOptions | undefined): SdkMethod[] | undefined;
|
|
10
|
+
//# sourceMappingURL=methods.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"methods.d.mts","sourceRoot":"","sources":["src/methods.ts"],"names":[],"mappings":"OAAO,EAAE,UAAU,EAAE;AAErB,MAAM,MAAM,SAAS,GAAG;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,UAAU,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,SAAS,EAmKjC,CAAC;AA+DF,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,UAAU,GAAG,SAAS,GAAG,SAAS,EAAE,GAAG,SAAS,CAUlG"}
|
package/methods.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { McpOptions } from "./options.js";
|
|
2
|
+
export type SdkMethod = {
|
|
3
|
+
clientCallName: string;
|
|
4
|
+
fullyQualifiedName: string;
|
|
5
|
+
httpMethod?: 'get' | 'post' | 'put' | 'patch' | 'delete' | 'query';
|
|
6
|
+
httpPath?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const sdkMethods: SdkMethod[];
|
|
9
|
+
export declare function blockedMethodsForCodeTool(options: McpOptions | undefined): SdkMethod[] | undefined;
|
|
10
|
+
//# sourceMappingURL=methods.d.ts.map
|
package/methods.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"methods.d.ts","sourceRoot":"","sources":["src/methods.ts"],"names":[],"mappings":"OAAO,EAAE,UAAU,EAAE;AAErB,MAAM,MAAM,SAAS,GAAG;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,UAAU,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,SAAS,EAmKjC,CAAC;AA+DF,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,UAAU,GAAG,SAAS,GAAG,SAAS,EAAE,GAAG,SAAS,CAUlG"}
|