On this page
Perplexity MCP Server: Setup, API Keys and Security (Oct 2026)

The Perplexity MCP server is Perplexity's official server for web search, quick answers, reasoning and deep research through the Perplexity API. TrustedMCP grades it A. Use the hosted server at https://api.perplexity.ai/mcp with OAuth sign-in, and treat every answer as untrusted web text.

What it connects

Perplexity's MCP docs and the modelcontextprotocol repo list four tools:

  • perplexity_search: direct web search through the Search API. Returns ranked results with titles, URLs, snippets and metadata. Supports recency and domain filters, plus search_type: "fast" for lower latency and cost.
  • perplexity_ask: conversational answers with real-time web search, on the Agent API fast preset.
  • perplexity_reason: step-by-step analysis on the medium preset.
  • perplexity_research: deep research on the high preset. Runs can take minutes.

There are two ways to run it:

  • Hosted (recommended by Perplexity): https://api.perplexity.ai/mcp over Streamable HTTP. Sign in with your Perplexity account (OAuth) or send an API key as a bearer token.
  • Local: the open-source @perplexity-ai/mcp-server package, run with npx over stdio and authenticated with PERPLEXITY_API_KEY.

No tool fetches an arbitrary URL the model picks. Searches and answers run on Perplexity's side and come back as text.

Setup

These snippets are copied from Perplexity's MCP docs and README.

Claude Code (hosted, OAuth):

claude mcp add --transport http perplexity https://api.perplexity.ai/mcp

Then run /mcp inside Claude Code and follow the sign-in prompt for perplexity. To use an API key instead, the docs say to add --header "Authorization: Bearer YOUR_API_KEY" to the command.

Cursor (hosted, OAuth): add this to ~/.cursor/mcp.json, then open Cursor Settings > Tools & MCP and click Connect next to perplexity:

{
  "mcpServers": {
    "perplexity": {
      "url": "https://api.perplexity.ai/mcp"
    }
  }
}

VS Code (hosted, OAuth): add this to .vscode/mcp.json. VS Code opens a browser to sign in the first time the server starts:

{
  "servers": {
    "perplexity": {
      "type": "http",
      "url": "https://api.perplexity.ai/mcp"
    }
  }
}

claude.ai: add the hosted URL as a custom connector. The docs list it among the clients that support OAuth.

Claude Desktop, Windsurf and other stdio clients (local):

{
  "mcpServers": {
    "perplexity": {
      "command": "npx",
      "args": ["-y", "@perplexity-ai/mcp-server"],
      "env": {
        "PERPLEXITY_API_KEY": "your_key_here"
      }
    }
  }
}

Don't leave a literal key there if the file could be shared. Perplexity's docs recommend an environment variable reference such as ${PERPLEXITY_API_KEY}, and our guide to keeping API keys out of your MCP config covers how per client.

Claude Code (local): the docs use single quotes so the reference, not the key, is saved:

claude mcp add perplexity --env 'PERPLEXITY_API_KEY=${PERPLEXITY_API_KEY}' -- npx -y @perplexity-ai/mcp-server

Codex (local):

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

If a strict client fails with EOF or initialize errors, the README suggests npx -yq instead of npx -y.

OAuth or API key?

Prefer OAuth on the hosted server. The docs describe it as OAuth 2.1 with PKCE and dynamic client registration. During sign-in you pick which API organization to bill. You must be an admin of an API organization that can pay for usage.

The docs also say what an OAuth connection can't do: it "cannot create API keys, view balances, or manage the organization." That's a real limit worth having.

Use an API key only when your client can't do OAuth, or for server-side setups such as the Anthropic API MCP connector. Send it in the Authorization: Bearer header, never in a URL. See MCP authentication explained for why the header matters.

Billing

Perplexity's docs say tool calls are billed at standard API pricing to the API key you connect with, or to the organization you chose at sign-in, and your organization's rate limits apply. The API uses prepaid credits. If they run out, your API keys are blocked until you add more. Check the pricing page for current rates.

perplexity_research is the heaviest tool. For perplexity_ask and perplexity_reason, the optional max_tokens and max_tokens_per_page arguments cap how much search content is retrieved, not answer length.

Security notes

Answers carry web text into your agent. Every tool returns content drawn from web pages. A page can include instructions aimed at your agent, and they reach the model inside the answer. Keep tool approval on for any other server that can write, so injected text can't act through it.

Local HTTP mode is locked down by default. For self-hosting, the README's HTTP mode binds to 127.0.0.1, accepts only loopback Host headers unless you add more with ALLOWED_HOSTS, and blocks cross-origin browser requests unless you set ALLOWED_ORIGINS. Keep it that way unless you need remote access, and avoid ALLOWED_ORIGINS=*.

Keys are revocable, not scoped. You can revoke a key in the API Portal, but it can't be limited to the MCP server. Create a dedicated key for MCP so you can track its usage and revoke it without breaking other apps.

See the 5-minute safety check for the general process.

Why it grades A

Perplexity's server is open source, actively maintained, and has no advisories on record. The hosted version runs over HTTPS, and the local HTTP mode ships with safe defaults. Because it only searches and answers through Perplexity's API, it can't touch your files or post anywhere.

The biggest deduction is authentication. Both OAuth and API keys act for the whole API organization with no scopes, so anyone holding the key can spend that organization's credits. OAuth softens this, since it can't create keys or manage billing, but there is still no way to grant less.

Full breakdown on the Perplexity MCP listing; the method is in how TrustedMCP scores servers.

Frequently asked questions

Is the Perplexity MCP server free?

The server is free and open source, but tool calls are not. They bill at standard API pricing to your API key or the organization you chose at sign-in.

Does it need Perplexity Pro or API credits?

API credits. The MCP docs say you need an API organization that can pay for usage, and calls draw on that organization's prepaid credits. They don't say a Perplexity Pro subscription covers MCP usage.

What's the Perplexity MCP URL?

https://api.perplexity.ai/mcp, over Streamable HTTP. Connect it with OAuth, or an API key in the Authorization header.

Perplexity MCP vs Tavily or Firecrawl?

Perplexity returns search results and finished, cited answers. Tavily also extracts and crawls pages, and Firecrawl searches, scrapes and crawls sites, so both fetch URLs the model chooses. See the Tavily MCP guide, the Firecrawl listing, and the best MCP server for SEO and search for a comparison.

Should I use the hosted or local server?

Perplexity recommends the hosted server: nothing to install or update, and it supports OAuth. Use the local server if your client only supports stdio or you need to pin a version.

More: MCP security best practices ยท Search category