Get the FREE Ultimate OpenClaw Setup Guide →

perplexity-ask-openrouter

The Perplexity Ask MCP Server use OpenRouter

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio elct9620-perplexity-ask-openrouter docker run -p 3000:3000 -e OPENROUTER_API_KEY=your_api_key_here ghcr.io/elct9620/perplexity-ask-openrouter:latest \
  --env OPENROUTER_API_KEY="OpenRouter API key (required)"

How to use

This MCP server exposes Perplexity-style capabilities through OpenRouter by implementing the Model Context Protocol (MCP). It wires Perplexity’s model tools to OpenRouter’s API so MCP clients can stream and exchange messages using SSE and the streamable HTTP transport. The server specifically exposes tools aligned with Perplexity: perplexity_ask (general queries via the Sonar model), perplexity_research (in-depth research via the Sonar Deep Research model), and perplexity_reason (complex reasoning via the Sonar Reasoning model). Clients can connect via the MCP endpoints and select the appropriate tool/model, receiving streamed responses as they are generated. The server also supports SSE for live, event-driven interactions and can be deployed easily with Docker.

How to install

Prerequisites:

  • Docker installed on your host (Docker Engine 19.03+ or newer)
  • Internet access to pull the container image

Install and run (Docker):

  1. Pull and run theDocker image with your OpenRouter API key configured:
docker run -p 3000:3000 \
  -e OPENROUTER_API_KEY=your_api_key_here \
  ghcr.io/elct9620/perplexity-ask-openrouter:latest
  1. The MCP server will start listening on port 3000 inside the container and exposed to the host on port 3000. Adjust PORT as needed via environment variables if supported by the image.

  2. Verify the MCP endpoint is reachable:

curl -s http://localhost:3000/mcp | head -n 20

Optional: If you want to customize the model selections or disable specific tools, set the corresponding environment variables documented in the project (e.g., BASE_URL, ASK_MODEL, RESEARCH_MODEL, REASON_MODEL, DISABLE_ASK, DISABLE_RESEARCH, DISABLE_REASON).

Additional notes

Tips and notes:

  • REQUIRED: OPENROUTER_API_KEY must be provided to access the OpenRouter backend.
  • The server supports both SSE and streamable HTTP transports; use /sse to establish an SSE connection or /mcp for the MCP streamable endpoint.
  • If you run into network issues with Docker, ensure port 3000 is accessible and not blocked by a firewall.
  • You can customize the default models via environment variables: ASK_MODEL (default perplexity/sonar-pro), RESEARCH_MODEL (default perplexity/sonar-deep-research), and REASON_MODEL (default perplexity/sonar-reasoning-pro).
  • Docker image deployments are suitable for cloud environments and CI workflows; you can pin to a specific tag instead of latest for stability.

Related MCP Servers

Sponsor this space

Reach thousands of developers