Exposes Perplexity AI's search capabilities, enabling web searching and planned integration with Perplexity Spaces for thread summarization and multi-source data synthesis.
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 Serversearch for the latest news on SpaceX's Starship launch"
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
MCP server that exposes Perplexity AI's search capabilities to Claude, enabling seamless research integration during conversations.
š§ Development Status
Current Version: v0.1.0-alpha (In Active Development)
ā Completed
Project foundation and security setup
Configuration management with API key validation
Perplexity API client with retry logic and error handling
MCP server implementation with FastMCP
Comprehensive testing suite
Security validation and sanitisation
š® Planned (Future Phases)
Perplexity Spaces integration
Memory and context management
Thread summarisation across Spaces
Cross-platform data synthesis
Document generation from multi-source data
Note: This project is in early development. The API and features may change.
Installation
Prerequisites
Python 3.10 or higher
Perplexity API key (Get one here)
Claude Desktop or Claude Code with MCP support
Step-by-Step Setup
Clone the repository
git clone https://github.com/yourusername/claude-perplexity-mcp-server.git cd claude-perplexity-mcp-serverCreate a virtual environment (recommended)
python -m venv venv # On Windows venv\Scripts\activate # On macOS/Linux source venv/bin/activateInstall dependencies
pip install -r requirements.txtConfigure environment variables
# Copy the example file cp .env.example .env # Edit .env and add your Perplexity API key # PERPLEXITY_API_KEY=pplx-your-actual-api-key-hereVerify configuration
python -c "from config import get_config; print('Configuration loaded successfully')"Test the server (optional)
python server.py
Configuration
All configuration is managed through environment variables in the .env file. See .env.example for the template.
Environment Variables
Variable | Required | Default | Description |
| Yes | - | Your Perplexity API key (starts with |
| No |
| Default Perplexity model to use |
| No |
| Enable caching (future feature) |
| No |
| Logging level: |
Model Options
sonar- Standard modelsonar-pro- Enhanced model with better reasoning (recommended)
Search Focus Options
web- General web search (default)academic- Academic and research sourcessec- Security-focused sources
Recency Filters
hour- Last hourday- Last dayweek- Last weekmonth- Last monthyear- Last year
Usage
Setting Up Claude Desktop
Locate Claude Desktop configuration
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Add MCP server configuration
{ "mcpServers": { "perplexity-search": { "command": "python", "args": ["C:/path/to/claude-perplexity-mcp-server/server.py"], "env": { "PERPLEXITY_API_KEY": "pplx-your-key-here" } } } }Note: For Windows, use forward slashes or escaped backslashes in the path:
"args": ["C:\\Users\\YourName\\path\\to\\server.py"]Restart Claude Desktop
Verify the tool is available
The
perplexity_searchtool should appear in Claude's available toolsYou can ask Claude: "What tools do you have available?"
Using the Tool
Simply ask Claude to search for information:
"Search Perplexity for the latest developments in quantum computing"Or be more specific:
"Use perplexity_search to find recent news about Python 3.12 features"Tool Parameters
Claude can use these parameters when calling the tool:
query (required): Your search question
model (optional): Override default model (
sonarorsonar-pro)search_focus (optional):
web,academic, orsecrecency (optional):
hour,day,week,month, oryear
Example Queries
"What are the latest AI developments?"
"Search for recent research on climate change solutions"
"Find current information about the Python programming language"
Known Limitations
Citation Display Issues
Current Status: Citations are included in the tool response but may not display correctly in Claude Desktop's UI.
Raw JSON: Citations appear correctly in the raw tool response JSON
Text Display: Citation markers and links may not render in Claude Desktop's text output
Workaround: Check the raw tool response in Claude Desktop's developer tools or JSON view
We are actively working on resolving this limitation. This is a known issue with how Claude Desktop handles MCP tool responses and citation formatting.
Other Limitations
Rate limits apply based on your Perplexity API tier
Network timeouts may occur with slow connections (automatic retry with backoff)
Very long queries (>10,000 characters) are rejected for safety
Troubleshooting
Server Won't Start
Problem: ModuleNotFoundError: No module named 'mcp'
Solution:
pip install -r requirements.txtProblem: ValueError: PERPLEXITY_API_KEY not found
Solution:
Ensure
.envfile exists in the project rootVerify
PERPLEXITY_API_KEYis set in.envCheck that the API key starts with
pplx-
Tool Not Appearing in Claude Desktop
Problem: Tool doesn't show up in Claude Desktop
Solutions:
Verify the path in
claude_desktop_config.jsonis correctEnsure Python is in your system PATH
Check that
server.pyis executableRestart Claude Desktop completely
Check Claude Desktop logs for errors
API Errors
Problem: API authentication failed
Solution:
Verify your API key is correct in
.envEnsure the API key hasn't expired
Check your Perplexity account for API usage limits
Problem: Rate limit exceeded
Solution:
Wait a few moments and try again
Check your Perplexity API tier and rate limits
Consider upgrading your Perplexity plan if needed
Network Issues
Problem: Request timed out
Solution:
Check your internet connection
Verify Perplexity API is accessible from your network
Try again (automatic retry with exponential backoff)
Configuration Issues
Problem: Invalid model or parameter errors
Solution:
Check
.env.examplefor valid optionsVerify
DEFAULT_MODELis set tosonarorsonar-proEnsure
search_focusvalues are:web,academic, orsecEnsure
recencyvalues are:hour,day,week,month, oryear
Security
Best Practices
Never commit
.envfiles - They contain sensitive API keysUse environment variables - All secrets are loaded from
.envSanitised logging - API keys are never logged in full
URL validation - Citations are validated to prevent malicious URLs
Security Checklist Before Committing
Run this before every commit:
.envis in.gitignoreand NOT stagedNo API keys in code, comments, or documentation
.env.examplecontains only placeholder valuesError messages don't expose secrets
Logs are sanitised
All secrets use environment variables
Quick check: git diff --cached and search for pplx-
See SECURITY.md for detailed security policies and responsible disclosure guidelines.
Development
Running Tests
python test_phase5.pyProject Structure
claude-perplexity-mcp-server/
āāā .env.example # Configuration template
āāā .gitignore # Git ignore rules
āāā README.md # This file
āāā SECURITY.md # Security policy
āāā requirements.txt # Python dependencies
āāā config.py # Configuration management
āāā perplexity_client.py # Perplexity API client
āāā server.py # MCP server implementation
āāā test_phase5.py # Test suiteCode Quality
Type hints throughout
Comprehensive error handling
Security-first design
PEP 8 compliant
Docstrings for all public functions
Contributing
Contributions are welcome! Please ensure:
Code follows existing style and patterns
All tests pass
Security checklist is followed
Documentation is updated
Type hints are included
License
Apache 2.0 License - see LICENSE file for details.
Support
For issues, questions, or contributions:
Security issues: See SECURITY.md
Bug reports: Open an issue on GitHub
Feature requests: Open an issue with the
enhancementlabel
Acknowledgements
Built with FastMCP - High-level MCP SDK
Powered by Perplexity AI - AI-powered search
Designed for Claude Desktop - Anthropic's AI assistant
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.