MCP Perplexity Proxy Server logo

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.

View on GitHub

Last updated: N/A

๐Ÿš€ MCP Perplexity Proxy Server

This Node.js server proxies OpenAI-compatible or MCP-native requests to Perplexity AI's Sonar models with streaming support.

๐Ÿ”ง Run locally

docker-compose up --build

๐Ÿ” Supported APIs

  • POST /v1/chat/completions (OpenAI-compatible)
  • POST /mcp-stream (MCP-native)
  • GET / (Swagger UI)

โœ… Usage in CLine / Cursor / RooCode

{
  "provider": "openai",
  "api_base": "http://localhost:3000/v1",
  "api_key": "dummy"
}

๐Ÿงช Local Testing

curl -X POST http://localhost:3000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"model":"sonar-reasoning-pro","messages":[{"role":"user","content":"Was ist JSON.stringify?"}]}'