Webpawm
Webpawm is an MCP (Model Context Protocol) server that provides web search capabilities with multiple search engine support.
Features
- Multiple Search Engines: Supports SearXNG, Google, Bing, Brave, Bing CN (China), and Arxiv
- Multiple Transport Modes:
- HTTP/SSE mode (via
webpawm webcommand) - Stdio mode (via
webpawmorwebpawm stdcommand)
- HTTP/SSE mode (via
- Unified Search: Single
web_searchtool with smart defaults (multi-engine, query expansion, deduplication) - Flexible Configuration: Support for config file (~/.config/webpawm/config.json, fallback: ~/.webpawm/config.json) and environment variables
- Access Logging: Built-in slog-based HTTP access logging
- API Key Authentication: Optional API key protection for HTTP endpoint (X-API-Key or Bearer token)
Installation
go install github.com/liut/webpawm@latest
Or build from source:
git clone https://github.com/liut/webpawm.git
cd webpawm
make main
install dist/webpawm /usr/local/bin/
Usage
Stdio Mode (Default)
Run as a local MCP tool:
webpawm
HTTP/SSE Mode
Start the web server (with optional API key authentication):
webpawm web --listen localhost:8087
The server provides two endpoints:
- HTTP:
http://localhost:8087/mcp - SSE:
http://localhost:8087/mcp/sse
With URI prefix:
webpawm web --listen localhost:8087 --uri-prefix /api
Endpoints become:
- HTTP:
http://localhost:8087/api/mcp - SSE:
http://localhost:8087/api/mcp/sse
Authentication
When api_key is configured in the config file or WEBPAWM_API_KEY environment variable, the HTTP endpoint requires authentication.
Request with X-API-Key header:
curl -H "X-API-Key: your-secret-key" http://localhost:8087/mcp
Or with Authorization: Bearer header:
curl -H "Authorization: Bearer your-secret-key" http://localhost:8087/mcp
MCP Tools
Webpawm provides two MCP tools:
web_search
Unified search tool with intelligent defaults. Supports single engine, multi-engine parallel search, and automatic query expansion with deduplication.
Note: engine and engines support enum values - available engines are listed in the tool schema.
web_fetch
Fetch a website and return its content with HTML to Markdown conversion.
Configuration
Config File
The default config path is ~/.config/webpawm/config.json. If that
file does not exist, webpawm falls back to the legacy
~/.webpawm/config.json. Both locations are searched on startup.
Create ~/.config/webpawm/config.json (or use webpawm gen-cfg to
write the default):
{
"searchxng_url": "https://searchx.ng",
"google_api_key": "your-api-key",
"google_cx": "your-search-engine-id",
"bing_api_key": "your-bing-api-key",
"brave_api_key": "your-brave-api-key",
"api_key": "your-api-key",
"max_results": 10,
"default_engine": "searchxng",
"listen_addr": "localhost:8087",
"uri_prefix": "",
"log_level": "info"
}
Environment Variables
Priority
Configuration priority (highest to lowest):
- CLI flags
- Environment variables
- Config file
- Default values
License
MIT