How to set up Claude Code for SEO
Claude Code is changing how SEO professionals work. It is Anthropic’s command-line tool that brings AI directly into your development workflow, letting you automate everything from technical audits to content analysis. Instead of spending hours manually checking meta tags, pulling data from Google Search Console, or cross-referencing analytics, you can have Claude Code do it in minutes.
The catch? Getting started feels intimidating if you are not a developer. This guide walks you through the entire setup process from zero to your first automated SEO audit. No coding experience required. Just follow the steps, copy the commands, and you will have a working SEO command center within the hour.
What you’ll need before starting
Let’s get the requirements out of the way so you don’t hit a wall halfway through.
Hardware and operating system: Claude Code runs on macOS, Linux, and Windows (via Windows Subsystem for Linux). If you are on Windows, you will need WSL installed. Most modern machines from the last five years handle this fine.
Software prerequisites: You need Node.js version 18 or higher and npm (Node Package Manager). If you are not sure whether you have these, open your terminal and type node --version. If you see a number below 18, or get a “command not found” error, download the latest Node.js from nodejs.org first.
Subscriptions: Claude Code requires a paid Anthropic subscription. Claude Pro costs $20 per month and handles most SEO workflows. Claude Max at $100 per month gives you higher usage limits if you are processing large sites or running frequent audits.
Optional but recommended: A free SerpAPI account for search data access. Their free tier includes 100 searches monthly, enough to test and run small projects.
Knowledge level: If you can copy and paste commands into a terminal, you can complete this setup. Every command is provided below.
Before diving in, consider using our AI Prompt Optimizer to sharpen the prompts you will be feeding Claude. Better prompts mean better outputs.
Step 1: Install Claude Code
Open your terminal. On Mac, find Terminal in Applications > Utilities. On Windows, open your WSL terminal. Then run this single command:
npm install -g @anthropic-ai/claude-code
This downloads and installs Claude Code globally on your system. The -g flag means you can run it from any folder. Wait for the installation to complete. You will see progress messages scroll by. When it finishes, verify the installation worked:
claude --version
You should see a version number like “0.2.35” or similar. If you get “command not found,” restart your terminal and try again. Sometimes the shell needs a refresh to recognize new global packages.
Now authenticate Claude Code with your Anthropic account. Type:
claude
This launches the tool and opens a browser window asking you to sign in. Complete the authentication, then return to your terminal. You should see a welcome message and a prompt ready for commands.
Common installation issues: If the npm command fails with permission errors on Mac or Linux, you may need to use sudo before the command (though this is generally discouraged for security reasons). A better fix is ensuring your npm permissions are configured correctly for global installs.
On Windows with WSL, make sure you are running WSL 2, not WSL 1. Claude Code needs features that WSL 1 does not support. Check your WSL version with wsl --list --verbose in PowerShell.
Step 2: Understand MCPs (Model Context Protocol)
Here is where things get interesting. Claude Code on its own is powerful but limited. It can read files on your computer and help you write code, but it cannot browse websites, access live search data, or pull information from APIs. That is where MCPs come in.
MCP stands for Model Context Protocol. Think of it as a universal adapter that lets Claude Code connect to external tools and data sources. Instead of building custom integrations for every service, MCP provides a standard way for Claude to talk to browsers, APIs, databases, and more.
For SEO work, MCPs are transformative. Without them, you are stuck manually exporting CSVs from Google Search Console and uploading them to Claude. With MCPs, Claude can pull that data directly, analyze it alongside your GA4 metrics, and spot patterns you would miss in spreadsheets.
The MCP ecosystem is growing fast. For SEO specifically, you will want to know about:
- Browser automation MCPs (Playwright, Puppeteer) that let Claude visit websites, take screenshots, and extract page data
- Search data MCPs (SerpAPI) that provide live Google search results, rankings, and keyword data
- Database MCPs (Supabase) for storing and querying your SEO data
- Platform MCPs (GitHub, Vercel) for deploying and managing SEO projects
The key difference from traditional integrations: you do not tell Claude exactly when to use these tools. You give it the capability, describe what you want to achieve, and Claude decides which tools to use and in what order. It is closer to giving an assistant a task than programming a script.
For more on how AI is reshaping SEO strategies, check out our guide on AI SEO for Growth.
Step 3: Set up your first MCP for SEO
You have two main options for getting started with SEO automation. Pick based on what you want to accomplish first, or install both. They work together.
Option A: Playwright MCP (Browser automation)
Playwright gives Claude a real browser it can control. This is essential for technical SEO audits because Claude can visit your site, check meta tags, analyze page structure, and identify issues just like a human would.
Install it with this command:
claude mcp add playwright -- npx @anthropic-ai/mcp-server-playwright
The installation takes about 30 seconds. Once complete, Claude can navigate websites, click elements, fill forms, and extract data. For SEO, this means automated crawling, screenshot capture for documentation, and extraction of on-page elements.
Best for: Technical audits, competitor analysis, site crawling, JavaScript rendering checks, and mobile responsiveness testing.
Option B: SerpAPI MCP (Search data)
SerpAPI connects Claude to live Google search data. This unlocks keyword research, rank tracking, and competitor analysis without leaving your terminal.
First, create a free account at serpapi.com. Copy your API key from the dashboard. Then install the MCP:
claude mcp add serpapi --url https://mcp.serpapi.com/YOUR_API_KEY/mcp
Replace YOUR_API_KEY with your actual key. The free tier gives you 100 searches monthly. Paid plans start at $50 monthly for 5,000 searches if you need more volume.
Best for: Keyword research, SERP analysis, competitor ranking checks, and search trend monitoring.
Both MCPs complement each other nicely. Playwright tells you what is happening on your site. SerpAPI tells you how you are performing in search results. Together they give you a complete picture.
If you are new to keyword research, our Keyword Research guide covers the fundamentals you will need to make the most of SerpAPI.
Step 4: Verify your setup
Before running your first audit, confirm everything is connected properly. In your terminal with Claude Code running, ask:
What MCPs do you have access to?
Claude should list Playwright and/or SerpAPI depending on what you installed. If you see “I don’t have any MCPs configured,” something went wrong with the installation. Try restarting Claude Code or reinstalling the MCP.
Test Playwright with a simple command:
Visit example.com and tell me the page title
Claude should respond with “Example Domain” and possibly additional observations about the page. If you get an error about not being able to browse, Playwright is not connected properly.
Test SerpAPI with:
What are the top 5 results for 'best SEO tools'?
You should see a list of websites ranking for that query. If SerpAPI is not working, check that your API key is correct and that you have not exceeded your free tier limit.
Common verification issues: If MCPs are installed but Claude says it cannot access them, try exiting Claude Code (Ctrl+D or type exit) and restarting it. Sometimes the tool needs a fresh session to recognize new MCPs.
On Windows WSL, ensure your WSL instance has internet access. Some corporate networks block WSL traffic, which prevents MCPs from connecting to external services.
Step 5: Run your first SEO audit
Now for the payoff. You are going to run a complete technical SEO audit on any website. Create a project folder first to keep things organized:
mkdir seo-audits
cd seo-audits
claude
With Claude Code running in your project folder, use this prompt:
I want you to do a complete SEO audit for [website URL]. Use Playwright to crawl the site and check: meta titles and descriptions, heading structure (H1-H6), structured data/schema markup, page load performance, mobile responsiveness, and internal linking structure. Save your findings to a markdown report with specific issues categorized by priority.
Replace [website URL] with the site you want to audit. Claude will create a todo list for itself and work through each item. You will see progress updates in the terminal. A typical audit takes 2-5 minutes depending on site size.
When finished, Claude generates a markdown report in your project folder. Open it to see findings organized by severity:
- Critical issues: Things blocking search engines or severely hurting rankings (missing meta descriptions, broken robots.txt, noindex tags)
- High priority: Important fixes that will move the needle (duplicate H1s, slow page speed, missing alt text)
- Quick wins: Easy improvements with minimal effort (title length optimization, meta description improvements)
- Long-term improvements: Strategic recommendations (content gaps, internal linking opportunities)
The report includes specific file locations and code snippets where relevant. Unlike generic audit tools, Claude explains why each issue matters and what to do about it.
Frequently Asked Questions
Is Claude Code free to use?
No, Claude Code requires a paid Anthropic subscription. Claude Pro costs $20/month and covers most SEO workflows. You also need to consider API costs for MCPs like SerpAPI if you need search data.
Do I need coding experience to use Claude Code?
No coding experience is required for basic SEO workflows. If you can copy and paste commands into a terminal, you can set up and use Claude Code. The tool handles the technical complexity for you.
What’s the difference between Claude Code and ChatGPT?
Claude Code is a command-line tool that can interact with your local files and external services via MCPs. ChatGPT is a conversational AI in a web interface. Claude Code is designed for automation and can actually perform tasks on your computer.
Can Claude Code replace traditional SEO tools?
Claude Code complements rather than replaces traditional tools. It excels at automation, custom analysis, and technical audits. For large-scale rank tracking, backlink analysis, or enterprise features, dedicated SEO platforms still have advantages.