Perplexity API Platform MCP Server
Provides access to Perplexity's API platform, enabling real-time web search, conversational Q&A, deep research, and advanced reasoning through the Search API and Agent API.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Perplexity API Platform MCP ServerSearch the web for the latest breakthroughs in fusion energy and summarize the key findings."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Perplexity API Platform MCP Server
The official MCP server implementation for the Perplexity API Platform, providing AI assistants with real-time web search, reasoning, and research capabilities through the Agent API and the Search API.
Remote MCP Server
The remote MCP server is hosted by Perplexity and is the easiest way to get started: same tools, nothing to install or update. The Cursor and VS Code buttons at the top of this page connect to it with one click. If your MCP client does not support remote servers yet, skip to the local server setup below. Connect over Streamable HTTP with your Perplexity API key:
https://api.perplexity.ai/mcpFor Claude Code:
claude mcp add --transport http perplexity https://api.perplexity.ai/mcp --header "Authorization: Bearer YOUR_API_KEY"See the MCP integration docs for manual Cursor/VS Code configuration, usage from the Anthropic API, and setup for other clients.
Related MCP server: Exa MCP Server
Local MCP Server
Get Your API Key
Get your Perplexity API Key from the API Portal
Replace
your_key_herein the configurations below with your API key(Optional) Set timeout:
PERPLEXITY_TIMEOUT_MS=600000(default: 5 minutes)(Optional) Set custom base URL:
PERPLEXITY_BASE_URL=https://your-custom-url.com(default: https://api.perplexity.ai)(Optional) Set log level:
PERPLEXITY_LOG_LEVEL=DEBUG|INFO|WARN|ERROR(default: ERROR)
Claude Code
claude mcp add perplexity --env PERPLEXITY_API_KEY="your_key_here" -- npx -y @perplexity-ai/mcp-serverOr install via plugin:
export PERPLEXITY_API_KEY="your_key_here"
claude
# Then run: /plugin marketplace add perplexityai/modelcontextprotocol
# Then run: /plugin install perplexityCodex
codex mcp add perplexity --env PERPLEXITY_API_KEY="your_key_here" -- npx -y @perplexity-ai/mcp-serverAgent Plugins
This repository is packaged as an Agent Plugin, so clients that support the standard can install it directly from this repository. The Agent Plugins format does not carry secrets, so set the PERPLEXITY_API_KEY environment variable through your client's plugin or MCP settings.
Other MCP Clients
Most clients can be configured manually using the same mcpServers wrapper in their client config (as shown for Cursor). If a client has a different schema, check its docs for the exact wrapper format.
For manual setup, these clients all use the same mcpServers structure:
Client | Config File |
Cursor |
|
Claude Desktop |
|
Kiro |
|
Windsurf |
|
VS Code |
|
{
"mcpServers": {
"perplexity": {
"command": "npx",
"args": ["-y", "@perplexity-ai/mcp-server"],
"env": {
"PERPLEXITY_API_KEY": "your_key_here"
}
}
}
}Proxy Setup (For Corporate Networks)
If you are running this server at work—especially behind a company firewall or proxy—you may need to tell the program how to send its internet traffic through your network's proxy. Follow these steps:
1. Get your proxy details
Ask your IT department for your HTTPS proxy address and port.
You may also need a username and password.
2. Set the proxy environment variable
The easiest and most reliable way for Perplexity MCP is to use PERPLEXITY_PROXY. For example:
export PERPLEXITY_PROXY=https://your-proxy-host:8080If your proxy needs a username and password, use:
export PERPLEXITY_PROXY=https://username:password@your-proxy-host:80803. Alternate: Standard environment variables
If you'd rather use the standard variables, we support HTTPS_PROXY and HTTP_PROXY.
The server checks proxy settings in this order:PERPLEXITY_PROXY → HTTPS_PROXY → HTTP_PROXY. If none are set, it connects directly to the internet.
URLs must include https://. Typical ports are 8080, 3128, and 80.
Self-Hosted HTTP Mode
For cloud or shared deployments, run the server in HTTP mode.
Environment Variables
Variable | Description | Default |
| Your Perplexity API key | Required |
| Custom base URL for API requests |
|
| HTTP server port |
|
| Network interface to bind to. Defaults to loopback. Set to |
|
| CORS origins (comma-separated). Defaults to empty (no cross-origin browser requests). Set to an explicit allowlist (e.g. | (empty) |
| Additional | (loopback only) |
Docker
docker build -t perplexity-mcp-server .
docker run -p 8080:8080 -e PERPLEXITY_API_KEY=your_key_here perplexity-mcp-serverNode.js
export PERPLEXITY_API_KEY=your_key_here
npm install && npm run build && npm run start:httpThe server will be accessible at http://localhost:8080/mcp
Available Tools
perplexity_search
Direct web search using the Perplexity Search API. Returns ranked search results with metadata, perfect for finding current information. Supports recency filters (search_recency_filter) and domain restrictions (search_domain_filter).
perplexity_ask
General-purpose conversational AI with real-time web search, backed by the Agent API fast preset. Great for quick questions and everyday searches.
perplexity_research
Deep, comprehensive research backed by the Agent API high preset. Ideal for thorough analysis and detailed reports. Runs can take minutes; the server streams the run and reports progress to clients that request it.
perplexity_reason
Advanced reasoning and problem-solving backed by the Agent API medium preset. Perfect for complex analytical tasks.
Presets are managed configurations (model, search setup, step budget) that Perplexity keeps tuned over time; see thepresets guide. Earlier versions of this server called the legacy sonar-pro, sonar-reasoning-pro, and sonar-deep-research models and accepted strip_thinking / reasoning_effort parameters. Those parameters are no longer part of the tool schemas and are ignored if sent; the Agent API produces no <think> tags.
Use as a Library
The package also exports the server factory for embedding in your own Node process:
import { createPerplexityServer } from "@perplexity-ai/mcp-server";
// Single-tenant: reads PERPLEXITY_API_KEY from the environment.
const server = createPerplexityServer("my-service");
// Multi-tenant hosts resolve the key per call instead. When a provider is
// set, the environment variable is never consulted, and a provider that
// returns no key fails the call rather than falling back.
const tenantServer = createPerplexityServer("my-service", {
apiKey: () => currentRequestApiKey,
});Mount the returned server on any MCP transport (stdio, streamable HTTP, in-memory).
Troubleshooting
API Key Issues: Ensure
PERPLEXITY_API_KEYis set correctlyConnection Errors: Check your internet connection and API key validity
Tool Not Found: Make sure the package is installed and the command path is correct
Timeout Errors: For very long research queries, set
PERPLEXITY_TIMEOUT_MSto a higher valueProxy Issues: Verify your
PERPLEXITY_PROXYorHTTPS_PROXYsetup and ensureapi.perplexity.aiisn't blocked by your firewall.EOF / Initialize Errors: Some strict MCP clients fail because
npxwrites installation messages to stdout. Usenpx -yqinstead ofnpx -yto suppress this output.
For support, visit community.perplexity.ai or file an issue.
Available Tools
4 toolsperplexity_askAsk PerplexityARead-only
Answer a question using web-grounded AI (Perplexity Agent API, fast preset). Best for: quick factual questions, summaries, explanations, and general Q&A. Returns a text response with numbered citations. Fastest and cheapest option. Supports filtering by recency (hour/day/week/month/year), domain restrictions, and search context size. For in-depth multi-source research, use perplexity_research instead. For step-by-step reasoning and analysis, use perplexity_reason instead.
| Name | Required | Description | Default |
|---|---|---|---|
| messages | Yes | Array of conversation messages | |
| search_context_size | No | Controls how much web context is retrieved. 'low' is fastest, 'high' provides more comprehensive results. | |
| search_domain_filter | No | Restrict search results to specific domains (e.g., ['wikipedia.org', 'arxiv.org']). Use '-' prefix for exclusion (e.g., ['-reddit.com']). | |
| search_recency_filter | No | Filter search results by recency. Use 'hour' for very recent news, 'day' for today's updates, 'week' for this week, etc. |
Output Schema
| Name | Required | Description |
|---|---|---|
| response | Yes | AI-generated text response with numbered citation references |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and destructiveHint=false, and the description adds meaningful behavior beyond that: it is web-grounded, uses the fast preset, returns text with numbered citations, and is the fastest/cheapest option. It doesn't cover rate limits or failure behavior, but the annotation bar is lower and the added details are substantive.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is front-loaded with the core purpose and then efficiently packs in use cases, return format, performance characteristics, filtering capabilities, and routing guidance to sibling tools. Every sentence earns its place; there is no filler or redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a read-only Q&A tool, the description covers purpose, use cases, return shape, filtering options, and explicit alternatives. The input schema fully documents all parameters, annotations cover safety, and an output schema exists, so the description is sufficiently complete for an agent to select and invoke it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema covers 100% of parameter descriptions, so the baseline is 3. The description references recency filtering, domain restrictions, and search context size, but it does not add detail beyond what the schema already explains. It adds no new semantic meaning for the parameters.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Answer') and resource ('web-grounded AI / Perplexity Agent API') and clearly positions the tool for quick factual questions, summaries, and general Q&A. It explicitly distinguishes this tool from perplexity_research and perplexity_reason by naming those alternatives and their different purposes.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It states exactly when to use this tool ('quick factual questions, summaries, explanations, and general Q&A') and when to use alternatives instead ('in-depth multi-source research' → perplexity_research; 'step-by-step reasoning and analysis' → perplexity_reason). This gives an agent clear routing criteria.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
perplexity_reasonAdvanced ReasoningARead-only
Analyze a question using step-by-step reasoning with web grounding (Perplexity Agent API, medium preset). Best for: math, logic, comparisons, complex arguments, and tasks requiring chain-of-thought. Returns a reasoned response with numbered citations. Supports filtering by recency (hour/day/week/month/year), domain restrictions, and search context size. For quick factual questions, use perplexity_ask instead. For comprehensive multi-source research, use perplexity_research instead.
| Name | Required | Description | Default |
|---|---|---|---|
| messages | Yes | Array of conversation messages | |
| search_context_size | No | Controls how much web context is retrieved. 'low' is fastest, 'high' provides more comprehensive results. | |
| search_domain_filter | No | Restrict search results to specific domains (e.g., ['wikipedia.org', 'arxiv.org']). Use '-' prefix for exclusion (e.g., ['-reddit.com']). | |
| search_recency_filter | No | Filter search results by recency. Use 'hour' for very recent news, 'day' for today's updates, 'week' for this week, etc. |
Output Schema
| Name | Required | Description |
|---|---|---|
| response | Yes | AI-generated text response with numbered citation references |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already cover read-only and non-destructive behavior. The description adds meaningful context beyond annotations: it returns a reasoned response with numbered citations, uses a medium preset, and mentions web grounding. This transparently sets expectations for the tool's output and behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is compact and front-loaded with the core behavior, followed by use cases, return characteristics, filter capabilities, and sibling alternatives. Every sentence serves a purpose, with no filler or redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the annotations, full parameter coverage, and output schema, the description provides all essential context: what the tool does, when to use it, what it returns, and how it differs from siblings. Nothing critical is missing for an agent to call it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the input schema already documents all parameters. The description mentions recency, domain restrictions, and search context size, but does not add semantic detail beyond what the schema already provides. Therefore, baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb and resource: 'Analyze a question using step-by-step reasoning with web grounding.' It also differentiates itself from siblings by naming perplexity_ask for quick factual questions and perplexity_research for comprehensive research, so the purpose is unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly lists when to use this tool: math, logic, comparisons, complex arguments, and chain-of-thought tasks. It also provides clear routing guidance by directing quick factual questions to perplexity_ask and comprehensive multi-source research to perplexity_research.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
perplexity_researchDeep ResearchARead-only
Conduct deep, multi-source research on a topic (Perplexity Agent API, high preset). Best for: literature reviews, comprehensive overviews, investigative queries needing many sources. Returns a detailed response with numbered citations. Significantly slower than other tools (can take minutes). For quick factual questions, use perplexity_ask instead. For logical analysis and reasoning, use perplexity_reason instead.
| Name | Required | Description | Default |
|---|---|---|---|
| messages | Yes | Array of conversation messages |
Output Schema
| Name | Required | Description |
|---|---|---|
| response | Yes | AI-generated text response with numbered citation references |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and destructiveHint=false, so the safety profile is covered. The description adds meaningful behavioral context beyond annotations by warning that this tool is 'Significantly slower than other tools (can take minutes)' and by noting it returns 'a detailed response with numbered citations.' This gives the agent critical execution-time expectations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is compact and front-loaded, with each sentence earning its place. It covers the core function, use cases, return characteristics, performance caveat, and sibling alternatives without any filler or repetition.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description is complete for an AI agent selecting and invoking the tool: it explains operation, when to use it, performance trade-offs, and the return shape (numbered citations). The presence of an output schema means the structure of the return value does not need to be described here. A small gap is that it does not mention input length or message-format constraints, but the schema already covers the required messages field.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, and the messages parameter is already fully described in the schema as an array of conversation messages. The description's reference to 'a topic' adds only light context and does not substantially enrich the meaning of the messages parameter beyond what the schema provides.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb and resource: 'Conduct deep, multi-source research on a topic' and immediately scopes it with 'Perplexity Agent API, high preset.' It also distinguishes itself from siblings by naming the best-use cases: literature reviews, comprehensive overviews, and investigative queries needing many sources.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit when-to-use guidance with concrete examples: 'Best for: literature reviews, comprehensive overviews, investigative queries needing many sources.' It also gives clear routing instructions by stating when NOT to use it: quick factual questions should use perplexity_ask, and logical analysis should use perplexity_reason.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
perplexity_searchSearch the WebARead-only
Search the web and return a ranked list of results with titles, URLs, snippets, and dates. Best for: finding specific URLs, checking recent news, verifying facts, discovering sources. Returns formatted results (title, URL, snippet, date) with no AI synthesis. Supports recency filters and domain restrictions. For AI-generated answers with citations, use perplexity_ask instead.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query string | |
| country | No | ISO 3166-1 alpha-2 country code for regional results (e.g., 'US', 'GB') | |
| max_results | No | Maximum number of results to return (1-20, default: 10) | |
| max_tokens_per_page | No | Maximum tokens to extract per webpage (default: 1024) | |
| search_domain_filter | No | Restrict search results to specific domains (e.g., ['wikipedia.org', 'arxiv.org']). Use '-' prefix for exclusion (e.g., ['-reddit.com']). | |
| search_recency_filter | No | Filter search results by recency. Use 'hour' for very recent news, 'day' for today's updates, 'week' for this week, etc. |
Output Schema
| Name | Required | Description |
|---|---|---|
| results | Yes | Formatted search results, each with title, URL, snippet, and date |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and destructiveHint=false; the description reinforces them by framing the tool as a pure retrieval operation. It adds value beyond annotations by disclosing 'returns formatted results with no AI synthesis,' which is a meaningful behavioral trait that distinguishes it from perplexity_ask, plus capability disclosures for recency filters and domain restrictions.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Four sentences with zero waste: core function first, then use cases, then behavioral trait, then sibling routing. Each sentence earns its place, and the most decision-relevant information (what it returns, what it does not do) is front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has rich supporting context: an output schema, annotations covering safety (read-only, open-world, non-destructive), and 100% parameter documentation. The description covers purpose, use cases, output format, and one sibling alternative. The only gap is the absence of routing guidance for the other two siblings (perplexity_research, perplexity_reason), which leaves an agent slightly under-informed about the full tool landscape.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all 6 parameters in detail (including the '-' prefix exclusion syntax and enum values). The description only adds marginal confirmation that recency filters and domain restrictions exist, which maps to search_recency_filter and search_domain_filter but adds no new detail beyond the schema. Baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource: 'Search the web and return a ranked list of results with titles, URLs, snippets, and dates.' It enumerates concrete use cases (finding specific URLs, checking recent news, verifying facts, discovering sources) and explicitly distinguishes itself from perplexity_ask, so an agent can separate it from siblings immediately.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides explicit when-to-use context via 'Best for: finding specific URLs, checking recent news, verifying facts, discovering sources' and names one alternative ('For AI-generated answers with citations, use perplexity_ask instead'). However, it never addresses when perplexity_research or perplexity_reason would be preferable, leaving part of the sibling routing to inference.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
4 tool updates
v1.2.1- First observed
perplexity_ask - First observed
perplexity_reason - First observed
perplexity_research - First observed
perplexity_search
TDQS
Scored across 4 tools
Each tool occupies a clearly distinct mode: quick Q&A, deep research, step-by-step reasoning, and raw search. The descriptions explicitly cross-reference one another to reduce confusion and guide the agent to the right tool.
All tools follow the exact same perplexity_<verb> pattern, making the API surface predictable and memorable. The verbs ask, research, reason, and search are all consistent action-oriented names.
Four tools is well-scoped for a Perplexity query platform: each tool maps to a distinct capability and there is no redundancy. The count is neither bloated nor too sparse for the apparent purpose.
The tool set covers the full range of query modes one would expect from Perplexity: fast Q&A, deep research, reasoning, and raw search results. Common options like recency filtering and domain restrictions are supported across relevant tools, so there are no obvious dead ends.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Real-time web search, reasoning, and research through Perplexity's API
Enable AI assistants to perform web searches using Perplexity's Sonar Pro.
Agent-native search engine with live web research optimized for AI agents.
Give AI assistants access to real-time data. Search the web, compare flights, find hotels, and more.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to perform real-time web searches, company research, content crawling, LinkedIn searches, and deep research using the Exa AI Search API. Provides comprehensive web information retrieval capabilities in a safe and controlled manner.219,5261MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to perform web searches, research papers, Twitter searches, company research, URL crawling, and LinkedIn searches using the Exa AI Search API for real-time web information.19,5261MIT
- AlicenseAqualityBmaintenanceProvides AI assistants with real-time web search, reasoning, and research capabilities through Perplexity's Sonar models and Search API. Supports quick searches, deep research, advanced reasoning, and direct web search with ranked results.427,1222,507MIT
- FlicenseBqualityDmaintenanceEnables AI assistants to perform real-time web and academic searches using Perplexity's Sonar API.2-