@rankcli/mcp-server 0.0.7 → 0.0.9
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/README.md +13 -1
- package/dist/chunk-FJ2K7KRV.js +804 -0
- package/dist/index.js +24 -683
- package/dist/server.d.ts +56 -0
- package/dist/server.js +16 -0
- package/package.json +17 -6
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
2
|
+
import { Tool, CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
+
|
|
4
|
+
interface FetchGuardOptions {
|
|
5
|
+
/** Refuse loopback, private, link-local, CGNAT and metadata addresses. */
|
|
6
|
+
blockPrivateNetworks?: boolean;
|
|
7
|
+
}
|
|
8
|
+
/** Loopback, private, link-local, CGNAT, multicast/reserved - anything not on the public internet. */
|
|
9
|
+
declare function isPrivateAddress(ip: string): boolean;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Shared, stateless SEO/GEO analysis tools - the part of the RankCLI MCP
|
|
13
|
+
* server that's safe to run anywhere, local stdio process or a shared
|
|
14
|
+
* remote HTTP endpoint, since none of it touches per-user local state.
|
|
15
|
+
* rankcli_connect/rankcli_disconnect (which read/write a local Conf file)
|
|
16
|
+
* stay in index.ts, exclusive to the local stdio server - a shared remote
|
|
17
|
+
* instance can't safely do per-user "connect this session to your account"
|
|
18
|
+
* via local file storage.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/** Options for the analysis tools. Everything defaults off, for local stdio use. */
|
|
22
|
+
type AnalysisServerOptions = FetchGuardOptions;
|
|
23
|
+
declare function fetchHtml(url: string, options?: AnalysisServerOptions): Promise<string>;
|
|
24
|
+
interface RobotsTxtResult {
|
|
25
|
+
/** robots.txt body when the site served one (2xx). */
|
|
26
|
+
content?: string;
|
|
27
|
+
/** One line for the report: what was found, or why crawler access is unknown. */
|
|
28
|
+
note: string;
|
|
29
|
+
/** robots.txt couldn't be read (5xx, 429, network) - access is not known. */
|
|
30
|
+
unknown?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The site's own robots.txt. seo_geo_check / seo_analyze used to skip this
|
|
34
|
+
* unless the caller pasted robots.txt in, and then reported every AI
|
|
35
|
+
* crawler as "allowed" - even on sites that block them all.
|
|
36
|
+
*/
|
|
37
|
+
declare function fetchRobotsTxt(pageUrl: string, options?: AnalysisServerOptions): Promise<RobotsTxtResult>;
|
|
38
|
+
declare const ANALYSIS_TOOLS: Tool[];
|
|
39
|
+
/**
|
|
40
|
+
* Handles a single analysis tool call. Returns undefined if `name` isn't
|
|
41
|
+
* one of ANALYSIS_TOOLS, so callers (index.ts's stdio server) can fall
|
|
42
|
+
* through to their own additional tools.
|
|
43
|
+
*/
|
|
44
|
+
declare function handleAnalysisTool(name: string, args: Record<string, unknown> | undefined, options?: AnalysisServerOptions): Promise<CallToolResult | undefined>;
|
|
45
|
+
/**
|
|
46
|
+
* A fresh Server exposing only the stateless analysis tools - used by the
|
|
47
|
+
* remote HTTP endpoint, one instance per request (see packages/audit-worker),
|
|
48
|
+
* matching the MCP SDK's own stateless-server example.
|
|
49
|
+
*
|
|
50
|
+
* A shared deployment should pass { blockPrivateNetworks: true } so callers
|
|
51
|
+
* can't point the fetching tools at internal addresses. Off by default: the
|
|
52
|
+
* local stdio server auditing http://localhost:3000 is a feature.
|
|
53
|
+
*/
|
|
54
|
+
declare function createAnalysisServer(options?: AnalysisServerOptions): Server;
|
|
55
|
+
|
|
56
|
+
export { ANALYSIS_TOOLS, type AnalysisServerOptions, type FetchGuardOptions, type RobotsTxtResult, createAnalysisServer, fetchHtml, fetchRobotsTxt, handleAnalysisTool, isPrivateAddress };
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ANALYSIS_TOOLS,
|
|
3
|
+
createAnalysisServer,
|
|
4
|
+
fetchHtml,
|
|
5
|
+
fetchRobotsTxt,
|
|
6
|
+
handleAnalysisTool,
|
|
7
|
+
isPrivateAddress
|
|
8
|
+
} from "./chunk-FJ2K7KRV.js";
|
|
9
|
+
export {
|
|
10
|
+
ANALYSIS_TOOLS,
|
|
11
|
+
createAnalysisServer,
|
|
12
|
+
fetchHtml,
|
|
13
|
+
fetchRobotsTxt,
|
|
14
|
+
handleAnalysisTool,
|
|
15
|
+
isPrivateAddress
|
|
16
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rankcli/mcp-server",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
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",
|
|
@@ -9,11 +9,21 @@
|
|
|
9
9
|
"bin": {
|
|
10
10
|
"rankcli-mcp": "./dist/index.js"
|
|
11
11
|
},
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./server": {
|
|
18
|
+
"types": "./dist/server.d.ts",
|
|
19
|
+
"import": "./dist/server.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
12
22
|
"scripts": {
|
|
13
|
-
"build": "tsup src/index.ts --format esm --dts --clean",
|
|
14
|
-
"dev": "tsup src/index.ts --format esm --watch",
|
|
23
|
+
"build": "tsup src/index.ts src/server.ts --format esm --dts --clean",
|
|
24
|
+
"dev": "tsup src/index.ts src/server.ts --format esm --watch",
|
|
15
25
|
"typecheck": "tsc --noEmit",
|
|
16
|
-
"test": "
|
|
26
|
+
"test": "vitest run",
|
|
17
27
|
"prepublishOnly": "npm run build"
|
|
18
28
|
},
|
|
19
29
|
"keywords": [
|
|
@@ -41,12 +51,13 @@
|
|
|
41
51
|
},
|
|
42
52
|
"dependencies": {
|
|
43
53
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
44
|
-
"@rankcli/agent-runtime": "^0.0.
|
|
54
|
+
"@rankcli/agent-runtime": "^0.0.21",
|
|
45
55
|
"conf": "^12.0.0"
|
|
46
56
|
},
|
|
47
57
|
"devDependencies": {
|
|
48
58
|
"tsup": "^8.0.0",
|
|
49
|
-
"typescript": "^5.4.0"
|
|
59
|
+
"typescript": "^5.4.0",
|
|
60
|
+
"vitest": "^1.6.0"
|
|
50
61
|
},
|
|
51
62
|
"files": [
|
|
52
63
|
"dist"
|