Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/perplexityai/modelcontextprotocol/llms.txt

Use this file to discover all available pages before exploring further.

Overview

If you’re running the Perplexity MCP Server behind a company firewall or proxy, you’ll need to configure proxy settings to allow the server to access the Perplexity API.
The server supports multiple proxy configuration methods and checks them in priority order: PERPLEXITY_PROXYHTTPS_PROXYHTTP_PROXY

Quick Setup

1

Get your proxy details

Contact your IT department for:
  • Proxy host address
  • Proxy port (typically 8080, 3128, or 80)
  • Username and password (if required)
2

Set the proxy environment variable

The recommended method is to use PERPLEXITY_PROXY:
export PERPLEXITY_PROXY="https://your-proxy-host:8080"
3

Add authentication if needed

If your proxy requires authentication:
export PERPLEXITY_PROXY="https://username:password@your-proxy-host:8080"
4

Configure your MCP client

Add the proxy variable to your client’s configuration:
{
  "mcpServers": {
    "perplexity": {
      "command": "npx",
      "args": ["-y", "@perplexity-ai/mcp-server"],
      "env": {
        "PERPLEXITY_API_KEY": "your_key_here",
        "PERPLEXITY_PROXY": "https://proxy.company.com:8080"
      }
    }
  }
}

Proxy Configuration Methods

The most reliable method specifically for the Perplexity MCP Server.
export PERPLEXITY_PROXY="https://your-proxy-host:8080"

Method 2: Standard Environment Variables

Alternatively, you can use standard HTTPS_PROXY or HTTP_PROXY variables.
export HTTPS_PROXY="https://proxy.company.com:8080"

Priority Order

The server checks proxy settings in this order:
  1. PERPLEXITY_PROXY - Checked first
  2. HTTPS_PROXY - Checked if PERPLEXITY_PROXY is not set
  3. HTTP_PROXY - Checked if neither of the above are set
  4. Direct connection - If no proxy variables are set
If multiple proxy variables are set, only the highest priority one will be used.

URL Format

Proxy URLs must follow this format:
[protocol://][username:password@]host:port

Components

  • protocol: Must be https:// (recommended) or http://
  • username:password: Optional authentication credentials
  • host: Proxy server hostname or IP address
  • port: Proxy server port (typically 8080, 3128, or 80)

Examples

# Basic proxy
https://proxy.company.com:8080

# With authentication
https://john.doe:password123@proxy.company.com:8080

# IP address
https://192.168.1.100:3128

# Different port
https://proxy.company.com:80
If your password contains special characters, you may need to URL-encode them. For example, @ becomes %40.

Common Proxy Ports

PortCommon Usage
8080Most common proxy port
3128Squid proxy default
80HTTP proxy
443HTTPS proxy
8888Alternative proxy port

Complete Configuration Example

Here’s a complete example for a corporate environment:
{
  "mcpServers": {
    "perplexity": {
      "command": "npx",
      "args": ["-y", "@perplexity-ai/mcp-server"],
      "env": {
        "PERPLEXITY_API_KEY": "your_key_here",
        "PERPLEXITY_PROXY": "https://username:password@proxy.company.com:8080",
        "PERPLEXITY_TIMEOUT_MS": "600000"
      }
    }
  }
}

Troubleshooting

Connection Still Fails

1

Verify proxy URL format

Ensure your proxy URL includes the protocol (https://) and correct port.
2

Test proxy connectivity

Try accessing api.perplexity.ai through your proxy using curl:
curl -x https://proxy.company.com:8080 https://api.perplexity.ai
3

Check firewall rules

Ask your IT department if api.perplexity.ai is blocked by your firewall.
4

Verify credentials

If using authentication, double-check your username and password.

Special Characters in Password

If your password contains special characters, URL-encode them:
CharacterEncoded
@%40
:%3A
/%2F
?%3F
#%23
&%26
=%3D
Example:
# Password: p@ssw0rd!
# Encoded: p%40ssw0rd!
export PERPLEXITY_PROXY="https://username:p%40ssw0rd!@proxy.company.com:8080"

Timeout Issues

Corporate proxies can be slower. Increase the timeout:
{
  "env": {
    "PERPLEXITY_API_KEY": "your_key_here",
    "PERPLEXITY_PROXY": "https://proxy.company.com:8080",
    "PERPLEXITY_TIMEOUT_MS": "900000"
  }
}

Getting Help

If you continue to experience proxy issues:
  1. Check the Troubleshooting guide
  2. Visit community.perplexity.ai
  3. File an issue on GitHub
When reporting proxy issues, include:
  • Your proxy configuration (without credentials)
  • Error messages
  • Whether you can access other HTTPS sites through the proxy

Build docs developers (and LLMs) love