MCP server

Connect Claude Code, Cursor or any MCP client to run audits and read results.

Overview

SEO Agent has a built-in [Model Context Protocol](https://modelcontextprotocol.io) server at /api/mcp (streamable HTTP). Any MCP client can connect with a personal API token and use 24 tools to list sites, start audits, wait for them, and read scores, issues, findings and recommendations.

Connect Claude Code

  1. 1

    Create a token

    In Settings → API & MCP, first pick the organization with the org switcher (a token only works there), then create a token. Choose Read + start jobs to let the agent run audits, or Read only. Copy it now; it isn't shown again.

  2. 2

    Add the server

    Run the command shown with the token:

terminal
claude mcp add --transport http ai-seo https://ai-seo.vdev.web.id/api/mcp \
  --header "Authorization: Bearer seo_pat_…"

Then ask Claude Code something like:

prompt
Audit example.com, wait for it to finish, and summarise the top 5 issues with fixes.
Then fix the missing canonicals in this codebase.

Other clients

Any client that supports streamable HTTP with a custom header works. For clients that only support local (stdio) servers, such as some versions of Claude Desktop, bridge with mcp-remote:

mcp config
{
  "mcpServers": {
    "ai-seo": {
      "command": "npx",
      "args": ["mcp-remote", "https://ai-seo.vdev.web.id/api/mcp",
               "--header", "Authorization: Bearer seo_pat_…"]
    }
  }
}

Tools

AreaTools
Contextwhoami, list_sites, get_site, list_checks
Auditsstart_audit, wait_for_audit, get_audit, list_audits
Resultsget_audit_score, list_findings, get_audit_changes, compare_audits, list_issues, get_issue, list_recommendations, get_recommendation, site_report
Research and datastart_keyword_research, get_keyword_research, get_ai_visibility, run_ai_visibility, gsc_summary, rankings_summary, rankings_opportunities
  • start_audit returns the running audit instead of failing if one is already in progress.
  • wait_for_audit waits up to 4 minutes and reports progress; if the audit is still running it returns still_running: true, and the agent calls it again.
  • List tools take a limit and filters, and say truncated: true when there is more.
Approving or rejecting recommendations and adding or removing sites are deliberately not available to agents. Those decisions stay with people in the web app.

Activity log

Every tool call an agent makes is recorded with the tool, its arguments, whether it worked (and the error if not) and how long it took. Open Settings → API & MCP and choose Activity on a token to see its calls; each token also shows how many calls it made today.

Audits started by an agent through MCP show MCP as their trigger; audits started by other scripts with a token show API.

Calls are kept for 90 days.

Troubleshooting

SymptomCause
401 when connectingMissing, mistyped, expired or revoked token. Check the header is exactly Authorization: Bearer seo_pat_….
"read-only API token"The token was created as Read only; create a Read + start jobs token to start audits.
"404: site not found"The site belongs to a different organization than the token.
"409 … active audit"Only one audit per site runs at a time; start_audit returns the running one.