@hasna/sandboxes 0.1.25 → 0.1.26
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/dist/mcp/http.d.ts +2 -1
- package/dist/mcp/index.js +8 -8
- package/package.json +1 -1
package/dist/mcp/http.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type Server } from "node:http";
|
|
2
|
-
export declare const DEFAULT_MCP_HTTP_PORT =
|
|
2
|
+
export declare const DEFAULT_MCP_HTTP_PORT = 8875;
|
|
3
3
|
export declare function isHttpMode(argv: string[]): boolean;
|
|
4
|
+
export declare function isStdioMode(argv: string[]): boolean;
|
|
4
5
|
export declare function resolveMcpHttpPort(argv: string[]): number;
|
|
5
6
|
export declare function healthPayload(name?: string): {
|
|
6
7
|
status: string;
|
package/dist/mcp/index.js
CHANGED
|
@@ -16930,9 +16930,9 @@ function buildServer() {
|
|
|
16930
16930
|
import { createServer } from "http";
|
|
16931
16931
|
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
16932
16932
|
import { WebStandardStreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js";
|
|
16933
|
-
var DEFAULT_MCP_HTTP_PORT =
|
|
16934
|
-
function
|
|
16935
|
-
return argv.includes("--
|
|
16933
|
+
var DEFAULT_MCP_HTTP_PORT = 8875;
|
|
16934
|
+
function isStdioMode(argv) {
|
|
16935
|
+
return argv.includes("--stdio") || process.env["MCP_STDIO"] === "1";
|
|
16936
16936
|
}
|
|
16937
16937
|
function resolveMcpHttpPort(argv) {
|
|
16938
16938
|
const portIdx = argv.indexOf("--port");
|
|
@@ -17014,12 +17014,12 @@ if (handleCliFlags(argv)) {
|
|
|
17014
17014
|
process.exit(0);
|
|
17015
17015
|
}
|
|
17016
17016
|
async function main() {
|
|
17017
|
-
if (
|
|
17018
|
-
|
|
17017
|
+
if (isStdioMode(argv)) {
|
|
17018
|
+
const server = buildServer();
|
|
17019
|
+
const transport = new StdioServerTransport;
|
|
17020
|
+
await server.connect(transport);
|
|
17019
17021
|
return;
|
|
17020
17022
|
}
|
|
17021
|
-
|
|
17022
|
-
const transport = new StdioServerTransport;
|
|
17023
|
-
await server.connect(transport);
|
|
17023
|
+
startMcpHttpServer({ port: resolveMcpHttpPort(argv) });
|
|
17024
17024
|
}
|
|
17025
17025
|
main().catch(console.error);
|