perplexity-mcp-server
The Perplexity MCP Server is a Node.js server implementing the Model Context Protocol to enhance AI interactions with Claude by connecting to Perplexity's language models. It supports advanced tools for chat completion and quick queries.
Overview
The Perplexity MCP Server is a Node.js implementation of Anthropic's Model Context Protocol (MCP) designed to enable Claude to interact with Perplexity's language models. It provides a secure connection for enhanced AI interactions using tools.
Available Tools
- perplexity_chat: An advanced chat completion tool supporting full message history.
- perplexity_ask: A simplified interface for single queries.
Installation
- Clone the repository and install dependencies.
- Configure the server with environment variables.
Development
- Start the server with
npm run dev
. Uses TypeScript and@modelcontextprotocol/sdk
.
Architecture
- PerplexityServer Class: Handles MCP protocol and tool management.
- Tools System: Facilitates modular tool definitions and type-safe handlers.
Error Handling
Comprehensive error management, including API errors, invalid requests, and connection issues.
Dependencies
Includes @modelcontextprotocol/sdk
, dotenv
, and isomorphic-fetch
.
Contributing
Fork, create a feature branch, commit, push, and open a Pull Request.
Security
Utilizes environment variables for API keys and validates input.
License
Licensed under the ISC License.
Troubleshooting
Common issues include server not found, authentication errors, and tool execution errors.