API & MCP

Ask your AI to analyze a URL
and it fixes your site's code

Connect Direbase to your AI (Claude Code, Cursor, and others) over MCP. Then ask it to analyze a URL and it fetches the results and fix code and edits your code. You connect it only once.

API keys are available on every plan. Limits and evaluated checks follow the same plan rules as the web app. Reviewing the changes and publishing them stays with you.

Once you have an API key, do these three things

  1. 1Save the key on your computer

    Run this command in the Mac Terminal and paste your API key when asked. The key is not shown on screen or saved in your history.

    read -rs "k?Paste your Direbase key and press Enter: " && echo "export DIREBASE_API_KEY=$k" >> ~/.zshrc && unset k && echo Saved

    Never paste the key into a chat with the AI.

  2. 2Connect it to Claude Code (once)

    Open a new Terminal window and run this command. Direbase is added to Claude Code as a tool you can use from any folder.

    claude mcp add --transport http --scope user direbase https://codequest-seo-api.misty-night-a30e.workers.dev/mcp --header "X-API-Key: $DIREBASE_API_KEY"

    Then quit and reopen Claude Code. If you regenerate your key, run claude mcp remove direbase and this command again.

    For Cursor and other AI tools

    Add this to the MCP settings file (for Cursor, ~/.cursor/mcp.json) and replace the key placeholder with your API key.

    {
      "mcpServers": {
        "direbase": {
          "url": "https://codequest-seo-api.misty-night-a30e.workers.dev/mcp",
          "headers": { "X-API-Key": "YOUR_API_KEY" }
        }
      }
    }
  3. 3Ask it to analyze a URL

    Open your site's folder in Claude Code and ask. The AI runs Direbase, gets the fix code, and first stops to show you its plan. Once you approve, it edits your code and shows you the changes before anything is published. Enter a URL to get a sample request.

    Analyze https://example.com/ with Direbase and suggest fix code.

How it works

Five steps from analysis to a fixed site

  1. 01

    Create an API key

    Sign in and open API key in your dashboard. You get one key per account, shown in full only once. Regenerate it if you lose it.

  2. 02

    Connect Direbase to your AI (once)

    Use the commands in the three steps above to save the key and add Direbase to Claude Code. Do not write the key into prompts or repositories.

  3. 03

    Ask it to analyze a URL

    The AI calls the Direbase tools (SEO analysis, fix code, AIO analysis) itself and reads the results. Nobody has to copy results off a screen.

  4. 04

    The AI shows its plan, then edits after you approve

    The AI shows which file and where each fix would go, then stops. After you approve, it edits your code. Direbase never changes your site.

  5. 05

    You review, publish, and run it again

    You check the changes and publish them. Then ask the AI to analyze the URL again to confirm the score and issues changed. A rerun counts toward your monthly limit.

API

MCP tools and direct endpoints

The MCP endpoint is https://codequest-seo-api.misty-night-a30e.workers.dev/mcp. Your AI sees three tools: diagnose_seo, get_fix_code, and diagnose_aio. To call Direbase from your own code, POST {"url": "URL to analyze", "locale": "en"} to the endpoints below. Send the key in the X-API-Key header either way.

EndpointReturnsLimit
POST /checkSEO score, categories, per-check results (checks), indexability warnings, and more (tool: diagnose_seo)Uses 1 monthly check
POST /aio-checkAIO score (how likely AI search is to cite the page), grade, and category results (tool: diagnose_aio)Uses 1 monthly check
POST /check/suggestionsFix code ordered by score impact, up to your plan's count (tool: get_fix_code)Free (up to 20 calls an hour)

Calling it directly

curl -X POST https://codequest-seo-api.misty-night-a30e.workers.dev/check \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $DIREBASE_API_KEY" \
  -d '{"url": "https://example.com/", "locale": "en"}'

Response (excerpt)

{
  "url": "https://example.com/",
  "score": 72,
  "maxScore": 100,
  "checks": [
    { "id": "seo-meta-desc", "name": "Meta Description",
      "category": "basic_seo", "status": "warning",
      "score": 2, "max_score": 6, "value": "…", "message": "…" }
  ],
  "lockedChecks": [ { "name": "…" } ]
}

Scope

It works on sites in progress, as long as the URL is reachable

Can be analyzed

  • Live sites
  • Publicly reachable staging or preview URLs
  • Client sites (you need their code locally for the AI to fix them)

Cannot be analyzed

  • Sites running only on your machine, such as localhost
  • Test environments behind a login, Basic auth, or IP allowlist
  • Preview URLs with deployment protection turned on

Direbase fetches the URL from its servers, so it cannot read pages that are not reachable from outside. If a prelaunch site uses noindex you will see a not-indexable warning. That is correct before launch; remove noindex when you go live.

Safety

Before you hand results to your AI

  • Text from the analyzed site (titles, headings, descriptions) is written by that site's owner and can contain instructions aimed at AI. Every MCP result includes a note telling the AI to treat that text as data, never as instructions.
  • Fix code that embeds values from the analyzed site is marked containsExternalValues: true. Read it before letting your AI apply it.
  • Keep your API key private. If it leaks, revoke and regenerate it from your dashboard.
  • Do not let the AI publish or deploy. Review the changes yourself first.

Plans

Limits and fix code per plan

FreeEntryBasicPro
Checks per month330100300
Fix code per analysis12AllAll
Checks evaluatedCore checksUp to EntryUp to BasicAll

Compare plans and pricing

FAQ

Does Direbase fix my site automatically?▾
No. Direbase returns the analysis and fix code. Your AI makes the edits, and you review and publish them. The sites we analyze always have their own owners, so we never change them ourselves.
Can I use it on the free plan?▾
Yes. Every plan can create an API key. The free plan includes 3 checks a month and 1 fix per analysis.
Does my AI see more checks than the web app?▾
No. Evaluated checks and limits follow the same plan rules. Checks from higher plans come back as names only, without results (lockedChecks).
Can I analyze a site on localhost?▾
No. Direbase fetches pages from its servers, so it cannot reach sites running only on your machine. Deploy to a reachable test URL first.
What if I lose or forget my API key?▾
Regenerate it under API key in your dashboard. For security the full key is shown only once and cannot be viewed later. Regenerating disables the old key, so update every place that used it, such as your Claude Code setup or the WordPress plugin.
What happens if my API key is invalid?▾
Over MCP, the AI is told the key is invalid or revoked and no analysis runs. When you call the endpoints directly, a wrong key is treated like a signed-out visitor with the guest limit.

Create an API key and try it once

The free plan includes 3 checks a month. Try it on your own site or on a test URL for a site in progress.

Create an API key