The Perplexity server provides access to Perplexity AI’s search and chat capabilities, enabling web searches with recency filters and conversations with various Perplexity models.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/dvlpjrs/guMCP/llms.txt
Use this file to discover all available pages before exploring further.
Authentication
This server uses API key authentication.Setup
- Obtain a Perplexity API key from Perplexity AI
- Run the authentication setup:
- Enter your API key when prompted
Models
The server supports these Perplexity models:| Model | Description |
|---|---|
sonar | Standard search model (default) |
sonar-pro | Enhanced search with better accuracy |
sonar-deep-research | In-depth research mode |
sonar-reasoning | Reasoning-focused responses |
sonar-reasoning-pro | Advanced reasoning capabilities |
Prompts
The server provides pre-configured prompts for common use cases.search_with_recency
search_with_recency
Search with time-based filtering.Arguments:Generates a prompt optimized for time-filtered web searches.
query(required): The search queryrecency(optional): Time filter - hour, day, week, month, year, or none
code_assistant
code_assistant
Get coding help from Perplexity.Arguments:Generates a prompt optimized for code-related queries.
problem(required): The coding problem or questionlanguage(optional): Programming language
Tools
search
search
Search the web using Perplexity’s API with optional filters.Parameters:Search Context:
The search uses high search context size for comprehensive results.Response Format:
query(string, required): The search querymodel(string, optional): Model to use (default: sonar)recency_filter(string, optional): Time filter - hour, day, week, month, yearreturn_related(boolean, optional): Include related questions
- Main answer content
- Related questions (if requested)
chat
chat
Send a message to a Perplexity model without forcing web search.Parameters:Search Context:
Uses medium search context size for balanced performance.Temperature Guide:
message(string, required): The message to sendmodel(string, optional): Model to use (default: sonar)system_prompt(string, optional): Custom system prompt (default: “Be helpful, concise, and precise.”)temperature(number, optional): Randomness of responses, 0-2 (default: 0.7)
0.0-0.3: More focused and deterministic0.4-0.7: Balanced creativity and consistency0.8-2.0: More creative and varied responses
Recency Filters
Time-based filtering for search results:| Filter | Description |
|---|---|
hour | Results from the past hour |
day | Results from the past 24 hours |
week | Results from the past 7 days |
month | Results from the past 30 days |
year | Results from the past year |
none | No time filtering (default) |
API Reference
Base URL:https://api.perplexity.ai
Key Endpoint
POST /chat/completions Request format:Features
Web Search
- Configurable search context size (medium/high)
- Time-based filtering for recent information
- Related questions for exploration
- Model selection for different use cases
Chat
- Flexible system prompts
- Temperature control for response variety
- Multiple specialized models
- Medium search context for background information
Error Handling
The server handles:- Missing API key errors
- Invalid model names (validates against supported models)
- API rate limits and timeouts (60 second timeout)
- HTTP error responses with status codes
- Network failures
- Status codes from Perplexity API
- Error text from responses
- Exception details for debugging
Best Practices
-
Model Selection:
- Use
sonarfor general searches - Use
sonar-profor higher accuracy needs - Use
sonar-deep-researchfor comprehensive research - Use reasoning models for complex problem-solving
- Use
-
Recency Filters:
- Apply time filters for news and current events
- Use
nonefor timeless topics - Consider
weekormonthas balanced defaults
-
Temperature:
- Lower (0.0-0.3) for factual, consistent responses
- Medium (0.4-0.7) for balanced output
- Higher (0.8-2.0) for creative tasks
-
Related Questions:
- Enable for exploratory research
- Use to discover related topics
- Helpful for user guidance