Perplexity API Platform MCP Server
Perplexity API 平台 MCP 服务器
这是 Perplexity API 平台的官方 MCP 服务器实现,通过 Sonar 模型和搜索 API 为 AI 助手提供实时网络搜索、推理和研究能力。
可用工具
perplexity_search
使用 Perplexity 搜索 API 进行直接网络搜索。返回带有元数据的排名搜索结果,非常适合查找最新信息。
perplexity_ask
使用 sonar-pro 模型进行实时网络搜索的通用对话式 AI。非常适合快速提问和日常搜索。
perplexity_research
使用 sonar-deep-research 模型进行深入、全面的研究。非常适合彻底的分析和详细的报告。
perplexity_reason
使用 sonar-reasoning-pro 模型进行高级推理和问题解决。非常适合复杂的分析任务。
[!TIP] 可作为 perplexity_reason 和 perplexity_research 的可选参数:
strip_thinking设置为
true可从响应中删除<think>...</think>标签,从而节省上下文 token。默认值:false
Related MCP server: Perplexity Ask MCP Server
配置
获取您的 API 密钥
从 API 门户 获取您的 Perplexity API 密钥
将下方配置中的
your_key_here替换为您的 API 密钥(可选) 设置超时:
PERPLEXITY_TIMEOUT_MS=600000(默认:5 分钟)(可选) 设置自定义基础 URL:
PERPLEXITY_BASE_URL=https://your-custom-url.com(默认:https://api.perplexity.ai)(可选) 设置日志级别:
PERPLEXITY_LOG_LEVEL=DEBUG|INFO|WARN|ERROR(默认:ERROR)
Claude Code
claude mcp add perplexity --env PERPLEXITY_API_KEY="your_key_here" -- npx -y @perplexity-ai/mcp-server或者通过插件安装:
export PERPLEXITY_API_KEY="your_key_here"
claude
# Then run: /plugin marketplace add perplexityai/modelcontextprotocol
# Then run: /plugin install perplexityCodex
codex mcp add perplexity --env PERPLEXITY_API_KEY="your_key_here" -- npx -y @perplexity-ai/mcp-serverCursor, Claude Desktop, Kiro, Windsurf 和 VS Code
大多数客户端可以使用相同的 mcpServers 包装器在客户端配置中手动配置(如 Cursor 所示)。如果客户端具有不同的架构,请查看其文档以获取确切的包装器格式。
对于手动设置,这些客户端都使用相同的 mcpServers 结构:
客户端 | 配置文件 |
Cursor |
|
Claude Desktop |
|
Kiro |
|
Windsurf |
|
VS Code |
|
{
"mcpServers": {
"perplexity": {
"command": "npx",
"args": ["-y", "@perplexity-ai/mcp-server"],
"env": {
"PERPLEXITY_API_KEY": "your_key_here"
}
}
}
}代理设置(针对企业网络)
如果您在工作环境中运行此服务器(特别是在公司防火墙或代理之后),您可能需要告诉程序如何通过网络代理发送其互联网流量。请按照以下步骤操作:
1. 获取您的代理详细信息
向您的 IT 部门询问您的 HTTPS 代理地址和端口。
您可能还需要用户名和密码。
2. 设置代理环境变量
对于 Perplexity MCP,最简单且最可靠的方法是使用 PERPLEXITY_PROXY。例如:
export PERPLEXITY_PROXY=https://your-proxy-host:8080如果您的代理需要用户名和密码,请使用:
export PERPLEXITY_PROXY=https://username:password@your-proxy-host:80803. 替代方案:标准环境变量
如果您更喜欢使用标准变量,我们支持 HTTPS_PROXY 和 HTTP_PROXY。
[!NOTE] 服务器按以下顺序检查代理设置:
PERPLEXITY_PROXY→HTTPS_PROXY→HTTP_PROXY。如果未设置任何内容,它将直接连接到互联网。 URL 必须包含https://。典型端口为8080、3128和80。
HTTP 服务器部署
对于云端或共享部署,请以 HTTP 模式运行服务器。
环境变量
变量 | 描述 | 默认值 |
| 您的 Perplexity API 密钥 | 必需 |
| API 请求的自定义基础 URL |
|
| HTTP 服务器端口 |
|
| 要绑定的网络接口 |
|
| CORS 来源(逗号分隔) |
|
Docker
docker build -t perplexity-mcp-server .
docker run -p 8080:8080 -e PERPLEXITY_API_KEY=your_key_here perplexity-mcp-serverNode.js
export PERPLEXITY_API_KEY=your_key_here
npm install && npm run build && npm run start:http服务器将可以通过 http://localhost:8080/mcp 访问
故障排除
API 密钥问题:确保
PERPLEXITY_API_KEY设置正确连接错误:检查您的互联网连接和 API 密钥有效性
找不到工具:确保已安装该软件包且命令路径正确
超时错误:对于非常长的研究查询,请将
PERPLEXITY_TIMEOUT_MS设置为更高的值代理问题:验证您的
PERPLEXITY_PROXY或HTTPS_PROXY设置,并确保api.perplexity.ai未被您的防火墙阻止。EOF / 初始化错误:一些严格的 MCP 客户端会失败,因为
npx会将安装消息写入 stdout。使用npx -yq代替npx -y来抑制此输出。
如需支持,请访问 community.perplexity.ai 或 提交问题。
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
- Alicense-qualityDmaintenanceProvides AI-powered search, research, and reasoning capabilities through integration with Perplexity.ai, offering three specialized tools: general conversational AI, deep research with citations, and advanced reasoning.92MIT
- Alicense-qualityDmaintenanceIntegrates the Sonar API to provide Claude with real-time web-wide research capabilities. Enables conversational web searches through Perplexity's AI-powered search engine for up-to-date information retrieval.1,748MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to perform real-time web searches, company research, content crawling, LinkedIn searches, and deep research using the Exa AI Search API. Provides comprehensive web information retrieval capabilities in a safe and controlled manner.227,1451MIT
- FlicenseBqualityDmaintenanceEnables AI assistants to perform real-time web and academic searches using Perplexity's Sonar API.2
Related MCP Connectors
The best web search for your AI Agent
Web research for agents: quality-scored Google search, webpage extraction, and deep research.
LLM-ready web search + instant answers + URL-to-clean-text fetch for agents and RAG.
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/perplexityai/modelcontextprotocol'
If you have feedback or need assistance with the MCP directory API, please join our Discord server