@zenrows/mcp 1.1.5 → 1.1.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.
- package/dist/server.js +6 -2
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -4,6 +4,9 @@ import { z } from "zod";
|
|
|
4
4
|
const require = createRequire(import.meta.url);
|
|
5
5
|
const pkg = require("../package.json");
|
|
6
6
|
const ZENROWS_API_URL = "https://api.zenrows.com/v1/";
|
|
7
|
+
const DEFAULT_JS_RENDER = process.env.ZENROWS_JS_RENDER === "true";
|
|
8
|
+
const DEFAULT_PREMIUM_PROXY = process.env.ZENROWS_PREMIUM_PROXY === "true";
|
|
9
|
+
const DEFAULT_RESPONSE_TYPE = process.env.ZENROWS_RESPONSE_TYPE ?? "markdown";
|
|
7
10
|
export function createServer(apiKey) {
|
|
8
11
|
const server = new McpServer({
|
|
9
12
|
name: "zenrows",
|
|
@@ -119,11 +122,12 @@ Examples:
|
|
|
119
122
|
url: params.url,
|
|
120
123
|
});
|
|
121
124
|
if (params.js_render ||
|
|
125
|
+
DEFAULT_JS_RENDER ||
|
|
122
126
|
params.screenshot ||
|
|
123
127
|
params.screenshot_fullpage ||
|
|
124
128
|
params.screenshot_selector)
|
|
125
129
|
searchParams.set("js_render", "true");
|
|
126
|
-
if (params.premium_proxy)
|
|
130
|
+
if (params.premium_proxy || DEFAULT_PREMIUM_PROXY)
|
|
127
131
|
searchParams.set("premium_proxy", "true");
|
|
128
132
|
if (params.proxy_country)
|
|
129
133
|
searchParams.set("proxy_country", params.proxy_country.toUpperCase());
|
|
@@ -148,7 +152,7 @@ Examples:
|
|
|
148
152
|
// response_type is mutually exclusive with autoparse, css_extractor, outputs, and screenshot params.
|
|
149
153
|
// 'html' is the ZenRows default (no param); all other values are passed through.
|
|
150
154
|
const isScreenshot = params.screenshot || params.screenshot_fullpage || params.screenshot_selector;
|
|
151
|
-
const effectiveType = params.response_type ??
|
|
155
|
+
const effectiveType = params.response_type ?? DEFAULT_RESPONSE_TYPE;
|
|
152
156
|
if (!params.autoparse &&
|
|
153
157
|
!params.css_extractor &&
|
|
154
158
|
!params.outputs &&
|