Prerequisites
- Docker installed on your system
- A Perplexity API key from the API Portal
Building the Docker Image
Running the Container
HTTP Mode (Default)
The Docker container runs in HTTP mode by default, making it accessible via HTTP requests:http://localhost:8080/mcp
Using Environment File
Integration with MCP Clients
When using the HTTP Docker server, configure your MCP client to connect to the HTTP endpoint:MCP Client Configuration
The Docker image is optimized for HTTP mode deployment. For local STDIO usage, the
npx method is recommended instead of Docker.STDIO Mode (Local Development)
For local development with STDIO transport, you can run the server locally without Docker:STDIO vs HTTP Mode: The Docker container uses HTTP mode, which is ideal for production deployments, cloud platforms, and shared environments. STDIO mode is better suited for local development and direct integration with desktop MCP clients.
Container Configuration
The Docker image exposes port 8080 by default and uses Node.js 22 Alpine for a minimal footprint. The entrypoint runsnode dist/http.js to start the HTTP server.
Environment Variables
| Variable | Description | Default |
|---|---|---|
PERPLEXITY_API_KEY | Your Perplexity API key (required) | - |
PERPLEXITY_TIMEOUT_MS | Request timeout in milliseconds | 300000 (5 min) |
PERPLEXITY_PROXY | Proxy URL for corporate networks | - |
PORT | HTTP server port | 8080 |
BIND_ADDRESS | Network interface to bind to | 0.0.0.0 |
ALLOWED_ORIGINS | CORS origins (comma-separated) | * |