MCP Websearch Skill for OpenCode — SerpAPI multi-key pool with caching, history, and rate-limit management.
- Multi-key pool: 4 SerpAPI keys with round-robin and 429 fallback
- Caching: SQLite-based deduplication to avoid duplicate API calls
- History: Persistent search history with status tracking
- MCP Server: 5 tools exposed via FastMCP
- CLI: Bash wrappers for direct terminal usage
- CoDocs: 100% documentation coverage
git clone https://github.com/OpenSIN-Code/SIN-Code-Websearch-Skill.git
cd SIN-Code-Websearch-Skill
bash install.sh
pytest -v| Tool | Description |
|---|---|
websearch_search |
Search the web via SerpAPI |
websearch_status |
Show key pool status |
websearch_cache |
Manage result cache |
websearch_history |
List recent searches |
websearch_rate_limit |
Check rate limits |
scripts/websearch-search.sh "openai" --num=10
scripts/websearch-status.sh
scripts/websearch-pool.sh reset
scripts/websearch-cache.sh clear
scripts/websearch-history.sh 20MCP Client (OpenCode)
↓ FastMCP (stdio)
mcp_server.py
↓ SerpAPIClient
├─ SerpAPIKeyPool (round-robin, 429 fallback)
├─ SearchCache (SQLite)
└─ SearchHistory (SQLite)
↓ SerpAPI
Keys are loaded from Infisical (fa7758b4-f84c-4297-966e-710056d531ef) or environment variables:
export SERPAPI_KEY_1="..."
export SERPAPI_KEY_2="..."
export SERPAPI_KEY_3="..."
export SERPAPI_KEY_4="..."pytest -v40+ tests covering pool rotation, 429 fallback, cache hit/miss, history tracking, and rate limiting.
MIT — OpenSIN Code