Skip to main content

A high-performance, asynchronous MCP server for Serper Google Search, featuring connection pooling, request retries, and intelligent input parsing.

Project description

Serper MCP Toolkit

A rebuilt Serper MCP server based on the firecrawl-toolkit architecture.

Highlights

  • Unified async request layer (httpx + connection pooling + retries)
  • Compact JSON responses (single-line) for lower token usage
  • Stable mapped response schemas (no upstream raw passthrough)
  • Multi-page aggregation for non-image search endpoints (10 results/page granularity)
  • Image search search_num normalization to 10 or 100
  • Multi-transport startup (STDIO / HTTP / SSE, mutually exclusive)
  • Process lock to prevent duplicate server instances

Tools

  • serper-aggregated-search
  • serper-general-search
  • serper-image-search
  • serper-video-search
  • serper-place-search
  • serper-maps-search
  • serper-reviews-search
  • serper-news-search
  • serper-lens-search
  • serper-scholar-search
  • serper-shopping-search
  • serper-patents-search
  • serper-scrape

Core Parameter Rules

  • Search tools do not expose page; internal pagination is automatic.
  • Non-image endpoints:
    • search_num is clamped to 1..100
    • then rounded up to nearest multiple of 10 (25 -> 30)
  • Image endpoint:
    • 1..10 -> 10, 11..100 -> 100
  • Maps endpoint:
    • when aggregation requires page > 1 and query mode is used, ll is required.

Environment Variables

API and network

  • SERPER_API_KEY
  • SERPER_HTTP2 (0/1)
  • SERPER_MAX_CONNECTIONS
  • SERPER_KEEPALIVE
  • SERPER_MAX_CONCURRENT_REQUESTS
  • SERPER_MAX_WORKERS
  • SERPER_RETRY_COUNT
  • SERPER_RETRY_BASE_DELAY
  • SERPER_ENDPOINT_CONCURRENCY (JSON, e.g. {"search":10,"scrape":2})
  • SERPER_ENDPOINT_RETRYABLE (JSON, e.g. {"scrape":false})

Transport selection (exactly one must be enabled)

  • SERPER_MCP_ENABLE_STDIO
  • SERPER_MCP_ENABLE_HTTP
  • SERPER_MCP_ENABLE_SSE

Transport host/port

  • SERPER_MCP_HTTP_HOST
  • SERPER_MCP_HTTP_PORT
  • SERPER_MCP_SSE_HOST
  • SERPER_MCP_SSE_PORT
  • SERPER_MCP_HOST (fallback)
  • SERPER_MCP_PORT (fallback)

Lock file

  • SERPER_MCP_LOCK_FILE (default /tmp/serper_mcp.lock on Unix)

MCP Client Example

{
  "mcpServers": {
    "serper-toolkit": {
      "command": "uvx",
      "args": ["serper-toolkit"],
      "env": {
        "SERPER_API_KEY": "<your-serper-api-key>",
        "SERPER_MCP_ENABLE_STDIO": "1"
      }
    }
  }
}

CI/CD

Two GitHub Actions workflows are included:

  • CI (.github/workflows/ci.yml)

    • Trigger: push/PR on main
    • Python matrix: 3.12, 3.13
    • Steps: alias validation, unit tests, build, twine check
  • Publish to PyPI (.github/workflows/publish-pypi.yml)

    • Trigger: push on main (automatic), plus manual workflow_dispatch
    • Preflight: alias validation, tests, build, twine check, version-not-on-PyPI check
    • Publish: trusted publishing via OIDC to PyPI

Required repository settings

  1. Create GitHub Environment: pypi
  2. Configure PyPI Trusted Publisher for this repo/workflow/branch:
    • Workflow file: .github/workflows/publish-pypi.yml
    • Branch: main
  3. Ensure Actions permissions allow OIDC (id-token: write in workflow is already set)

Development Validation

python3 scripts/validate_country_aliases.py
python3 -m unittest discover -s tests -p "test_*.py"
python3 -m build
python3 -m twine check dist/*

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

serper_toolkit-0.0.12.tar.gz (23.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

serper_toolkit-0.0.12-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

Details for the file serper_toolkit-0.0.12.tar.gz.

File metadata

  • Download URL: serper_toolkit-0.0.12.tar.gz
  • Upload date:
  • Size: 23.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for serper_toolkit-0.0.12.tar.gz
Algorithm Hash digest
SHA256 660d8023b48ba7aff60af9c3ff3a5ac630cdfa5cf5b0556411df3e3310688f33
MD5 f12c0536a2fd9c3ffdae5f18ec7989a9
BLAKE2b-256 e096a6720dc80e2c076a83f6c993b48ce794e7670a38d8cb56f13cdd5ac17a92

See more details on using hashes here.

Provenance

The following attestation bundles were made for serper_toolkit-0.0.12.tar.gz:

Publisher: publish-pypi.yml on Joey-Kot/serper-toolkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file serper_toolkit-0.0.12-py3-none-any.whl.

File metadata

File hashes

Hashes for serper_toolkit-0.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 a07d566cbf31621e13fb094c7dffa7d8e8465b56be39effee47dd3b3cd64986f
MD5 d501e0f7f191c0b75c10c173e8157f0b
BLAKE2b-256 a2403f4f036f6f155428be0378e3f45f4c7a6c9d7b1d6aafa1db6e3f1c422984

See more details on using hashes here.

Provenance

The following attestation bundles were made for serper_toolkit-0.0.12-py3-none-any.whl:

Publisher: publish-pypi.yml on Joey-Kot/serper-toolkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page