MCP Perplexity Proxy Server
by nikolaospapagiannis
This Node.js server acts as a proxy for Perplexity AI's Sonar models. It supports both OpenAI-compatible and MCP-native requests with streaming.
Last updated: N/A
What is MCP Perplexity Proxy Server?
The MCP Perplexity Proxy Server is a Node.js application that facilitates communication with Perplexity AI's Sonar models. It allows users to interact with these models using either the standard OpenAI API format or a native MCP format, offering flexibility in integration.
How to use MCP Perplexity Proxy Server?
To use the server, first run it locally using docker-compose up --build
. Then, configure your application (e.g., CLine, Cursor, RooCode) to use the server's endpoint (e.g., http://localhost:3000/v1
) as the api_base
. You can then send requests to the server using either the OpenAI-compatible /v1/chat/completions
endpoint or the MCP-native /mcp-stream
endpoint. A Swagger UI is available at /
.
Key features of MCP Perplexity Proxy Server
OpenAI-compatible API
MCP-native API
Streaming support
Dockerized deployment
Swagger UI for API exploration
Use cases of MCP Perplexity Proxy Server
Integrating Perplexity AI models into existing OpenAI-based applications
Developing custom applications that leverage Perplexity AI's Sonar models
Experimenting with different Perplexity AI models and configurations
Providing a unified interface for accessing multiple AI models
FAQ from MCP Perplexity Proxy Server
What models are supported?
What models are supported?
The server is designed to work with Perplexity AI's Sonar models.
Is an API key required?
Is an API key required?
A dummy API key is used for OpenAI compatibility, but the server interacts with Perplexity AI directly.
How do I deploy this to production?
How do I deploy this to production?
The provided docker-compose file is suitable for local development. For production, consider using a more robust deployment strategy such as Kubernetes or a cloud-based container service.
Can I customize the server's behavior?
Can I customize the server's behavior?
Yes, the server's code can be modified to add custom features or integrations.
What is the purpose of the MCP-native API?
What is the purpose of the MCP-native API?
The MCP-native API provides a more direct interface to Perplexity AI's models, potentially offering more control over the interaction.