Perplexity Web Search MCP Server
Perplexity Web 搜索 MCP 服务器
一个简单的 MCP(模型上下文协议)服务器,使用 Perplexity API 提供网页搜索功能。该服务器允许 Claude 或其他兼容 MCP 的 AI 助手搜索网页并获取最新信息。
特征
使用 Perplexity 强大的搜索功能搜索网络
获得包含来源和引文的全面搜索结果
按时间段(日、周、月、年)过滤结果
包含一个可立即使用的网页搜索提示模板
支持从环境变量或.env 文件加载 API 密钥
Related MCP server: Perplexity MCP Server
安装
克隆此存储库
安装依赖项:
pip install -e .或者
uv pip install -e .
配置
您可以使用 Perplexity API 密钥设置PERPLEXITY_API_KEY环境变量:
export PERPLEXITY_API_KEY="your-api-key-here"或者,您可以在项目根目录中创建一个包含以下内容的.env文件:
PERPLEXITY_API_KEY=your-api-key-here提供了一个示例.env.example文件以供参考。
获取 Perplexity API 密钥:
如果您没有帐户,请创建一个
生成 API 密钥
用法
运行服务器
python server.py测试服务器
您可以使用附带的测试脚本来测试服务器功能,而无需运行完整的 MCP 服务器:
python test_server.py "your search query here" --recency month--recency的选项有:天、周、月(默认)、年
与 Claude Desktop 一起使用
编辑您的 Claude Desktop 配置文件:
在 macOS 上:
~/Library/Application\ Support/Claude/claude_desktop_config.json在 Windows 上:
%APPDATA%/Claude/claude_desktop_config.json
添加以下配置:
{ "perplexity-mcp": { "env": { "PERPLEXITY_API_KEY": "your-api-key-here" }, "command": "python", "args": [ "/path/to/server.py" ] } }重启Claude桌面
克劳德的示例提示
“在网上搜索有关人工智能的最新消息”
“使用 Perplexity 查找过去一周发布的有关气候变化的信息”
“搜索过去一个月有关量子计算的最新研究论文”
API 参考
工具: search_web(query: str, recency: str = "month") -> str
使用 Perplexity API 搜索网络并返回结果。
参数:
query:搜索查询字符串recency:按时间段过滤结果 - “天”、“周”、“月”(默认)或“年”
**返回:**包含以下内容的综合文本响应:
搜索结果的详细摘要
发现的关键事实和信息
带有 URL 的来源以供验证
任何有冲突的信息(如有)
提示: web_search_prompt(query: str, recency: str = "month") -> str
创建使用 Perplexity 搜索网络的提示模板。
参数:
query:搜索查询recency:时间段过滤器 - ‘天’、‘周’、‘月’(默认)或‘年’
**返回:**格式化的提示字符串,指示 AI 执行以下操作:
搜索指定查询
关注特定时间段内的结果
总结主要发现
突出重要事实
提及相互矛盾的信息
引用来源并附链接
执照
麻省理工学院
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
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 Connectors
Real-time web search, reasoning, and research through Perplexity's API
Enable AI assistants to perform web searches using Perplexity's Sonar Pro.
Live AI-native web search with citations. One tool for every MCP client. Flat per-request pricing.
Provides AI assistants with access to Seltz's powerful Web Search capabilities.
Related MCP Servers
- AlicenseBqualityDmaintenanceFacilitates web search capabilities using Perplexity's API, allowing users to retrieve search results through Claude's interface.17MIT
- AlicenseBqualityDmaintenanceEnables web search functionality through Perplexity AI's API with time-based filtering options. Allows users to search the web for recent information within specified time periods (day, week, month, or year).1MIT
- AlicenseBqualityDmaintenanceEnables web search using Perplexity AI's API, allowing users to search the web with optional recency filters and integration with Claude, Cursor, and other MCP clients.1MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to perform web searches and retrieve real-time information using Perplexity AI's Sonar models, with support for multiple search modes and easy integration with MCP clients.51MIT
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/nachoal/perplexity-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server