Integration · MODEL CONTEXT PROTOCOL
code yeongyu perplexity advanced mcp
Advanced MCP tool for Perplexity and OpenRouter API integration.
WHAT IT CONNECTS
What code yeongyu perplexity advanced mcp gives an AI Agent
- **Unified API Client:** Supports both [OpenRouter](https://openrouter.ai/) and [Perplexity](https://docs.perplexity.ai/home) APIs with configurable models for handling simple and complex queries.
- **Command-Line Interface (CLI):** Manage API key configuration and run the MCP server using [Typer](https://typer.tiangolo.com/).
- **Advanced Query Processing:** Incorporates file attachment processing, allowing you to include contextual data in your queries.
- **Robust Retry Mechanism:** Utilizes Tenacity for retry logic to ensure consistent and reliable API communications.
- **Customizable Logging:** Flexible logging configuration for detailed debugging and runtime monitoring.
- You would search on Google.
- Then read the top two or three results directly to verify.
- Providing both OpenRouter and Perplexity API keys simultaneously will result in an error
- When both CLI arguments and environment variables are provided, CLI arguments take precedence
- **Simple Queries:** Provides fast, efficient responses.
- **Complex Queries:** Engages in detailed reasoning and supports file attachments formatted as XML.
- **API Keys:** Configure either the `OPENROUTER_API_KEY` or `PERPLEXITY_API_KEY` through command-line options or environment variables.
- **Model Selection:** The configuration (in `src/perplexity_advanced_mcp/config.py`) maps query types to specific models:
- **[OpenRouter](https://openrouter.ai/):**
- Simple Queries: `perplexity/sonar`
- Complex Queries: `perplexity/sonar-reasoning`
- **[Perplexity](https://docs.perplexity.ai/home):**
- Simple Queries: `sonar-pro`
- Complex Queries: `sonar-reasoning-pro`
- Starting and stopping the MCP server to help AI conduct proper testing
- Copying and providing error logs when issues occurred
- Finding and providing [Python MCP SDK](https://github.com/modelcontextprotocol/python-sdk) documentation and examples from the internet
- Requesting modifications for code that didn't seem correct
SECURITY
An MCP listing is not a security review
An MCP server may receive model context, credentials, local files, or permission to call external systems. Review its code, requested environment variables, network behavior, package provenance, and maintenance status before connecting it to an agent.