scrapeunblocker-mcp 0.12.7 → 0.12.8
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/index.js +8 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8955,7 +8955,7 @@ ${body}`);
|
|
|
8955
8955
|
}
|
|
8956
8956
|
|
|
8957
8957
|
// src/index.ts
|
|
8958
|
-
var VERSION = "0.12.
|
|
8958
|
+
var VERSION = "0.12.8";
|
|
8959
8959
|
var DEFAULT_BASE_URL = "https://api.scrapeunblocker.com";
|
|
8960
8960
|
var API_KEY_HEADER = "x-scrapeunblocker-key";
|
|
8961
8961
|
function resolveApiKey() {
|
|
@@ -8968,11 +8968,16 @@ function resolveBaseUrl() {
|
|
|
8968
8968
|
""
|
|
8969
8969
|
);
|
|
8970
8970
|
}
|
|
8971
|
+
function userAgent() {
|
|
8972
|
+
const name = server.server.getClientVersion()?.name ?? "";
|
|
8973
|
+
const app = name.toLowerCase().replace(/[^a-z0-9]+/g, "-").slice(0, 32).replace(/^-+|-+$/g, "");
|
|
8974
|
+
return app ? `scrapeunblocker-mcp/${VERSION} mcp-host/${app}` : `scrapeunblocker-mcp/${VERSION}`;
|
|
8975
|
+
}
|
|
8971
8976
|
function client() {
|
|
8972
8977
|
const apiKey = resolveApiKey();
|
|
8973
8978
|
if (!apiKey) throw new Error(MISSING_KEY_MESSAGE);
|
|
8974
8979
|
const baseUrl = process.env.SCRAPEUNBLOCKER_BASE_URL || void 0;
|
|
8975
|
-
return new ScrapeUnblockerClient({ apiKey, baseUrl, userAgent:
|
|
8980
|
+
return new ScrapeUnblockerClient({ apiKey, baseUrl, userAgent: userAgent() });
|
|
8976
8981
|
}
|
|
8977
8982
|
function errorText(err) {
|
|
8978
8983
|
if (err instanceof Error) return err.message;
|
|
@@ -9027,7 +9032,7 @@ function pageSourceUrl(params) {
|
|
|
9027
9032
|
function requestHeaders(apiKey) {
|
|
9028
9033
|
return {
|
|
9029
9034
|
[API_KEY_HEADER]: apiKey,
|
|
9030
|
-
"User-Agent":
|
|
9035
|
+
"User-Agent": userAgent(),
|
|
9031
9036
|
Accept: "*/*"
|
|
9032
9037
|
};
|
|
9033
9038
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scrapeunblocker-mcp",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.8",
|
|
4
4
|
"mcpName": "com.scrapeunblocker/scrapeunblocker-mcp",
|
|
5
5
|
"description": "Model Context Protocol (MCP) server for ScrapeUnblocker - lets Claude fetch any web page's HTML (or AI-parsed JSON) and run 100+ site plugins that return structured JSON, through the ScrapeUnblocker anti-bot API, using your own API key.",
|
|
6
6
|
"keywords": [
|