@rankcli/mcp-server 0.0.6 → 0.0.7

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/index.js +13 -17
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -11,6 +11,15 @@ import Conf from "conf";
11
11
  import { analyzers } from "@rankcli/agent-runtime";
12
12
  var SUPABASE_URL = process.env.RANKCLI_SUPABASE_URL || "https://bspljbxwbjiqueeyzyat.supabase.co";
13
13
  var localConfig = new Conf({ projectName: "rankcli" });
14
+ async function fetchHtml(url) {
15
+ const res = await fetch(url, {
16
+ headers: { "User-Agent": "RankCLI/1.0 (+https://rankcli.dev)" }
17
+ });
18
+ if (!res.ok) {
19
+ throw new Error(`Fetching ${url} returned ${res.status} ${res.statusText}`);
20
+ }
21
+ return res.text();
22
+ }
14
23
  var TOOLS = [
15
24
  {
16
25
  name: "seo_analyze",
@@ -309,17 +318,8 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
309
318
  try {
310
319
  switch (name) {
311
320
  case "seo_analyze": {
312
- const { url, html, robotsTxt } = args;
313
- if (!html) {
314
- return {
315
- content: [
316
- {
317
- type: "text",
318
- text: "HTML content is required for analysis. Please provide the HTML of the page."
319
- }
320
- ]
321
- };
322
- }
321
+ const { url, html: providedHtml, robotsTxt } = args;
322
+ const html = providedHtml ?? await fetchHtml(url);
323
323
  const result = await analyzers.analyzeComprehensive(html, url, { robotsTxt });
324
324
  return {
325
325
  content: [
@@ -331,12 +331,8 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
331
331
  };
332
332
  }
333
333
  case "seo_geo_check": {
334
- const { url, html, robotsTxt } = args;
335
- if (!html) {
336
- return {
337
- content: [{ type: "text", text: "HTML content required for GEO analysis." }]
338
- };
339
- }
334
+ const { url, html: providedHtml, robotsTxt } = args;
335
+ const html = providedHtml ?? await fetchHtml(url);
340
336
  const result = await analyzers.analyzeGEO(html, url, robotsTxt);
341
337
  return {
342
338
  content: [{ type: "text", text: formatGEOResult(result) }]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rankcli/mcp-server",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "mcpName": "io.github.integrallis/rankcli-mcp-server",
5
5
  "description": "Free, local SEO + GEO (AI-search-citation) analysis for AI assistants - audits GEO/AI-crawler access, Core Web Vitals, structured data, security headers, mobile, and images with no signup or API key.",
6
6
  "type": "module",
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "dependencies": {
43
43
  "@modelcontextprotocol/sdk": "^1.30.0",
44
- "@rankcli/agent-runtime": "^0.0.18",
44
+ "@rankcli/agent-runtime": "^0.0.19",
45
45
  "conf": "^12.0.0"
46
46
  },
47
47
  "devDependencies": {