Integration · MODEL CONTEXT PROTOCOL

code yeongyu perplexity advanced mcp

Advanced MCP tool for Perplexity and OpenRouter API integration.

WHAT IT CONNECTS

code yeongyu perplexity advanced mcp 为 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

MCP 收录不等于安全审核

MCP 服务器可能获得模型上下文、凭据、本地文件或调用外部系统的权限。连接 Agent 前,请检查代码、环境变量、网络行为、软件包来源与维护状态。