Perplexity MCP Server
Connects AI assistants to Perplexity AI's search API, enabling natural language web search with fine-grained control over recency, citations, images, and model parameters directly from MCP clients like Claude.
README
<!-- mcp-server: perplexity | tools: 1 | transport: stdio | auth: api_key -->
<h1 align="center">Perplexity MCP Server</h1>
<p align="center"> <a href="https://www.npmjs.com/package/@jschuller/perplexity-mcp"><img src="https://img.shields.io/npm/v/@jschuller/perplexity-mcp?color=CB3837&label=npm" alt="npm"></a> <a href="https://www.npmjs.com/package/@jschuller/perplexity-mcp"><img src="https://img.shields.io/npm/dm/@jschuller/perplexity-mcp?color=CB3837&label=downloads" alt="Downloads"></a> <a href="https://nodejs.org/"><img src="https://img.shields.io/badge/Node.js-18+-339933" alt="Node.js"></a> <a href="https://modelcontextprotocol.io"><img src="https://img.shields.io/badge/MCP-SDK%201.x-5436DA" alt="MCP SDK"></a> <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue" alt="License"></a> <a href="https://github.com/jschuller/perplexity-mcp/actions/workflows/ci.yml"><img src="https://github.com/jschuller/perplexity-mcp/actions/workflows/ci.yml/badge.svg" alt="CI"></a> </p>
<p align="center"> Search the web from Claude Desktop, Claude Code, or any MCP client using Perplexity AI —<br> with fine-grained control over recency, citations, images, and model parameters. </p>
What This Does
This MCP server connects AI assistants to Perplexity AI's search API. Ask questions in natural language and get grounded, cited answers from the live web — directly inside Claude or any MCP-compatible client.
One tool, full control: perplexity_search_web exposes the complete Perplexity API — recency filtering, model selection, temperature, top_k/top_p, citation/image toggles, and streaming.
Getting Started
1. Get a Perplexity API Key
Sign up at perplexity.ai and generate an API key from your account settings.
2. Install & Configure
Claude Code (Recommended)
claude mcp add perplexity -- npx -y @jschuller/perplexity-mcp
Then set your API key:
export PERPLEXITY_API_KEY=pplx-your-key-here
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"perplexity": {
"command": "npx",
"args": ["-y", "@jschuller/perplexity-mcp"],
"env": {
"PERPLEXITY_API_KEY": "pplx-your-key-here"
}
}
}
}
Config location:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
From Source
git clone https://github.com/jschuller/perplexity-mcp.git
cd perplexity-mcp
npm install && npm run build
3. Verify
Ask Claude: "Search the web for the latest developments in quantum computing from the last week"
Tool Reference
perplexity_search_web
| Parameter | Type | Default | Description |
|---|---|---|---|
query |
string | (required) | Search query |
recency |
day | week | month | year |
month |
Filter results by time period |
model |
string | sonar |
Perplexity model (model cards) |
temperature |
number | — | Randomness (0 = deterministic, 2 = creative) |
max_tokens |
integer | — | Maximum tokens to generate |
top_k |
integer | — | Limit high-probability token pool (0 = disable) |
top_p |
number | — | Nucleus sampling threshold |
frequency_penalty |
number | — | Penalize repeated tokens |
presence_penalty |
number | — | Encourage topic variety |
return_citations |
boolean | true |
Include source citations |
return_images |
boolean | false |
Include relevant images |
stream |
boolean | false |
Stream response incrementally |
Environment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
PERPLEXITY_API_KEY |
Yes | — | Your Perplexity API key |
PERPLEXITY_MODEL |
No | sonar |
Default model for all queries |
Available Models
sonar— Standard model (default)sonar-pro— Enhanced capabilities- See full list: Perplexity Model Cards
Security
- API key stays in your local environment — never sent anywhere except the Perplexity API
- The server communicates only with
api.perplexity.aiover HTTPS - No data is stored or logged beyond the API request lifecycle
- See SECURITY.md for vulnerability reporting
Troubleshooting
| Issue | Fix |
|---|---|
PERPLEXITY_API_KEY is required |
Set the env var in your MCP client config or shell |
400 invalid_request_error |
Update to v2.1.0+ (fixes JSON Schema validation with Claude Code) |
| Server not found | Verify npx @jschuller/perplexity-mcp runs without error |
| Connection timeout | Check internet connectivity and Perplexity API status |
Contributing
Contributions welcome — see CONTRIBUTING.md.
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。