MCP WebSearch
Provides web search through Perplexity Sonar models, returning answers, sources, and query costs. It defaults to the cheaper Sonar model and can optionally use Sonar Pro Search when needed.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
MCP WebSearch
MCP server for Claude Code: web search via Perplexity Sonar and image generation — all with one OpenRouter key.
Built for one task: not letting the agent accidentally overspend. The expensive search model is not the default, and image generation has a separate tool to estimate the cost before calling.
Installation
git clone git@github.com:DrSeedon/mcp-websearch.git ~/.claude/mcp-servers/websearch
cd ~/.claude/mcp-servers/websearch
npm install
cp .env.example .env # и вписать свой ключRegistration in Claude Code:
claude mcp add websearch node ~/.claude/mcp-servers/websearch/index.js \
-e OPENROUTER_API_KEY=sk-or-v1-...Requires Node 18+ (uses native fetch and ESM).
Related MCP server: sysauto Ask MCP Server
Environment variables
Variable | Required | Purpose |
| yes | OpenRouter key. Checked at startup |
| no | Proxy, if direct access to |
The key is only read from the environment — it is not and must not be in the code.
Tools
search
Web search via Perplexity Sonar. Returns the answer, sources, and request cost.
Model | Cost | When |
| ~$0.006 | Default. Facts, documentation, regular research |
| ~$0.03 | Only if |
There are no other search models — the list is hardcoded.
Why it matters: the price difference is fivefold. If the expensive model were the default, the agent would call it without thinking. Tested on a live setup: 171 out of 425 requests went through the expensive tier simply because the model was not specified explicitly.
generate_image
Image generation. Supports reference images as input and aspect ratios from 21:9 to 9:16.
Model | Purpose |
| Default, good quality |
| Budget option |
| Alternative engine, from fast to high quality |
| Another style option |
generate_image_cost
Estimates the generation cost before the call. Needed so the model choice is deliberate, not "just pick the first one from the list".
Logs
requests.log (in .gitignore) — JSONL, one line per call: [iso] tool: {json}.
search— request, full response, sources, model, tokens, costgenerate_image— prompt, save paths, size, references; base64 is not written to the lognext to the image, a
.jsonfile with the same prompt and metadata is saved ingenerated/
What is not committed
.env, requests.log, generated/ (archive of generated images), node_modules/. Logs and images contain request history — that is private data and has no place in the repository.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Hosted Web Crawler MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Augments MCP Server - A comprehensive framework documentation provider for Claude Code
Hosted SQL Server MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that enables Claude to perform web searches using Perplexity's API with intelligent model selection based on query intent and support for domain and recency filtering.64MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that integrates with Sonar API to provide Claude with real-time web search capabilities for comprehensive research.17 npmMIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that brings Perplexity's Sonar models with real-time web search capabilities to Claude Desktop and other MCP clients.44 npm9MIT
- AlicenseAqualityDmaintenanceMCP server that bridges OpenAI's Agents SDK with Claude Code, enabling web search, file search, and computer use capabilities directly in your development environment.29 npm1MIT