Perplexity MCP Server
The Perplexity MCP Server enables web searches using Perplexity AI with intelligent query handling and filtering options:
Web Search: Perform searches using the Perplexity API
Intelligent Model Selection: Automatically chooses the optimal model based on query intent (research, reasoning, general search)
Manual Model Control: Set or view information about available Perplexity AI models
Domain Filtering: Allow or block up to 3 specific domains in search results
Recency Filtering: Limit results to a specific time window (hour, day, week, month)
Filter Management: View active filters or clear all filters
Integration: Works seamlessly with Claude Desktop App for interactive search
Provides web search capabilities using Perplexity's API with automatic model selection based on query intent, supporting various Perplexity models like sonar, sonar-pro, sonar-reasoning, sonar-reasoning-pro, and sonar-deep-research
Click on "Deploy 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 MCP Server what are the latest developments in quantum computing?"
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 MCP Server
An MCP server that provides Perplexity AI web search capabilities to Claude, with automatic model selection, stateful filters, and 10 purpose-built tools.
Prerequisites
Node.js v20 or higher
A Perplexity API key — get one at https://www.perplexity.ai/settings/api
Claude Desktop (or any MCP-compatible client)
Related MCP server: Perplexity MCP Server
Installation
Clone this repository:
git clone https://github.com/RossH121/perplexity-mcp.git cd perplexity-mcpInstall dependencies:
npm installBuild the server:
npm run build
Configuration
Add the server to Claude's config file at ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"perplexity-server": {
"command": "node",
"args": ["/absolute/path/to/perplexity-mcp/build/index.js"],
"env": {
"PERPLEXITY_API_KEY": "your-api-key-here",
"PERPLEXITY_MODEL": "sonar-pro"
}
}
}
}Replace /absolute/path/to with the actual path to where you cloned the repository.
Available Models
The server automatically selects the best model based on your query, but you can also set a default via PERPLEXITY_MODEL:
Model | Best for |
| Comprehensive reports, exhaustive multi-source research |
| Complex logic, math, chain-of-thought analysis |
| General search, factual queries (default) |
| Quick, simple lookups |
For pricing and availability: https://docs.perplexity.ai/guides/pricing
Tools
search — AI-powered web search
The main search tool. Automatically selects the right model based on your query. Returns a synthesized answer with cited sources.
Parameter | Options | Description |
| string | Your search query |
|
| How much web context to retrieve. |
|
| Search engine tier (nested in |
|
| Depth of reasoning for |
| boolean | Remove |
|
|
|
|
| Filter sources by publication date |
|
| Filter sources by last-updated date |
|
| Restrict sources to languages (ISO 639-1) |
| ISO 639-1 | Preferred response language |
| boolean | Answer from training data only (no web search) |
| boolean | Let a classifier decide whether to search |
| boolean | Append an Images section of result URLs |
| string[] | Restrict images by domain or format |
| boolean | Append follow-up question suggestions |
| — | Localize results via |
|
| Streaming event format for Pro Search |
| boolean | Append a request-cost footer when available |
| boolean | Enable streaming responses |
Examples:
"What's the latest on fusion energy?" → auto-selects
sonar-pro"Deep research analysis of CRISPR gene editing advances" → auto-selects
sonar-deep-research"Solve this logic puzzle step by step" → auto-selects
sonar-reasoning-pro
raw_search — Raw ranked results (no LLM)
Returns ranked web results directly without AI synthesis. Faster and cheaper — useful for URL discovery, building source lists, or fact-checking pipelines.
Parameter | Options | Description |
| string or string[] | Search query, or an array of queries run in one request |
| 1–20 | Number of results (default: 10) |
| number | Token budget overall / per result |
|
| Source category |
|
|
|
|
| Time window filter |
|
| Filter by publication date |
|
| Filter by last-updated date |
|
| Restrict to languages (ISO 639-1) |
| ISO 3166 code | Localize results (e.g. |
Note: prior versions sent these params in camelCase, which the Search API silently ignored — so
max_results,recency,search_modeand the date filters had no effect. This is fixed; they now take effect.
async_research — Long-running deep research
Submit a sonar-deep-research job and poll it, instead of blocking on a synchronous call. Useful when research may exceed the 5-minute synchronous timeout. Jobs expire 7 days after creation.
Parameter | Options | Description |
|
| What to do |
| string | Research question (required for |
| string | Job id from a prior |
| Sonar model | Job model (default: |
|
| Reasoning depth |
|
| Source category |
| boolean | Strip |
"Submit async research: comprehensive comparison of solid-state battery startups"
→ returns a request_id
"Check async research status for <request_id>"agent — Agentic loop with built-in tools
The Perplexity Agent API. Runs a multi-step agent that can call built-in tools and optionally a third-party model.
Parameter | Options | Description |
| string | The task or question |
| e.g. | Provider-qualified model |
| string[] | Fallback chain (takes precedence over |
|
| Named preset instead of a model |
| string | System prompt |
| 1–10 | Max agentic/tool steps |
| number | Max output tokens |
|
| Built-in tools the agent may use |
embeddings — Text embeddings
Generate embeddings via the Perplexity Embeddings API. Returns a compact summary (model, vector count, token usage) by default.
Parameter | Options | Description |
| string or string[] | Text(s) to embed (max 512) |
|
| Embedding model (default: 0.6b) |
| number | Output dimensions (Matryoshka) |
| boolean | Include raw base64-encoded vectors |
domain_filter — Allowlist/blocklist domains
Restrict or exclude specific domains from search results. Filters persist across all subsequent searches until cleared.
action: "allow"— restrict results to this domain (allowlist mode)action: "block"— exclude this domain from results (denylist mode)Maximum 20 domains; cannot mix allow and block in the same filter set
"Allow results only from arxiv.org and nature.com"
"Block pinterest.com and reddit.com from search results"recency_filter — Time window filter
Limit search results to a specific time period. Persists until changed.
Options: hour, day, week, month, year, none
"Set recency filter to week"
"Remove the recency filter"clear_filters — Reset all filters
Clears all domain and recency filters in one call.
list_filters — View active filters
Shows currently active domain allowlist/blocklist and recency setting.
model_info — View or override model selection
View available models and current selection, or manually force a specific model.
"Show model info"
"Set model to sonar-deep-research"Intelligent Model Selection
The server scores your query against keyword lists to automatically pick the right model:
Research keywords (
deep research,comprehensive,in-depth) →sonar-deep-researchReasoning keywords (
solve,logic,mathematical,figure out) →sonar-reasoning-proSimple keywords (
quick,brief,basic) →sonarEverything else →
sonar-pro
Each response shows which model was used and why. If a query strongly matches a model (score ≥ 2), it will override a manually set model.
Example Workflows
Time-sensitive research with domain filtering:
recency_filter→weekdomain_filter→ allownature.com, allowarxiv.orgsearch→ "Recent breakthroughs in quantum error correction"
Financial document research:
raw_searchwithsearch_mode: "sec"→ find relevant filingssearchwithsearch_mode: "sec"→ synthesized analysis
Academic literature review:
searchwithsearch_mode: "academic",search_context_size: "high"→ comprehensive results from peer-reviewed sources
Deep research with reasoning control:
searchwithreasoning_effort: "high",strip_thinking: true→ thorough analysis without<think>blocks in the output
Development
npm run build # Compile TypeScript to build/
npm start # Run the built serverSource is in src/ — after editing, rebuild and restart Claude to load changes.
License
MIT
Available Tools
6 toolsclear_filtersA
Remove all domain filters (both allowed and blocked). Use when switching search contexts or starting fresh. Does not affect recency filter.
Inputs: no named parameters.
domain_filterA
Configure domain filtering for search results. Use 'allow' to prioritize trusted sources (e.g., documentation sites, academic domains) or 'block' to exclude unreliable sources. Maximum 20 domains total. Filters persist across searches until cleared.
Inputs: domain (required), action (required).
list_filtersA
Display current filter configuration including allowed domains, blocked domains, and active recency setting. Useful for debugging search behavior.
Inputs: no named parameters.
model_infoA
View available Perplexity models and their specializations, or manually override model selection. By default, models are auto-selected based on query intent (research, reasoning, general search).
Inputs: model.
recency_filterA
Control the time window for search results. Essential for time-sensitive queries like news, updates, or recent developments. Filter persists until changed.
Inputs: filter (required).
searchA
Web search via Perplexity AI with automatic model selection. Returns cited sources with summaries. The search uses only the query text (not conversation history). Best for: current events, factual research, technical documentation, comparative analysis.
Inputs: query (required), stream.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a clearly distinct purpose with no overlap: clear_filters removes filters, domain_filter configures domains, list_filters displays current settings, model_info shows models, recency_filter controls time windows, and search performs web searches. The descriptions reinforce these unique roles, making misselection unlikely.
All tool names follow a consistent verb_noun pattern with snake_case (e.g., clear_filters, domain_filter, list_filters, model_info, recency_filter, search). The naming is predictable and readable throughout, with no deviations or mixed conventions.
With 6 tools, this server is well-scoped for its purpose of configuring and executing Perplexity AI searches. Each tool earns its place by covering essential aspects like filtering, model selection, and search execution, without being overly sparse or bloated.
The tool set provides complete coverage for the domain of Perplexity AI search configuration and execution. It includes setup (filters, model info), control (recency, domain filters), status (list_filters), and core functionality (search), with no obvious gaps that would cause agent failures.
Maintenance
Related MCP Connectors
Hosted Web Crawler MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Web search API and MCP server for developers building AI agents.
Docs: https://docs.keenable.ai/mcp-server Keenable is a free, remote MCP server that gives agents access to the web index. Search the web with ranked results and date/site filters, then fetch any indexed page as clean markdown. Works out of the box with no account or API key.
Related MCP Servers
AlicenseAqualityBmaintenanceAn MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.2559MIT- AlicenseAqualityDmaintenanceMCP server that enables Claude to request chat completions with citations from the Perplexity API.1MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that integrates with Sonar API to provide Claude with real-time web search capabilities for comprehensive research.17 npmMIT
- AlicenseAqualityDmaintenanceAn MCP server that enables AI assistants to perform web searches on Perplexity.ai using browser automation instead of an official API. It supports persistent authenticated sessions and returns search results along with cited sources directly to the client.380 npm13MIT