# OpenAPI, llms.txt & MCP Agent-Readiness Auditor + MCP Generator (`trustlens_labs/agent-readiness-openapi-mcp-auditor`) Actor

Audit any domain or API for AI-agent readiness: llms.txt, robots.txt AI crawler matrix (GPTBot, ClaudeBot, PerplexityBot), MCP & A2A discovery cards, Markdown negotiation, Schema.org JSON-LD, OpenAPI discovery, and auto-generated MCP tool schemas.

- **URL**: https://apify.com/trustlens_labs/agent-readiness-openapi-mcp-auditor.md
- **Developed by:** [TrustLens Labs](https://apify.com/trustlens_labs) (community)
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $20.00 / 1,000 ai agent-readiness & protocol audits

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## AgentReady — OpenAPI, llms.txt & MCP Agent-Readiness Auditor

> **Audit any website or SaaS API for AI-agent readiness in under 2 seconds — and automatically convert discovered OpenAPI 3.x / Swagger 2.0 specs into ready-to-use Model Context Protocol (MCP) tool definitions.**

Built by **TrustLens Labs**. Pure lightweight HTTP/JSON analysis (zero headless Chromium overhead, ~128 MB RAM, millisecond parsing, 100% open web standards).

***

### What It Audits

1. **`llms.txt` & `llms-full.txt` Compliance (`llmstxt.org`)**
   - Probes `/llms.txt`, `/.well-known/llms.txt`, and `/llms-full.txt` (filtering out HTML soft-404 pages).
   - Extracts H1 title, blockquote summary, H2 sections, Markdown link count, estimated LLM token count, and spec compliance issues.
2. **AI Crawler `robots.txt` Policy Matrix (11 Major AI Bots)**
   - Evaluates RFC 9309 allow/disallow rules for: `GPTBot`, `OAI-SearchBot`, `ChatGPT-User`, `ClaudeBot`, `Claude-SearchBot`, `Claude-User`, `Google-Extended`, `PerplexityBot`, `Applebot-Extended`, `CCBot`, and `Meta-ExternalAgent`, plus `Content-Signal` directives and `Sitemap:` URLs.
3. **Agent Discovery Protocols (`/.well-known/`)**
   - Detects **Model Context Protocol (MCP)** discovery cards (`/.well-known/mcp/server-card.json`, `/.well-known/mcp.json`), **A2A Agent Cards** (`/.well-known/agent.json`), and legacy AI plugin manifests (`/.well-known/ai-plugin.json`).
4. **OpenAPI / Swagger Discovery & Automatic MCP Tool Schema Generator**
   - Discovers public OpenAPI 3.x or Swagger 2.0 JSON specs from direct URLs, `llms.txt`, `ai-plugin.json`, HTML links, `/.well-known/openapi.json`, and `/openapi.json`.
   - Resolves internal `#/components/schemas` `$ref` definitions and generates clean **MCP Tool JSON schemas** (`name`, `description`, `httpMethod`, `httpPath`, `inputSchema`, `requiresAuth`).
5. **Markdown Content Negotiation & Structured Machine Data**
   - Tests `Accept: text/markdown` negotiation (e.g. Cloudflare Markdown for Agents + `x-markdown-tokens` header).
   - Extracts Schema.org JSON-LD types, OpenGraph tags, RSS/Atom/JSON feeds, and API documentation links.
6. **Deterministic 0–100 Agent-Readiness Score (`A+` to `F`) + Weekly Diff Monitoring**
   - Breaks down readiness across 5 pillars with concrete engineering recommendations.
   - Optional **Diff Mode** stores baselines in an Apify Key-Value Store and flags `llms_txt_added`, `llms_txt_removed`, `ai_bot_policy_changed`, `mcp_discovered`, `a2a_discovered`, `openapi_updated`, and `grade_changed`.

***

### Use Cases

- **GEO / AI-SEO Agencies & DevRel Teams:** Benchmark 100+ client or competitor domains weekly for `llms.txt`, AI search bot access, and Markdown-for-Agents support.
- **MCP Server Builders & AI Engineers:** Pass any public OpenAPI JSON URL to instantly generate validated MCP tool definitions (`inputSchema`) ready for Claude, Cursor, or custom agent routers.
- **Autonomous AI Agents (via Apify MCP Server):** Give agents a single tool to check whether an external vendor exposes machine-readable docs, MCP cards, or OpenAPI endpoints before attempting web scraping.

***

### Example Output

```json
{
  "target": "cloudflare.com",
  "domain": "cloudflare.com",
  "status": "ok",
  "score": {
    "overall": 78,
    "grade": "B",
    "breakdown": {
      "llmsTxtQuality": 18,
      "aiCrawlerAccess": 20,
      "agentProtocolsAndApi": 13,
      "structuredMachineData": 12,
      "contentNegotiationAndFeeds": 15
    }
  },
  "llmsTxt": {
    "found": true,
    "specCompliant": true,
    "linkCount": 42,
    "estimatedTokens": 1850
  },
  "aiCrawlers": {
    "robotsTxtFound": true,
    "summary": "Selective (8 allowed, 3 blocked)"
  },
  "protocols": {
    "mcpFound": false,
    "a2aAgentCardFound": false
  },
  "structuredData": {
    "markdownNegotiationSupported": true,
    "jsonLdTypes": ["Organization", "WebSite"]
  },
  "mcpToolsCount": 0
}
```

***

### Transparent Pay-Per-Event Pricing

- **`agent-audit` ($0.02 / domain):** Charged only on successful domain audits (never charged on invalid or failed targets).
- **`mcp-codegen` ($0.03 / spec):** Charged only when `generateMcpTools` is enabled AND a valid OpenAPI/Swagger spec is actually converted into MCP tool schemas.

# Actor input Schema

## `targets` (type: `array`):

List of public domains (e.g. \["stripe.com", "apify.com", "cloudflare.com"]) or direct OpenAPI/Swagger JSON URLs.

## `generateMcpTools` (type: `boolean`):

When an OpenAPI 3.x or Swagger 2.0 JSON spec is discovered (or passed directly), convert operations into ready-to-use MCP tool definitions (name, description, JSON Schema inputSchema).

## `maxMcpTools` (type: `integer`):

Cap on generated MCP tool definitions per OpenAPI spec (1-100).

## `enableDiffMonitoring` (type: `boolean`):

Compare each target against its previous baseline in a named Apify Key-Value Store and emit structured diffs (llms_txt_added, ai_bot_policy_changed, mcp_discovered, openapi_updated, grade_changed).

## `diffStoreName` (type: `string`):

Apify Key-Value Store name for baseline snapshots when Diff Mode is enabled.

## `concurrency` (type: `integer`):

Number of domains or OpenAPI URLs audited concurrently (1-10).

## `timeoutMs` (type: `integer`):

Maximum milliseconds to wait per HTTP request before timing out (3000-20000).

## Actor input object example

```json
{
  "targets": [
    "apify.com",
    "stripe.com",
    "cloudflare.com"
  ],
  "generateMcpTools": true,
  "maxMcpTools": 25,
  "enableDiffMonitoring": false,
  "diffStoreName": "agentready-baselines",
  "concurrency": 4,
  "timeoutMs": 8000
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

# 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 = {
    "targets": [
        "apify.com",
        "stripe.com",
        "cloudflare.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("trustlens_labs/agent-readiness-openapi-mcp-auditor").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 = { "targets": [
        "apify.com",
        "stripe.com",
        "cloudflare.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("trustlens_labs/agent-readiness-openapi-mcp-auditor").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 '{
  "targets": [
    "apify.com",
    "stripe.com",
    "cloudflare.com"
  ]
}' |
apify call trustlens_labs/agent-readiness-openapi-mcp-auditor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,trustlens_labs/agent-readiness-openapi-mcp-auditor"
        }
    }
}
```

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/H2TiR6f7zNzccojGf/builds/D7LbQ7AzDfCRvkfyJ/openapi.json
