Perplexity MCP Server
Sends questions to Perplexity's Sonar Pro, Sonar Reasoning Pro and Sonar Deep Research models
Web search, quick answers, reasoning and long research runs from Perplexity's API
Official · Perplexity TypeScript Remote (hosted) · Streamable HTTPLocal · stdio Web searchAI and ML
95 popularity score ★ 2.6k ↓ 42k/wk
Opens the app, which asks before it adds the server.
{
"mcpServers": {
"perplexity-api-platform": {
"url": "https://api.perplexity.ai/mcp"
}
}
}{
"servers": {
"perplexity-api-platform": {
"type": "http",
"url": "https://api.perplexity.ai/mcp"
}
}
}Opens the app, which asks before it adds the server. Then replace each <NAME> in its settings with your value.
It needs PERPLEXITY_API_KEY. Replace each <NAME> with your value.
claude mcp add perplexity-api-platform -e PERPLEXITY_API_KEY=<PERPLEXITY_API_KEY> -- npx -y @perplexity-ai/mcp-server{
"mcpServers": {
"perplexity-api-platform": {
"command": "npx",
"args": [
"-y",
"@perplexity-ai/mcp-server"
],
"env": {
"PERPLEXITY_API_KEY": "<PERPLEXITY_API_KEY>"
}
}
}
}{
"mcpServers": {
"perplexity-api-platform": {
"command": "npx",
"args": [
"-y",
"@perplexity-ai/mcp-server"
],
"env": {
"PERPLEXITY_API_KEY": "<PERPLEXITY_API_KEY>"
}
}
}
}{
"servers": {
"perplexity-api-platform": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@perplexity-ai/mcp-server"
],
"env": {
"PERPLEXITY_API_KEY": "<PERPLEXITY_API_KEY>"
}
}
}
}[mcp_servers.perplexity-api-platform]
command = "npx"
args = ["-y", "@perplexity-ai/mcp-server"]
[mcp_servers.perplexity-api-platform.env]
PERPLEXITY_API_KEY = "<PERPLEXITY_API_KEY>"gemini mcp add --scope user -e PERPLEXITY_API_KEY=<PERPLEXITY_API_KEY> perplexity-api-platform npx -- -y @perplexity-ai/mcp-serverPERPLEXITY_API_KEY secret |
Required: API key from the Perplexity API portal; tool calls are billed to it. |
|---|---|
PERPLEXITY_TIMEOUT_MS |
Optional: Request timeout in milliseconds (5 minutes). Raise it for long research runs. |
PERPLEXITY_BASE_URL |
Optional: Custom API base URL. |
PERPLEXITY_LOG_LEVEL |
Optional: DEBUG, INFO, WARN or ERROR. |
| Set together: proxy | |
PERPLEXITY_PROXY secret |
Optional: HTTPS proxy URL, optionally with credentials; checked before HTTPS_PROXY and HTTP_PROXY. |
HTTPS_PROXY |
Optional: Standard proxy setting, used when PERPLEXITY_PROXY is unset; HTTP_PROXY is tried after it. |
| Set together: http mode | |
PORT |
Optional: Port the HTTP server listens on. |
BIND_ADDRESS |
Optional: Interface to bind; 0.0.0.0 exposes it on all interfaces. |
ALLOWED_ORIGINS |
Optional: Comma-separated CORS origins; empty by default. |
ALLOWED_HOSTS |
Optional: Extra Host header values to accept; loopback only by default. |
Perplexity's own MCP server puts four tools from its paid API platform in front of an assistant. One returns a ranked list of web results with titles, URLs, snippets and dates from the Search API: 10 results by default and up to 20 with max_results, with filters for recency, domain and country and a cheaper fast mode. The other three send a conversation to the Agent API at different presets and return a written answer with numbered citations built from live web sources: the fast preset for everyday questions, the medium preset for reasoning through harder problems, and the high preset for long research reports that can take several minutes. In version 1.3.0 all four tools are marked read-only in their registration, and ask and reason take an optional search_context_size of low, medium or high to set how much web content is retrieved.
There are two ways to use it. Perplexity hosts it at https://api.perplexity.ai/mcp over Streamable HTTP, where a client either signs in with a Perplexity account through a browser (choosing which API organisation is billed) or sends an API key as a bearer token. The same code is published on npm as @perplexity-ai/mcp-server and runs locally over stdio with a key in PERPLEXITY_API_KEY. It can also run as a self-hosted HTTP service, from source or a Docker image you build yourself, and the package exports a factory for embedding the server in your own Node process. Perplexity's docs note that the hosted and local versions aim to expose the same tools but can differ in release timing and behaviour.
The repository is also packaged as a Claude Code plugin and an Agent Plugin, so some clients install it straight from GitHub.
| To run it yourself | Node.js 18+ |
|---|---|
| Runs on | macOS, Windows, Linux |
| Perplexity API | Paid planEvery tool call is billed at API rates to the key or the organisation chosen at sign-in. |
Get an API key from the Perplexity API portal (console.perplexity.ai) with billing set up, or, for the hosted endpoint, sign in with a Perplexity account through OAuth. The local version needs outbound access to api.perplexity.ai, directly or through PERPLEXITY_PROXY.
Every tool call is billed at standard API pricing to the key or organisation used, and the organisation's rate limits apply. Research runs can take minutes; the default timeout is 5 minutes and long queries may need PERPLEXITY_TIMEOUT_MS raised. It cannot fetch a given page or crawl a site; it only searches and answers. The older sonar-pro, sonar-reasoning-pro and sonar-deep-research models and the strip_thinking and reasoning_effort parameters are gone and are ignored if sent. Some strict clients fail on npx install output; the docs advise npx -yq.
It suits anyone who already pays for, or is willing to pay for, Perplexity's API and wants an assistant to search the current web and get cited answers without running anything locally: the hosted endpoint with account sign-in needs no install at all. The npm package covers clients that only speak stdio or teams that want to pin a version or route through a corporate proxy. As every call costs money and all queries go to Perplexity, it is a poor fit for someone who wants free search, offline use, or a server that opens and reads specific pages; a browsing or scraping server serves that better.
4 only read. A ? marks an optional parameter.
perplexity_searchquery: stringmax_results?: numbermax_tokens_per_page?: numbercountry?: stringsearch_recency_filter?: enumsearch_domain_filter?: arraysearch_type?: enumperplexity_askmessages: arraysearch_recency_filter?: enumsearch_domain_filter?: arraysearch_context_size?: enumperplexity_reasonmessages: arraysearch_recency_filter?: enumsearch_domain_filter?: arraysearch_context_size?: enumperplexity_researchmessages: array