MCP WebSearch
MCP WebSearch
用于 Claude Code 的 MCP 服务器:通过 Perplexity Sonar 进行网页搜索和图像生成——全部使用一个 OpenRouter 密钥。
它为一个目标而编写:不让代理意外多花钱。昂贵的搜索模型不是默认选项,而图像生成则有一个单独的工具,用于在调用前计算价格。
安装
git clone git@github.com:DrSeedon/mcp-websearch.git ~/.claude/mcp-servers/websearch
cd ~/.claude/mcp-servers/websearch
npm install
cp .env.example .env # и вписать свой ключ在 Claude Code 中注册:
claude mcp add websearch node ~/.claude/mcp-servers/websearch/index.js \
-e OPENROUTER_API_KEY=sk-or-v1-...需要 Node 18+(使用原生 fetch 和 ESM)。
Related MCP server: sysauto Ask MCP Server
环境变量
变量 | 必填 | 用途 |
| 是 | OpenRouter 密钥。启动时检查 |
| 否 | 代理,当无法直接访问 |
密钥只从环境变量读取——代码中没有也不应有密钥。
工具
search
通过 Perplexity Sonar 进行网页搜索。返回回答、来源和请求费用。
模型 | 价格 | 适用场景 |
| ~$0.006 | **默认。**事实、文档、常规研究 |
| ~$0.03 | 仅当 |
没有其他搜索模型——列表在代码层面被锁定。
**为什么这很重要:**价格相差五倍。如果把昂贵模型设为默认,代理会不假思索地调用它。已在真实环境中验证:425 个请求中有 171 个走了昂贵方案,仅仅因为没有显式指定模型。
generate_image
图像生成。支持输入参考图片,以及从 21:9 到 9:16 的宽高比。
模型 | 用途 |
| 默认,质量好 |
| 经济型选项 |
| 替代引擎,从快速到高质量 |
| 另一种风格选项 |
generate_image_cost
在调用之前计算生成费用。目的是让模型选择有意识,而不是“从列表中随便选第一个”。
日志
requests.log(在 .gitignore 中)— JSONL,每次调用一行:[iso] tool: {json}。
search— 请求、完整回答、来源、模型、token、费用generate_image— 提示词、保存路径、尺寸、参考图;base64 不写入日志在
generated/中图片旁边会放置一个.json,包含相同的提示词和元数据
不提交的内容
.env、requests.log、generated/(生成的图片存档)、node_modules/。日志和图片包含请求历史——这些是私有数据,不应出现在仓库中。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityCmaintenanceAn 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.14MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server that brings Perplexity's Sonar models with real-time web search capabilities to Claude Desktop and other MCP clients.199MIT
- 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.291MIT
Related MCP Connectors
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
Augments MCP Server - A comprehensive framework documentation provider for Claude Code
MCP server for Grok Imagine AI video generation
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/DrSeedon/mcp-websearch'
If you have feedback or need assistance with the MCP directory API, please join our Discord server