VOOZH about

URL: https://deepwiki.com/ppl-ai/modelcontextprotocol

⇱ ppl-ai/modelcontextprotocol | DeepWiki


Loading...
Last indexed: 28 February 2026 (95c7a8)
Menu

Overview

This page introduces the @perplexity-ai/mcp-server package: what it is, what tools it exposes, and how to get started. For deeper coverage of architecture and internals, see System Architecture. For individual tool references, see Tools Reference. For configuration details, see Configuration.


What It Is

@perplexity-ai/mcp-server is the official Model Context Protocol (MCP) server for the Perplexity API Platform. It acts as a bridge between MCP-compatible AI clients (such as Claude Desktop, Cursor, VS Code, and Codex) and Perplexity's Sonar models and Search API.

The server exposes four MCP tools that give AI assistants access to real-time web search, conversational search, chain-of-thought reasoning, and deep research. Clients communicate with the server over either stdio (for local process-based integrations) or HTTP (for shared or cloud deployments).

Sources: README.md1-10 package.json1-8


The Four Tools

Each tool maps to a specific Perplexity model or API endpoint. The table below summarizes them:

ToolBacking Model / EndpointBest For
perplexity_searchPerplexity Search API (/search)Ranked web results with metadata (title, URL, snippet, date)
perplexity_asksonar-pro (/chat/completions)Quick conversational questions with live web grounding
perplexity_reasonsonar-reasoning-pro (/chat/completions)Complex analytical tasks requiring chain-of-thought
perplexity_researchsonar-deep-research (/chat/completions, SSE)Thorough multi-step research reports (30+ seconds)

Sources: README.md11-28

Tool-to-model mapping:


Sources: README.md11-28


System Topology

The server sits between MCP clients and the Perplexity API. Both deployment modes share a single server core (createPerplexityServer() in src/server.ts):


Sources: README.md40-107 package.json26-30 server.json1-17


Prerequisites

Node.js ≥ 18 is required (see package.json69-71).

A Perplexity API key is required:

  1. Obtain a key from the Perplexity API Portal.
  2. Set it as the PERPLEXITY_API_KEY environment variable before starting the server.

The server will refuse to start if PERPLEXITY_API_KEY is not set. This check occurs in src/index.ts before any transport is initialized.

Sources: README.md32-38


Quick Start

The fastest way to connect the server to a compatible client is via npx:


For clients that parse stdout strictly (and may break on npx install messages), use the -yq flag:


For clients that use a JSON config file (Cursor, Claude Desktop, Windsurf), add the following block:


For VS Code, the wrapper key is servers instead of mcpServers, and a "type": "stdio" field is required. See Client Integration for client-specific snippets.

Sources: README.md40-107


Key Configuration Variables

VariableRequiredDefaultPurpose
PERPLEXITY_API_KEYYesBearer token for Perplexity API authentication
PERPLEXITY_BASE_URLNohttps://api.perplexity.aiOverride the API base URL
PERPLEXITY_TIMEOUT_MSNo300000 (5 min)Request timeout in milliseconds
PERPLEXITY_LOG_LEVELNoERRORLog verbosity: DEBUG, INFO, WARN, ERROR
PERPLEXITY_PROXYNoHTTPS proxy URL (highest priority)
PORTNo8080HTTP server port (HTTP mode only)
ALLOWED_ORIGINSNo*CORS allowed origins (HTTP mode only)

For the complete reference, see Environment Variables Reference.

Sources: README.md144-153


Deployment Modes

ModeEntry PointTransport ClassTypical Use
stdiosrc/index.tsStdioServerTransportLocal AI client integrations
HTTPsrc/http.tsStreamableHTTPServerTransportCloud or shared deployments

Both modes call createPerplexityServer() from src/server.ts and differ only in how the MCP transport layer is initialized. See Dual Deployment Architecture for details.

Sources: package.json37-50 server.json8-16


Package Identity

FieldValue
npm package name@perplexity-ai/mcp-server
MCP registry nameai.perplexity/mcp-server
Binary (bin)perplexity-mcpdist/index.js
LicenseMIT
Minimum Node.js≥ 18

Sources: package.json1-30 server.json3-5