Dev.to WebDev πŸ›  Dev πŸ‘ 0 πŸ“– 6 min read

How to Add an SEO MCP Server to Claude Code

How to add an SEO MCP server to Claude Code Claude Code can already edit files, run commands, and reason through a codebase. The gap shows up when the work depends on a live external system. SEO is a good example. If

How to Add an SEO MCP Server to Claude Code

How to add an SEO MCP server to Claude Code

Claude Code can already edit files, run commands, and reason through a codebase.

The gap shows up when the work depends on a live external system.

SEO is a good example. If you ask Claude Code to improve a landing page, it can inspect the page and suggest better copy. But it cannot know the current SERP, the competing page formats, the AI Overview behavior, or the backlink context unless you paste that data in.

That is exactly the job MCP is built for.

Claude Code’s MCP docs describe MCP servers as a way to connect Claude Code to external tools, databases, and APIs so Claude can read and act on those systems directly instead of working from copied data.

In this guide, we will add an SEO MCP server to Claude Code and run the first useful prompts.

I will use AgentSEO as the example server because it exposes a hosted Streamable HTTP MCP endpoint and a local npm package. The setup pattern is the important part.

What you get from an SEO MCP server

An SEO MCP server gives Claude Code tool access to live search workflows.

Instead of asking:

Here is a SERP export. Can you summarize it?

you can ask:

Use the SEO MCP server to analyze the SERP for "best seo api" in the United States.
Then identify the search intent and draft a content brief for a comparison page.

The difference is small in wording and large in workflow.

The first prompt makes you the data pipeline.

The second prompt lets Claude Code call the tool directly.

For AgentSEO, the live server card currently lists 45 MCP tools, including SERP analysis, keyword ideas, content briefs, local SEO checks, backlink analysis, rank tracking, and AI Overview extraction.

You can verify that yourself:

curl https://www.agentseo.dev/.well-known/mcp/server-card.json

The hosted endpoint is:

https://www.agentseo.dev/mcp

Before you start

You need three things:

  • Claude Code installed.
  • An AgentSEO API key.
  • A project where you want the MCP server available.

Use a server-side API key. Do not use a browser-restricted key for local agent tooling.

Option 1: add the hosted SEO MCP server

Claude Code supports remote HTTP MCP servers with:

claude mcp add --transport http <name> <url>

For AgentSEO:

claude mcp add --transport http agentseo https://www.agentseo.dev/mcp \
  --header "Authorization: Bearer sk_live_your_key" \
  --header "x-project-id: client-alpha" \
  --header "x-workflow-id: seo-mcp-test"

Replace sk_live_your_key with your AgentSEO API key.

The x-project-id and x-workflow-id headers are optional, but I like adding them early. Once an agent workflow starts making real API calls, traceability matters.

Option 2: add the local npm MCP server

If you prefer a local stdio server, use the npm package:

{
  "mcpServers": {
    "agentseo": {
      "command": "npx",
      "args": ["-y", "@agentseo/mcp-server"],
      "env": {
        "AGENTSEO_API_KEY": "sk_live_your_key",
        "AGENTSEO_API_URL": "https://www.agentseo.dev/api/v1"
      }
    }
  }
}

This is useful when your MCP client expects a local subprocess instead of a hosted HTTP endpoint.

For Claude Code, I would start with the hosted HTTP version unless you have a reason to keep everything local.

Verify the server in Claude Code

After adding the server, open Claude Code and run:

/mcp

Claude Code’s /mcp panel lets you inspect connected MCP servers. It should show the server and its tools.

If the server does not appear:

  • restart Claude Code
  • check the API key header
  • confirm the endpoint URL is exactly https://www.agentseo.dev/mcp
  • run claude mcp list
  • run claude mcp get agentseo

The setup is not done until Claude Code can see the tools.

First prompt: analyze a live SERP

Start with one bounded workflow.

Use AgentSEO to analyze the SERP for "best seo api" in the United States.

Return:
1. the dominant search intent
2. the common page formats
3. the SERP features that matter
4. what kind of page I should build
5. three risks before publishing

This is better than asking for β€œSEO advice.” The prompt names the keyword, location, output shape, and decision you need.

Second prompt: create a content brief

Once the SERP analysis works, ask for something closer to production.

Use AgentSEO to create a content brief for the keyword "seo api for ai agents".

Audience: developers building agent workflows.
Page type: educational comparison page.
Goal: explain when an SEO API should be exposed as MCP tools.

Include:
- search intent
- suggested H2 structure
- entities and subtopics to cover
- internal link ideas
- title and meta options
- what not to claim

The phrase β€œwhat not to claim” is important. Agent-generated SEO content gets risky when it turns every tool output into marketing confidence.

Ask Claude Code to preserve the review step.

Third prompt: check AI Overview visibility

If your SEO work touches AI search, use a narrower prompt:

Use AgentSEO to check AI Overview visibility for "best seo api".

Tell me:
1. whether an AI Overview appears
2. what source patterns show up
3. whether AgentSEO or competing pages are citation candidates
4. what page changes would improve citation likelihood

Treat this as directional research, not a magic ranking button.

AI Overview behavior changes. The point is to create a repeatable check, not a one-time screenshot.

Common setup mistakes

The annoying MCP failures are usually small.

Wrong header format

Use:

--header "Authorization: Bearer sk_live_your_key"

Do not paste the header as JSON into the CLI command.

Wrong transport

For the hosted AgentSEO endpoint, use:

--transport http

The MCP spec calls the current HTTP transport Streamable HTTP. Claude Code accepts http in the CLI and also recognizes streamable-http in JSON configuration.

No restart after configuration

If Claude Code was already open, restart it or check /mcp again after adding the server.

Prompt is too vague

This is a bad first prompt:

Improve my SEO.

This is a better first prompt:

Use AgentSEO to analyze the SERP for "best seo api" in the United States and tell me what page type I should build.

MCP gives Claude Code tools. You still need to give it a job.

When not to use an SEO MCP server

Do not use an SEO MCP server for every writing task.

You probably do not need live SEO tools when:

  • you are editing brand voice
  • you are cleaning grammar
  • you are writing internal docs
  • you already have the source data in the repo
  • the page is not search-led

Use the server when the decision depends on current search context.

That includes SERP intent, competitor page shape, keyword opportunities, AI Overview visibility, rank tracking, local visibility, or backlink signals.

The operator checklist

Before you call the setup done:

  • Add the MCP server.
  • Confirm it appears in /mcp.
  • Run one live SERP prompt.
  • Run one production-shaped content brief prompt.
  • Save the working prompt in your repo or team docs.
  • Add project/workflow metadata if multiple people will use it.
  • Decide who reviews the SEO recommendation before it ships.

The last step matters.

An SEO MCP server gives Claude Code fresher context. It does not remove judgment.

The best workflow is not β€œagent writes, human publishes.”

The better workflow is:

agent gathers live SEO context
agent drafts the recommendation
human checks the tradeoffs
agent helps implement the approved changes

That is where MCP starts to feel useful.

Not as another dashboard.

As a tool layer inside the place where the work is already happening.

Links

πŸ“° Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.