@automatelab/ai-seo-mcp 0.1.0 → 0.1.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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 automatelab
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 automatelab
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,217 +1,217 @@
1
- # @automatelab/ai-seo-mcp
2
-
3
- [![npm version](https://img.shields.io/npm/v/@automatelab/ai-seo-mcp.svg)](https://www.npmjs.com/package/@automatelab/ai-seo-mcp)
4
- [![license](https://img.shields.io/npm/l/@automatelab/ai-seo-mcp.svg)](./LICENSE)
5
- [![node](https://img.shields.io/node/v/@automatelab/ai-seo-mcp.svg)](https://nodejs.org)
6
-
7
- Vendor-agnostic MCP server that audits, scores, and rewrites web pages for AI-citation eligibility. No API keys. No registration.
8
-
9
- Works in Claude Desktop, Cursor, Cline, Windsurf, VS Code (Copilot / Continue), and any client that speaks the [Model Context Protocol](https://modelcontextprotocol.io).
10
-
11
- ## Why it's important
12
-
13
- AI assistants are eating search. ChatGPT, Perplexity, Google AI Overviews, and Claude with web access answer a fast-growing share of "what is X" and "how do I Y" queries - and each answer cites a handful of pages. Being one of those cited sources is binary: you are in the answer, or you are invisible.
14
-
15
- The signals that decide citation eligibility are not what classic SEO tools measure. Lighthouse will not flag missing `FAQPage` schema. Search Console will not tell you that `GPTBot` is allowed but `OAI-SearchBot` is blocked. Ahrefs does not score citation worthiness. Screaming Frog does not validate `llms.txt`.
16
-
17
- A page that no AI assistant cites is a page that, for a growing share of users, does not exist.
18
-
19
- This MCP gives you a short list of no-brainer fixes that dramatically increase the odds of getting cited by an AI assistant versus unprepared text. It audits the specific signals AI assistants use - schema completeness, FAQ structure, AI-crawler allowlists, `llms.txt`, entity density, freshness, authority - and for each gap it returns the exact change to make. No opaque scores, no guesswork. Most of the fixes are one-time edits to a template or a `robots.txt` and pay off on every page you publish from then on.
20
-
21
- ## What it does
22
-
23
- Modern search increasingly happens inside AI assistants. ChatGPT Search, Perplexity, Google AI Overviews, Claude with web access, and Microsoft Copilot all cite pages they consider authoritative, well-structured, and machine-readable. The signals that drive those citations overlap with classic SEO but are not the same.
24
-
25
- This MCP gives any AI client a toolkit to inspect a URL and answer questions like:
26
-
27
- - Is this page set up to be cited by AI Overviews and Perplexity?
28
- - What schema is missing, malformed, or deprecated?
29
- - Are GPTBot, ClaudeBot, OAI-SearchBot, and PerplexityBot allowed by `robots.txt`?
30
- - Does the page have a chance at the Answer Engine slot for a given query?
31
- - Rewrite this passage into a citation-ready answer block.
32
-
33
- 13 tools. Deterministic where possible. Rule-based scoring with explicit rubrics, not black-box numbers.
34
-
35
- ## Install
36
-
37
- ```bash
38
- npx -y @automatelab/ai-seo-mcp
39
- ```
40
-
41
- Requires Node 20 or later. No global install needed.
42
-
43
- ### Claude Desktop
44
-
45
- Add to `%APPDATA%\Claude\claude_desktop_config.json` on Windows, or `~/Library/Application Support/Claude/claude_desktop_config.json` on macOS:
46
-
47
- ```json
48
- {
49
- "mcpServers": {
50
- "ai-seo": {
51
- "command": "npx",
52
- "args": ["-y", "@automatelab/ai-seo-mcp"]
53
- }
54
- }
55
- }
56
- ```
57
-
58
- Restart Claude Desktop. The 13 tools appear in the tool tray.
59
-
60
- ### Cursor
61
-
62
- Add to `.cursor/mcp.json` in the project root or `~/.cursor/mcp.json` globally:
63
-
64
- ```json
65
- {
66
- "mcpServers": {
67
- "ai-seo": {
68
- "command": "npx",
69
- "args": ["-y", "@automatelab/ai-seo-mcp"]
70
- }
71
- }
72
- }
73
- ```
74
-
75
- ### Cline
76
-
77
- Add to VS Code settings or `.cline/mcp_settings.json`:
78
-
79
- ```json
80
- {
81
- "mcpServers": {
82
- "ai-seo": {
83
- "command": "npx",
84
- "args": ["-y", "@automatelab/ai-seo-mcp"],
85
- "disabled": false,
86
- "autoApprove": []
87
- }
88
- }
89
- }
90
- ```
91
-
92
- ### Windsurf, Continue, VS Code Copilot
93
-
94
- Use the same `command` / `args` pattern. Any MCP client that supports stdio transport works.
95
-
96
- ## Quickstart
97
-
98
- After adding the config snippet above and restarting your client, try these prompts:
99
-
100
- - *"Run an AI-SEO audit on `https://example.com` and tell me the top three things to fix."* - calls `audit_page` and returns a scored report with prioritized findings.
101
- - *"Check which AI crawlers my site allows in `robots.txt` for `https://yourdomain.com`."* - calls `check_robots` and lists per-crawler allow/disallow.
102
- - *"Score how citation-worthy this blog post is for Perplexity and ChatGPT: `https://...`."* - calls `score_citation_worthiness`.
103
- - *"Generate an `llms.txt` for `https://yourdomain.com` from its sitemap."* - calls `generate_llms_txt`.
104
- - *"Rewrite this passage for Answer Engine Optimization: [paste passage]."* - calls `rewrite_for_aeo` (uses MCP sampling if your client supports it).
105
-
106
- No API keys. No accounts. The first call may take a few seconds while `npx` downloads the package; subsequent calls are instant.
107
-
108
- ## Tools
109
-
110
- | Tool | Purpose |
111
- |------|---------|
112
- | `audit_page` | Composite AI-SEO audit with 8-dimension scoring (schema, technical, structure, robots, freshness, authority, entity density, sitemap). |
113
- | `audit_schema` | Validate JSON-LD against Schema.org rules and AI-citation best practice. Flags deprecated patterns. |
114
- | `audit_canonical` | Canonical link integrity, trailing-slash hygiene, `og:url` consistency. |
115
- | `check_robots` | Parse `robots.txt` and report per-crawler allow/disallow for all known AI crawlers. Surfaces the GPTBot-blocked-but-OAI-SearchBot-allowed trap. |
116
- | `check_sitemap` | Validate XML sitemaps: presence, URL count, `lastmod` freshness, image/video extensions. |
117
- | `check_technical` | HEAD tag audit: canonical, OpenGraph, Twitter Card, hreflang, HTTPS, noindex, title hygiene. |
118
- | `score_ai_overview_eligibility` | Score a page's probability of appearing in Google AI Overviews using current correlation factors. |
119
- | `generate_llms_txt` | Generate `llms.txt` and optionally `llms-full.txt` from a domain's sitemap. |
120
- | `validate_llms_txt` | Lint an existing `llms.txt` for spec compliance and broken links. |
121
- | `score_citation_worthiness` | Score how citable a page or text block is for Perplexity, ChatGPT, Google AI Overviews, and Claude. |
122
- | `rewrite_for_aeo` | Rewrite content for Answer Engine Optimization (BLUF structure, FAQ format, schema additions). |
123
- | `rewrite_for_geo` | Rewrite content for Generative Engine Optimization (entity definitions, comparison tables, synthesis-ready structure). |
124
- | `extract_entities` | Extract named entities, `sameAs` links, and citation-density score from a page's content and structured data. |
125
-
126
- ## Example
127
-
128
- In Claude Desktop, after wiring the server above:
129
-
130
- > **You:** Run an AI-SEO audit on `https://automatelab.tech/how-to-connect-zapier-to-notion`.
131
-
132
- Claude calls `audit_page`. Result (truncated):
133
-
134
- ```json
135
- {
136
- "url": "https://automatelab.tech/how-to-connect-zapier-to-notion",
137
- "fetched_at": "2026-05-15T10:32:00Z",
138
- "score": 61,
139
- "grade": "C",
140
- "dimension_scores": {
141
- "schema": 45, "technical": 80, "structure": 40,
142
- "robots": 90, "freshness": 85, "authority": 40,
143
- "entity_density": 21, "sitemap": 100
144
- },
145
- "findings": [
146
- {
147
- "severity": "critical",
148
- "category": "structure",
149
- "where": "<body>",
150
- "message": "No FAQ structure found (no FAQPage schema or H3 question headings).",
151
- "fix": "Add FAQ H3 headings ending in '?' with answer paragraphs, and a FAQPage JSON-LD block.",
152
- "estimated_impact": "high"
153
- },
154
- {
155
- "severity": "warning",
156
- "category": "authority",
157
- "where": "page-level",
158
- "message": "Low authority signals - missing Organization or author Person schema.",
159
- "fix": "Add Organization JSON-LD and Article.author as a Person node with sameAs links.",
160
- "estimated_impact": "high"
161
- }
162
- ]
163
- }
164
- ```
165
-
166
- Claude then summarizes the findings and proposes fixes. For rewrite tools, the host model (Claude / GPT / etc.) does the rewriting via MCP sampling.
167
-
168
- ## Environment variables
169
-
170
- All variables are optional. Set them in the MCP client config under `"env"`.
171
-
172
- | Variable | Default | Description |
173
- |----------|---------|-------------|
174
- | `USER_AGENT` | `automatelab-ai-seo-mcp/0.1.0 (+https://github.com/AutomateLab-tech/ai-seo)` | HTTP User-Agent on all fetches. |
175
- | `FETCH_TIMEOUT_MS` | `15000` | Per-request timeout in milliseconds. |
176
- | `MAX_BYTES` | `5242880` | Maximum response body size in bytes (5 MB). |
177
- | `RESPECT_ROBOTS` | `true` | Global default for robots.txt compliance. Set `"false"` to disable. |
178
- | `INTER_REQUEST_DELAY_MS` | `1500` | Minimum delay between requests to the same host within a tool call. |
179
-
180
- ## Polite by default
181
-
182
- Every tool that hits the network goes through one fetch path that:
183
-
184
- - Respects `robots.txt` for the configured User-Agent (override with `RESPECT_ROBOTS=false`).
185
- - Identifies itself honestly via `User-Agent` (no spoofing as a browser).
186
- - Sleeps `INTER_REQUEST_DELAY_MS` between requests to the same host within a tool call.
187
- - Times out at `FETCH_TIMEOUT_MS` per request.
188
- - Caps response body at `MAX_BYTES` and refuses non-HTML / non-XML payloads where inappropriate.
189
-
190
- This MCP is not a scraper. It audits public pages the way Lighthouse or Screaming Frog do, one URL at a time.
191
-
192
- ## What it does not do
193
-
194
- - No JavaScript-rendered scraping. Only static HTML is fetched. SPAs that render content client-side will produce incomplete audits.
195
- - No paid-API integrations (Search Console, Ahrefs, Semrush). Bring those signals manually if you need them.
196
- - No site-wide crawling. Tools that need multiple URLs read from the public sitemap.
197
- - No live SERP checks. AI Overview eligibility is a deterministic heuristic, not a guarantee.
198
- - English-language tuning. Technical checks (schema, robots, canonical) are language-agnostic; content scoring assumes English.
199
- - Entity extraction is regex-based (title-case phrases, acronyms, CamelCase). False positives and misses are expected on v0.1.
200
-
201
- ## Contributing
202
-
203
- Bug reports, feature ideas, and PRs welcome. See [CONTRIBUTING.md](./CONTRIBUTING.md).
204
-
205
- ## Security
206
-
207
- To report a vulnerability, see [SECURITY.md](./SECURITY.md).
208
-
209
- ## License
210
-
211
- MIT - see [LICENSE](./LICENSE).
212
-
213
- ## Acknowledgements
214
-
215
- Built by [automatelab.tech](https://automatelab.tech/products/mcp/ai-seo/)
216
-
217
- Schema.org, `robots.txt`, and `llms.txt` are open standards. Crawler user-agent data is sourced from Anthropic, OpenAI, Google, Perplexity, and Cloudflare documentation. The MCP itself is built on the [Model Context Protocol](https://modelcontextprotocol.io) by Anthropic.
1
+ # @automatelab/ai-seo-mcp
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@automatelab/ai-seo-mcp.svg)](https://www.npmjs.com/package/@automatelab/ai-seo-mcp)
4
+ [![license](https://img.shields.io/npm/l/@automatelab/ai-seo-mcp.svg)](./LICENSE)
5
+ [![node](https://img.shields.io/node/v/@automatelab/ai-seo-mcp.svg)](https://nodejs.org)
6
+
7
+ Vendor-agnostic MCP server that audits, scores, and rewrites web pages for AI-citation eligibility. No API keys. No registration.
8
+
9
+ Works in Claude Desktop, Cursor, Cline, Windsurf, VS Code (Copilot / Continue), and any client that speaks the [Model Context Protocol](https://modelcontextprotocol.io).
10
+
11
+ ## Why it's important
12
+
13
+ AI assistants are eating search. ChatGPT, Perplexity, Google AI Overviews, and Claude with web access answer a fast-growing share of "what is X" and "how do I Y" queries - and each answer cites a handful of pages. Being one of those cited sources is binary: you are in the answer, or you are invisible.
14
+
15
+ The signals that decide citation eligibility are not what classic SEO tools measure. Lighthouse will not flag missing `FAQPage` schema. Search Console will not tell you that `GPTBot` is allowed but `OAI-SearchBot` is blocked. Ahrefs does not score citation worthiness. Screaming Frog does not validate `llms.txt`.
16
+
17
+ A page that no AI assistant cites is a page that, for a growing share of users, does not exist.
18
+
19
+ This MCP gives you a short list of no-brainer fixes that dramatically increase the odds of getting cited by an AI assistant versus unprepared text. It audits the specific signals AI assistants use - schema completeness, FAQ structure, AI-crawler allowlists, `llms.txt`, entity density, freshness, authority - and for each gap it returns the exact change to make. No opaque scores, no guesswork. Most of the fixes are one-time edits to a template or a `robots.txt` and pay off on every page you publish from then on.
20
+
21
+ ## What it does
22
+
23
+ Modern search increasingly happens inside AI assistants. ChatGPT Search, Perplexity, Google AI Overviews, Claude with web access, and Microsoft Copilot all cite pages they consider authoritative, well-structured, and machine-readable. The signals that drive those citations overlap with classic SEO but are not the same.
24
+
25
+ This MCP gives any AI client a toolkit to inspect a URL and answer questions like:
26
+
27
+ - Is this page set up to be cited by AI Overviews and Perplexity?
28
+ - What schema is missing, malformed, or deprecated?
29
+ - Are GPTBot, ClaudeBot, OAI-SearchBot, and PerplexityBot allowed by `robots.txt`?
30
+ - Does the page have a chance at the Answer Engine slot for a given query?
31
+ - Rewrite this passage into a citation-ready answer block.
32
+
33
+ 13 tools. Deterministic where possible. Rule-based scoring with explicit rubrics, not black-box numbers.
34
+
35
+ ## Install
36
+
37
+ ```bash
38
+ npx -y @automatelab/ai-seo-mcp
39
+ ```
40
+
41
+ Requires Node 20 or later. No global install needed.
42
+
43
+ ### Claude Desktop
44
+
45
+ Add to `%APPDATA%\Claude\claude_desktop_config.json` on Windows, or `~/Library/Application Support/Claude/claude_desktop_config.json` on macOS:
46
+
47
+ ```json
48
+ {
49
+ "mcpServers": {
50
+ "ai-seo": {
51
+ "command": "npx",
52
+ "args": ["-y", "@automatelab/ai-seo-mcp"]
53
+ }
54
+ }
55
+ }
56
+ ```
57
+
58
+ Restart Claude Desktop. The 13 tools appear in the tool tray.
59
+
60
+ ### Cursor
61
+
62
+ Add to `.cursor/mcp.json` in the project root or `~/.cursor/mcp.json` globally:
63
+
64
+ ```json
65
+ {
66
+ "mcpServers": {
67
+ "ai-seo": {
68
+ "command": "npx",
69
+ "args": ["-y", "@automatelab/ai-seo-mcp"]
70
+ }
71
+ }
72
+ }
73
+ ```
74
+
75
+ ### Cline
76
+
77
+ Add to VS Code settings or `.cline/mcp_settings.json`:
78
+
79
+ ```json
80
+ {
81
+ "mcpServers": {
82
+ "ai-seo": {
83
+ "command": "npx",
84
+ "args": ["-y", "@automatelab/ai-seo-mcp"],
85
+ "disabled": false,
86
+ "autoApprove": []
87
+ }
88
+ }
89
+ }
90
+ ```
91
+
92
+ ### Windsurf, Continue, VS Code Copilot
93
+
94
+ Use the same `command` / `args` pattern. Any MCP client that supports stdio transport works.
95
+
96
+ ## Quickstart
97
+
98
+ After adding the config snippet above and restarting your client, try these prompts:
99
+
100
+ - *"Run an AI-SEO audit on `https://example.com` and tell me the top three things to fix."* - calls `audit_page` and returns a scored report with prioritized findings.
101
+ - *"Check which AI crawlers my site allows in `robots.txt` for `https://yourdomain.com`."* - calls `check_robots` and lists per-crawler allow/disallow.
102
+ - *"Score how citation-worthy this blog post is for Perplexity and ChatGPT: `https://...`."* - calls `score_citation_worthiness`.
103
+ - *"Generate an `llms.txt` for `https://yourdomain.com` from its sitemap."* - calls `generate_llms_txt`.
104
+ - *"Rewrite this passage for Answer Engine Optimization: [paste passage]."* - calls `rewrite_for_aeo` (uses MCP sampling if your client supports it).
105
+
106
+ No API keys. No accounts. The first call may take a few seconds while `npx` downloads the package; subsequent calls are instant.
107
+
108
+ ## Tools
109
+
110
+ | Tool | Purpose |
111
+ |------|---------|
112
+ | `audit_page` | Composite AI-SEO audit with 8-dimension scoring (schema, technical, structure, robots, freshness, authority, entity density, sitemap). |
113
+ | `audit_schema` | Validate JSON-LD against Schema.org rules and AI-citation best practice. Flags deprecated patterns. |
114
+ | `audit_canonical` | Canonical link integrity, trailing-slash hygiene, `og:url` consistency. |
115
+ | `check_robots` | Parse `robots.txt` and report per-crawler allow/disallow for all known AI crawlers. Surfaces the GPTBot-blocked-but-OAI-SearchBot-allowed trap. |
116
+ | `check_sitemap` | Validate XML sitemaps: presence, URL count, `lastmod` freshness, image/video extensions. |
117
+ | `check_technical` | HEAD tag audit: canonical, OpenGraph, Twitter Card, hreflang, HTTPS, noindex, title hygiene. |
118
+ | `score_ai_overview_eligibility` | Score a page's probability of appearing in Google AI Overviews using current correlation factors. |
119
+ | `generate_llms_txt` | Generate `llms.txt` and optionally `llms-full.txt` from a domain's sitemap. |
120
+ | `validate_llms_txt` | Lint an existing `llms.txt` for spec compliance and broken links. |
121
+ | `score_citation_worthiness` | Score how citable a page or text block is for Perplexity, ChatGPT, Google AI Overviews, and Claude. |
122
+ | `rewrite_for_aeo` | Rewrite content for Answer Engine Optimization (BLUF structure, FAQ format, schema additions). |
123
+ | `rewrite_for_geo` | Rewrite content for Generative Engine Optimization (entity definitions, comparison tables, synthesis-ready structure). |
124
+ | `extract_entities` | Extract named entities, `sameAs` links, and citation-density score from a page's content and structured data. |
125
+
126
+ ## Example
127
+
128
+ In Claude Desktop, after wiring the server above:
129
+
130
+ > **You:** Run an AI-SEO audit on `https://automatelab.tech/how-to-connect-zapier-to-notion`.
131
+
132
+ Claude calls `audit_page`. Result (truncated):
133
+
134
+ ```json
135
+ {
136
+ "url": "https://automatelab.tech/how-to-connect-zapier-to-notion",
137
+ "fetched_at": "2026-05-15T10:32:00Z",
138
+ "score": 61,
139
+ "grade": "C",
140
+ "dimension_scores": {
141
+ "schema": 45, "technical": 80, "structure": 40,
142
+ "robots": 90, "freshness": 85, "authority": 40,
143
+ "entity_density": 21, "sitemap": 100
144
+ },
145
+ "findings": [
146
+ {
147
+ "severity": "critical",
148
+ "category": "structure",
149
+ "where": "<body>",
150
+ "message": "No FAQ structure found (no FAQPage schema or H3 question headings).",
151
+ "fix": "Add FAQ H3 headings ending in '?' with answer paragraphs, and a FAQPage JSON-LD block.",
152
+ "estimated_impact": "high"
153
+ },
154
+ {
155
+ "severity": "warning",
156
+ "category": "authority",
157
+ "where": "page-level",
158
+ "message": "Low authority signals - missing Organization or author Person schema.",
159
+ "fix": "Add Organization JSON-LD and Article.author as a Person node with sameAs links.",
160
+ "estimated_impact": "high"
161
+ }
162
+ ]
163
+ }
164
+ ```
165
+
166
+ Claude then summarizes the findings and proposes fixes. For rewrite tools, the host model (Claude / GPT / etc.) does the rewriting via MCP sampling.
167
+
168
+ ## Environment variables
169
+
170
+ All variables are optional. Set them in the MCP client config under `"env"`.
171
+
172
+ | Variable | Default | Description |
173
+ |----------|---------|-------------|
174
+ | `USER_AGENT` | `automatelab-ai-seo-mcp/0.1.0 (+https://github.com/AutomateLab-tech/ai-seo)` | HTTP User-Agent on all fetches. |
175
+ | `FETCH_TIMEOUT_MS` | `15000` | Per-request timeout in milliseconds. |
176
+ | `MAX_BYTES` | `5242880` | Maximum response body size in bytes (5 MB). |
177
+ | `RESPECT_ROBOTS` | `true` | Global default for robots.txt compliance. Set `"false"` to disable. |
178
+ | `INTER_REQUEST_DELAY_MS` | `1500` | Minimum delay between requests to the same host within a tool call. |
179
+
180
+ ## Polite by default
181
+
182
+ Every tool that hits the network goes through one fetch path that:
183
+
184
+ - Respects `robots.txt` for the configured User-Agent (override with `RESPECT_ROBOTS=false`).
185
+ - Identifies itself honestly via `User-Agent` (no spoofing as a browser).
186
+ - Sleeps `INTER_REQUEST_DELAY_MS` between requests to the same host within a tool call.
187
+ - Times out at `FETCH_TIMEOUT_MS` per request.
188
+ - Caps response body at `MAX_BYTES` and refuses non-HTML / non-XML payloads where inappropriate.
189
+
190
+ This MCP is not a scraper. It audits public pages the way Lighthouse or Screaming Frog do, one URL at a time.
191
+
192
+ ## What it does not do
193
+
194
+ - No JavaScript-rendered scraping. Only static HTML is fetched. SPAs that render content client-side will produce incomplete audits.
195
+ - No paid-API integrations (Search Console, Ahrefs, Semrush). Bring those signals manually if you need them.
196
+ - No site-wide crawling. Tools that need multiple URLs read from the public sitemap.
197
+ - No live SERP checks. AI Overview eligibility is a deterministic heuristic, not a guarantee.
198
+ - English-language tuning. Technical checks (schema, robots, canonical) are language-agnostic; content scoring assumes English.
199
+ - Entity extraction is regex-based (title-case phrases, acronyms, CamelCase). False positives and misses are expected on v0.1.
200
+
201
+ ## Contributing
202
+
203
+ Bug reports, feature ideas, and PRs welcome. See [CONTRIBUTING.md](./CONTRIBUTING.md).
204
+
205
+ ## Security
206
+
207
+ To report a vulnerability, see [SECURITY.md](./SECURITY.md).
208
+
209
+ ## License
210
+
211
+ MIT - see [LICENSE](./LICENSE).
212
+
213
+ ## Acknowledgements
214
+
215
+ Built by [automatelab.tech](https://automatelab.tech/products/mcp/ai-seo/)
216
+
217
+ Schema.org, `robots.txt`, and `llms.txt` are open standards. Crawler user-agent data is sourced from Anthropic, OpenAI, Google, Perplexity, and Cloudflare documentation. The MCP itself is built on the [Model Context Protocol](https://modelcontextprotocol.io) by Anthropic.
@@ -17,20 +17,20 @@ export const rewriteForAeoInputSchema = z
17
17
  .refine((d) => d.url !== undefined || d.text !== undefined, {
18
18
  message: "One of url or text is required",
19
19
  });
20
- const AEO_SYSTEM_PROMPT = `You are an Answer Engine Optimization (AEO) specialist. Rewrite the provided content to maximize AI engine citation probability.
21
-
22
- Rules:
23
- 1. Open with a direct 40-60 word answer to the target query (BLUF - Bottom Line Up Front).
24
- 2. Structure body content into FAQ format: H3 questions ending in "?" followed by 40-60 word answers.
25
- 3. Include at least one ordered list for procedural content.
26
- 4. Define key technical terms inline (e.g., "X is a type of Y that...").
27
- 5. Cite statistics with year and source where present.
28
- 6. End with a "Key Takeaways" or "Summary" section.
29
- 7. No em-dashes. No filler phrases ("In conclusion", "It is important to note").
30
- 8. Keep within the max_words limit.
31
- 9. For howto format: use numbered HowToStep structure.
32
- 10. For comparison format: include a comparison table.
33
-
20
+ const AEO_SYSTEM_PROMPT = `You are an Answer Engine Optimization (AEO) specialist. Rewrite the provided content to maximize AI engine citation probability.
21
+
22
+ Rules:
23
+ 1. Open with a direct 40-60 word answer to the target query (BLUF - Bottom Line Up Front).
24
+ 2. Structure body content into FAQ format: H3 questions ending in "?" followed by 40-60 word answers.
25
+ 3. Include at least one ordered list for procedural content.
26
+ 4. Define key technical terms inline (e.g., "X is a type of Y that...").
27
+ 5. Cite statistics with year and source where present.
28
+ 6. End with a "Key Takeaways" or "Summary" section.
29
+ 7. No em-dashes. No filler phrases ("In conclusion", "It is important to note").
30
+ 8. Keep within the max_words limit.
31
+ 9. For howto format: use numbered HowToStep structure.
32
+ 10. For comparison format: include a comparison table.
33
+
34
34
  Also generate a JSON-LD schema block appropriate for the content type and format.`;
35
35
  export async function rewriteForAeo(input, hostDelays, robotsCache, server) {
36
36
  // Fetch URL if provided
@@ -47,18 +47,18 @@ export async function rewriteForAeo(input, hostDelays, robotsCache, server) {
47
47
  // Compute before score
48
48
  const beforeResult = await scoreCitationWorthiness({ text: originalText, target_query: input.target_query, respect_robots: false }, hostDelays, robotsCache);
49
49
  const before_score = beforeResult.overall_score;
50
- const userMessage = `Target query: "${input.target_query}"
51
- Format: ${input.format}
52
- Max words: ${input.max_words}
53
-
54
- Original content:
55
- ---
56
- ${originalText.substring(0, 4000)}
57
- ---
58
-
59
- Rewrite this content for AEO. Return your response as JSON with these fields:
60
- - rewritten_text: the rewritten content (Markdown)
61
- - schema_additions: JSON-LD string to add to the page <head>
50
+ const userMessage = `Target query: "${input.target_query}"
51
+ Format: ${input.format}
52
+ Max words: ${input.max_words}
53
+
54
+ Original content:
55
+ ---
56
+ ${originalText.substring(0, 4000)}
57
+ ---
58
+
59
+ Rewrite this content for AEO. Return your response as JSON with these fields:
60
+ - rewritten_text: the rewritten content (Markdown)
61
+ - schema_additions: JSON-LD string to add to the page <head>
62
62
  - changes_made: array of strings describing each change applied`;
63
63
  // Attempt MCP sampling
64
64
  if (server) {
@@ -102,8 +102,8 @@ Rewrite this content for AEO. Return your response as JSON with these fields:
102
102
  }
103
103
  }
104
104
  // Prompt template fallback
105
- const promptTemplate = `${AEO_SYSTEM_PROMPT}
106
-
105
+ const promptTemplate = `${AEO_SYSTEM_PROMPT}
106
+
107
107
  ${userMessage}`;
108
108
  return {
109
109
  rewritten_text: promptTemplate,
@@ -16,19 +16,19 @@ export const rewriteForGeoInputSchema = z
16
16
  .refine((d) => d.url !== undefined || d.text !== undefined, {
17
17
  message: "One of url or text is required",
18
18
  });
19
- const GEO_SYSTEM_PROMPT = `You are a Generative Engine Optimization (GEO) specialist focused on Google AI Overviews and multi-source synthesis engines.
20
-
21
- Rules:
22
- 1. Define every key entity inline on first mention: "X (also known as Y) is a type of Z that...".
23
- 2. Include authoritative external citations with hyperlinks (Wikipedia, official docs, research papers).
24
- 3. Add a comparison table if requested or if the query implies comparison.
25
- 4. Use numbered feature lists for technical capabilities.
26
- 5. Structure for multi-source synthesis: each section should be independently citable without reading the full article.
27
- 6. Cite statistics with source, year, and context.
28
- 7. Add a "Related entities" section at the end listing key entities with sameAs links.
29
- 8. No em-dashes. No filler phrases.
30
- 9. Keep within the max_words limit.
31
-
19
+ const GEO_SYSTEM_PROMPT = `You are a Generative Engine Optimization (GEO) specialist focused on Google AI Overviews and multi-source synthesis engines.
20
+
21
+ Rules:
22
+ 1. Define every key entity inline on first mention: "X (also known as Y) is a type of Z that...".
23
+ 2. Include authoritative external citations with hyperlinks (Wikipedia, official docs, research papers).
24
+ 3. Add a comparison table if requested or if the query implies comparison.
25
+ 4. Use numbered feature lists for technical capabilities.
26
+ 5. Structure for multi-source synthesis: each section should be independently citable without reading the full article.
27
+ 6. Cite statistics with source, year, and context.
28
+ 7. Add a "Related entities" section at the end listing key entities with sameAs links.
29
+ 8. No em-dashes. No filler phrases.
30
+ 9. Keep within the max_words limit.
31
+
32
32
  Generate JSON-LD schema for all key entities mentioned (Organization, Person, Product, SoftwareApplication as appropriate) with sameAs links.`;
33
33
  export async function rewriteForGeo(input, hostDelays, robotsCache, server) {
34
34
  let originalText = input.text ?? "";
@@ -43,19 +43,19 @@ export async function rewriteForGeo(input, hostDelays, robotsCache, server) {
43
43
  }
44
44
  const beforeResult = await scoreCitationWorthiness({ text: originalText, target_query: input.target_query, respect_robots: false }, hostDelays, robotsCache);
45
45
  const before_score = beforeResult.overall_score;
46
- const userMessage = `Target query: "${input.target_query}"
47
- Add comparison table: ${input.add_comparison_table}
48
- Max words: ${input.max_words}
49
-
50
- Original content:
51
- ---
52
- ${originalText.substring(0, 4000)}
53
- ---
54
-
55
- Rewrite this content for GEO. Return JSON with:
56
- - rewritten_text: Markdown content
57
- - schema_additions: JSON-LD for key entities
58
- - changes_made: array of changes applied
46
+ const userMessage = `Target query: "${input.target_query}"
47
+ Add comparison table: ${input.add_comparison_table}
48
+ Max words: ${input.max_words}
49
+
50
+ Original content:
51
+ ---
52
+ ${originalText.substring(0, 4000)}
53
+ ---
54
+
55
+ Rewrite this content for GEO. Return JSON with:
56
+ - rewritten_text: Markdown content
57
+ - schema_additions: JSON-LD for key entities
58
+ - changes_made: array of changes applied
59
59
  - entities_added: array of entity names you defined or linked`;
60
60
  if (server) {
61
61
  try {
@@ -97,8 +97,8 @@ Rewrite this content for GEO. Return JSON with:
97
97
  // sampling unavailable
98
98
  }
99
99
  }
100
- const promptTemplate = `${GEO_SYSTEM_PROMPT}
101
-
100
+ const promptTemplate = `${GEO_SYSTEM_PROMPT}
101
+
102
102
  ${userMessage}`;
103
103
  return {
104
104
  rewritten_text: promptTemplate,
package/package.json CHANGED
@@ -1,60 +1,61 @@
1
- {
2
- "name": "@automatelab/ai-seo-mcp",
3
- "version": "0.1.0",
4
- "description": "MCP server for AI-SEO auditing: schema, robots.txt, llms.txt, citation scoring, and AEO/GEO rewrites",
5
- "license": "MIT",
6
- "author": "automatelab.tech",
7
- "homepage": "https://github.com/AutomateLab-tech/ai-seo",
8
- "repository": {
9
- "type": "git",
10
- "url": "git+https://github.com/AutomateLab-tech/ai-seo.git"
11
- },
12
- "engines": { "node": ">=20" },
13
- "type": "module",
14
- "bin": {
15
- "ai-seo-mcp": "dist/index.js"
16
- },
17
- "main": "dist/index.js",
18
- "scripts": {
19
- "build": "tsc",
20
- "dev": "tsx src/index.ts",
21
- "start": "node dist/index.js",
22
- "test": "vitest run",
23
- "test:watch": "vitest",
24
- "lint": "eslint src tests --ext .ts",
25
- "typecheck": "tsc --noEmit"
26
- },
27
- "dependencies": {
28
- "@modelcontextprotocol/sdk": "1.29.0",
29
- "cheerio": "1.0.0",
30
- "fast-xml-parser": "5.8.0",
31
- "robots-parser": "3.0.1",
32
- "undici": "7.25.0",
33
- "zod": "3.25.76"
34
- },
35
- "devDependencies": {
36
- "@types/node": "22.19.19",
37
- "tsx": "4.22.0",
38
- "typescript": "5.7.3",
39
- "vitest": "3.2.4"
40
- },
41
- "files": [
42
- "dist",
43
- "src/lib/crawlers.json",
44
- "src/lib/schema-types.json",
45
- "README.md",
46
- "LICENSE"
47
- ],
48
- "keywords": [
49
- "mcp",
50
- "seo",
51
- "ai-seo",
52
- "aeo",
53
- "geo",
54
- "ai-overview",
55
- "schema",
56
- "robots",
57
- "llms-txt",
58
- "citation"
59
- ]
60
- }
1
+ {
2
+ "name": "@automatelab/ai-seo-mcp",
3
+ "version": "0.1.1",
4
+ "mcpName": "io.github.AutomateLab-tech/ai-seo",
5
+ "description": "MCP server for AI-SEO auditing: schema, robots.txt, llms.txt, citation scoring, and AEO/GEO rewrites",
6
+ "license": "MIT",
7
+ "author": "automatelab.tech",
8
+ "homepage": "https://github.com/AutomateLab-tech/ai-seo",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/AutomateLab-tech/ai-seo.git"
12
+ },
13
+ "engines": { "node": ">=20" },
14
+ "type": "module",
15
+ "bin": {
16
+ "ai-seo-mcp": "dist/index.js"
17
+ },
18
+ "main": "dist/index.js",
19
+ "scripts": {
20
+ "build": "tsc",
21
+ "dev": "tsx src/index.ts",
22
+ "start": "node dist/index.js",
23
+ "test": "vitest run",
24
+ "test:watch": "vitest",
25
+ "lint": "eslint src tests --ext .ts",
26
+ "typecheck": "tsc --noEmit"
27
+ },
28
+ "dependencies": {
29
+ "@modelcontextprotocol/sdk": "1.29.0",
30
+ "cheerio": "1.0.0",
31
+ "fast-xml-parser": "5.8.0",
32
+ "robots-parser": "3.0.1",
33
+ "undici": "7.25.0",
34
+ "zod": "3.25.76"
35
+ },
36
+ "devDependencies": {
37
+ "@types/node": "22.19.19",
38
+ "tsx": "4.22.0",
39
+ "typescript": "5.7.3",
40
+ "vitest": "3.2.4"
41
+ },
42
+ "files": [
43
+ "dist",
44
+ "src/lib/crawlers.json",
45
+ "src/lib/schema-types.json",
46
+ "README.md",
47
+ "LICENSE"
48
+ ],
49
+ "keywords": [
50
+ "mcp",
51
+ "seo",
52
+ "ai-seo",
53
+ "aeo",
54
+ "geo",
55
+ "ai-overview",
56
+ "schema",
57
+ "robots",
58
+ "llms-txt",
59
+ "citation"
60
+ ]
61
+ }
@@ -1,6 +1,6 @@
1
- {
2
- "training": ["GPTBot", "ClaudeBot", "CCBot", "Meta-ExternalAgent", "Amazonbot"],
3
- "search": ["OAI-SearchBot", "Claude-SearchBot", "PerplexityBot", "Bingbot", "DuckAssistBot"],
4
- "user_triggered": ["ChatGPT-User", "Claude-User", "Google-Agent"],
5
- "robots_token_only": ["Google-Extended", "Applebot-Extended"]
6
- }
1
+ {
2
+ "training": ["GPTBot", "ClaudeBot", "CCBot", "Meta-ExternalAgent", "Amazonbot"],
3
+ "search": ["OAI-SearchBot", "Claude-SearchBot", "PerplexityBot", "Bingbot", "DuckAssistBot"],
4
+ "user_triggered": ["ChatGPT-User", "Claude-User", "Google-Agent"],
5
+ "robots_token_only": ["Google-Extended", "Applebot-Extended"]
6
+ }
@@ -1,56 +1,56 @@
1
- [
2
- "Article",
3
- "BlogPosting",
4
- "NewsArticle",
5
- "FAQPage",
6
- "Question",
7
- "Answer",
8
- "HowTo",
9
- "HowToStep",
10
- "HowToSection",
11
- "HowToTool",
12
- "HowToSupply",
13
- "Organization",
14
- "LocalBusiness",
15
- "Person",
16
- "Product",
17
- "Offer",
18
- "AggregateOffer",
19
- "Review",
20
- "AggregateRating",
21
- "Rating",
22
- "BreadcrumbList",
23
- "ListItem",
24
- "SoftwareApplication",
25
- "WebApplication",
26
- "MobileApplication",
27
- "WebSite",
28
- "WebPage",
29
- "ItemPage",
30
- "AboutPage",
31
- "ContactPage",
32
- "SearchResultsPage",
33
- "ImageObject",
34
- "VideoObject",
35
- "AudioObject",
36
- "MediaObject",
37
- "Event",
38
- "CreativeWork",
39
- "Book",
40
- "Course",
41
- "Recipe",
42
- "Dataset",
43
- "SpeakableSpecification",
44
- "SearchAction",
45
- "EntryPoint",
46
- "PostalAddress",
47
- "GeoCoordinates",
48
- "OpeningHoursSpecification",
49
- "PriceSpecification",
50
- "MonetaryAmount",
51
- "ContactPoint",
52
- "Brand",
53
- "Intangible",
54
- "Thing",
55
- "Place"
56
- ]
1
+ [
2
+ "Article",
3
+ "BlogPosting",
4
+ "NewsArticle",
5
+ "FAQPage",
6
+ "Question",
7
+ "Answer",
8
+ "HowTo",
9
+ "HowToStep",
10
+ "HowToSection",
11
+ "HowToTool",
12
+ "HowToSupply",
13
+ "Organization",
14
+ "LocalBusiness",
15
+ "Person",
16
+ "Product",
17
+ "Offer",
18
+ "AggregateOffer",
19
+ "Review",
20
+ "AggregateRating",
21
+ "Rating",
22
+ "BreadcrumbList",
23
+ "ListItem",
24
+ "SoftwareApplication",
25
+ "WebApplication",
26
+ "MobileApplication",
27
+ "WebSite",
28
+ "WebPage",
29
+ "ItemPage",
30
+ "AboutPage",
31
+ "ContactPage",
32
+ "SearchResultsPage",
33
+ "ImageObject",
34
+ "VideoObject",
35
+ "AudioObject",
36
+ "MediaObject",
37
+ "Event",
38
+ "CreativeWork",
39
+ "Book",
40
+ "Course",
41
+ "Recipe",
42
+ "Dataset",
43
+ "SpeakableSpecification",
44
+ "SearchAction",
45
+ "EntryPoint",
46
+ "PostalAddress",
47
+ "GeoCoordinates",
48
+ "OpeningHoursSpecification",
49
+ "PriceSpecification",
50
+ "MonetaryAmount",
51
+ "ContactPoint",
52
+ "Brand",
53
+ "Intangible",
54
+ "Thing",
55
+ "Place"
56
+ ]