Mcp Perplexity
@daniel-lxs
关于 Mcp Perplexity
MCP Server for the Perplexity API.
基本信息
配置
使用下面的配置,将此服务器添加到你的 MCP 客户端。
{
"mcpServers": {
"mcp-perplexity": {
"command": "uvx",
"args": [
"mcp-perplexity"
],
"env": {
"PERPLEXITY_API_KEY": "your-api-key",
"PERPLEXITY_MODEL": "sonar-pro",
"DB_PATH": "chats.db"
}
}
}
}工具
4Provides expert programming assistance through Perplexity. This tool only has access to the context you have provided. It cannot read any file unless you provide it with the file content. Focuses on coding solutions, error debugging, and technical explanations. Returns responses with source citations and alternative suggestions.
Maintains ongoing conversations with Perplexity AI. Creates new chats or continues existing ones with full history context. This tool only has access to the context you have provided. It cannot read any file unless you provide it with the file content. Returns chat ID for future continuation. For new chats: Provide 'message' and 'title' For existing chats: Provide 'chat_id' and 'message'
Lists all available chat conversations with Perplexity AI. Returns chat IDs, titles, and creation dates. Results are paginated with 50 chats per page.
Retrieves the complete conversation history for a specific chat. Returns the full chat history with all messages and their timestamps. No API calls are made to Perplexity - this only reads from local storage.
概览
What is Mcp Perplexity?
Mcp Perplexity is a Python-based MCP server that provides a programmatic interface to the Perplexity API. It offers tools for querying responses, maintaining chat history, and managing conversations, mimicking the browser-based Perplexity Chat experience. Designed for developers, it integrates with MCP-compatible clients and stores chat data locally.
How to use Mcp Perplexity?
Configure your MCP client with the command uvx mcp-perplexity and set the required environment variable PERPLEXITY_API_KEY. Optionally set PERPLEXITY_MODEL, DB_PATH, and other variables. You can also use Smithery CLI: npx -y @smithery/cli@latest run @daniel-lxs/mcp-perplexity --config "{\"perplexityApiKey\":\"pplx-abc\",\"perplexityModel\":\"sonar-pro\"}".
Key features of Mcp Perplexity
- Model selection via
PERPLEXITY_MODELenvironment variable. - Separate models for ask and chat tools.
- Persistent chat history with local database storage.
- Streaming responses with progress reporting to prevent timeouts.
- Paginated chat listing (50 chats per page, relative timestamps).
- Optional web UI for interactive chat management.
Use cases of Mcp Perplexity
- Ask specific programming questions and receive source citations.
- Maintain ongoing, context-aware conversations with Perplexity AI.
- List and review all previous chat conversations.
- Debug and research using full chat history retrieval.
- Integrate Perplexity’s capabilities into development workflows.
FAQ from Mcp Perplexity
What Python version is required?
Python 3.10 or higher is required.
How do I set my Perplexity API key?
Set the environment variable PERPLEXITY_API_KEY in your MCP client configuration. It is required.
Can I use different models for ask and chat tools?
Yes, set PERPLEXITY_MODEL_ASK for ask_perplexity and PERPLEXITY_MODEL_CHAT for chat_perplexity. These override the default PERPLEXITY_MODEL.
Where is chat history stored?
Chat history is stored locally in a SQLite database at the path specified by DB_PATH (default: chats.db). The read_chat_perplexity tool reads from this local storage without making API calls.
Is there a web interface?
Yes, when WEB_UI_ENABLED is set to true, a web UI is available at http://WEB_UI_HOST:WEB_UI_PORT (default http://127.0.0.1:8050).
AI 与智能体 分类下的更多 MCP 服务器
Hass-MCP
voskaControl and query Home Assistant from Claude and other LLMs — a Model Context Protocol (MCP) server.
meGPT - upload an author's content into an LLM
adriancoCode to process many kinds of content by an author into an MCP server
Web Agent Protocol
OTA-Tech-AI🌐Web Agent Protocol (WAP) - Record and replay user interactions in the browser with MCP support
Open Multi-Agent Canvas
CopilotKitThe open-source multi-agent chat interface that lets you manage multiple agents in one dynamic conversation and add MCP servers for deep research
🔎 GPT Researcher
assafelovicAn autonomous agent that conducts deep research on any data using any LLM providers
评论