fetchSERP speaks Model Context Protocol (MCP), making it plug-and-play with any LLM that supports tool calling.

Supported Providers

Claude API Example

claude.js
const claudeRequest = {
  model: 'claude-sonnet-4-20250514',
  messages: [
    { role: 'user', content: 'Give me keyword ideas for "seo audit"' }
  ],
  mcp_servers: [
    {
      type: 'url',
      url: 'https://www.fetchserp.com/mcp',
      name: 'fetchserp',
      authorization_token: process.env.FETCHSERP_API_TOKEN,
      tool_configuration: {
        enabled: true
      }
    }
  ]
};

OpenAI API Example

openai.js
let response = await openai.chat.completions.create({
  model: 'gpt-4o',
  messages: [
    { role: 'user', content: 'Check my domain ranking for "project management tools"' }
  ],
  tools: [
    {
      type: 'mcp',
      server_label: 'fetchserp',
      server_url: process.env.MCP_SERVER_URL, // https://www.fetchserp.com/mcp
      headers: {
        Authorization: `Bearer ${process.env.FETCHSERP_API_TOKEN}`
      }
    }
  ]
});

Custom Agent Flow

  1. Call the /mcp/schema endpoint to fetch a JSON schema describing every fetchSERP tool.
  2. Feed that schema to your LLM along with user instructions.
  3. Execute tool calls returned by the LLM and stream the results back.

For an end-to-end reference implementation, check out the fetchserp-mcp-server on GitHub.

Best Practices

  • One server per request – List only the tools you actually need.
  • Stream responses – Large SERP payloads benefit from HTTP chunked encoding.
  • Cache intelligently – Many endpoints are cached for 15 minutes, so store UUIDs where applicable.

Features Available via MCP

Tool NameREST EndpointWhat It Does
serp/api/v1/serpStructured SERP results from Google, Bing, Yahoo, DuckDuckGo
ranking/api/v1/rankingDomain ranking for a keyword
serp_html/api/v1/serp_htmlSERP results with full HTML content
serp_text/api/v1/serp_textSERP results with extracted text
serp_js/api/v1/serp_jsJavaScript-rendered SERP with AI Overview
serp_ai/api/v1/serp_aiAI Overview + AI Mode response
serp_ai_mode/api/v1/serp_ai_modeCached US-only AI Mode
keywords_search_volume/api/v1/keywords_search_volumeMonthly search volume metrics
keywords_suggestions/api/v1/keywords_suggestionsKeyword ideas & metrics
long_tail_keywords_generator/api/v1/long_tail_keywords_generatorGenerate long-tail keywords
page_indexation/api/v1/page_indexationCheck if a page is indexed
backlinks/api/v1/backlinksBacklink data for a domain
web_page_seo_analysis/api/v1/web_page_seo_analysisTechnical & on-page SEO audit
web_page_ai_analysis/api/v1/web_page_ai_analysisAI-powered content analysis
scrape/api/v1/scrapeRaw HTML (no JS)
scrape_js/api/v1/scrape_jsCustom JS extraction
scrape_js_with_proxy/api/v1/scrape_js_with_proxyJS extraction through proxy
domain_scraping/api/v1/domain_scrapingCrawl an entire domain
domain_infos/api/v1/domain_infosDNS, WHOIS, SSL, tech stack
domain_emails/api/v1/domain_emailsExtract emails from SERPs
moz/api/v1/mozMoz domain authority & metrics

These tools are auto-generated from our OpenAPI spec, so new endpoints will appear here automatically.

Need help? Contact support or jump in our Slack community.