# SaaS robots.txt, Sitemap & llms.txt AI Crawl Audit (MCP) (`the_magic_dragon/saas-robots-sitemap-llms-audit-mcp`) Actor

Audit SaaS domains for AI bot robots.txt crawl policies (GPTBot, OAI-SearchBot, ClaudeBot, PerplexityBot, Google-Extended, CCBot, Applebot-Extended, Bytespider), XML/gzip sitemaps, and llms.txt / llms-full.txt AI readiness (0-100). MCP-ready.

- **URL**: https://apify.com/the_magic_dragon/saas-robots-sitemap-llms-audit-mcp.md
- **Developed by:** [Cade Hockley](https://apify.com/the_magic_dragon) (community)
- **Categories:** AI, SEO tools, Developer tools
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.20 / 1,000 site auditeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## SaaS robots.txt, Sitemap & llms.txt AI Crawl Audit (MCP)

Audit SaaS domains and documentation sites for **AI crawler permissions in `robots.txt`**, **XML / gzip sitemaps**, and **`llms.txt` / `llms-full.txt` readiness** with a `0–100` AI Readiness Score and actionable recommendations.

Built for **Apify Pay-per-Event** (`$0.004` per site audited), **MCP AI agents**, **Clay**, and **n8n** SEO / GEO (Generative Engine Optimization) workflows.

### Overview

Modern AI search and coding assistants rely on `robots.txt` crawl permissions, XML sitemaps, and the emerging `llms.txt` standard to discover and cite SaaS documentation. Misconfigured `robots.txt` wildcards, broken or gzipped sitemaps, or missing `llms.txt` files silently block visibility across AI search engines.

#### Key Capabilities

- **AI Bot Policy Matrix (`robots.txt`):** Fetches `https://{host}/robots.txt` (up to `256 KB`, gzip/UTF-8 safe) and evaluates RFC 9309 `Allow` / `Disallow` rules for `GPTBot`, `OAI-SearchBot`, `ClaudeBot`, `PerplexityBot`, `Google-Extended`, `CCBot`, `Applebot-Extended`, `Bytespider`, and `*`.
- **XML & Gzip Sitemap Inspection:** Inspects the first `Sitemap:` URL declared in `robots.txt` (or fallback `https://{host}/sitemap.xml`), capped at `512 KB`, with transparent `.gz` / gzip magic-byte decompression, `<loc>` URL counting, `<sitemap>` index counting, latest `<lastmod>` extraction, and defensive `ParseError` handling.
- **`llms.txt` & `llms-full.txt` Readiness:** Checks both `/llms.txt` and `/llms-full.txt` for HTTP status, non-HTML content verification (filtering out SPA HTML 200 fallbacks), byte size, Markdown heading title, and link count.
- **AI Readiness Score (`0–100`) & Actionable Summary:** Outputs `crawlPolicySummary` with `allowsAiTraining`, `allowsAiSearch`, `sitemapCountDetected`, `hasLlmsTxt`, `findings`, and `recommendations`.

### Input & Output

#### Input Fields

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `domains` | `array<string>` | *Required* | List of bare domains (e.g. `stripe.com`) or HTTP(S) URLs (up to 500 per run). |
| `timeoutSeconds` | `integer` | `12` | Per-request HTTP timeout in seconds (`3–30`). |
| `checkLlmsTxt` | `boolean` | `true` | Fetch `/llms.txt` and `/llms-full.txt` for Markdown AI readiness checks. |
| `checkSitemap` | `boolean` | `true` | Inspect the primary declared sitemap (or `/sitemap.xml`) up to `512 KB`. |
| `conciseMcpMode` | `boolean` | `true` | Trims verbose rule lists and excerpts to keep responses compact for MCP / LLM contexts. |

#### Output Dataset Fields

| Field | Type | Description |
| --- | --- | --- |
| `domain` | `string \| null` | Normalized ASCII hostname. |
| `status` | `string` | `ok`, `invalid_input`, or `network_error`. |
| `ok` | `boolean` | `true` when HTTP audit completed cleanly. |
| `aiReadinessScore` | `integer` | Composite `0–100` AI crawl & documentation readiness score. |
| `crawlPolicySummary` | `object \| null` | `allowsAiTraining`, `allowsAiSearch`, `sitemapCountDetected`, `hasLlmsTxt`, `findings`, and `recommendations`. |
| `robotsTxt` | `object \| null` | Parsed `robots.txt` metadata, declared sitemaps, and per-bot `botPolicyMatrix`. |
| `sitemap` | `object \| null` | Sitemap source, kind (`urlset`/`sitemapindex`), `urlCount`, `sitemapIndexCount`, and `latestLastmod`. |
| `llmsTxt` | `object \| null` | Inspection results for both `/llms.txt` and `/llms-full.txt`. |

### Use Cases

- **GEO / AI Search Agencies:** Identify SaaS prospects blocking `OAI-SearchBot` or `PerplexityBot` or missing `/llms.txt` as high-intent agency outreach hooks in Clay.
- **Technical SEO & Docs Engineering:** Validate XML/gzip sitemap parsing, `<loc>` counts, and `/llms-full.txt` Markdown validity across docs subdomains (`docs.*`) in CI or n8n.
- **AI Agent Diagnostics (`mcp.apify.com`):** Check whether any domain permits AI search citation crawlers before indexing.

### Pay-per-Event Pricing & Store Discounts

This Actor uses **Apify Pay-per-Event (PPE)** billing on `site-audited`, with **automatic Apify Store discounts** for paid subscription tiers:

| Apify Tier | Price per Valid Site | Effective Rate / 1,000 Sites |
| --- | --- | --- |
| Free (`FREE`) | `$0.0040` | `US$4.00` |
| Starter (`BRONZE`) | `$0.0034` | `US$3.40` (15% off) |
| Scale (`SILVER`) | `$0.0028` | `US$2.80` (30% off) |
| Business (`GOLD`) | `$0.0022` | `US$2.20` (45% off) |
| Enterprise (`PLATINUM` / `DIAMOND`) | `$0.0018` / `$0.0014` | `US$1.80` / `US$1.40` |

- **Fair Billing Guarantee:** Malformed inputs (`invalid_input`) and pre-HTTP DNS/socket failures (`network_error`) incur **`$0.00`**. Runs smoothly at **256 MB** RAM.

### Example Input

```json
{
  "domains": [
    "stripe.com",
    "docs.anthropic.com"
  ],
  "timeoutSeconds": 12,
  "checkLlmsTxt": true,
  "checkSitemap": true,
  "conciseMcpMode": true
}
```

### Example Output

```json
{
  "input": "docs.anthropic.com",
  "domain": "docs.anthropic.com",
  "status": "ok",
  "ok": true,
  "aiReadinessScore": 95,
  "crawlPolicySummary": {
    "allowsAiTraining": true,
    "allowsAiSearch": true,
    "sitemapCountDetected": 1,
    "hasLlmsTxt": true,
    "hasLlmsFullTxt": true,
    "findings": [
      "robots.txt is reachable (HTTP 200).",
      "AI search/citation bots (OAI-SearchBot / PerplexityBot) are permitted.",
      "/llms.txt is present."
    ],
    "recommendations": []
  },
  "error": null
}
```

### Hosted MCP Configuration (`mcp.apify.com`)

Connect this Actor directly to Claude Desktop, Cursor, or any MCP client using Apify's hosted MCP endpoint:

```json
{
  "mcpServers": {
    "apify-saas-ai-crawl-audit": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://mcp.apify.com/?actors=the_magic_dragon/saas-robots-sitemap-llms-audit-mcp",
        "--header",
        "Authorization: Bearer ${APIFY_TOKEN}"
      ]
    }
  }
}
```

### Clay & n8n Integration Tips

- **Clay:** Add an **Apify — Run Actor** enrichment column targeting `the_magic_dragon~saas-robots-sitemap-llms-audit-mcp` with `{"domains": ["{{Company Domain}}"], "conciseMcpMode": true}`. Filter prospects where `crawlPolicySummary.hasLlmsTxt == false` or `crawlPolicySummary.allowsAiSearch == false` for targeted GEO/SEO agency outreach.
- **n8n:** Use the official **Apify** node to run weekly audits across customer documentation subdomains (`docs.*`), alerting Slack whenever `aiReadinessScore` drops or `OAI-SearchBot` / `PerplexityBot` becomes disallowed.

### FAQ & Troubleshooting

- **How does this detect fake `/llms.txt` SPA fallback pages?** Many SaaS marketing sites serve an HTML catch-all `200 OK` page for unknown paths. The Actor inspects `Content-Type` and HTML signatures to avoid false positives on SPA fallbacks.
- **Are compressed `.xml.gz` sitemaps supported?** Yes — `.gz` URLs and gzip-compressed responses are decompressed in memory up to the 512 KB cap.
- **Am I charged if a domain doesn't resolve?** No. Pre-HTTP DNS/socket errors and malformed inputs incur `$0.00`.

# Actor input Schema

## `domains` (type: `array`):

List of bare domains (e.g. 'stripe.com') or HTTP/HTTPS URLs (up to 500 per run) to audit.

## `timeoutSeconds` (type: `integer`):

Per-request HTTP timeout in seconds (minimum 3, maximum 30).

## `checkLlmsTxt` (type: `boolean`):

Fetch /llms.txt and /llms-full.txt to inspect AI documentation readiness, headings, and link counts.

## `checkSitemap` (type: `boolean`):

Inspect the first Sitemap URL declared in robots.txt (or fallback /sitemap.xml) up to 512 KB for URL/index counts and latest lastmod.

## `conciseMcpMode` (type: `boolean`):

Trim verbose robots.txt rule lists and raw excerpts to stay lightweight inside LLM and MCP context windows.

## Actor input object example

```json
{
  "domains": [
    "stripe.com",
    "docs.anthropic.com"
  ],
  "timeoutSeconds": 12,
  "checkLlmsTxt": true,
  "checkSitemap": true,
  "conciseMcpMode": true
}
```

# Actor output Schema

## `results` (type: `string`):

Structured per-domain robots.txt AI bot policy matrix, sitemap inspection, llms.txt readiness, and 0-100 AI readiness scores.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "domains": [
        "stripe.com",
        "docs.anthropic.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("the_magic_dragon/saas-robots-sitemap-llms-audit-mcp").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "domains": [
        "stripe.com",
        "docs.anthropic.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("the_magic_dragon/saas-robots-sitemap-llms-audit-mcp").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "domains": [
    "stripe.com",
    "docs.anthropic.com"
  ]
}' |
apify call the_magic_dragon/saas-robots-sitemap-llms-audit-mcp --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,the_magic_dragon/saas-robots-sitemap-llms-audit-mcp"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/CZg99e4t8oQdqNNqz/builds/HcYSipvJ9xqRt2zL6/openapi.json
