Skip to main content
Glama
perplexityai

Perplexity API Platform MCP Server

by perplexityai

Perplexity API Platform MCP Server

Install in Cursor   Install in VS Code   Add to Kiro   npm version

The official MCP server implementation for the Perplexity API Platform, providing AI assistants with real-time web search, reasoning, and research capabilities through the Agent API and the Search API.

Remote MCP Server

The remote MCP server is hosted by Perplexity and is the easiest way to get started: same tools, nothing to install or update. The Cursor and VS Code buttons at the top of this page connect to it with one click. If your MCP client does not support remote servers yet, skip to the local server setup below. Connect over Streamable HTTP with your Perplexity API key:

https://api.perplexity.ai/mcp

For Claude Code:

claude mcp add --transport http perplexity https://api.perplexity.ai/mcp --header "Authorization: Bearer YOUR_API_KEY"

See the MCP integration docs for manual Cursor/VS Code configuration, usage from the Anthropic API, and setup for other clients.

Related MCP server: Perplexity Ask MCP Server

Local MCP Server

Get Your API Key

  1. Get your Perplexity API Key from the API Portal

  2. Replace your_key_here in the configurations below with your API key

  3. (Optional) Set timeout: PERPLEXITY_TIMEOUT_MS=600000 (default: 5 minutes)

  4. (Optional) Set custom base URL: PERPLEXITY_BASE_URL=https://your-custom-url.com (default: https://api.perplexity.ai)

  5. (Optional) Set log level: PERPLEXITY_LOG_LEVEL=DEBUG|INFO|WARN|ERROR (default: ERROR)

Claude Code

claude mcp add perplexity --env PERPLEXITY_API_KEY="your_key_here" -- npx -y @perplexity-ai/mcp-server

Or install via plugin:

export PERPLEXITY_API_KEY="your_key_here"
claude
# Then run: /plugin marketplace add perplexityai/modelcontextprotocol
# Then run: /plugin install perplexity

Codex

codex mcp add perplexity --env PERPLEXITY_API_KEY="your_key_here" -- npx -y @perplexity-ai/mcp-server

Agent Plugins

This repository is packaged as an Agent Plugin, so clients that support the standard can install it directly from this repository. The Agent Plugins format does not carry secrets, so set the PERPLEXITY_API_KEY environment variable through your client's plugin or MCP settings.

Other MCP Clients

Most clients can be configured manually using the same mcpServers wrapper in their client config (as shown for Cursor). If a client has a different schema, check its docs for the exact wrapper format.

For manual setup, these clients all use the same mcpServers structure:

Client

Config File

Cursor

~/.cursor/mcp.json

Claude Desktop

claude_desktop_config.json

Kiro

.kiro/settings/mcp.json

Windsurf

~/.codeium/windsurf/mcp_config.json

VS Code

.vscode/mcp.json

{
  "mcpServers": {
    "perplexity": {
      "command": "npx",
      "args": ["-y", "@perplexity-ai/mcp-server"],
      "env": {
        "PERPLEXITY_API_KEY": "your_key_here"
      }
    }
  }
}

Proxy Setup (For Corporate Networks)

If you are running this server at work—especially behind a company firewall or proxy—you may need to tell the program how to send its internet traffic through your network's proxy. Follow these steps:

1. Get your proxy details

  • Ask your IT department for your HTTPS proxy address and port.

  • You may also need a username and password.

2. Set the proxy environment variable

The easiest and most reliable way for Perplexity MCP is to use PERPLEXITY_PROXY. For example:

export PERPLEXITY_PROXY=https://your-proxy-host:8080

If your proxy needs a username and password, use:

export PERPLEXITY_PROXY=https://username:password@your-proxy-host:8080

3. Alternate: Standard environment variables

If you'd rather use the standard variables, we support HTTPS_PROXY and HTTP_PROXY.

NOTE

The server checks proxy settings in this order:PERPLEXITY_PROXYHTTPS_PROXYHTTP_PROXY. If none are set, it connects directly to the internet. URLs must include https://. Typical ports are 8080, 3128, and 80.

Self-Hosted HTTP Mode

For cloud or shared deployments, run the server in HTTP mode.

Environment Variables

Variable

Description

Default

PERPLEXITY_API_KEY

Your Perplexity API key

Required

PERPLEXITY_BASE_URL

Custom base URL for API requests

https://api.perplexity.ai

PORT

HTTP server port

8080

BIND_ADDRESS

Network interface to bind to. Defaults to loopback. Set to 0.0.0.0 to expose on all interfaces.

127.0.0.1

ALLOWED_ORIGINS

CORS origins (comma-separated). Defaults to empty (no cross-origin browser requests). Set to an explicit allowlist (e.g. https://app.example.com) or to * to allow any origin.

(empty)

ALLOWED_HOSTS

Additional Host header values to accept (comma-separated). Loopback hosts on PORT are always allowed. Add the public hostname when binding to 0.0.0.0.

(loopback only)

Docker

docker build -t perplexity-mcp-server .
docker run -p 8080:8080 -e PERPLEXITY_API_KEY=your_key_here perplexity-mcp-server

Node.js

export PERPLEXITY_API_KEY=your_key_here
npm install && npm run build && npm run start:http

The server will be accessible at http://localhost:8080/mcp

Available Tools

Direct web search using the Perplexity Search API. Returns ranked search results with metadata, perfect for finding current information. Supports recency filters (search_recency_filter) and domain restrictions (search_domain_filter).

perplexity_ask

General-purpose conversational AI with real-time web search, backed by the Agent API fast preset. Great for quick questions and everyday searches.

perplexity_research

Deep, comprehensive research backed by the Agent API high preset. Ideal for thorough analysis and detailed reports. Runs can take minutes; the server streams the run and reports progress to clients that request it.

perplexity_reason

Advanced reasoning and problem-solving backed by the Agent API medium preset. Perfect for complex analytical tasks.

NOTE

Presets are managed configurations (model, search setup, step budget) that Perplexity keeps tuned over time; see thepresets guide. Earlier versions of this server called the legacy sonar-pro, sonar-reasoning-pro, and sonar-deep-research models and accepted strip_thinking / reasoning_effort parameters. Those parameters are no longer part of the tool schemas and are ignored if sent; the Agent API produces no <think> tags.

Use as a Library

The package also exports the server factory for embedding in your own Node process:

import { createPerplexityServer } from "@perplexity-ai/mcp-server";

// Single-tenant: reads PERPLEXITY_API_KEY from the environment.
const server = createPerplexityServer("my-service");

// Multi-tenant hosts resolve the key per call instead. When a provider is
// set, the environment variable is never consulted, and a provider that
// returns no key fails the call rather than falling back.
const tenantServer = createPerplexityServer("my-service", {
  apiKey: () => currentRequestApiKey,
});

Mount the returned server on any MCP transport (stdio, streamable HTTP, in-memory).

Troubleshooting

  • API Key Issues: Ensure PERPLEXITY_API_KEY is set correctly

  • Connection Errors: Check your internet connection and API key validity

  • Tool Not Found: Make sure the package is installed and the command path is correct

  • Timeout Errors: For very long research queries, set PERPLEXITY_TIMEOUT_MS to a higher value

  • Proxy Issues: Verify your PERPLEXITY_PROXY or HTTPS_PROXY setup and ensure api.perplexity.ai isn't blocked by your firewall.

  • EOF / Initialize Errors: Some strict MCP clients fail because npx writes installation messages to stdout. Use npx -yq instead of npx -y to suppress this output.

For support, visit community.perplexity.ai or file an issue.


Available Tools

4 tools
perplexity_askAsk PerplexityB
Read-only

Engages in a conversation using the Sonar API. Accepts an array of messages (each with a role and content) and returns a chat completion response from the Perplexity model.

ParametersJSON Schema
NameRequiredDescriptionDefault
messagesYesArray of conversation messages

Output Schema

ParametersJSON Schema
NameRequiredDescription
responseYesThe response from Perplexity

TDQS

B3.4/5.0
Behavior3/5

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

Annotations indicate readOnlyHint=true and openWorldHint=true, which the description doesn't contradict. The description adds that it 'engages in a conversation' and uses the 'Sonar API', providing some context beyond annotations, but lacks details on rate limits, authentication needs, or specific behavioral traits like response format or error handling.

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

Conciseness5/5

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

The description is concise and front-loaded, consisting of two sentences that directly state the tool's action and parameters without unnecessary details. Every sentence contributes essential information, making it efficient and well-structured.

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 (a conversational AI tool with one parameter), the description covers the basic purpose and input. With annotations providing safety hints and an output schema presumably detailing the response, the description is reasonably complete, though it could benefit from more behavioral context or sibling differentiation.

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

Parameters3/5

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

Schema description coverage is 100%, with the single parameter 'messages' fully documented in the schema. The description mentions 'accepts an array of messages (each with a role and content)', which aligns with but doesn't add meaningful semantics beyond the schema, such as usage examples or constraints on message structure.

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 'engages in a conversation using the Sonar API' and 'returns a chat completion response from the Perplexity model', which specifies the verb (engages/returns) and resource (conversation/response). However, it doesn't explicitly differentiate from sibling tools like perplexity_reason or perplexity_search, which likely have similar conversational purposes but different scopes or behaviors.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus its siblings (perplexity_reason, perplexity_research, perplexity_search). It mentions the general action but offers no context about appropriate scenarios, exclusions, or alternatives, leaving the agent to guess based on tool names alone.

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

perplexity_reasonAdvanced ReasoningB
Read-only

Performs reasoning tasks using the Perplexity API. Accepts an array of messages (each with a role and content) and returns a well-reasoned response using the sonar-reasoning-pro model.

ParametersJSON Schema
NameRequiredDescriptionDefault
messagesYesArray of conversation messages
strip_thinkingNoIf true, removes <think>...</think> tags and their content from the response to save context tokens. Default is false.

Output Schema

ParametersJSON Schema
NameRequiredDescription
responseYesThe response from Perplexity

TDQS

B3.4/5.0
Behavior3/5

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

Annotations indicate readOnlyHint=true and openWorldHint=true, which the description doesn't contradict. The description adds value by specifying the model (sonar-reasoning-pro) and the purpose (reasoning tasks), but it lacks details on behavioral traits like rate limits, error handling, or response format beyond what annotations provide. No contradiction is present.

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

Conciseness5/5

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

The description is concise and front-loaded, consisting of two sentences that efficiently convey the core functionality and model used. Every sentence adds value without redundancy, making it easy for an agent to parse quickly.

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 (reasoning tasks with an API), annotations cover safety (readOnlyHint) and scope (openWorldHint), and an output schema exists, the description is reasonably complete. It specifies the model and purpose, but could improve by differentiating from siblings or adding more context on use cases.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema fully documents the parameters (messages array and strip_thinking boolean). The description adds no additional meaning beyond what's in the schema, such as examples or usage tips for parameters. Baseline 3 is appropriate as the schema handles the heavy lifting.

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 reasoning tasks using the Perplexity API' and 'returns a well-reasoned response using the sonar-reasoning-pro model,' which is a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like perplexity_ask, perplexity_research, or perplexity_search, leaving some ambiguity about when to choose this tool over others for reasoning tasks.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus its siblings (perplexity_ask, perplexity_research, perplexity_search). It mentions the model (sonar-reasoning-pro) but doesn't specify use cases, exclusions, or alternatives, leaving the agent without clear context for selection.

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

perplexity_researchDeep ResearchB
Read-only

Performs deep research using the Perplexity API. Accepts an array of messages (each with a role and content) and returns a comprehensive research response with citations.

ParametersJSON Schema
NameRequiredDescriptionDefault
messagesYesArray of conversation messages
strip_thinkingNoIf true, removes <think>...</think> tags and their content from the response to save context tokens. Default is false.

Output Schema

ParametersJSON Schema
NameRequiredDescription
responseYesThe response from Perplexity

TDQS

B3.4/5.0
Behavior3/5

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

Annotations indicate read-only and open-world hints, which the description doesn't contradict. It adds value by specifying that it 'returns a comprehensive research response with citations', providing context on output behavior. However, it lacks details on rate limits, authentication needs, or response format beyond citations.

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

Conciseness5/5

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

The description is front-loaded with the core purpose, uses two concise sentences with zero waste, and efficiently conveys key information without redundancy. Every sentence earns its place by adding distinct value.

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 presence of annotations and an output schema, the description is reasonably complete for a research tool. It covers the basic action and output type, though it could benefit from more context on when to use versus siblings or behavioral traits like response structure.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema fully documents parameters. The description adds minimal semantics by mentioning 'array of messages' and 'comprehensive research response', but doesn't elaborate on parameter usage beyond what's in the schema. Baseline 3 is appropriate given high schema coverage.

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 action ('Performs deep research') and resource ('using the Perplexity API'), and distinguishes from siblings by specifying 'deep research' rather than generic queries. However, it doesn't explicitly contrast with 'perplexity_reason' or 'perplexity_search' to fully differentiate purpose.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives like 'perplexity_ask' or 'perplexity_search'. The description mentions 'deep research' but doesn't clarify scenarios or prerequisites for choosing this over sibling tools.

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. 4 tool updatesv0.6.1
    • First observedperplexity_ask
    • First observedperplexity_reason
    • First observedperplexity_research
    • First observedperplexity_search

TDQS

A3.8/5.0
Disambiguation4/5

The tools are mostly distinct with clear primary purposes: 'ask' for general conversation, 'reason' for reasoning tasks, 'research' for deep research with citations, and 'search' for web search results. However, 'ask' and 'reason' could be confused as both involve chat completions with similar inputs, potentially leading to misselection in ambiguous scenarios.

Naming Consistency5/5

All tool names follow a consistent 'perplexity_' prefix with descriptive suffixes (ask, reason, research, search), using snake_case uniformly. This predictable pattern makes it easy for an agent to understand and navigate the tool set without confusion.

Tool Count5/5

With 4 tools, the count is well-scoped for a server focused on interacting with the Perplexity API. Each tool serves a distinct function (conversation, reasoning, research, search), and there are no redundant or unnecessary tools, making the set efficient and appropriate for the domain.

Completeness4/5

The tool set covers core functionalities of the Perplexity API, including general chat, reasoning, research, and web search, which aligns well with the server's purpose. A minor gap is the lack of tools for managing conversations (e.g., clearing history or handling follow-ups), but agents can work around this using the provided message arrays.

Maintenance

ActivityMaintained
ResponsivenessUnresponsive

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
    Provides AI-powered search, research, and reasoning capabilities through integration with Perplexity.ai, offering three specialized tools: general conversational AI, deep research with citations, and advanced reasoning.
    13
    2
    MIT
  • 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,826
    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/perplexityai/modelcontextprotocol'

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