@hasna/mcps 0.0.19 → 0.0.20
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/bin/index.js +6 -6
- package/bin/mcp.js +7 -4
- package/dist/mcp/http.d.ts +2 -1
- package/dist/mcp/index.js +7 -4
- package/package.json +1 -1
package/bin/index.js
CHANGED
|
@@ -41343,10 +41343,10 @@ class StreamableHTTPServerTransport {
|
|
|
41343
41343
|
|
|
41344
41344
|
// src/mcp/http.ts
|
|
41345
41345
|
init_server2();
|
|
41346
|
-
var DEFAULT_HTTP_PORT =
|
|
41346
|
+
var DEFAULT_HTTP_PORT = 8866;
|
|
41347
41347
|
var HTTP_NAME = "mcps";
|
|
41348
|
-
function
|
|
41349
|
-
return args.includes("--
|
|
41348
|
+
function isStdioMode(args = process.argv.slice(2)) {
|
|
41349
|
+
return args.includes("--stdio") || process.env.MCP_STDIO === "1";
|
|
41350
41350
|
}
|
|
41351
41351
|
function resolveHttpPort(args = process.argv.slice(2)) {
|
|
41352
41352
|
for (let i = 0;i < args.length; i++) {
|
|
@@ -41461,11 +41461,11 @@ Options:
|
|
|
41461
41461
|
console.log(VERSION3);
|
|
41462
41462
|
return;
|
|
41463
41463
|
}
|
|
41464
|
-
if (
|
|
41465
|
-
|
|
41464
|
+
if (isStdioMode(args)) {
|
|
41465
|
+
await startMcpServer();
|
|
41466
41466
|
return;
|
|
41467
41467
|
}
|
|
41468
|
-
|
|
41468
|
+
startHttpServer({ port: resolveHttpPort(args) });
|
|
41469
41469
|
}
|
|
41470
41470
|
var isDirectRun = import.meta.url === `file://${process.argv[1]}` || process.argv[1]?.endsWith("/mcp/index.ts") || process.argv[1]?.endsWith("/bin/mcp.js");
|
|
41471
41471
|
if (isDirectRun) {
|
package/bin/mcp.js
CHANGED
|
@@ -37680,11 +37680,14 @@ class StreamableHTTPServerTransport {
|
|
|
37680
37680
|
|
|
37681
37681
|
// src/mcp/http.ts
|
|
37682
37682
|
init_server2();
|
|
37683
|
-
var DEFAULT_HTTP_PORT =
|
|
37683
|
+
var DEFAULT_HTTP_PORT = 8866;
|
|
37684
37684
|
var HTTP_NAME = "mcps";
|
|
37685
37685
|
function isHttpMode(args = process.argv.slice(2)) {
|
|
37686
37686
|
return args.includes("--http") || process.env.MCP_HTTP === "1";
|
|
37687
37687
|
}
|
|
37688
|
+
function isStdioMode(args = process.argv.slice(2)) {
|
|
37689
|
+
return args.includes("--stdio") || process.env.MCP_STDIO === "1";
|
|
37690
|
+
}
|
|
37688
37691
|
function resolveHttpPort(args = process.argv.slice(2)) {
|
|
37689
37692
|
for (let i = 0;i < args.length; i++) {
|
|
37690
37693
|
const arg = args[i];
|
|
@@ -37798,11 +37801,11 @@ Options:
|
|
|
37798
37801
|
console.log(VERSION3);
|
|
37799
37802
|
return;
|
|
37800
37803
|
}
|
|
37801
|
-
if (
|
|
37802
|
-
|
|
37804
|
+
if (isStdioMode(args)) {
|
|
37805
|
+
await startMcpServer();
|
|
37803
37806
|
return;
|
|
37804
37807
|
}
|
|
37805
|
-
|
|
37808
|
+
startHttpServer({ port: resolveHttpPort(args) });
|
|
37806
37809
|
}
|
|
37807
37810
|
var isDirectRun = import.meta.url === `file://${process.argv[1]}` || process.argv[1]?.endsWith("/mcp/index.ts") || process.argv[1]?.endsWith("/bin/mcp.js");
|
|
37808
37811
|
if (isDirectRun) {
|
package/dist/mcp/http.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Server } from "node:http";
|
|
2
|
-
export declare const DEFAULT_HTTP_PORT =
|
|
2
|
+
export declare const DEFAULT_HTTP_PORT = 8866;
|
|
3
3
|
export declare const HTTP_NAME = "mcps";
|
|
4
4
|
export interface StartHttpServerOptions {
|
|
5
5
|
port?: number;
|
|
@@ -7,5 +7,6 @@ export interface StartHttpServerOptions {
|
|
|
7
7
|
name?: string;
|
|
8
8
|
}
|
|
9
9
|
export declare function isHttpMode(args?: string[]): boolean;
|
|
10
|
+
export declare function isStdioMode(args?: string[]): boolean;
|
|
10
11
|
export declare function resolveHttpPort(args?: string[]): number;
|
|
11
12
|
export declare function startHttpServer(options?: StartHttpServerOptions): Server;
|
package/dist/mcp/index.js
CHANGED
|
@@ -37680,11 +37680,14 @@ class StreamableHTTPServerTransport {
|
|
|
37680
37680
|
|
|
37681
37681
|
// src/mcp/http.ts
|
|
37682
37682
|
init_server2();
|
|
37683
|
-
var DEFAULT_HTTP_PORT =
|
|
37683
|
+
var DEFAULT_HTTP_PORT = 8866;
|
|
37684
37684
|
var HTTP_NAME = "mcps";
|
|
37685
37685
|
function isHttpMode(args = process.argv.slice(2)) {
|
|
37686
37686
|
return args.includes("--http") || process.env.MCP_HTTP === "1";
|
|
37687
37687
|
}
|
|
37688
|
+
function isStdioMode(args = process.argv.slice(2)) {
|
|
37689
|
+
return args.includes("--stdio") || process.env.MCP_STDIO === "1";
|
|
37690
|
+
}
|
|
37688
37691
|
function resolveHttpPort(args = process.argv.slice(2)) {
|
|
37689
37692
|
for (let i = 0;i < args.length; i++) {
|
|
37690
37693
|
const arg = args[i];
|
|
@@ -37798,11 +37801,11 @@ Options:
|
|
|
37798
37801
|
console.log(VERSION3);
|
|
37799
37802
|
return;
|
|
37800
37803
|
}
|
|
37801
|
-
if (
|
|
37802
|
-
|
|
37804
|
+
if (isStdioMode(args)) {
|
|
37805
|
+
await startMcpServer();
|
|
37803
37806
|
return;
|
|
37804
37807
|
}
|
|
37805
|
-
|
|
37808
|
+
startHttpServer({ port: resolveHttpPort(args) });
|
|
37806
37809
|
}
|
|
37807
37810
|
var isDirectRun = import.meta.url === `file://${process.argv[1]}` || process.argv[1]?.endsWith("/mcp/index.ts") || process.argv[1]?.endsWith("/bin/mcp.js");
|
|
37808
37811
|
if (isDirectRun) {
|