Perplexity MCP Server
Provides tools for searching the web and synthesizing sources using Perplexity AI, including asking questions with cited answers, in-depth search, managing conversation context, and selecting models.
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 MCP Serverwhat are the latest developments in fusion energy?"
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
Exposes Perplexity AI's search and synthesis capabilities through the Model Context Protocol (MCP), enabling Claude Desktop and other MCP clients to search the web, synthesize sources, and get cited answers.
Claude Desktop
↓ stdio
Perplexity MCP Server
├── perplexity_ask → Ask a question, get answer + sources
├── perplexity_search → In-depth web search
├── set_cookies → Set Perplexity cookies (JSON / Netscape format)
├── list_models → List available models
└── reset_conversation → Reset conversation context
↓
PerplexityClient (curl_cffi → Chrome impersonation → Cloudflare bypass)
↓
Perplexity.ai internal API (SSE)Installation
pip install -r requirements.txtRequires Python 3.10+. Only two dependencies:
Related MCP server: Perplexity Tool for Claude Desktop
Getting Cookies
This MCP server uses Perplexity's internal API, which requires valid session cookies. Choose one of the following methods:
Method 1: Browser Export (Recommended)
Log in to Perplexity.ai in Chrome
Open DevTools → Application → Cookies →
www.perplexity.aiExport all cookies as JSON
Save to
cookies/perplexity_cookies.json
Method 2: Playwright (Automated)
pip install playwright
playwright install chromium
python get_cookies.py
# Browser opens → log in to Perplexity → press Enter in terminalFor headless mode: python get_cookies.py --headless
Method 3: Netscape Format
Export cookies from any browser in Netscape format and save to cookies/perplexity_cookies.txt. The server reads them automatically.
Method 4: Environment Variable
export PERPLEXITY_COOKIES_JSON='{"cookie_name": "value", ...}'Method 5: MCP Tool (Runtime)
If you already have cookie values (e.g., from another AI agent), use the set_cookies tool at runtime. It accepts both JSON and Netscape formats:
{
"cookies_data": "{\"__Secure-next-auth.session-token\": \"...\", \"cf_clearance\": \"...\"}"
}or Netscape format:
{
"cookies_data": ".perplexity.ai\ttrue\t/\ttrue\t1787873851\tcookie_name\tcookie_value"
}This is especially useful when an AI agent possesses cookie values and needs to configure the MCP server without filesystem access.
Usage
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"perplexity": {
"command": "python",
"args": ["C:/full/path/to/mcp_server.py"]
}
}
}Cursor / VS Code
Add to .cursor/mcp.json or VS Code MCP settings:
{
"mcpServers": {
"perplexity": {
"command": "python",
"args": ["C:/full/path/to/mcp_server.py"]
}
}
}Direct Testing
# Start the MCP server
python mcp_server.py
# In another terminal, test with MCP Inspector
npx @modelcontextprotocol/inspector python mcp_server.pyTools
perplexity_ask
Ask a question. Perplexity searches the web and returns a cited answer.
Parameter | Type | Default | Description |
| string | required | Question or topic |
| string |
| Model: |
| enum |
|
|
| string[] |
| Sources: |
perplexity_search
In-depth web search. An alias for perplexity_ask with different default parameters focused on search.
Parameter | Type | Default | Description |
| string | required | Search query |
| enum |
|
|
| string[] |
| Source types: |
| string |
| Model preference |
set_cookies
Set Perplexity cookies at runtime via MCP. Accepts JSON objects or Netscape-format cookie strings.
Parameter | Type | Default | Description |
| string | required | Cookie data — JSON ( |
| string |
| Session ID |
list_models
Lists all available models with their Perplexity internal IDs and use-case descriptions.
reset_conversation
Resets conversation history and starts a fresh context.
Parameter | Type | Default | Description |
| string |
| Session ID |
Supported Models
Name | Perplexity ID | Use Case |
| gpt5 | Balanced, general purpose |
| gpt5_thinking | Complex reasoning, broad sources (~28) |
| gpt4o | Multimodal |
| gpt45 | General purpose |
| o3 | Advanced reasoning, math |
| o3pro | Highest reasoning |
| o3mini | Fast reasoning, code |
| o4mini | Broad sources (~28), balanced |
| o1 | Step-by-step reasoning |
| claude45sonnet | Detailed analysis, coding |
| claude45sonnetthinking | Complex reasoning |
| claude40opus | Security-focused |
| claude41opusthinking | Latest Opus, advanced reasoning |
| grok4 | Latest news, breaking stories |
| gemini30pro | Multimodal, 1M+ token context |
| r1 | Price/performance, open source |
| pplx_pro | Fast, concise answers |
| o3pro_research | Deep research |
| pplx_reasoning | Balanced, efficient |
Full details: call the list_models tool.
Notes
Cookie expiry: Cookies expire over time. If Perplexity logs you out or returns errors, re-export fresh cookies.
Guest mode: The server works without cookies but will fall back to the
turbomodel only. Authentication significantly expands model availability.Multi-turn conversations: Supported via
session_id. Context is maintained server-side throughbackend_uuid,read_write_token, andthread_url_slug.Reasoning models: Models like
deepseek-r1,o3,gpt-5-thinking,claude-4.5-sonnet-thinkingemit a separate reasoning/thinking stream that is prepended to the response.Security: Cookie files in
cookies/are gitignored by default. Never commit live credentials to version control.
This server cannot be installed
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 Servers
- Flicense-qualityDmaintenanceAllows Claude or other MCP-compatible AI assistants to search the web and get up-to-date information using the Perplexity API, with features for filtering results by time period.Last updated8
- AlicenseCqualityFmaintenanceA custom MCP tool that integrates Perplexity AI's API with Claude Desktop, allowing Claude to perform web-based research and provide answers with citations.Last updated16MIT
- AlicenseBqualityDmaintenanceEnables web search using Perplexity AI's API, allowing users to search the web with optional recency filters and integration with Claude, Cursor, and other MCP clients.Last updated1MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to perform web searches and retrieve real-time information using Perplexity AI's Sonar models, with support for multiple search modes and easy integration with MCP clients.Last updated51MIT
Related MCP Connectors
Serper MCP — wraps the Serper Google Search API (serper.dev)
Multi-engine search for AI agents. Trust scoring, local corpus, MCP-native. Self-hostable, BYOK.
Jina AI Reader/Search MCP — turn any URL into clean LLM-ready markdown, plus web search.
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/barankrky/perplexity-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server