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.11.tar.gz (22.8 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.11-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: serper_toolkit-0.0.11.tar.gz
  • Upload date:
  • Size: 22.8 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.11.tar.gz
Algorithm Hash digest
SHA256 49468c7b985df9aefcf3d5e6f378396985403a8935b572c9eaf416cfd41b01b6
MD5 a5a65970880ac5f9127a8a9ab8e9e36c
BLAKE2b-256 17cb279a1e1f3d7803ae3c06e474938c609ea9bbdccd1ecf4d456e929ea59643

See more details on using hashes here.

Provenance

The following attestation bundles were made for serper_toolkit-0.0.11.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.11-py3-none-any.whl.

File metadata

File hashes

Hashes for serper_toolkit-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 e34bda47ffff02a670b4e914cfdc96e11eb89e0049d58a41c48f1d199bb35ce3
MD5 655761e82ffc8e2d7b18567a22aa07e9
BLAKE2b-256 065e80948a8b7c1df668b1beb116904ad2b9462f817be60af41e0794277e961c

See more details on using hashes here.

Provenance

The following attestation bundles were made for serper_toolkit-0.0.11-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