MCP client

AgentSEO MCP Setup for Claude Code

Connect AgentSEO to Claude Code when you need Google results for a specific query, market, and device. Start with one search results check and confirm you have a usable response before building a workflow around it.

Copy the setup first, validate one live workflow, then decide whether this path belongs in docs, automation, or your agent runtime.

Claude CodeHosted MCPLive SERP data

Before you start

You need Claude Code and an AgentSEO server-side API key. The free sample in the Claude SEO guide works with the bundled files and needs no AgentSEO account.

Use This Guide For

Set up the integration and check the result

Open the configuration, see a sample response, or review the API quickstart.

Core workflows

What you can do

  • Inspect the result types, competing pages, and search features for one query in a chosen market.
  • Turn a completed search result into a content brief or a follow-up check.
  • Use a workflow ID to identify calls from this setup.

Setup snapshot

Claude Code project MCP configuration

{
  "mcpServers": {
    "agentseo": {
      "type": "http",
      "url": "https://www.agentseo.dev/mcp",
      "headers": {
        "Authorization": "Bearer ${AGENTSEO_API_KEY}",
        "x-workflow-id": "claude-seo-starter"
      }
    }
  }
}

Discovery shows the available tools. Live execution uses your AgentSEO key and consumes credits according to the tool.

Implementation plan

How to set it up

  1. 1

    Create an AgentSEO API key without browser domain restrictions. Set AGENTSEO_API_KEY in the shell environment that will launch Claude Code.

  2. 2

    Save the sample as .mcp.json in your project root. If the file already exists, add the agentseo entry to its mcpServers object.

  3. 3

    Start Claude Code in that directory, approve the project server if prompted, and open /mcp to check discovery.

  4. 4

    Run the example below and inspect the returned result or job status.

Output shape

What users get back

  • A completed SERP analysis with result and feature data when available.
  • A job ID when the result is queued. Use agentseo_job_status to check it.

Limits

What to check before you run it

  • Hosted MCP requires a server-side key without allowed domains.
  • The SERP tools show market results. Supply a Search Console export separately when you need your site's Google clicks or impressions.
  • Review costs and the first completed result before adding more tool calls.

Visual flow

Claude Code tool loop

One query gives you a bounded way to check the connection and review the evidence.

1

Prompt

User asks for SERP triage or page opportunity analysis.

2

MCP Tool

Claude calls analyze_serp or another AgentSEO tool.

3

Job status

Check the existing job if the result is queued.

4

Review

Read the result and confirm it supports the proposed action.

Concrete example

Run one live SERP check

Ask for one query and keep the result context with the recommendation.

Prompt for Claude Code

Use AgentSEO's analyze_serp tool for "claude seo".
Use United States, en, and desktop.
If queued, keep the job ID and check its status.
Show up to three direct result URLs and the intent they support.
If a redirect hides a destination, report its rank and title and mark the destination unknown.

What to check in the result

Completed: inspect the SERP features and any direct result URLs.
Queued: pass the returned ID as job_id to agentseo_job_status.
Failed or pending: report the current state before drawing conclusions.
  • The sample configuration tags requests with the claude-seo-starter workflow ID.
  • Record the query, market, language, device, and any collection time returned before comparing the result with another run.

FAQ

Questions this page should answer fast

Package-level docs

Why does MCP discovery work but the tool call returns 401?

Tool execution needs a valid AgentSEO key. Check that AGENTSEO_API_KEY is available in the environment that launched Claude Code and that the Authorization header uses Bearer followed by the key.

What should I check for a 403 or 402?

For a 403, check whether the key was revoked, expired, or has an allowed domain list. For a 402, check the account credit balance before retrying.

What if my first tool call is queued?

Use agentseo_job_status with the returned job ID. Use the evidence once the job completes, or report the failure if the job ends without a result.