@zenrows/mcp 2.0.5 → 2.0.6

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/dist/http.js +1 -12
  2. package/package.json +1 -1
package/dist/http.js CHANGED
@@ -5,9 +5,6 @@ import { WebStandardStreamableHTTPServerTransport } from "@modelcontextprotocol/
5
5
  import { createServer } from "./server.js";
6
6
  // ─── app ──────────────────────────────────────────────────────────────────────
7
7
  const app = new Hono();
8
- // Cache MCP client name per API key across invocations.
9
- // Populated from the clientInfo field in MCP initialize requests.
10
- const mcpClientCache = new Map();
11
8
  // CORS — required for browser-side MCP clients (Claude.ai, Cursor web, etc.)
12
9
  // All origins allowed: the API key is the auth mechanism, not the origin.
13
10
  app.use(cors({
@@ -96,17 +93,9 @@ app.all("/mcp", async (c) => {
96
93
  sessionIdGenerator: undefined, // stateless — no session tracking between requests
97
94
  enableJsonResponse: true, // return JSON instead of SSE (simpler for Lambda + most MCP clients)
98
95
  });
99
- // Use cached client name from a prior initialize request (stateless transport
100
- // creates a new server per request, so getClientVersion() is only set during
101
- // the initialize request itself, not during subsequent tool calls).
102
- const server = createServer(apiKey, mcpClientCache.get(apiKey));
96
+ const server = createServer(apiKey, c.req.raw.headers.get("user-agent") ?? undefined);
103
97
  await server.connect(transport);
104
98
  const response = await transport.handleRequest(c.req.raw);
105
- // If this was an initialize request, getClientVersion() is now set — cache it
106
- // so subsequent tool call requests can include x-mcp-client-name.
107
- const resolvedName = server.server.getClientVersion()?.name;
108
- if (resolvedName)
109
- mcpClientCache.set(apiKey, resolvedName);
110
99
  await transport.close();
111
100
  return response;
112
101
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenrows/mcp",
3
- "version": "2.0.5",
3
+ "version": "2.0.6",
4
4
  "description": "ZenRows MCP server — Universal Scraper API for AI coding assistants",
5
5
  "type": "module",
6
6
  "bin": {