A Python MCP server for the Perplexity Sonar API, providing AI-powered search and reasoning. Built with the Dedalus MCP framework.
- perplexity_ask - Quick factual questions with web search
- perplexity_research - Deep research on complex topics
- perplexity_reason - Complex reasoning and problem-solving
- perplexity_chat - Multi-turn conversational interactions
# Clone the repository
git clone https://github.com/dedalus-labs/sonar-mcp-python.git
cd sonar-mcp-python
# Install dependencies with uv
uv syncCreate a .env file with your Perplexity API key:
PERPLEXITY_API_KEY=your_api_key_hereGet your API key from Perplexity Settings.
uv run python src/main.pyThe server will start on http://localhost:3011/mcp.
uv run python src/client.pyQuick answers to factual questions using web search.
Parameters:
question(required): The question to answer
Model: sonar (fast, web-grounded)
Deep research on complex topics with citations.
Parameters:
topic(required): The topic to research
Model: sonar-deep-research (comprehensive, longer response time)
Complex reasoning and problem-solving without web search.
Parameters:
problem(required): The problem to reason through
Model: sonar-reasoning-pro (advanced reasoning)
Multi-turn conversational interactions.
Parameters:
messages(required): Array of message objects withroleandcontent
Model: sonar-pro (conversational, web-grounded)
MIT