perplexity-web-api-mcp

作者 mishamyrt已验证

🔍 Perplexity AI MCP without API key

100
Stars
18
Forks
Rust
语言
2026/8/24
添加时间

⚠️ 第三方软件声明

本 Skill 为第三方开源软件,独立托管于 GitHub。SkillTip 仅为信息目录,不控制或维护底层仓库。所显示的安全检查为自动化且范围有限,安装前请自行审查源码。

阅读服务条款

安装

添加到你的 Claude Code skills 目录:

# Add to your Claude Code skills
git clone https://github.com/mishamyrt/perplexity-web-api-mcp

快速入门

使用 perplexity-web-api-mcp 等 Skills 的指南。

安全报告

已验证

上次扫描:—

{
  "status": "PASSED",
  "issues": []
}

README.md

Perplexity Web API MCP Server

Install in Cursor Install in VS Code NPM Version

MCP (Model Context Protocol) server that exposes Perplexity AI search, research, and reasoning capabilities as tools.

No API Key Required

This MCP server uses your Perplexity account session directly — no API key needed.

Perplexity offers a separate paid API with per-request pricing that is charged independently from your Pro subscription. With this MCP, you don't need to pay for API access — your existing Perplexity subscription (or even a free account) is enough.

Simply extract the session tokens from your browser cookies, and you're ready to use Perplexity search, research, and reasoning in your IDE.

Tokenless Mode

The server can run without any authentication tokens. In this mode:

  • Only perplexity_search (links only) and perplexity_ask (answer with sources) are available — perplexity_research and perplexity_reason require tokens.
  • Both tools use the turbo model; PERPLEXITY_ASK_MODEL and PERPLEXITY_REASON_MODEL cannot be set (the server will throw an error if they are).
  • File attachments (files parameter) are unavailable — they require tokens.

To use tokenless mode, simply omit PERPLEXITY_SESSION_TOKEN and PERPLEXITY_CSRF_TOKEN from your configuration.

For full access to all tools and model selection, provide both tokens as described in the Configuration section below.

Requirements

Supported Platforms

  • macOS (arm64, x86_64)
  • Linux (x86_64, aarch64)
  • Windows (x86_64)

Configuration

Getting Your Tokens

This server requires a Perplexity AI account. You need to extract two authentication tokens from your browser cookies:

  1. Log in to perplexity.ai in your browser
  2. Open Developer Tools (F12 or right-click → Inspect)
  3. Go to Application → Cookies → https://www.perplexity.ai
  4. Copy the values of:
    • __Secure-next-auth.session-token → use as PERPLEXITY_SESSION_TOKEN
    • next-auth.csrf-token → use as PERPLEXITY_CSRF_TOKEN

Environment Variables

  • PERPLEXITY_SESSION_TOKEN (optional): Perplexity session token (next-auth.session-token cookie). Required for perplexity_research, perplexity_reason, and file attachments.
  • PERPLEXITY_CSRF_TOKEN (optional): Perplexity CSRF token (next-auth.csrf-token cookie). Required for perplexity_research, perplexity_reason, and file attachments.
  • PERPLEXITY_ASK_MODEL (optional, requires tokens): Model for perplexity_ask. Valid values:
    • turbo (default for tokenless)
    • pro-auto (default for authenticated)
    • sonar
    • gpt-5.4
    • claude-4.6-sonnet
    • nemotron-3-super
  • PERPLEXITY_REASON_MODEL (optional, requires tokens): Model for perplexity_reason. Valid values:
    • gemini-3.1-pro (default)
    • gpt-5.4-thinking
    • claude-4.6-sonnet-thinking
  • PERPLEXITY_INCOGNITO (optional, default: true): Whether requests should use Perplexity's incognito mode. Valid values: true or false

Claude Code

claude mcp add perplexity --env PERPLEXITY_SESSION_TOKEN="your-session-token" --env PERPLEXITY_CSRF_TOKEN="your-csrf-token" -- npx -y perplexity-web-api-mcp

Cursor, Claude Desktop & Windsurf

I recommend using the one-click install badge at the top of this README for Cursor.

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

ClientConfig File
Cursor~/.cursor/mcp.json
Claude Desktopclaude_desktop_config.json
Windsurf~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "perplexity": {
      "command": "npx",
      "args": ["-y", "perplexity-web-api-mcp"],
      "env": {
        "PERPLEXITY_SESSION_TOKEN": "your-session-token",
        "PERPLEXITY_CSRF_TOKEN": "your-csrf-token"
      }
    }
  }
}

Zed

Add following following to context_servers in your settings file:

{
  "context_servers": {
    "perplexity": {
      "command": "npx",
      "args": ["-y", "perplexity-web-api-mcp"],
      "env": {
        "PERPLEXITY_SESSION_TOKEN": "your-session-token",
        "PERPLEXITY_CSRF_TOKEN": "your-csrf-token"
      }
    }
  }
}

VS Code

I recommend using the one-click install badge at the top of this README for VS Code, or for manual setup, add to .vscode/mcp.json:

{
  "servers": {
    "perplexity": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "perplexity-web-api-mcp"],
      "env": {
        "PERPLEXITY_SESSION_TOKEN": "your-session-token",
        "PERPLEXITY_CSRF_TOKEN": "your-csrf-token"
      }
    }
  }
}

Codex

codex mcp add perplexity --env PERPLEXITY_SESSION_TOKEN="your-session-token" --env PERPLEXITY_CSRF_TOKEN="your-csrf-token" -- npx -y perplexity-web-api-mcp

Building from Source

Source build instructions, including optional cargo features, are documented in CONTRIBUTING.md.

Other MCP Clients

Most clients can be manually configured to use the mcpServers wrapper in their configuration file (like Cursor). If your client doesn't work, check its documentation for the correct wrapper format.

Docker

A pre-built multi-arch image (linux/amd64, linux/arm64) is available on Docker Hub:

docker run -d \
  -p 8080:8080 \
  -e PERPLEXITY_SESSION_TOKEN="your-session-token" \
  -e PERPLEXITY_CSRF_TOKEN="your-csrf-token" \
  mishamyrt/perplexity-web-api-mcp

The container exposes the MCP server via Streamable HTTP at http://localhost:8080/mcp. The Docker image is built with --features streamable-http; local/source builds need the same feature if you want HTTP transport.

Configure your MCP client to connect:

{
  "mcpServers": {
    "perplexity": {
      "url": "http://localhost:8080/mcp"
    }
  }
}

Environment Variables (Docker-specific)

VariableDefaultDescription
MCP_TRANSPORTstreamable-httpTransport mode. stdio or streamable-http (requires the streamable-http cargo feature)
MCP_HOST0.0.0.0Host address to bind
MCP_PORT8080Port to listen on

The authentication tokens, model variables, and incognito flag described above work the same way in Docker.

Available Tools

perplexity_search

Quick web search using the turbo model. Returns only links, titles, and snippets — no generated answer.

Best for: Finding relevant URLs and sources quickly.

Parameters:

  • query (required): The search query or question
  • sources (optional): Array of sources — "web", "scholar", "social". Defaults to ["web"]
  • language (optional): Language code, e.g., "en-US". Defaults to "en-US"

File attachments are not supported by this tool.

perplexity_ask

Ask Perplexity AI a question and get a comprehensive answer with source citations. By default uses the best model (Pro auto mode) when authentication tokens are provided, or turbo in tokenless mode. Can be configured via PERPLEXITY_ASK_MODEL.

Best for: Getting detailed answers to questions with web context.

Parameters: Same as perplexity_search, plus:

  • files (optional, requires tokens): Array of file attachments for document analysis. See File Attachments.

perplexity_reason

Advanced reasoning and problem-solving. By default uses Perplexity's sonar-reasoning model, but can be configured via PERPLEXITY_REASON_MODEL.

Best for: Logical problems, complex analysis, decision-making, and tasks requiring step-by-step reasoning.

Parameters: Same as perplexity_ask.

perplexity_research

Deep, comprehensive research using Perplexity's sonar-deep-research (pplx_alpha) model.

Best for: Complex topics requiring detailed investigation, comprehensive reports, and in-depth analysis. Provides thorough analysis with citations.

Parameters: Same as perplexity_ask.

File Attachments

perplexity_ask, perplexity_research, and perplexity_reason accept an optional files parameter for document analysis. Requires authentication tokens.

Each entry in the files array must have:

  • filename (required): Filename with extension, e.g. "report.pdf" or "notes.txt"
  • text (mutually exclusive with data): Plain-text file content. Use for .txt, .md, .csv, .json, source code, etc.
  • data (mutually exclusive with text): Base64-encoded binary content. Use for .pdf, .docx, images, etc.

Example — plain text:

{
  "query": "Summarise the key points",
  "files": [
    {
      "filename": "notes.txt",
      "text": "Meeting notes: Q1 revenue up 12%..."
    }
  ]
}

Example — binary file (PDF):

{
  "query": "What does this contract say about termination?",
  "files": [
    {
      "filename": "contract.pdf",
      "data": "JVBERi0xLjQK..."
    }
  ]
}

Multiple files can be passed in a single request — they are uploaded to Perplexity's storage in parallel before the query is sent.

Response Format

perplexity_search returns only web results:

{
  "web_results": [
    {
      "name": "Source name",
      "url": "https://example.com",
      "snippet": "Source snippet"
    }
  ]
}

perplexity_ask, perplexity_research, and perplexity_reason return a full response:

{
  "answer": "The generated answer text...",
  "web_results": [
    {
      "name": "Source name",
      "url": "https://example.com",
      "snippet": "Source snippet"
    }
  ],
  "follow_up": {
    "backend_uuid": "uuid-for-follow-up-queries",
    "attachments": []
  }
}

License

MIT

常见问题

What is perplexity-web-api-mcp?

perplexity-web-api-mcp is an open-source mcp servers skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by mishamyrt. 🔍 Perplexity AI MCP without API key. It has 100 GitHub stars.

Is perplexity-web-api-mcp safe to use?

Yes. perplexity-web-api-mcp passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install perplexity-web-api-mcp?

Clone the repository with "git clone https://github.com/mishamyrt/perplexity-web-api-mcp" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is perplexity-web-api-mcp written in?

perplexity-web-api-mcp is primarily written in Rust. It is open-source under mishamyrt on GitHub, so you can review or fork the full source.

Are there alternatives to perplexity-web-api-mcp?

Yes. SkillsLLM lists many other MCP Servers skills you can browse and compare side by side. Open the MCP Servers category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh perplexity-web-api-mcp against similar tools.

评论 (0)

暂无评论,成为第一个分享想法的人!

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

Scrapling

by D4Vinci

🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl!

75,9137,581Python
MCP 服务器
查看详情

TrendRadar

by sansan0

⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts.🎯 告别信息过载,你的 AI 舆情监控助手与热点筛选工具!聚合多平台热点 + RSS 订阅,支持关键词精准筛选。AI 智能筛选新闻 + AI 翻译 + AI 分析简报直推手机,也支持接入 MCP 架构,赋能 AI 自然语言对话分析、情感洞察与趋势预测等。支持 Docker ,数据本地/云端自持。集成微信/飞书/钉钉/Telegram/邮件/ntfy/bark/slack 等渠道智能推送。

61,65224,883Python
MCP 服务器
查看详情

context7

by upstash

Context7 Platform -- Up-to-date code documentation for LLMs and AI code editors

61,0602,938TypeScript
MCP 服务器
查看详情

High-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.

39,9393,219C
MCP 服务器
查看详情

开发者还喜欢

基于喜欢此 Skill 的开发者投票和收藏

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情