mcp-server-value-picker 1.0.0 → 1.0.1
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 +16 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -34121,6 +34121,16 @@ 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 stderrWrite = (...args) => {
|
|
34127
|
+
process.stderr.write(args.map(String).join(" ") + `
|
|
34128
|
+
`);
|
|
34129
|
+
};
|
|
34130
|
+
console.log = stderrWrite;
|
|
34131
|
+
console.info = stderrWrite;
|
|
34132
|
+
console.warn = stderrWrite;
|
|
34133
|
+
}
|
|
34124
34134
|
async function startStreamableHTTPServer(createServer2) {
|
|
34125
34135
|
const port = parseInt(process.env.PORT ?? "3456", 10);
|
|
34126
34136
|
const app = createMcpExpressApp({ host: "0.0.0.0" });
|
|
@@ -34156,18 +34166,20 @@ async function startStreamableHTTPServer(createServer2) {
|
|
|
34156
34166
|
console.log(`Value Picker MCP server listening on http://localhost:${port}/mcp`);
|
|
34157
34167
|
});
|
|
34158
34168
|
const shutdown = () => {
|
|
34159
|
-
console.
|
|
34160
|
-
Shutting down...`);
|
|
34169
|
+
console.error("Shutting down...");
|
|
34161
34170
|
httpServer.close(() => process.exit(0));
|
|
34162
34171
|
};
|
|
34163
34172
|
process.on("SIGINT", shutdown);
|
|
34164
34173
|
process.on("SIGTERM", shutdown);
|
|
34165
34174
|
}
|
|
34166
34175
|
async function startStdioServer(createServer2) {
|
|
34167
|
-
|
|
34176
|
+
const server = createServer2();
|
|
34177
|
+
const transport = new StdioServerTransport;
|
|
34178
|
+
await server.connect(transport);
|
|
34179
|
+
console.error("Value Picker MCP server running on STDIO");
|
|
34168
34180
|
}
|
|
34169
34181
|
async function main() {
|
|
34170
|
-
if (
|
|
34182
|
+
if (isStdio) {
|
|
34171
34183
|
await startStdioServer(createServer);
|
|
34172
34184
|
} else {
|
|
34173
34185
|
await startStreamableHTTPServer(createServer);
|