{"id":35837109,"url":"https://github.com/mishamyrt/perplexity-web-api-mcp","last_synced_at":"2026-04-02T17:59:15.424Z","repository":{"id":332413948,"uuid":"1129996899","full_name":"mishamyrt/perplexity-web-api-mcp","owner":"mishamyrt","description":"🔍 Perplexity AI MCP without API key","archived":false,"fork":false,"pushed_at":"2026-03-26T22:07:48.000Z","size":166,"stargazers_count":35,"open_issues_count":1,"forks_count":7,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-03-27T10:13:48.334Z","etag":null,"topics":["ai","claude-desktop","codex","cursor-ai","mcp","mcp-server","openclaw","perplexity","perplexity-mcp-server","reverse-engineering"],"latest_commit_sha":null,"homepage":"https://mishamyrt.github.io/perplexity-web-api-mcp/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mishamyrt.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-01-07T22:08:18.000Z","updated_at":"2026-03-26T22:18:45.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/mishamyrt/perplexity-web-api-mcp","commit_stats":null,"previous_names":["mishamyrt/perplexity-web-api-mcp"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/mishamyrt/perplexity-web-api-mcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mishamyrt%2Fperplexity-web-api-mcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mishamyrt%2Fperplexity-web-api-mcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mishamyrt%2Fperplexity-web-api-mcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mishamyrt%2Fperplexity-web-api-mcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mishamyrt","download_url":"https://codeload.github.com/mishamyrt/perplexity-web-api-mcp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mishamyrt%2Fperplexity-web-api-mcp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31312744,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","claude-desktop","codex","cursor-ai","mcp","mcp-server","openclaw","perplexity","perplexity-mcp-server","reverse-engineering"],"created_at":"2026-01-08T01:15:30.510Z","updated_at":"2026-04-02T17:59:15.417Z","avatar_url":"https://github.com/mishamyrt.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Perplexity Web API MCP Server\n\n\u003cp\u003e\n    \u003ca href=\"https://cursor.com/en/install-mcp?name=perplexity-web\u0026config=eyJ0eXBlIjoic3RkaW8iLCJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsInBlcnBsZXhpdHktd2ViLWFwaS1tY3AiXSwiZW52Ijp7IlBFUlBMRVhJVFlfU0VTU0lPTl9UT0tFTiI6IiIsIlBFUlBMRVhJVFlfQ1NSRl9UT0tFTiI6IiJ9fQ==\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://custom-icon-badges.demolab.com/badge/Install_in_Cursor-000000?style=for-the-badge\u0026logo=cursor-ai-white\" alt=\"Install in Cursor\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://vscode.dev/redirect/mcp/install?name=perplexity-web\u0026config=%7B%22type%22%3A%22stdio%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22perplexity-web-api-mcp%22%5D%2C%22env%22%3A%7B%22PERPLEXITY_SESSION_TOKEN%22%3A%22%22%2C%22PERPLEXITY_CSRF_TOKEN%22%3A%22%22%7D%7D\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://custom-icon-badges.demolab.com/badge/Install_in_VS_Code-007ACC?style=for-the-badge\u0026logo=vsc\u0026logoColor=white\" alt=\"Install in VS Code\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://www.npmjs.com/package/perplexity-web-api-mcp\" target=\"_blank\"\u003e\n        \u003cimg\n            src=\"https://img.shields.io/npm/v/perplexity-web-api-mcp?style=for-the-badge\u0026logo=npm\u0026logoColor=white\u0026color=CB3837\"\n            alt=\"NPM Version\" /\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\nMCP (Model Context Protocol) server that exposes Perplexity AI search, research, and reasoning capabilities as tools.\n\n## No API Key Required\n\nThis MCP server uses your Perplexity account session directly — **no API key needed**.\n\nPerplexity offers a separate [paid API](https://docs.perplexity.ai/guides/pricing) 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.\n\nSimply extract the session tokens from your browser cookies, and you're ready to use Perplexity search, research, and reasoning in your IDE.\n\n## Tokenless Mode\n\nThe server can run **without any authentication tokens**. In this mode:\n\n- Only `perplexity_search` (links only) and `perplexity_ask` (answer with sources) are available — `perplexity_research` and `perplexity_reason` require tokens.\n- 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).\n- File attachments (`files` parameter) are unavailable — they require tokens.\n\nTo use tokenless mode, simply omit `PERPLEXITY_SESSION_TOKEN` and `PERPLEXITY_CSRF_TOKEN` from your configuration.\n\nFor full access to all tools and model selection, provide both tokens as described in the [Configuration](#configuration) section below.\n\n## Requirements\n\n### Supported Platforms\n\n- macOS (arm64, x86_64)\n- Linux (x86_64, aarch64)\n- Windows (x86_64)\n\n## Configuration\n\n### Getting Your Tokens\n\nThis server requires a Perplexity AI account. You need to extract two authentication tokens from your browser cookies:\n\n1. Log in to [perplexity.ai](https://www.perplexity.ai) in your browser\n2. Open Developer Tools (F12 or right-click → Inspect)\n3. Go to Application → Cookies → `https://www.perplexity.ai`\n4. Copy the values of:\n   - `__Secure-next-auth.session-token` → use as `PERPLEXITY_SESSION_TOKEN`\n   - `next-auth.csrf-token` → use as `PERPLEXITY_CSRF_TOKEN`\n\n### Environment Variables\n\n- `PERPLEXITY_SESSION_TOKEN` (optional): Perplexity session token (`next-auth.session-token` cookie). Required for `perplexity_research`, `perplexity_reason`, and file attachments.\n- `PERPLEXITY_CSRF_TOKEN` (optional): Perplexity CSRF token (`next-auth.csrf-token` cookie). Required for `perplexity_research`, `perplexity_reason`, and file attachments.\n- `PERPLEXITY_ASK_MODEL` (optional, requires tokens): Model for `perplexity_ask`.\n  Valid values:\n    - `turbo` (default for tokenless)\n    - `pro-auto` (default for authenticated)\n    - `sonar`\n    - `gpt-5.4`\n    - `claude-4.6-sonnet`\n    - `nemotron-3-super`\n- `PERPLEXITY_REASON_MODEL` (optional, requires tokens): Model for `perplexity_reason`.\n  Valid values:\n    - `gemini-3.1-pro` (default)\n    - `gpt-5.4-thinking`\n    - `claude-4.6-sonnet-thinking`\n\n### Claude Code\n\n```bash\nclaude mcp add perplexity --env PERPLEXITY_SESSION_TOKEN=\"your-session-token\" --env PERPLEXITY_CSRF_TOKEN=\"your-csrf-token\" -- npx -y perplexity-web-api-mcp\n```\n\n### Cursor, Claude Desktop \u0026 Windsurf\n\nI recommend using the one-click install badge at the top of this README for Cursor.\n\nFor manual setup, all these clients use the same `mcpServers` format:\n\n| Client | Config File |\n|--------|-------------|\n| Cursor | `~/.cursor/mcp.json` |\n| Claude Desktop | `claude_desktop_config.json` |\n| Windsurf | `~/.codeium/windsurf/mcp_config.json` |\n\n```json\n{\n  \"mcpServers\": {\n    \"perplexity\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"perplexity-web-api-mcp\"],\n      \"env\": {\n        \"PERPLEXITY_SESSION_TOKEN\": \"your-session-token\",\n        \"PERPLEXITY_CSRF_TOKEN\": \"your-csrf-token\"\n      }\n    }\n  }\n}\n```\n\n### Zed\n\nAdd following following to `context_servers` in your [settings file](https://zed.dev/docs/configuring-zed.html#settings-files):\n\n```json\n{\n  \"context_servers\": {\n    \"perplexity\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"perplexity-web-api-mcp\"],\n      \"env\": {\n        \"PERPLEXITY_SESSION_TOKEN\": \"your-session-token\",\n        \"PERPLEXITY_CSRF_TOKEN\": \"your-csrf-token\"\n      }\n    }\n  }\n}\n```\n\n### VS Code\n\nI 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`:\n\n```json\n{\n  \"servers\": {\n    \"perplexity\": {\n      \"type\": \"stdio\",\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"perplexity-web-api-mcp\"],\n      \"env\": {\n        \"PERPLEXITY_SESSION_TOKEN\": \"your-session-token\",\n        \"PERPLEXITY_CSRF_TOKEN\": \"your-csrf-token\"\n      }\n    }\n  }\n}\n```\n\n### Codex\n\n```bash\ncodex mcp add perplexity --env PERPLEXITY_SESSION_TOKEN=\"your-session-token\" --env PERPLEXITY_CSRF_TOKEN=\"your-csrf-token\" -- npx -y perplexity-web-api-mcp\n```\n\n### Other MCP Clients\n\nMost 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.\n\n## Docker\n\nA pre-built multi-arch image (`linux/amd64`, `linux/arm64`) is available on Docker Hub:\n\n```bash\ndocker run -d \\\n  -p 8080:8080 \\\n  -e PERPLEXITY_SESSION_TOKEN=\"your-session-token\" \\\n  -e PERPLEXITY_CSRF_TOKEN=\"your-csrf-token\" \\\n  mishamyrt/perplexity-web-api-mcp\n```\n\nThe container exposes the MCP server via Streamable HTTP at `http://localhost:8080/mcp`.\n\nConfigure your MCP client to connect:\n\n```json\n{\n  \"mcpServers\": {\n    \"perplexity\": {\n      \"url\": \"http://localhost:8080/mcp\"\n    }\n  }\n}\n```\n\n### Environment Variables (Docker-specific)\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `MCP_TRANSPORT` | `streamable-http` | Transport mode. `stdio` or `streamable-http` |\n| `MCP_HOST` | `0.0.0.0` | Host address to bind |\n| `MCP_PORT` | `8080` | Port to listen on |\n\nThe [authentication tokens and model variables](#configuration) described above work the same way in Docker.\n\n## Available Tools\n\n### `perplexity_search`\n\nQuick web search using the `turbo` model. Returns only links, titles, and snippets — no generated answer.\n\n**Best for:** Finding relevant URLs and sources quickly.\n\n**Parameters:**\n\n- `query` (required): The search query or question\n- `sources` (optional): Array of sources — `\"web\"`, `\"scholar\"`, `\"social\"`. Defaults to `[\"web\"]`\n- `language` (optional): Language code, e.g., `\"en-US\"`. Defaults to `\"en-US\"`\n\n\u003e File attachments are not supported by this tool.\n\n### `perplexity_ask`\n\nAsk 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`.\n\n**Best for:** Getting detailed answers to questions with web context.\n\n**Parameters:** Same as `perplexity_search`, plus:\n\n- `files` (optional, requires tokens): Array of file attachments for document analysis. See [File Attachments](#file-attachments).\n\n### `perplexity_reason`\n\nAdvanced reasoning and problem-solving. By default uses Perplexity's `sonar-reasoning` model, but can be configured via `PERPLEXITY_REASON_MODEL`.\n\n**Best for:** Logical problems, complex analysis, decision-making, and tasks requiring step-by-step reasoning.\n\n**Parameters:** Same as `perplexity_ask`.\n\n### `perplexity_research`\n\nDeep, comprehensive research using Perplexity's sonar-deep-research (`pplx_alpha`) model.\n\n**Best for:** Complex topics requiring detailed investigation, comprehensive reports, and in-depth analysis. Provides thorough analysis with citations.\n\n**Parameters:** Same as `perplexity_ask`.\n\n## File Attachments\n\n`perplexity_ask`, `perplexity_research`, and `perplexity_reason` accept an optional `files` parameter for document analysis. **Requires authentication tokens.**\n\nEach entry in the `files` array must have:\n\n- `filename` (required): Filename with extension, e.g. `\"report.pdf\"` or `\"notes.txt\"`\n- `text` (mutually exclusive with `data`): Plain-text file content. Use for `.txt`, `.md`, `.csv`, `.json`, source code, etc.\n- `data` (mutually exclusive with `text`): Base64-encoded binary content. Use for `.pdf`, `.docx`, images, etc.\n\n**Example — plain text:**\n\n```json\n{\n  \"query\": \"Summarise the key points\",\n  \"files\": [\n    {\n      \"filename\": \"notes.txt\",\n      \"text\": \"Meeting notes: Q1 revenue up 12%...\"\n    }\n  ]\n}\n```\n\n**Example — binary file (PDF):**\n\n```json\n{\n  \"query\": \"What does this contract say about termination?\",\n  \"files\": [\n    {\n      \"filename\": \"contract.pdf\",\n      \"data\": \"JVBERi0xLjQK...\"\n    }\n  ]\n}\n```\n\nMultiple files can be passed in a single request — they are uploaded to Perplexity's storage in parallel before the query is sent.\n\n## Response Format\n\n`perplexity_search` returns only web results:\n\n```json\n{\n  \"web_results\": [\n    {\n      \"name\": \"Source name\",\n      \"url\": \"https://example.com\",\n      \"snippet\": \"Source snippet\"\n    }\n  ]\n}\n```\n\n`perplexity_ask`, `perplexity_research`, and `perplexity_reason` return a full response:\n\n```json\n{\n  \"answer\": \"The generated answer text...\",\n  \"web_results\": [\n    {\n      \"name\": \"Source name\",\n      \"url\": \"https://example.com\",\n      \"snippet\": \"Source snippet\"\n    }\n  ],\n  \"follow_up\": {\n    \"backend_uuid\": \"uuid-for-follow-up-queries\",\n    \"attachments\": []\n  }\n}\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmishamyrt%2Fperplexity-web-api-mcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmishamyrt%2Fperplexity-web-api-mcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmishamyrt%2Fperplexity-web-api-mcp/lists"}