Skip to main content
Glama

πŸ€– Google SERP & AI Agent Grounding β€” Model Context Protocol (MCP) Server

MCP Protocol Python 3.8+ License: MIT Glama

A high-performance Model Context Protocol (MCP) Server and live Google search grounding engine for Claude Desktop, Cursor IDE, LangChain, and Autonomous AI Agents.


⚑ Overview

This repository provides a standardized Model Context Protocol (MCP) server (mcp_server.py) that equips LLMs and autonomous agents with real-time web search and webpage content extraction without hallucination.

  • πŸ›‘οΈ Zero 429 Rate-Limit Blocks: Automatic anti-blocking engine with multi-engine fallback.

  • πŸ€– LLM-Optimized Grounding: Returns token-budgeted Markdown context with structured citations ([1], [2]).

  • πŸ“„ Universal Markdown Extractor: Strips navigation, ads, and scripts from any URL to produce dense Markdown for RAG context windows.

  • πŸ”Œ Zero-Config MCP Integration: Plug-and-play with Claude Desktop, Cursor, and Antigravity.


Related MCP server: SerpApi MCP Server

πŸ› οΈ MCP Tools & Capabilities

The server exposes the following Model Context Protocol (MCP) tools:

Tool Name

Parameters

Description

search_google_agent

query (string), max_results (int), max_tokens (int), country_code (string)

Searches Google and returns token-optimized Markdown context with structured citations ([1], [2]) specifically formatted for LLM system prompts and RAG grounding.

extract_webpage_markdown

url (string), max_chars (int)

Fetches any live URL, strips boilerplate/ads/navbars, and converts the page into clean Markdown text for LLM ingestion.


πŸ”Œ Quickstart: Connect to Claude Desktop & Cursor

1. Claude Desktop Configuration

Add this server to your claude_desktop_config.json:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

  • Linux: ~/.config/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "google-serp-agent": {
      "command": "python3",
      "args": [
        "/path/to/google-serp-extractor/mcp_server.py"
      ]
    }
  }
}

2. Cursor IDE Configuration (.cursor/mcp.json)

{
  "mcpServers": {
    "google-serp-agent": {
      "command": "python3",
      "args": ["/path/to/google-serp-extractor/mcp_server.py"]
    }
  }
}

πŸ“¦ Python SDK & LangChain Tool Usage

You can also use this library directly inside Python scripts and LangChain agents:

pip install google-serp-extractor
from google_serp_extractor import agent_search_and_ground, extract_webpage_markdown

# 1. Ground your LLM with real-time web search facts
result = agent_search_and_ground(
    query="Latest breakthroughs in Quantum Computing 2026",
    max_results=3,
    max_tokens=1500
)

# Feed context directly into your LLM prompt
print(result["context_markdown"])

# 2. Extract clean Markdown from any live URL
page_md = extract_webpage_markdown("https://en.wikipedia.org/wiki/Artificial_intelligence")
print(page_md["markdown"][:500])

🌐 Serverless REST API Endpoints

Method

Endpoint

Description

POST

/api/v1/agent/search

AI Agent search with token budgeting and citation formatting (Tavily/Exa alternative).

POST

/api/v1/agent/extract

Universal URL-to-Markdown extractor for RAG pipelines.

POST

/api/v1/search

Raw Google SERP batch search with organic rankings, PAA, and ads.

GET

/api/v1/health

Service health status and supported agent capabilities.


πŸ“„ License

MIT License. Created by Meanus Arcanus.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables LLM clients to run real-time searches across Google, Bing, Yahoo, DuckDuckGo, YouTube, eBay, and other engines, returning organic results, news, images, shopping, weather, and stock data with automatic result-type formatting. Supports JSON or token-efficient Markdown output, compact or complete response modes, and opt-in interactive result UIs.
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI assistants to run real-time searches across Google, Bing, Yahoo, DuckDuckGo, YouTube, eBay and other engines, returning structured results for queries, weather, stocks, news, images, and shopping. Supports JSON or token-efficient Markdown output plus optional interactive UI tools for tables and dashboards.
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI agents to search multiple web providers in parallel and crawl single pages or entire sites into clean, deduplicated Markdown or JSON, including authenticated crawls.
      -