@ivotoby/openapi-mcp-server 1.9.3 → 1.10.0

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/README.md CHANGED
@@ -297,6 +297,48 @@ The HTTP transport allows the MCP server to be accessed over HTTP, enabling web
297
297
 
298
298
  **When to use**: When you need to expose the MCP server to web clients or systems that communicate over HTTP rather than stdio.
299
299
 
300
+ ### Health Check Endpoint
301
+
302
+ When using HTTP transport, a health check endpoint is available at `/health` for monitoring and service discovery:
303
+
304
+ ```bash
305
+ # Check server health
306
+ curl http://localhost:3000/health
307
+
308
+ # Response:
309
+ # {
310
+ # "status": "healthy",
311
+ # "activeSessions": 2,
312
+ # "uptime": 3600
313
+ # }
314
+ ```
315
+
316
+ **Health Response Fields:**
317
+ - `status`: Always returns "healthy" when server is running
318
+ - `activeSessions`: Number of active MCP sessions
319
+ - `uptime`: Server uptime in seconds
320
+
321
+ **Key Features:**
322
+ - No authentication required
323
+ - Works with any HTTP method (GET, POST, etc.)
324
+ - Ideal for load balancers, Kubernetes probes, and monitoring systems
325
+
326
+ **Integration Examples:**
327
+
328
+ ```yaml
329
+ # Kubernetes liveness probe
330
+ livenessProbe:
331
+ httpGet:
332
+ path: /health
333
+ port: 3000
334
+ initialDelaySeconds: 3
335
+ periodSeconds: 10
336
+
337
+ # Docker healthcheck
338
+ HEALTHCHECK --interval=30s --timeout=3s \
339
+ CMD curl -f http://localhost:3000/health || exit 1
340
+ ```
341
+
300
342
  ## Security Considerations
301
343
 
302
344
  - The HTTP transport validates Origin headers to prevent DNS rebinding attacks
package/dist/bundle.js CHANGED
@@ -24000,7 +24000,6 @@ import {
24000
24000
  import * as http2 from "http";
24001
24001
  import { randomUUID } from "crypto";
24002
24002
  var StreamableHttpServerTransport = class {
24003
- // Maps request IDs to session IDs
24004
24003
  /**
24005
24004
  * Initialize a new StreamableHttpServerTransport
24006
24005
  *
@@ -24017,9 +24016,12 @@ var StreamableHttpServerTransport = class {
24017
24016
  server;
24018
24017
  sessions = /* @__PURE__ */ new Map();
24019
24018
  started = false;
24019
+ startTime = Date.now();
24020
24020
  maxBodySize = 4 * 1024 * 1024;
24021
24021
  // 4MB max request size
24022
24022
  requestSessionMap = /* @__PURE__ */ new Map();
24023
+ // Maps request IDs to session IDs
24024
+ healthCheckPath = "/health";
24023
24025
  /**
24024
24026
  * Callback when message is received
24025
24027
  */
@@ -24163,10 +24165,28 @@ var StreamableHttpServerTransport = class {
24163
24165
  }
24164
24166
  }
24165
24167
  }
24168
+ /**
24169
+ * Handle health check request
24170
+ */
24171
+ handleHealthCheck(_req, res) {
24172
+ const uptime = Math.floor((Date.now() - this.startTime) / 1e3);
24173
+ const healthResponse = {
24174
+ status: "healthy",
24175
+ activeSessions: this.sessions.size,
24176
+ uptime
24177
+ };
24178
+ res.setHeader("Content-Type", "application/json");
24179
+ res.writeHead(200);
24180
+ res.end(JSON.stringify(healthResponse));
24181
+ }
24166
24182
  /**
24167
24183
  * Handle HTTP request
24168
24184
  */
24169
24185
  handleRequest(req, res) {
24186
+ if (req.url === this.healthCheckPath) {
24187
+ this.handleHealthCheck(req, res);
24188
+ return;
24189
+ }
24170
24190
  if (req.url !== this.endpointPath) {
24171
24191
  res.writeHead(404);
24172
24192
  res.end();
package/dist/cli.js CHANGED
@@ -24000,7 +24000,6 @@ import {
24000
24000
  import * as http2 from "http";
24001
24001
  import { randomUUID } from "crypto";
24002
24002
  var StreamableHttpServerTransport = class {
24003
- // Maps request IDs to session IDs
24004
24003
  /**
24005
24004
  * Initialize a new StreamableHttpServerTransport
24006
24005
  *
@@ -24017,9 +24016,12 @@ var StreamableHttpServerTransport = class {
24017
24016
  server;
24018
24017
  sessions = /* @__PURE__ */ new Map();
24019
24018
  started = false;
24019
+ startTime = Date.now();
24020
24020
  maxBodySize = 4 * 1024 * 1024;
24021
24021
  // 4MB max request size
24022
24022
  requestSessionMap = /* @__PURE__ */ new Map();
24023
+ // Maps request IDs to session IDs
24024
+ healthCheckPath = "/health";
24023
24025
  /**
24024
24026
  * Callback when message is received
24025
24027
  */
@@ -24163,10 +24165,28 @@ var StreamableHttpServerTransport = class {
24163
24165
  }
24164
24166
  }
24165
24167
  }
24168
+ /**
24169
+ * Handle health check request
24170
+ */
24171
+ handleHealthCheck(_req, res) {
24172
+ const uptime = Math.floor((Date.now() - this.startTime) / 1e3);
24173
+ const healthResponse = {
24174
+ status: "healthy",
24175
+ activeSessions: this.sessions.size,
24176
+ uptime
24177
+ };
24178
+ res.setHeader("Content-Type", "application/json");
24179
+ res.writeHead(200);
24180
+ res.end(JSON.stringify(healthResponse));
24181
+ }
24166
24182
  /**
24167
24183
  * Handle HTTP request
24168
24184
  */
24169
24185
  handleRequest(req, res) {
24186
+ if (req.url === this.healthCheckPath) {
24187
+ this.handleHealthCheck(req, res);
24188
+ return;
24189
+ }
24170
24190
  if (req.url !== this.endpointPath) {
24171
24191
  res.writeHead(404);
24172
24192
  res.end();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ivotoby/openapi-mcp-server",
3
- "version": "1.9.3",
3
+ "version": "1.10.0",
4
4
  "description": "An MCP server that exposes OpenAPI endpoints as resources",
5
5
  "license": "MIT",
6
6
  "type": "module",