parseapi-mcp 1.10.5 → 1.11.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/http.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  buildServer,
4
4
  catalogMode
5
- } from "./chunk-QOTNYA4K.js";
5
+ } from "./chunk-OUEJNQ7T.js";
6
6
 
7
7
  // src/http.ts
8
8
  import { createServer } from "http";
@@ -134,8 +134,31 @@ async function gate(req, res) {
134
134
  req.headers["x-api-key"] = key;
135
135
  return nodeHandler(req, res);
136
136
  }
137
+ function isBrowserVisit(req, path) {
138
+ if (path !== "/" || req.method !== "GET" && req.method !== "HEAD") return false;
139
+ const headers = req.headers;
140
+ if (headers.authorization !== void 0 || headers["x-api-key"] !== void 0 || headers["mcp-session-id"] !== void 0 || headers["mcp-protocol-version"] !== void 0) return false;
141
+ let html = false;
142
+ for (const range of (headers.accept ?? "").split(",")) {
143
+ const [media, ...parameters] = range.trim().toLowerCase().split(";");
144
+ const quality = parameters.find((parameter) => parameter.trim().startsWith("q="));
145
+ const q = quality === void 0 ? 1 : Number(quality.trim().slice(2));
146
+ if (!Number.isFinite(q) || q <= 0 || q > 1) continue;
147
+ if (media?.trim() === "text/event-stream" || media?.trim() === "application/json") return false;
148
+ if (media?.trim() === "text/html") html = true;
149
+ }
150
+ return html;
151
+ }
137
152
  createServer((req, res) => {
138
153
  const path = (req.url ?? "/").split("?")[0];
154
+ if (isBrowserVisit(req, path)) {
155
+ res.writeHead(302, {
156
+ location: "https://parseapi.com/mcp",
157
+ "cache-control": "no-store",
158
+ vary: "Accept"
159
+ }).end();
160
+ return;
161
+ }
139
162
  if (req.method === "GET" && path === "/health") {
140
163
  res.writeHead(200, { "content-type": "text/plain" }).end("ok");
141
164
  return;
package/dist/registry.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  VERSION,
4
4
  buildServer
5
- } from "./chunk-QOTNYA4K.js";
5
+ } from "./chunk-OUEJNQ7T.js";
6
6
  export {
7
7
  VERSION,
8
8
  buildServer
package/dist/stdio.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  buildServer,
4
4
  catalogMode
5
- } from "./chunk-QOTNYA4K.js";
5
+ } from "./chunk-OUEJNQ7T.js";
6
6
 
7
7
  // src/stdio.ts
8
8
  import { serveStdio } from "@modelcontextprotocol/server/stdio";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "parseapi-mcp",
3
- "version": "1.10.5",
3
+ "version": "1.11.1",
4
4
  "mcpName": "com.parseapi/mcp",
5
5
  "description": "Official ParseAPI MCP server. Look up places, addresses, company numbers, email, phone, weather, dates and more.",
6
6
  "keywords": [
@@ -50,7 +50,7 @@
50
50
  "dependencies": {
51
51
  "@modelcontextprotocol/node": "^2.0.0",
52
52
  "@modelcontextprotocol/server": "^2.0.0",
53
- "@parseapi/sdk": "^1.11.4",
53
+ "@parseapi/sdk": "^1.12.0",
54
54
  "zod": "^4.0.0"
55
55
  },
56
56
  "devDependencies": {