Skip to main content
Glama
jujubytes-a11y

Perplexity MCP Server

Perplexity MCP Server

Python MCP server that exposes Perplexity Sonar Chat Completions to any MCP client (Cursor, Claude Desktop, custom agents).

Tools

Tool

Default model

Purpose

perplexity_search

sonar-pro

General web search

perplexity_deep_research

sonar-deep-research

Comprehensive synthesis

Both tools accept optional Sonar parameters and return JSON:

{
  "answer": "...",
  "citations": ["https://..."],
  "search_results": [],
  "model": "sonar-pro",
  "usage": {}
}

Optional parameters

Parameter

Values / format

When to use

temperature

02 (default 0.2)

Lower = more focused; raise only for more varied phrasing

max_tokens

1128000

Cap answer length; omit for API default

search_recency_filter

hour | day | week | month | year

News / “latest” questions; omit for evergreen topics

search_after_date_filter

MM/DD/YYYY

Absolute start of publication window

search_before_date_filter

MM/DD/YYYY

Absolute end of publication window

search_domain_filter

up to 20 domains; allowlist or -domain denylist (not mixed)

Trusted sources only, or exclude noisy sites

search_mode

web | academic | sec

Papers (academic), SEC filings (sec); omit for general web

model

sonar | sonar-pro | sonar-deep-research | sonar-reasoning-pro

Override tool default only when you need a different speed/depth tradeoff

Prefer date filters over search_recency_filter when the window is known exactly. Queries are capped at 4,000 characters. The API key is never logged or returned in tool output.

Related MCP server: Perplexity Web-Search MCP

Setup

  1. Copy env template and add your Perplexity API key:

cp .env.example .env
  1. Install with uv:

uv sync

Run locally (stdio)

uv run mcp-perplexity

Cursor / Claude Desktop

Add to your MCP config (adjust the project path):

{
  "mcpServers": {
    "perplexity": {
      "command": "uv",
      "args": ["--directory", "C:/Users/KozakJ/git/mcp_perplexity", "run", "mcp-perplexity"],
      "env": {
        "PERPLEXITY_API_KEY": "pplx-your-api-key-here"
      }
    }
  }
}

Or rely on a .env file in the project directory (PERPLEXITY_API_KEY=...).

Cursor / Claude Desktop (container, stdio)

Rebuild after image changes, then only the API key is required — other settings use the same defaults as local runs:

{
  "mcpServers": {
    "perplexity": {
      "command": "podman",
      "args": [
        "run", "-i", "--rm",
        "-e", "PERPLEXITY_API_KEY",
        "mcp-perplexity"
      ],
      "env": {
        "PERPLEXITY_API_KEY": "pplx-your-api-key-here"
      }
    }
  }
}

Override any setting the same way (-e MCP_PORT, etc.) only when you need non-defaults.

Run with Podman (streamable HTTP)

podman compose needs a compose provider (podman-compose or Docker Compose). On a plain Podman install, use build + run:

podman build -t mcp-perplexity .
podman run --rm -p 8000:8000 --env-file .env ^
  -e MCP_TRANSPORT=streamable-http ^
  -e MCP_HOST=0.0.0.0 ^
  -e MCP_PORT=8000 ^
  --name mcp-perplexity mcp-perplexity

(On bash/zsh, replace ^ with \.)

If you have a compose provider installed (pip install podman-compose, or Docker Compose):

podman compose up --build

Endpoint: http://localhost:8000/mcp (Streamable HTTP). Bind to trusted networks only — this image does not add HTTP auth.

Configuration

Variable

Default

Description

PERPLEXITY_API_KEY

(required)

Perplexity API key

MCP_TRANSPORT

stdio

stdio or streamable-http

MCP_HOST

127.0.0.1

HTTP bind host

MCP_PORT

8000

HTTP bind port

PERPLEXITY_RPM

30

Soft client-side requests/minute limit

PERPLEXITY_MAX_CONCURRENCY

2

Max concurrent API calls

PERPLEXITY_SEARCH_TIMEOUT

60

Search timeout (seconds)

PERPLEXITY_DEEP_RESEARCH_TIMEOUT

180

Deep research timeout (seconds)

PERPLEXITY_MAX_RETRIES

3

Retries on 429/5xx and transport errors

Retries use exponential backoff (honors Retry-After when present). Logging goes to stderr only so stdio JSON-RPC stays clean.

Available Tools

2 tools
perplexity_deep_researchA

Comprehensive synthesis via Perplexity Sonar Deep Research.

Returns JSON with answer, citations, and optional search_results/usage.
Uses a longer timeout suitable for exhaustive research.

When to use optional filters:
- search_recency_filter: current events / "latest" questions (hour|day|week|month|year).
- search_after/before_date_filter: absolute windows as MM/DD/YYYY; prefer over recency when exact.
- search_domain_filter: trusted sources (allowlist) or exclude noise (denylist with '-'); one mode only.
- search_mode: 'academic' for papers, 'sec' for SEC filings; omit for general web.
- Leave filters unset for broad evergreen queries.
ParametersJSON Schema
NameRequiredDescriptionDefault
modelNoSonar model id: sonar (fast), sonar-pro (default search quality), sonar-deep-research (exhaustive synthesis), or sonar-reasoning-pro. Leave the tool default unless you need a different speed/depth tradeoff.sonar-deep-research
queryYesNatural-language search or research question. Non-empty; max 4000 characters.
max_tokensNoMaximum completion tokens. Omit to use the API default; set only when you need a shorter or longer answer budget.
search_modeNoSearch corpus: 'web' (general web, default), 'academic' (scholarly papers), or 'sec' (SEC filings). Set academic for literature reviews; sec for company filings; omit or web for general questions.
temperatureNoSampling temperature (0-2). Lower values (default 0.2) keep answers focused and factual; raise only when more varied phrasing is wanted.
search_domain_filterNoLimit or exclude domains/URLs (max 20). Allowlist: ['nature.com', 'nih.gov']. Denylist: ['-reddit.com', '-pinterest.com']. Use one mode only - do not mix allowlist and denylist entries in the same request.
search_recency_filterNoRestrict results to recent publications: hour, day, week, month, or year. Use for news, live events, or 'latest' questions. Omit for evergreen topics. Prefer absolute date filters when an exact window is known.
search_after_date_filterNoOnly include results published after this date. Format: MM/DD/YYYY (e.g. 01/15/2024). Prefer over search_recency_filter for an absolute start.
search_before_date_filterNoOnly include results published before this date. Format: MM/DD/YYYY (e.g. 12/31/2024). Prefer over search_recency_filter for an absolute end.

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations exist, so the description must carry the burden. It discloses the output format (JSON with answer, citations, optional fields), timeout behavior ('longer timeout suitable for exhaustive research'), and optional filter behavior. However, it does not discuss error states, rate limits, or authentication requirements, which could be important for agent planning.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise, with a clear front-loaded purpose and output format, followed by the timeout note and structured filter guidance. Every sentence adds value. The filter section could be more bulletized, but it remains easy to scan. No redundant or tautological content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (9 parameters, output schema exists), the description covers the core purpose, output format, timeout, and filter usage comprehensively. It does not need to explain return values since the output schema provides that. Missing details like error handling or limits are acceptable given the parameter and schema richness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description adds value by connecting filter usage to real-world scenarios (e.g., 'current events / "latest" questions' for recency, 'absolute windows as MM/DD/YYYY' for date filters) and stating preferences (e.g., 'prefer over recency when exact'). This context clarifies when to use each parameter beyond the schema's individual descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool performs 'comprehensive synthesis via Perplexity Sonar Deep Research' and returns JSON with answer and citations. It implies a deeper, more exhaustive research capability compared to the sibling tool 'perplexity_search', though it does not explicitly differentiate. The purpose is specific and actionable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides detailed guidance on when to use optional filters (e.g., 'search_recency_filter: current events / "latest" questions'), and advises 'Leave filters unset for broad evergreen queries.' However, it lacks explicit guidance on when to choose this tool over the sibling 'perplexity_search,' leaving the AI agent to infer based on the 'deep research' name and 'longer timeout' mention.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 2 tool updatesv0.1.0
    • First observedperplexity_deep_research
    • First observedperplexity_search

TDQS

A3.6/5.0

Scored across 2 tools

Disambiguation3/5

Both tools target web search via Perplexity with nearly identical descriptions, differing only in timeout and 'deep research' label. An agent may struggle to choose between them without clear use-case differentiation.

Naming Consistency5/5

Both tool names follow a consistent pattern: 'perplexity_search' and 'perplexity_deep_research' use the same prefix and verb_noun structure, making them clearly identifiable.

Tool Count3/5

With only 2 tools, the set is minimal but arguably covers the server's purpose (search and deep research). However, the overlap reduces the value of having two separate tools.

Completeness2/5

The set only provides two search variants, lacking any additional functionalities like result filtering, history, or configuration. Important search UX features are missing, making the surface incomplete for a comprehensive search server.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Integrates the Sonar API to provide Claude with real-time web-wide research capabilities. Enables conversational web searches through Perplexity's AI-powered search engine for up-to-date information retrieval.
    1,514
    MIT
  • A
    license
    B
    quality
    D
    maintenance
    Enables web search using Perplexity AI's API, allowing users to search the web with optional recency filters and integration with Claude, Cursor, and other MCP clients.
    1
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Enables AI assistants to perform web searches and retrieve real-time information using Perplexity AI's Sonar models, with support for multiple search modes and easy integration with MCP clients.
    5
    1
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jujubytes-a11y/mcp_perplexity'

If you have feedback or need assistance with the MCP directory API, please join our Discord server