Perplexity API Platform MCP Server

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

Connect your client

Remote (hosted)

Add in one click

Opens the app, which asks before it adds the server.

Or add it by command or config

Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "perplexity-api-platform": {
      "url": "https://api.perplexity.ai/mcp"
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "perplexity-api-platform": {
      "type": "http",
      "url": "https://api.perplexity.ai/mcp"
    }
  }
}
Local (npm)

Add in one click

Opens the app, which asks before it adds the server. Then replace each <NAME> in its settings with your value.

Or add it by command or config

It needs PERPLEXITY_API_KEY. Replace each <NAME> with your value.

Claude CodeTerminal
claude mcp add perplexity-api-platform -e PERPLEXITY_API_KEY=<PERPLEXITY_API_KEY> -- npx -y @perplexity-ai/mcp-server
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "perplexity-api-platform": {
      "command": "npx",
      "args": [
        "-y",
        "@perplexity-ai/mcp-server"
      ],
      "env": {
        "PERPLEXITY_API_KEY": "<PERPLEXITY_API_KEY>"
      }
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "perplexity-api-platform": {
      "command": "npx",
      "args": [
        "-y",
        "@perplexity-ai/mcp-server"
      ],
      "env": {
        "PERPLEXITY_API_KEY": "<PERPLEXITY_API_KEY>"
      }
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "perplexity-api-platform": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@perplexity-ai/mcp-server"
      ],
      "env": {
        "PERPLEXITY_API_KEY": "<PERPLEXITY_API_KEY>"
      }
    }
  }
}
Codex~/.codex/config.toml
[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 CLITerminal
gemini mcp add --scope user -e PERPLEXITY_API_KEY=<PERPLEXITY_API_KEY> perplexity-api-platform npx -- -y @perplexity-ai/mcp-server

Settings 10

PERPLEXITY_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. Default 300000.
PERPLEXITY_BASE_URL Optional: Custom API base URL. Default https://api.perplexity.ai.
PERPLEXITY_LOG_LEVEL Optional: DEBUG, INFO, WARN or ERROR. Default 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. Default 8080. For self-hosted HTTP mode.
BIND_ADDRESS Optional: Interface to bind; 0.0.0.0 exposes it on all interfaces. Default 127.0.0.1. For self-hosted HTTP mode.
ALLOWED_ORIGINS Optional: Comma-separated CORS origins; empty by default. For self-hosted HTTP mode.
ALLOWED_HOSTS Optional: Extra Host header values to accept; loopback only by default. For self-hosted HTTP mode.

What it does

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.

What it needs

To run it yourselfNode.js 18+
Runs onmacOS, Windows, Linux
Perplexity APIPaid 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.

Limits

  • Cost Every tool call is billed at standard API pricing to the key or organisation used, and that organisation's rate limits apply.
  • Limit Research runs can take minutes; requests time out after 300000 ms (5 minutes) by default, raised with PERPLEXITY_TIMEOUT_MS.
  • Not covered It searches and answers only; no tool fetches a given page or crawls a site.
  • Size cap perplexity_search returns at most 20 results (10 by default) and 256 to 2048 tokens of text per page (1024 by default).
  • Early release The max_tokens and max_tokens_per_page arguments the README lists for perplexity_ask and perplexity_reason are on the main branch (1.4.0), not in released 1.3.0.
  • Limit The legacy sonar-pro, sonar-reasoning-pro and sonar-deep-research models and the strip_thinking and reasoning_effort parameters are gone and ignored if sent.
  • Limit Some strict clients fail on npx install output; the docs advise running it as npx -yq.

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.

Who it suits

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.

Tools 4

4 only read. A ? marks an optional parameter.

perplexity_search
Returns ranked web results with titles, URLs, snippets and dates, filterable by recency, domain and country, with an optional fast mode.query: stringmax_results?: numbermax_tokens_per_page?: numbercountry?: stringsearch_recency_filter?: enumsearch_domain_filter?: arraysearch_type?: enum
perplexity_ask
Answers a question with cited live web context using the Agent API fast preset.messages: arraysearch_recency_filter?: enumsearch_domain_filter?: arraysearch_context_size?: enum
perplexity_reason
Works through analytical or multi-step problems using the Agent API medium preset.messages: arraysearch_recency_filter?: enumsearch_domain_filter?: arraysearch_context_size?: enum
perplexity_research
Runs a long, cited research report on the Agent API high preset, streaming progress; can take minutes.messages: array

Similar servers