mcp-server-value-picker 1.0.0 → 1.0.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/dist/index.js +13 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -34121,6 +34121,15 @@ class StreamableHTTPServerTransport {
|
|
|
34121
34121
|
// main.ts
|
|
34122
34122
|
var import_cors = __toESM(require_lib4(), 1);
|
|
34123
34123
|
import { createServer } from "./server.js";
|
|
34124
|
+
var isStdio = process.argv.includes("--stdio");
|
|
34125
|
+
if (isStdio) {
|
|
34126
|
+
const noop = () => {};
|
|
34127
|
+
console.log = noop;
|
|
34128
|
+
console.info = noop;
|
|
34129
|
+
console.warn = noop;
|
|
34130
|
+
console.error = noop;
|
|
34131
|
+
console.debug = noop;
|
|
34132
|
+
}
|
|
34124
34133
|
async function startStreamableHTTPServer(createServer2) {
|
|
34125
34134
|
const port = parseInt(process.env.PORT ?? "3456", 10);
|
|
34126
34135
|
const app = createMcpExpressApp({ host: "0.0.0.0" });
|
|
@@ -34156,18 +34165,18 @@ async function startStreamableHTTPServer(createServer2) {
|
|
|
34156
34165
|
console.log(`Value Picker MCP server listening on http://localhost:${port}/mcp`);
|
|
34157
34166
|
});
|
|
34158
34167
|
const shutdown = () => {
|
|
34159
|
-
console.log(`
|
|
34160
|
-
Shutting down...`);
|
|
34161
34168
|
httpServer.close(() => process.exit(0));
|
|
34162
34169
|
};
|
|
34163
34170
|
process.on("SIGINT", shutdown);
|
|
34164
34171
|
process.on("SIGTERM", shutdown);
|
|
34165
34172
|
}
|
|
34166
34173
|
async function startStdioServer(createServer2) {
|
|
34167
|
-
|
|
34174
|
+
const server = createServer2();
|
|
34175
|
+
const transport = new StdioServerTransport;
|
|
34176
|
+
await server.connect(transport);
|
|
34168
34177
|
}
|
|
34169
34178
|
async function main() {
|
|
34170
|
-
if (
|
|
34179
|
+
if (isStdio) {
|
|
34171
34180
|
await startStdioServer(createServer);
|
|
34172
34181
|
} else {
|
|
34173
34182
|
await startStreamableHTTPServer(createServer);
|