Perplexity WebUI MCP server
Allows an AI client to query Perplexity Pro models including Deep Research and Sonar using a WebUI session token.
Also known as Microck/perplexity-webui-mcp
- Stars
- 5
- Tools
- —
- Downloads, 30 days
- —
- Latest version
- —
- Last commit
- Jul 8, 2026
- License
- MIT
What is Perplexity WebUI MCP?
Perplexity WebUI allows an AI client to query Perplexity Pro models including Deep Research and Sonar using a WebUI session token.
Summary generated from the project's README
About Perplexity WebUI MCP server
Querying Perplexity Pro models like Deep Research and Sonar directly from an AI client is what this local MCP server enables. It acts as a wrapper that launches an upstream scraper via uvx, allowing developers to access advanced model-specific tools through a standard stdio transport. Users must provide a WebUI session token, which can be obtained manually from browser cookies or via an interactive CLI tool.
This server is designed for personal or local use and requires a valid session cookie to impersonate a browser session. It includes built-in support for handling Cloudflare challenges by connecting to a FlareSolverr instance and allows for proxy configurations through standard environment variables. For users needing to bypass network restrictions, it supports remote deployment over Tailscale to connect a cloud-based client to a home machine.
What you can do with it
- 1Perform deep research tasksAn AI agent can execute complex investigations using the dedicated deep research mode.
- 2Query specific AI modelsDevelopers can instruct their client to use specific models like Sonar, Gemini, or Claude variants.
- 3Bypass Cloudflare protectionsIf a host is blocked by security challenges, the server can use FlareSolverr to solve them.
Written from the project's README. Every use case is checked against a quote from it.
How to install Perplexity WebUI MCP
Formats verified 10 Nov 2026Add to CursorAdd to GooseInstall Perplexity WebUI MCP in Claude Code
$ claude mcp add perplexity-webui-mcp -- npx -y perplexity-webui-mcpInstall Perplexity WebUI MCP in Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"perplexity-webui-mcp": {
"command": "npx",
"args": [
"-y",
"perplexity-webui-mcp"
]
}
}
}Install Perplexity WebUI MCP in VS Code
.vscode/mcp.json
{
"servers": {
"perplexity-webui-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"perplexity-webui-mcp"
]
}
}
}Install Perplexity WebUI MCP in VS Code CLI
$ code --add-mcp '{"name":"perplexity-webui-mcp","type":"stdio","command":"npx","args":["-y","perplexity-webui-mcp"]}'Install Perplexity WebUI MCP in Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"perplexity-webui-mcp": {
"command": "npx",
"args": [
"-y",
"perplexity-webui-mcp"
]
}
}
}Install Perplexity WebUI MCP in Codex
$ codex mcp add perplexity-webui-mcp -- npx -y perplexity-webui-mcpInstall Perplexity WebUI MCP in Codex config.toml
~/.codex/config.toml
[mcp_servers.perplexity-webui-mcp] command = "npx" args = ["-y", "perplexity-webui-mcp"]
Install Perplexity WebUI MCP in Gemini CLI
$ gemini mcp add -s user perplexity-webui-mcp npx -- -y perplexity-webui-mcpInstall Perplexity WebUI MCP in Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"perplexity-webui-mcp": {
"command": "npx",
"args": [
"-y",
"perplexity-webui-mcp"
]
}
}
}Configuration
PERPLEXITY_FLARESOLVERR_URLPERPLEXITY_PROXY_URLPERPLEXITY_SESSION_TOKENPERPLEXITY_UPSTREAM_FROM
| Name | Description | |
|---|---|---|
| PERPLEXITY_FLARESOLVERR_URL | — | |
| PERPLEXITY_PROXY_URL | — | |
| PERPLEXITY_SESSION_TOKEN | — | |
| PERPLEXITY_UPSTREAM_FROM | — |
Automated checks
Ran Nov 15, 2026Full report →Not verified yet. A server needs a score of 80, no serious finding, and enough data for us to check. How checks work · What to fix for more points
- Source repository linked and reachablemicrock/perplexity-webui-mcp is public and reachablegithub.com/microck/perplexity-webui-mcp ↗Pass
- Package names this repository as its sourceperplexity-webui-mcp names microck/perplexity-webui-mcp as sourcenpmjs.com/package/perplexity-webui-mcp ↗Pass
- Build provenance (Sigstore attestation)No build attestation published for this releaseNot checked
- Open source license (OSI)MITspdx.org/licenses/MIT.html ↗Pass
- Commit or release in the last yearLast commit or release 2026-07-08github.com/microck/perplexity-webui-mcp ↗Pass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNo popular package one edit away from perplexity-webui-mcpPass
- No critical advisory in the package or its dependenciesNot checked
- No hidden instructions to the model0 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelledNot checked
- Remote endpoint answers the MCP handshakeNot checked
README
View on GitHubquick start
this package is a local mcp wrapper (stdio transport) that launches the upstream perplexity-webui-scraper mcp server via uvx.
by default it pins the upstream runner to:
perplexity-webui-scraper[mcp]@git+https://github.com/henrique-coder/perplexity-webui-scraper.git@prod
override that only if you need to test a different upstream build:
PERPLEXITY_UPSTREAM_FROM="perplexity-webui-scraper[mcp]@git+https://github.com/henrique-coder/perplexity-webui-scraper.git@<ref>" \
PERPLEXITY_SESSION_TOKEN="your_token_here" \
npx perplexity-webui-mcp
manual run:
PERPLEXITY_SESSION_TOKEN="your_token_here" npx perplexity-webui-mcp
manual run through a proxy:
PERPLEXITY_SESSION_TOKEN="your_token_here" \
PERPLEXITY_PROXY_URL="socks5://127.0.0.1:1080" \
npx perplexity-webui-mcp
manual run with flaresolverr:
docker run -d --name flaresolverr -p 8191:8191 ghcr.io/flaresolverr/flaresolverr:latest
PERPLEXITY_SESSION_TOKEN="your_token_here" \
PERPLEXITY_FLARESOLVERR_URL="http://127.0.0.1:8191" \
npx perplexity-webui-mcp
important: this uses perplexity's internal webui api with a session cookie. for personal/local tinkering only - not affiliated with perplexity ai.
overview
perplexity-webui-mcp is a local stdio mcp wrapper that launches the upstream perplexity-webui-scraper mcp server through uvx. this keeps the package on npm while using the upstream webui implementation for browser impersonation, retry logic, model-specific tools, and token tooling.
quick installation
paste this into your llm agent session:
Install and configure perplexity-webui-mcp by following the instructions here:
https://raw.githubusercontent.com/Microck/perplexity-webui-mcp/refs/heads/master/INSTALL.md
npm (recommended)
npm install -g perplexity-webui-mcp
runtime requirement:
uv --version
if uv is missing, install it from https://docs.astral.sh/uv/getting-started/installation/
manual installation
from source
git clone https://github.com/Microck/perplexity-webui-mcp.git
cd perplexity-webui-mcp
npm install
npm run build
getting your session token
fastest method (automatic via CLI):
uvx --with rich --from "perplexity-webui-scraper@git+https://github.com/henrique-coder/perplexity-webui-scraper.git@prod" get-perplexity-session-token
this interactive CLI asks for your email, handles OTP/magic-link verification, and prints the session token.
you can run that command from any directory.
manual method (browser):
- open perplexity.ai in your browser and log in
- open devtools (f12 or cmd+opt+i)
- go to application > cookies >
https://www.perplexity.ai - copy the value of
__Secure-next-auth.session-token
powered by token extraction flow from: https://github.com/henrique-coder/perplexity-webui-scraper
configuration
because this server uses stdio, you configure it as a local command and pass the token via env.
proxy support:
- standard proxy env vars already pass through:
HTTP_PROXY,HTTPS_PROXY,ALL_PROXY,NO_PROXYand their lowercase variants - for a simpler single-value setup, set
PERPLEXITY_PROXY_URL; the wrapper expands it into the standard proxy env vars before launching the upstream MCP server - optional bypass list:
PERPLEXITY_NO_PROXY - if perplexity keeps returning cloudflare challenge pages, set
PERPLEXITY_FLARESOLVERR_URLto a running flaresolverr instance. the wrapper solveshttps://www.perplexity.ai/search/new, injects the returned cookies into the upstreamcurl_cffisession, and stops forwarding the standard proxy env vars in that mode - optional flaresolverr overrides:
PERPLEXITY_FLARESOLVERR_SOLVE_URL- alternate url to solve first. default:https://www.perplexity.ai/search/newPERPLEXITY_FLARESOLVERR_MAX_TIMEOUT- flaresolverr solve timeout in milliseconds. default:60000
note: deep research can take longer than 60 seconds. if your client supports it, set a higher timeout (example: 10 minutes).
mcp client config (claude desktop, opencode, etc)
{
"mcpServers": {
"perplexity": {
"command": "perplexity-webui-mcp",
"timeout": 600000,
"env": {
"PERPLEXITY_SESSION_TOKEN": "your_session_token_here",
"PERPLEXITY_FLARESOLVERR_URL": "http://127.0.0.1:8191"
}
}
}
}
from source
{
"mcpServers": {
"perplexity": {
"command": "node",
"args": ["/path/to/perplexity-webui-mcp/dist/index.js"],
"timeout": 600000,
"env": {
"PERPLEXITY_SESSION_TOKEN": "your_session_token_here",
"PERPLEXITY_FLARESOLVERR_URL": "http://127.0.0.1:8191"
}
}
}
}
using flaresolverr when cloudflare blocks your host
start flaresolverr:
docker run -d --name flaresolverr -p 8191:8191 ghcr.io/flaresolverr/flaresolverr:latest
curl http://127.0.0.1:8191/
then point the wrapper at it:
PERPLEXITY_SESSION_TOKEN="your_token_here" \
PERPLEXITY_FLARESOLVERR_URL="http://127.0.0.1:8191" \
npx perplexity-webui-mcp
flaresolverr mode:
- the wrapper solves the cloudflare wall in flaresolverr first, then injects the returned cookies into the upstream session
- the wrapper does not forward
HTTP_PROXY,HTTPS_PROXY,ALL_PROXY, orNO_PROXYto the upstream process in this mode because the solved cookies need to stay tied to the flaresolverr browser route - if flaresolverr itself needs a proxy, configure that on the flaresolverr side instead of on
perplexity-webui-mcp
remote deployment over tailscale (optional)
if your cloud machine gets blocked by cloudflare but your home machine works, run the upstream mcp server on the home machine and connect to it from opencode as a remote mcp.
- copy templates from this repo:
deploy/systemd/perplexity-webui-mcp.env.exampledeploy/systemd/perplexity-webui-mcp-sse.shdeploy/systemd/perplexity-webui-mcp.service
- install and enable service on the home machine (user service):
mkdir -p ~/.config ~/.config/systemd/user ~/.local/bin
cp deploy/systemd/perplexity-webui-mcp.env.example ~/.config/perplexity-webui-mcp.env
cp deploy/systemd/perplexity-webui-mcp-sse.sh ~/.local/bin/perplexity-webui-mcp-sse.sh
cp deploy/systemd/perplexity-webui-mcp.service ~/.config/systemd/user/perplexity-webui-mcp.service
chmod 600 ~/.config/perplexity-webui-mcp.env
chmod 755 ~/.local/bin/perplexity-webui-mcp-sse.sh
systemctl --user daemon-reload
systemctl --user enable --now perplexity-webui-mcp.service
- point opencode (cloud host) to the tailscale endpoint:
{
"mcp": {
"perplexity-webui": {
"type": "remote",
"url": "http://<tailscale-ip>:8790/sse",
"enabled": true,
"timeout": 600000,
"oauth": false
}
}
}
- verify:
opencode mcp list
features
| tool | description |
|---|---|
pplx_ask |
best-model query (auto model selection) |
pplx_deep_research |
deep research mode |
pplx_sonar |
sonar model |
pplx_gpt54 / pplx_gpt54_thinking |
gpt-5.4 variants |
pplx_claude_o46 / pplx_claude_o46_think |
claude opus 4.6 variants |
pplx_claude_s46 / pplx_claude_s46_think |
claude sonnet 4.6 variants |
pplx_gemini31_pro / pplx_gemini31_pro_think |
gemini 3.1 pro variants |
pplx_gemini_flash / pplx_gemini_flash_think |
gemini flash variants |
pplx_grok41 / pplx_grok41_think |
grok 4.1 variants |
pplx_nemotron3_super_think |
nemotron 3 super thinking |
all upstream model tools support source_focus values: web, academic, social, finance, all.
how this differs from v1.0.0
- old v1.0.0: one custom tool (
perplexity_search) implemented in local TypeScript HTTP logic. - current: delegates to upstream
perplexity-webui-scraperMCP, exposing the full upstream model-specific toolset. - result: significantly better compatibility with Perplexity anti-bot protections.
troubleshooting
| problem | solution |
|---|---|
| token invalid / 401 | get a fresh token from browser cookies |
uvx not found |
install uv (uv --version should work) |
| no answer returned | check rate limits or whether your account can access the selected model |
| clarifying questions error | deep research retries once with recommended/default clarification choices; if this still appears, Perplexity rejected the skip and needs a more specific query |
cloudflare challenge / Just a moment... |
run flaresolverr and set PERPLEXITY_FLARESOLVERR_URL=http://127.0.0.1:8191 |
| timeout | deep research can take several minutes - be patient |
verify both modes quickly
PERPLEXITY_SESSION_TOKEN="your_token_here" npm run self-test
this checks both:
- regular search (
best) - deep research (
deep-research)
and prints pass/fail per mode.
project structure
perplexity-webui-mcp/
├── deploy/
│ └── systemd/
│ ├── perplexity-webui-mcp.env.example
│ ├── perplexity-webui-mcp-sse.sh
│ └── perplexity-webui-mcp.service
├── src/
│ └── index.ts # proxy launcher for upstream MCP
├── package.json
├── tsconfig.json
├── .env.example
├── .gitignore
├── LICENSE
├── INSTALL.md
└── README.md
license
mit
author
shoutout
special thanks to henrique-coder/perplexity-webui-scraper for the WebUI reverse-engineering and token CLI workflow that helped this project.
Perplexity WebUI MCP questions
How do I add Perplexity WebUI MCP to Claude Code?
Run claude mcp add perplexity-webui-mcp -- npx -y perplexity-webui-mcp in your terminal. Add --scope user to make it available in every project.
How do I add Perplexity WebUI MCP to Cursor?
Open ~/.cursor/mcp.json and add the server under mcpServers, using the Cursor config shown in the install section above.
How do I get my Perplexity session token?
You can use the interactive CLI via uvx which handles email and OTP verification, or manually copy the __Secure-next-auth.session-token cookie from your browser's devtools.
How can I bypass Cloudflare challenges?
You can run a FlareSolverr instance and configure the PERPLEXITY_FLARESOLVERR_URL environment variable to point to it.