Perplexity API MCP Server
Provides AI assistants with real-time web search, reasoning, and research capabilities through Perplexity's Sonar models and Search 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 MCP Serverwhat is the latest breakthrough in AI?"
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 Sonar models and the Search API.
Available Tools
perplexity_search
Direct web search using the Perplexity Search API. Returns ranked search results with metadata, perfect for finding current information.
perplexity_ask
General-purpose conversational AI with real-time web search using the sonar-pro model. Great for quick questions and everyday searches.
perplexity_research
Deep, comprehensive research using the sonar-deep-research model. Ideal for thorough analysis and detailed reports.
perplexity_reason
Advanced reasoning and problem-solving using the sonar-reasoning-pro model. Perfect for complex analytical tasks.
Available as an optional parameter forperplexity_reason and perplexity_research: strip_thinking
Set to true to remove <think>...</think> tags from the response, saving context tokens. Default: false
Configuration
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-serverCursor, Claude Desktop, Kiro, Windsurf, and VS Code
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.
HTTP Server Deployment
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 |
|
| CORS origins (comma-separated) |
|
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
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 (Sonar Pro model). 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_recency_filter | No | Filter search results by recency. Use 'hour' for very recent news, 'day' for today's updates, 'week' for this week, etc. | |
| 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_context_size | No | Controls how much web context is retrieved. 'low' (default) is fastest, 'high' provides more comprehensive results. |
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 mark readOnlyHint=true and destructiveHint=false, so the agent knows it's safe. The description adds that it returns 'text response with numbered citations' and supports filtering by recency, domain, and context size. No contradictions. Slight room for improvement: could mention it's stateless or that citations are always numbered.
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?
Two tightly packed sentences plus a concise enumeration of filtering options. Purpose is front-loaded, no filler. Every sentence earns its place.
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 4 parameters, existing output schema, and rich annotations, the description covers all key aspects: purpose, usage, alternatives, return format, and filtering. No gaps remain for an agent to misinterpret.
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 coverage is 100% with good descriptions for each parameter (e.g., enum values for search_recency_filter). The description mentions filtering capabilities but does not add significant extra meaning 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?
The description specifies the action ('Answer a question'), the resource ('web-grounded AI (Sonar Pro model)'), and concrete use cases (quick factual questions, summaries, explanations, general Q&A). It explicitly differentiates from siblings by naming alternatives (perplexity_research, perplexity_reason) and their respective strengths.
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 clearly states when to use this tool (best for quick factual questions, summaries, etc.) and when not to (in-depth research → use perplexity_research; step-by-step reasoning → use perplexity_reason). It also highlights speed and cost ('fastest and cheapest option'), providing complete guidance.
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 (Sonar Reasoning Pro model). 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 | |
| strip_thinking | No | If true, removes <think>...</think> tags and their content from the response to save context tokens. Default is false. | |
| 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. | |
| 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_context_size | No | Controls how much web context is retrieved. 'low' (default) is fastest, 'high' provides more comprehensive results. |
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 provide readOnly, destructive, idempotent, and openWorld hints. The description adds behavioral context about the reasoning model (Sonar Reasoning Pro), step-by-step reasoning, and return format (numbered citations), which goes beyond annotations.
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?
Three well-structured sentences: first sentence states purpose and model, second gives best uses, third mentions return format and filters, fourth gives alternatives. No wasted words, information 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?
Given the complexity (5 params, 1 required, 100% schema coverage, output schema exists), the description sufficiently covers purpose, usage, and filtering options. Output schema handles return value details, so no further explanation needed.
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 coverage is 100% with descriptions for all 5 parameters. The description adds context by summarizing filtering capabilities (recency, domain, context size) and their purpose, enhancing understanding beyond the schema.
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 clearly states 'Analyze a question using step-by-step reasoning with web grounding', specifying a specific verb and resource. It distinguishes from siblings by mentioning alternative tools for quick facts and comprehensive research.
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?
Explicitly states best use cases (math, logic, comparisons, complex arguments, chain-of-thought) and provides clear alternatives: 'For quick factual questions, use perplexity_ask instead. For comprehensive multi-source research, use perplexity_research instead.'
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 (Sonar Deep Research model). Best for: literature reviews, comprehensive overviews, investigative queries needing many sources. Returns a detailed response with numbered citations. Significantly slower than other tools (30+ seconds). 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 | |
| strip_thinking | No | If true, removes <think>...</think> tags and their content from the response to save context tokens. Default is false. | |
| reasoning_effort | No | Controls depth of deep research reasoning. Higher values produce more thorough analysis. |
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 indicate readOnlyHint=true and destructiveHint=false, but description adds behavioral context: 'Significantly slower than other tools (30+ seconds)' and 'Returns a detailed response with numbered citations', which are not in annotations. No contradiction.
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?
Three sentences with no fluff: first defines purpose, second lists best use cases, third addresses speed and output format. Each sentence adds value.
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 tool has 3 parameters, output schema, and annotations, the description covers purpose, usage context, behavioral trait (slowness), and output format. No gaps.
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 parameters are fully documented in schema. Description does not add parameter-specific meaning, which is acceptable given high coverage.
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?
Description clearly states the tool conducts deep multi-source research, cites literature reviews and comprehensive overviews as use cases, and distinguishes from sibling tools by contrasting with perplexity_ask and perplexity_reason.
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?
Explicitly provides when to use (literature reviews, comprehensive overviews, investigative queries needing many sources) and when not to use (quick factual questions → perplexity_ask; logical analysis → perplexity_reason), with sibling tool names.
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) — no AI synthesis. For AI-generated answers with citations, use perplexity_ask instead.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query string | |
| 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) | |
| country | No | ISO 3166-1 alpha-2 country code for regional results (e.g., 'US', 'GB') |
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 adds that the tool does no AI synthesis and returns formatted results, which is consistent and helpful beyond the annotations.
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 extremely concise with two sentences and a bullet-like phrase. It is front-loaded and every sentence adds value.
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 tool's simplicity (1 required param, 4 total) and the presence of annotations and output schema, the description is complete enough to guide correct use.
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 coverage is 100%, so the description adds little beyond the schema. It does not elaborate on parameter meanings, but the schema already provides adequate descriptions. A score of 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 clearly states the verb 'search', the resource 'the web', and the output format. It distinguishes itself from the sibling tool perplexity_ask by noting that this tool returns formatted results without AI synthesis.
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 best use cases (finding URLs, checking news, verifying facts) and provides an alternative for AI-generated answers with citations (perplexity_ask).
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Each tool has a clearly delineated purpose (quick Q&A, step-by-step reasoning, deep research, raw search) and descriptions explicitly guide which tool to use for which scenario, eliminating ambiguity.
All tools follow a consistent 'perplexity_verb' pattern in snake_case (ask, reason, research, search), making the naming predictable and easy for agents to infer functionality.
Four tools is well-scoped for a search/QA server: covering quick answers, reasoning, deep research, and raw web search without redundancy or missing core functionality.
The tool set covers the primary workflows (factual Q&A, reasoning, multi-source research, raw search) with no major gaps; a potential minor addition could be a batch or follow-up tool, but not essential.
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
Official MCP server for Lovable, the AI-powered full-stack app builder.
Official MCP server for subfeed.app — the cloud for agents. 15+ tools for AI agents to register, build, and deploy other agents. Zero human required. Start here: subfeed.app/skill.md
Official MCP server for Agentwork — delegate tasks to AI agents with human-in-the-loop
Official Microsoft Learn MCP Server – real-time, trusted docs & code samples for AI and LLMs.
Appeared in Searches
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Hanato238/perplexity-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server