perplexity-unofficial-mcp
Provides tools to interact with Perplexity AI via browser cookies, including ask, research, reason, and search capabilities.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@perplexity-unofficial-mcpresearch the effects of climate change on agriculture"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Perplexity Unofficial MCP(基于 Cookies)
非官方实现:本项目通过浏览器 Cookies 调用 Perplexity 的 Web 接口,稳定性与合规性不做保证。请确保你的使用方式符合你所在组织的安全要求与 Perplexity 的服务条款。
本项目目标是把非官方 perplexity-ai(Python SDK,Cookies 方式)包装成一个 MCP STDIO Server,让 MCP 客户端(Claude Desktop / Cursor / VS Code 等)能像使用官方 Perplexity MCP 一样使用它。
你会得到什么
一个 Python MCP Server(STDIO + JSON-RPC 2.0),工具命名对齐官方:
perplexity_askperplexity_researchperplexity_reasonperplexity_search
一份可直接用于 MCP 客户端的快速配置 JSON
Related MCP server: PPX-MCP
前置条件
Python >= 3.10
uv已安装(https://docs.astral.sh/uv/)非官方 SDK 依赖:
默认通过
pyproject.toml里的 git pin 依赖安装(见perplexity-api @ git+https://...@<commit>)因此运行环境通常需要可用的
git与网络访问(受限网络环境可考虑自行改为 vendoring)
(可选)你已在浏览器登录 Perplexity,并能获取 Cookies(提供后通常更稳定;未提供时可能走匿名访问/自动回退,取决于 Perplexity 侧策略)
重要:STDIO 模式下 stdout 只能输出 MCP 协议消息。本项目所有日志都输出到 stderr。建议使用
uv -q并设置UV_NO_PROGRESS=1来尽量抑制 uv 自身输出。
Cookies 获取与配置
获取 Cookies(建议方式)
在浏览器登录
perplexity.ai打开开发者工具 → Application/Storage → Cookies →
https://www.perplexity.ai找到并复制你当前会话的 Cookies(常见包含):
next-auth.csrf-tokennext-auth.session-token
通过两个环境变量传入 Cookies(推荐方式)
本项目默认使用两个环境变量注入 Cookies:
PERPLEXITY_CSRF_TOKEN:对应next-auth.csrf-tokenPERPLEXITY_SESSION_TOKEN:对应next-auth.session-token
如果上述变量缺失或为空,服务端会自动生成随机占位值用于满足上游 SDK 的参数形态(不会写入 stdout/stderr)。此时是否能成功调用取决于 Perplexity 是否允许匿名访问及其回退策略,本项目不做稳定性保证。
注意:不要把 token 写进仓库或公开渠道;建议通过本机环境变量或密钥管理注入。
安装与启动(推荐:uv)
本项目不再提供或依赖 npx 启动方式。推荐使用 uv 直接运行(由 uv 负责依赖解析与运行)。
如果你需要把它接入 MCP 客户端,推荐使用“从 GitHub 仓库地址启动”的形式(无需本地 clone)。
MCP 快速配置(JSON)
以下示例默认使用主分支 main。生产/团队环境建议 pin 到 tag 或 commit 以保证可复现。
Cursor / Claude Desktop / Windsurf(mcpServers 格式)
方式:使用 uv 从 GitHub 启动(推荐)
{
"mcpServers": {
"perplexity_unofficial": {
"command": "uv",
"args": [
"-q",
"tool",
"run",
"--from",
"git+https://github.com/exqlnet/unofficial-perplexity-mcp.git@main",
"perplexity-unofficial-mcp"
],
"env": {
"PERPLEXITY_CSRF_TOKEN": "<csrf>",
"PERPLEXITY_SESSION_TOKEN": "<session>",
"UV_NO_PROGRESS": "1",
"UV_COLOR": "never"
}
}
}
}VS Code(.vscode/mcp.json,servers 格式)
方式:使用 uv 从 GitHub 启动(推荐)
{
"servers": {
"perplexity_unofficial": {
"type": "stdio",
"command": "uv",
"args": [
"-q",
"tool",
"run",
"--from",
"git+https://github.com/exqlnet/unofficial-perplexity-mcp.git@main",
"perplexity-unofficial-mcp"
],
"env": {
"PERPLEXITY_CSRF_TOKEN": "<csrf>",
"PERPLEXITY_SESSION_TOKEN": "<session>",
"UV_NO_PROGRESS": "1",
"UV_COLOR": "never"
}
}
}
}工具说明(与官方对齐)
perplexity_ask
入参:
query(字符串),可选backend_uuid行为:
为避免调用方误传导致行为不可预测:本 MCP 已禁用外部
mode/model入参服务端会按内部默认策略选择模式(例如有 Cookies 时倾向使用 pro,并默认使用
gpt-5.2)请避免频繁调用;尽量将多个子问题合并到一次 query / 一次 perplexity_search 中查清楚
出参:
content(文本)+structuredContent.response(文本)+ 可选structuredContent.chunks+ 可选structuredContent.backend_uuid
续问(同一对话线程继续问)
每次调用若上游返回
backend_uuid,本 MCP 会在structuredContent.backend_uuid回传。下一次调用时,把该值作为入参
backend_uuid传回,即可让 Perplexity 以同一对话上下文续问。注意:该能力依赖网页端私有接口与服务端策略,
backend_uuid可能缺失、过期或被忽略;本项目不保证稳定。
perplexity_research
入参:
query(字符串),可选backend_uuid、strip_thinking行为:
默认 deep research(专用语义)
本 MCP 已禁用外部
mode/model入参注意:这是重型调用,耗时更长;仅在必要时使用,优先 ask/search
perplexity_reason
入参:
query(字符串),可选backend_uuid、strip_thinking行为:
默认 reasoning(专用语义)
本 MCP 已禁用外部
mode/model入参
perplexity_search
入参:
query(字符串),可选backend_uuid行为:
当前实现返回“回答文本”(并尽量在
structuredContent.chunks附带结构化片段)本 MCP 已禁用外部
mode/model入参;服务端会按内部默认策略选择模式请避免频繁调用;尽量把要查的点写进一次 query(例如用编号列出多个子问题),一次 search 查清楚
说明:官方
perplexity_search语义是“返回搜索结果列表”;非官方 SDK 不一定稳定提供同等结构,因此本实现优先保证可用性与对齐接口形状。
重要:本 MCP 不再支持
messages[]入参;如果你的调用方仍传messages,会返回工具级错误并提示改用query。 重要:本 MCP 不再支持mode/model入参;如果你的调用方仍传mode/model,会返回工具级错误并提示移除该字段。
排错
启动报错
未找到 uv:安装 uv 后重试。提示 Cookies 无效/请求失败:通常是会话过期,重新获取 Cookies 并更新
PERPLEXITY_CSRF_TOKEN/PERPLEXITY_SESSION_TOKEN。MCP 客户端初始化失败:检查是否有任何非协议输出写入 stdout;本项目日志写入 stderr,且推荐使用
uv -q并设置UV_NO_PROGRESS=1,仍失败时请检查你的外层启动命令是否会向 stdout 输出额外内容。GitHub 拉取失败:检查网络与 git 可用性;受限环境可改为本地 clone 后再使用本地方式启动(见下文开发说明)。
开发说明
直接运行(不走 uv)
在仓库目录下:
使用
PYTHONPATH=src python3 -m perplexity_unofficial_mcp.cli(适合不安装依赖时做协议层开发)使用
uv -q run --no-editable perplexity-unofficial-mcp(会按pyproject.toml安装依赖)
安全提示
不要把真实 Cookies 提交到 git、截图或粘贴到公开渠道。
建议通过密钥管理(或本机环境变量注入)提供
PERPLEXITY_CSRF_TOKEN/PERPLEXITY_SESSION_TOKEN。
Available Tools
4 toolsperplexity_askAsk PerplexityBRead-only
对齐官方 Perplexity MCP:输入 query 字符串并返回回答文本。请避免频繁调用;尽量将多个子问题合并到一次 query / 一次 perplexity_search 中查清楚。
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| backend_uuid | No | 续问用的会话标识。通常应直接使用上一轮工具返回的 structuredContent.backend_uuid;若不提供则视为新对话。 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and openWorldHint=true, covering the safety profile. The description adds genuinely useful behavioral context beyond that — a rate/call-frequency caution and batching advice — but says nothing about latency, session behavior, or result limits. It adds some value over the annotations but not rich disclosure.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, front-loaded with the purpose and then the operational caveat, with no filler. It is efficient, though the purpose half is just a restatement of the obvious name.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
There is no output schema, and the description does note that it returns answer text, which is the essential return contract. Combined with readOnly/openWorld annotations, the safety and shape are covered. However, for a tool with a sibling family and a session-continuation parameter, it does not fully explain return structure or when continuation via backend_uuid applies.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage sits at 50%: backend_uuid is documented in the schema, while query is not. The description only restates that query is a string, adding no format, length, or example meaning beyond the schema. With coverage near the midpoint, baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states the mechanics clearly — it takes a query string and returns answer text — which is a specific input/output contract. However, it never differentiates perplexity_ask from its three siblings (perplexity_research, perplexity_reason, perplexity_search); it only cites perplexity_search as an alternative batching target, not as a contrasting purpose. An agent cannot tell from this text why it would choose 'ask' over 'search' or 'reason'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives real operational guidance: avoid frequent calls and consolidate multiple sub-questions into one query or one perplexity_search call. That is a useful when-to-batch rule. But it offers no explicit criteria for choosing this tool over the sibling research/reason/search tools, leaving the routing decision to inference.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
perplexity_reasonAdvanced ReasoningCRead-only
对齐官方 Perplexity MCP:推理(默认 reasoning)。请避免频繁调用;尽量将多个子问题合并到一次 query / 一次 perplexity_search 中查清楚。
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| backend_uuid | No | 续问用的会话标识。通常应直接使用上一轮工具返回的 structuredContent.backend_uuid;若不提供则视为新对话。 | |
| strip_thinking | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The annotations already declare readOnlyHint=true and openWorldHint=true, covering the safety profile. The description adds a behavioral constraint beyond those annotations: avoid frequent calls and merge sub-questions into one query or search. It does not disclose rate limits, authentication needs, or return behavior, but it does add relevant call-efficiency context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences and contains no obvious padding. It is reasonably front-loaded with the official-alignment and reasoning purpose, followed by the usage constraint, though the first clause is somewhat vague rather than maximally informative.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a three-parameter tool with 33% schema description coverage, no output schema, and three sibling tools, the description leaves significant gaps. It does not explain when to prefer this reasoning tool over perplexity_ask or perplexity_research, nor does it define the query or strip_thinking parameters. The call-efficiency advice is present but insufficient for the definition to be complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is only 33%, with backend_uuid described in the schema and query and strip_thinking undocumented. The description mentions query only as a container for merged sub-questions and adds no meaning to strip_thinking or the required query format, so it fails to compensate for the sparse schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description identifies the tool as the 'reasoning (default reasoning)' variant aligned with official Perplexity MCP, which gives a basic sense of purpose. However, it does not clearly state what kind of reasoning output the agent should expect or how it differs from siblings perplexity_ask and perplexity_research. The only sibling contrast is an indirect reference to merging sub-questions into perplexity_search.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It advises avoiding frequent calls and consolidating multiple sub-questions into one query or one perplexity_search call, which is useful operational guidance. Still, it does not explicitly say when to choose perplexity_reason over perplexity_ask or perplexity_research, so an agent must infer its place among siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
perplexity_researchDeep Research(重型)ARead-only
对齐官方 Perplexity MCP:深度研究(重型调用,耗时更长;仅在必要时使用,优先 ask/search)。请避免频繁调用;尽量将多个子问题合并到一次 query / 一次 perplexity_search 中查清楚。
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| backend_uuid | No | 续问用的会话标识。通常应直接使用上一轮工具返回的 structuredContent.backend_uuid;若不提供则视为新对话。 | |
| strip_thinking | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations only declare readOnlyHint and openWorldHint, so the description's disclosure that this is a slow, heavyweight call with cost/rate implications (避免频繁调用) is genuinely additive. It omits anything about result shape or session behavior beyond what the backend_uuid schema description already carries.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two compact sentences with the heavy-call warning and the preference for lighter siblings front-loaded; there is no filler and every clause carries an instruction.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema, the description should say something about what a research call returns, but it does not, and strip_thinking remains undocumented. The cost/latency framing and sibling routing are present, so it is adequate but incomplete for a 3-parameter tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is only 33%: backend_uuid is documented in the schema, while query and strip_thinking are not. The description partially compensates by advising how to shape the query (merge sub-questions into one call), but says nothing about strip_thinking, leaving one parameter unexplained in both places.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states the resource and character of the operation (深度研究, 重型调用) and explicitly positions it against its siblings by naming ask/search. It is clear enough that an agent can distinguish it from perplexity_ask and perplexity_search without opening a schema, though the core verb is partly restated from the tool name itself.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives an explicit use-only-when-necessary rule, names the preferred alternatives (优先 ask/search), warns against frequent invocation, and advises consolidating sub-questions into a single call. This is a complete when/when-not/alternative routing instruction.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
perplexity_searchSearch the WebBRead-only
对齐官方 Perplexity MCP:搜索(当前实现返回回答文本,结构化字段尽量附带)。请避免频繁调用;尽量将多个子问题合并到一次 query / 一次 perplexity_search 中查清楚。
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| backend_uuid | No | 续问用的会话标识。通常应直接使用上一轮工具返回的 structuredContent.backend_uuid;若不提供则视为新对话。 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint and openWorldHint, and the description adds genuinely new behavior: it discloses that the current implementation returns answer text with structured fields 'attached where possible', and warns about call frequency. The rate-limit warning and return-format caveat go beyond what the annotations convey.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
It is short and the batching advice is actionable, but the first clause ('align with official Perplexity MCP') is meta-noise that does not help an agent call the tool. That padding dilutes an otherwise compact definition.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema the description does helpfully sketch the return shape (answer text + optional structured fields), which compensates somewhat. However, with three sibling tools and no differentiation, and query undocumented in the schema, the definition is only minimally complete for an agent choosing among the perplexity_* family.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 50%: backend_uuid is well documented in the schema (session continuation via structuredContent.backend_uuid), but query has no schema description. The description only implicitly covers query by advising sub-questions be merged into 'one query', which is mild but useful guidance rather than full parameter semantics.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description names the verb/resource (web search) and notes it returns answer text, but it opens with meta-commentary about aligning with the official Perplexity MCP rather than stating scope. It never distinguishes itself from the three siblings (perplexity_ask, perplexity_research, perplexity_reason), which leaves the agent guessing what makes 'search' the right pick.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives efficiency advice ('avoid frequent calls', batch sub-questions into one query) but no when-to-use guidance relative to the sibling tools that exist. No exclusions or alternatives are named, so the agent has no basis for choosing this over perplexity_ask or perplexity_research.
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.
4 tool updates
v0.1.3- First observed
perplexity_ask - First observed
perplexity_reason - First observed
perplexity_research - First observed
perplexity_search
TDQS
Scored across 4 tools
All four tools take a query and return answer text, with nearly identical boilerplate warnings about avoiding frequent calls. The boundaries between perplexity_ask and perplexity_search are especially unclear since search also returns answer text, and only perplexity_research (heavy) and perplexity_reason (reasoning) are somewhat distinct.
Every tool follows the exact same perplexity_<action> snake_case pattern with no deviations. The naming is fully predictable and consistent.
Four tools align with the four Perplexity modes (ask, search, reason, research), which is a well-scoped set for a wrapper. No obvious missing or redundant tools based on the stated purpose.
The surface covers the main query modes, but perplexity_search returns answer text rather than fully structured search results, and there is no explicit conversational/session tool. These are minor gaps that agents can likely work around.
Maintenance
Related MCP Connectors
Remote MCP server for supportsheep: run AI interviews and manage support content for your blog.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Personal assistant MCP server with search, execute, packages, jobs, secrets, and integrations.
Related MCP Servers
- MIT
- AlicenseAqualityDmaintenanceAn unofficial MCP server for Perplexity AI that leverages Pro subscriptions and browser cookies to enable real-time web searches and model selection without an API key. It provides tools for performing queries, listing available models, and automating the login process to manage authentication.413 npmMIT
- AlicenseNot gradedqualityNot gradedmaintenanceA Python port of the official Perplexity MCP server that enables web-grounded Q\&A, deep research, and step-by-step reasoning via Perplexity AI's models. It supports both STDIO and HTTP interfaces for seamless integration with tools like Claude Desktop and Cursor.MIT
- AlicenseNot gradedqualityCmaintenanceMCP server that queries Perplexity Pro via WebUI session token, providing model-specific tools for search and deep research.22 npm5MIT