💡

The official MCP server implementation for the Perplexity API Platform. Provides AI assistants with real-time web search, reasoning, and research capabilities through Sonar models and the Search API.

🔓
Real-time web search & research Capability
Installation · mcp config
Claude Code $ claude mcp add perplexity --env PERPLEXITY_API_KEY="your_key_here" -- npx -y @perplexity-ai/mcp-server
Codex $ codex mcp add perplexity --env PERPLEXITY_API_KEY="your_key_here" -- npx -y @perplexity-ai/mcp-server
Docker $ docker build -t perplexity-mcp-server . && docker run -p 8080:8080 -e PERPLEXITY_API_KEY=your_key_here perplexity-mcp-server

What it does

Claude’s training data has a cutoff, so questions that require fresh information — recent news, just-shipped docs, latest releases — can’t be answered from memory alone. The usual workaround is to switch to a browser, run a search, and paste results back. Perplexity MCP collapses that loop: Claude calls the search directly through MCP tools and gets answers grounded in real-time web data.

Because Perplexity’s Sonar models synthesize answers from search results rather than returning raw pages, Claude doesn’t have to re-read full result pages itself.

Key features — four tools

  • perplexity_search — direct web search

    Returns ranked Perplexity Search API results unmodified. Use when you want the raw result set rather than a synthesized answer.

  • perplexity_ask — conversational AI with real-time web search

    The most common entry point. Runs on sonar-pro and returns a synthesized answer over current web data in a single call.

  • perplexity_research — deep research

    Runs on sonar-deep-research and produces longer-form research that combines multiple sources. Better suited for topic-wide questions than one-shot queries.

  • perplexity_reason — advanced reasoning

    Runs on sonar-reasoning-pro and adds an explicit reasoning step on top of search results.

Both perplexity_research and perplexity_reason accept a strip_thinking boolean to drop thinking tags from output and save tokens.

Installation

Claude Code (recommended) — one-liner that registers and installs the server.

claude mcp add perplexity \
  --env PERPLEXITY_API_KEY="your_key_here" \
  -- npx -y @perplexity-ai/mcp-server

Codex — same pattern.

codex mcp add perplexity \
  --env PERPLEXITY_API_KEY="your_key_here" \
  -- npx -y @perplexity-ai/mcp-server

Cursor · Claude Desktop · Kiro · Windsurf · VS Code — add the server to the client’s mcpServers JSON config (file location varies per client).

Docker · HTTP server — for shared or cloud deployments. Either docker build and docker run -p 8080:8080 -e PERPLEXITY_API_KEY=..., or run the HTTP mode directly with npm install && npm run build && npm run start:http.

Environment variables

VariableRequiredDefaultPurpose
PERPLEXITY_API_KEYAPI key. Generate at https://www.perplexity.ai/account/api/group
PERPLEXITY_TIMEOUT_MS5 minutesAPI call timeout
PERPLEXITY_BASE_URLhttps://api.perplexity.aiCustom endpoint
PERPLEXITY_LOG_LEVELERROROne of DEBUG, INFO, WARN, ERROR
PERPLEXITY_PROXY / HTTPS_PROXY / HTTP_PROXYCorporate proxy. Format: https://[username:password@]host:port

HTTP server deployment also reads: PORT (default 8080), BIND_ADDRESS (default 0.0.0.0), and ALLOWED_ORIGINS.

Notes

  • Officially operated by Perplexity — maintained in the github.com/perplexityai org, distinct from community wrappers.
  • API usage is billed separately by Perplexity — Anthropic charges for Claude tokens, Perplexity charges for API calls. Track usage on each platform separately if cost monitoring matters.
  • Proxy support — set PERPLEXITY_PROXY, HTTPS_PROXY, or HTTP_PROXY; any of the three is recognized.
  • Use strip_thinking to save tokens — the research and reason tools include thinking tags in output by default. When only the final answer is needed, enable the option to reduce token usage.
  • MIT licensed — free for commercial and personal use.

Frequently Asked Questions

What is Perplexity MCP?

The official MCP server implementation for the Perplexity API Platform. It gives AI assistants real-time web search, reasoning, and research capabilities through Perplexity's Sonar models (`sonar-pro`, `sonar-deep-research`, `sonar-reasoning-pro`) and the Search API.

Where does it run?

Claude Code, Claude Desktop, Codex, Cursor, Kiro, Windsurf, and VS Code. Any standard MCP client can connect via manual `mcpServers` JSON configuration.

How do I install it?

On Claude Code, run `claude mcp add perplexity --env PERPLEXITY_API_KEY="..." -- npx -y @perplexity-ai/mcp-server`. Codex uses the equivalent `codex mcp add` command. Docker and a Node.js HTTP server deployment are also supported.

Where do I get the API key?

Generate one at https://www.perplexity.ai/account/api/group and set it as the `PERPLEXITY_API_KEY` environment variable.

What tools does the server expose?

`perplexity_search` (direct web search), `perplexity_ask` (conversational AI on `sonar-pro`), `perplexity_research` (deep research on `sonar-deep-research`), and `perplexity_reason` (advanced reasoning on `sonar-reasoning-pro`). The last two accept an optional `strip_thinking` boolean to remove thinking tags and save tokens.

What's the license?

MIT. Perplexity API usage is billed separately by Perplexity — refer to the [Perplexity documentation](https://docs.perplexity.ai/) for pricing.