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
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.
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" } } } }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
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.
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.
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.
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.
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.
| Endpoint | Returns | Limit |
|---|---|---|
| POST /check | SEO score, categories, per-check results (checks), indexability warnings, and more (tool: diagnose_seo) | Uses 1 monthly check |
| POST /aio-check | AIO score (how likely AI search is to cite the page), grade, and category results (tool: diagnose_aio) | Uses 1 monthly check |
| POST /check/suggestions | Fix 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
| Free | Entry | Basic | Pro | |
|---|---|---|---|---|
| Checks per month | 3 | 30 | 100 | 300 |
| Fix code per analysis | 1 | 2 | All | All |
| Checks evaluated | Core checks | Up to Entry | Up to Basic | All |
FAQ
Does Direbase fix my site automatically?▾
Can I use it on the free plan?▾
Does my AI see more checks than the web app?▾
Can I analyze a site on localhost?▾
What if I lose or forget my API key?▾
What happens if my API key is invalid?▾
Which AI tools work?▾
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