@hasna/microservices 0.0.24 → 0.0.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.
Files changed (2) hide show
  1. package/bin/mcp.js +17 -17
  2. package/package.json +1 -1
package/bin/mcp.js CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env bun
2
2
  // @bun
3
3
  var __create = Object.create;
4
4
  var __getProtoOf = Object.getPrototypeOf;
@@ -21203,9 +21203,9 @@ class StreamableHTTPServerTransport {
21203
21203
 
21204
21204
  // src/mcp/http.ts
21205
21205
  var MCP_HTTP_SERVICE_NAME = "microservices";
21206
- var DEFAULT_MCP_HTTP_PORT = 8825;
21207
- function isHttpMode(argv = process.argv, env = process.env) {
21208
- return argv.includes("--http") || env.MCP_HTTP === "1";
21206
+ var DEFAULT_MCP_HTTP_PORT = 8868;
21207
+ function isStdioMode(argv = process.argv, env = process.env) {
21208
+ return argv.includes("--stdio") || env.MCP_STDIO === "1";
21209
21209
  }
21210
21210
  function resolveMcpHttpPort(argv = process.argv, env = process.env) {
21211
21211
  const portIdx = argv.indexOf("--port");
@@ -21719,21 +21719,21 @@ async function main() {
21719
21719
  `);
21720
21720
  return;
21721
21721
  }
21722
- if (isHttpMode()) {
21723
- const handle = await startMcpHttpServer(buildServer, {
21724
- port: resolveMcpHttpPort()
21725
- });
21726
- process.on("SIGINT", () => {
21727
- handle.close().finally(() => process.exit(0));
21728
- });
21729
- process.on("SIGTERM", () => {
21730
- handle.close().finally(() => process.exit(0));
21731
- });
21722
+ if (isStdioMode()) {
21723
+ const server = buildServer();
21724
+ const transport = new StdioServerTransport;
21725
+ await server.connect(transport);
21732
21726
  return;
21733
21727
  }
21734
- const server = buildServer();
21735
- const transport = new StdioServerTransport;
21736
- await server.connect(transport);
21728
+ const handle = await startMcpHttpServer(buildServer, {
21729
+ port: resolveMcpHttpPort()
21730
+ });
21731
+ process.on("SIGINT", () => {
21732
+ handle.close().finally(() => process.exit(0));
21733
+ });
21734
+ process.on("SIGTERM", () => {
21735
+ handle.close().finally(() => process.exit(0));
21736
+ });
21737
21737
  }
21738
21738
  main().catch(console.error);
21739
21739
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/microservices",
3
- "version": "0.0.24",
3
+ "version": "0.0.26",
4
4
  "description": "21 production-grade microservice building blocks for AI-native SaaS — auth, billing, LLM gateway, agent registry, RAG, guardrails, tracing, and more. Each with PostgreSQL, HTTP API, MCP server, and CLI.",
5
5
  "type": "module",
6
6
  "bin": {