Perplexity MCP Server

Perplexity MCP Server

Enables web search and deep research using Perplexity Sonar models through MCP clients like Cursor or Claude Desktop.

Category
访问服务器

README

Perplexity MCP Server

Python MCP server that exposes Perplexity Sonar Chat Completions to any MCP client (Cursor, Claude Desktop, custom agents).

Tools

Tool Default model Purpose
perplexity_search sonar-pro General web search
perplexity_deep_research sonar-deep-research Comprehensive synthesis

Both tools accept optional Sonar parameters and return JSON:

{
  "answer": "...",
  "citations": ["https://..."],
  "search_results": [],
  "model": "sonar-pro",
  "usage": {}
}

Optional parameters

Parameter Values / format When to use
temperature 02 (default 0.2) Lower = more focused; raise only for more varied phrasing
max_tokens 1128000 Cap answer length; omit for API default
search_recency_filter hour | day | week | month | year News / “latest” questions; omit for evergreen topics
search_after_date_filter MM/DD/YYYY Absolute start of publication window
search_before_date_filter MM/DD/YYYY Absolute end of publication window
search_domain_filter up to 20 domains; allowlist or -domain denylist (not mixed) Trusted sources only, or exclude noisy sites
search_mode web | academic | sec Papers (academic), SEC filings (sec); omit for general web
model sonar | sonar-pro | sonar-deep-research | sonar-reasoning-pro Override tool default only when you need a different speed/depth tradeoff

Prefer date filters over search_recency_filter when the window is known exactly. Queries are capped at 4,000 characters. The API key is never logged or returned in tool output.

Setup

  1. Copy env template and add your Perplexity API key:
cp .env.example .env
  1. Install with uv:
uv sync

Run locally (stdio)

uv run mcp-perplexity

Cursor / Claude Desktop

Add to your MCP config (adjust the project path):

{
  "mcpServers": {
    "perplexity": {
      "command": "uv",
      "args": ["--directory", "C:/Users/KozakJ/git/mcp_perplexity", "run", "mcp-perplexity"],
      "env": {
        "PERPLEXITY_API_KEY": "pplx-your-api-key-here"
      }
    }
  }
}

Or rely on a .env file in the project directory (PERPLEXITY_API_KEY=...).

Cursor / Claude Desktop (container, stdio)

Rebuild after image changes, then only the API key is required — other settings use the same defaults as local runs:

{
  "mcpServers": {
    "perplexity": {
      "command": "podman",
      "args": [
        "run", "-i", "--rm",
        "-e", "PERPLEXITY_API_KEY",
        "mcp-perplexity"
      ],
      "env": {
        "PERPLEXITY_API_KEY": "pplx-your-api-key-here"
      }
    }
  }
}

Override any setting the same way (-e MCP_PORT, etc.) only when you need non-defaults.

Run with Podman (streamable HTTP)

podman compose needs a compose provider (podman-compose or Docker Compose). On a plain Podman install, use build + run:

podman build -t mcp-perplexity .
podman run --rm -p 8000:8000 --env-file .env ^
  -e MCP_TRANSPORT=streamable-http ^
  -e MCP_HOST=0.0.0.0 ^
  -e MCP_PORT=8000 ^
  --name mcp-perplexity mcp-perplexity

(On bash/zsh, replace ^ with \.)

If you have a compose provider installed (pip install podman-compose, or Docker Compose):

podman compose up --build

Endpoint: http://localhost:8000/mcp (Streamable HTTP). Bind to trusted networks only — this image does not add HTTP auth.

Configuration

Variable Default Description
PERPLEXITY_API_KEY (required) Perplexity API key
MCP_TRANSPORT stdio stdio or streamable-http
MCP_HOST 127.0.0.1 HTTP bind host
MCP_PORT 8000 HTTP bind port
PERPLEXITY_RPM 30 Soft client-side requests/minute limit
PERPLEXITY_MAX_CONCURRENCY 2 Max concurrent API calls
PERPLEXITY_SEARCH_TIMEOUT 60 Search timeout (seconds)
PERPLEXITY_DEEP_RESEARCH_TIMEOUT 180 Deep research timeout (seconds)
PERPLEXITY_MAX_RETRIES 3 Retries on 429/5xx and transport errors

Retries use exponential backoff (honors Retry-After when present). Logging goes to stderr only so stdio JSON-RPC stays clean.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选
mcp-server-qdrant

mcp-server-qdrant

这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。

官方
精选