@perplexity-ai/mcp-server 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,14 +6,14 @@
6
6
  },
7
7
  "metadata": {
8
8
  "description": "Official Perplexity AI plugin providing real-time web search, reasoning, and research capabilities",
9
- "version": "1.2.0"
9
+ "version": "1.2.1"
10
10
  },
11
11
  "plugins": [
12
12
  {
13
13
  "name": "perplexity",
14
14
  "source": "./",
15
15
  "description": "Real-time web search, reasoning, and research through Perplexity's API",
16
- "version": "1.2.0",
16
+ "version": "1.2.1",
17
17
  "author": {
18
18
  "name": "Perplexity AI",
19
19
  "email": "api@perplexity.ai"
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Perplexity API Platform MCP Server
2
2
 
3
- [![Install in Cursor](https://custom-icon-badges.demolab.com/badge/Install_in_Cursor-000000?style=for-the-badge&logo=cursor-ai-white)](https://cursor.com/en/install-mcp?name=perplexity&config=eyJ0eXBlIjoic3RkaW8iLCJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBwZXJwbGV4aXR5LWFpL21jcC1zZXJ2ZXIiXSwiZW52Ijp7IlBFUlBMRVhJVFlfQVBJX0tFWSI6IiJ9fQ==)
3
+ [![Install in Cursor](https://custom-icon-badges.demolab.com/badge/Install_in_Cursor-000000?style=for-the-badge&logo=cursor-ai-white)](https://cursor.com/install-mcp?name=perplexity&config=eyJ1cmwiOiJodHRwczovL2FwaS5wZXJwbGV4aXR5LmFpL21jcCIsImhlYWRlcnMiOnsiQXV0aG9yaXphdGlvbiI6IkJlYXJlciBZT1VSX0FQSV9LRVkifX0%3D)
4
4
   
5
- [![Install in VS Code](https://custom-icon-badges.demolab.com/badge/Install_in_VS_Code-007ACC?style=for-the-badge&logo=vsc&logoColor=white)](https://vscode.dev/redirect/mcp/install?name=perplexity&config=%7B%22type%22%3A%22stdio%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40perplexity-ai%2Fmcp-server%22%5D%2C%22env%22%3A%7B%22PERPLEXITY_API_KEY%22%3A%22%22%7D%7D)
5
+ [![Install in VS Code](https://custom-icon-badges.demolab.com/badge/Install_in_VS_Code-007ACC?style=for-the-badge&logo=vsc&logoColor=white)](https://vscode.dev/redirect/mcp/install?name=perplexity&config=%7B%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fapi.perplexity.ai%2Fmcp%22%2C%22headers%22%3A%7B%22Authorization%22%3A%22Bearer%20%24%7Binput%3Aperplexity-api-key%7D%22%7D%7D&inputs=%5B%7B%22type%22%3A%22promptString%22%2C%22id%22%3A%22perplexity-api-key%22%2C%22description%22%3A%22Perplexity%20API%20Key%22%2C%22password%22%3Atrue%7D%5D)
6
6
   
7
7
  [![Add to Kiro](https://img.shields.io/badge/Add_to_Kiro-9046FF?style=for-the-badge&logo=data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkxIiBoZWlnaHQ9IjIyNi44MTQiIHZpZXdCb3g9IjAgMCAxOTEgMjI2LjgxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMzUuNjA5IDE3My4xNjVjLTIzLjExMSA1MS4yMzUgMjYuMTA2IDY0LjA2OCA2Mi4zOTYgMzQuMTA2IDEwLjY2IDMzLjYwNSA1MC42OTggOC41MzQgNjUuMDU5LTE3LjUxMSAzMS42MzQtNTcuMzgzIDE4Ljg2Mi0xMTUuOTM3IDE1LjU3OS0xMjguMDE3LTIyLjUwMi04Mi4zNTctMTM0LjkyOS04Mi40MjktMTU0LjI4MS40MTgtNC41MjMgMTQuNTA1LTQuNTk1IDMxLjAwMy03LjE2MSA0OC4xMzItMS4yOSA4LjYzMS0yLjE5OCAxNC4xNDUtNS41MzkgMjMuMjMtMS45MjEgNS4yMTgtNC41NTkgOS44NDktOC43MTQgMTcuNjY2LTguMjEzIDEyLjU0NS4xNTUgMzguMiAzMi42NSAyMi4wMDF6IiBmaWxsPSIjZmZmIi8+PHBhdGggZD0iTTEwMi42MDMgOTYuODk4Yy05LjIyOSAwLTEwLjYxMy0xMS4wMzEtMTAuNjEzLTE3LjU5NyAwLTUuOTMyIDEuMDc0LTEwLjY0OSAzLjA2Ny0xMy42NDRhOC41OCA4LjU4IDAgMCAxIDcuNTIxLTMuOTY0YzMuMjM2IDAgNi4wMDQgMS4zNjIgNy45NjEgNC4wMzYgMi4yMDkgMy4wNDUgMy4zOTEgNy43NTkgMy4zOTEgMTMuNTg2IDAgMTEuMDE3LTQuMjM4IDE3LjU5Ny0xMS4zNDEgMTcuNTk3em0zNy45NDggMGMtOS4yNCAwLTEwLjYyNC0xMS4wMzEtMTAuNjI0LTE3LjU5NyAwLTUuOTMyIDEuMDc0LTEwLjY0OSAzLjA4MS0xMy42NDRhOC41OCA4LjU4IDAgMCAxIDcuNTIxLTMuOTY0IDkuNTEgOS41MSAwIDAgMSA3Ljk1IDQuMDM2YzIuMjIgMy4wNDUgMy40MDIgNy43NTkgMy40MDIgMTMuNTg2IDAgMTEuMDE3LTQuMjM4IDE3LjU5Ny0xMS4zNDEgMTcuNTk3eiIgZmlsbD0iIzAwMCIvPlw8L3N2Zz4=&logoColor=white)](https://kiro.dev/launch/mcp/add?name=perplexity&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40perplexity-ai%2Fmcp-server%22%5D%2C%22env%22%3A%7B%22PERPLEXITY_API_KEY%22%3A%22your_key_here%22%7D%7D)
8
8
   
@@ -10,28 +10,27 @@
10
10
 
11
11
  The official MCP server implementation for the Perplexity API Platform, providing AI assistants with real-time web search, reasoning, and research capabilities through the [Agent API](https://docs.perplexity.ai/docs/agent-api/quickstart) and the Search API.
12
12
 
13
- ## Available Tools
13
+ ## Remote MCP Server
14
14
 
15
- ### **perplexity_search**
16
- Direct web search using the Perplexity Search API. Returns ranked search results with metadata, perfect for finding current information. Supports recency filters (`search_recency_filter`) and domain restrictions (`search_domain_filter`).
15
+ The remote MCP server is hosted by Perplexity and is the easiest way to get started: same tools, nothing to install or update. The Cursor and VS Code buttons at the top of this page connect to it with one click. If your MCP client does not support remote servers yet, skip to the [local server](#local-mcp-server) setup below. Connect over Streamable HTTP with your [Perplexity API key](https://console.perplexity.ai):
17
16
 
18
- ### **perplexity_ask**
19
- General-purpose conversational AI with real-time web search, backed by the Agent API `fast` preset. Great for quick questions and everyday searches.
17
+ ```
18
+ https://api.perplexity.ai/mcp
19
+ ```
20
20
 
21
- ### **perplexity_research**
22
- Deep, comprehensive research backed by the Agent API `high` preset. Ideal for thorough analysis and detailed reports. Runs can take minutes; the server streams the run and reports progress to clients that request it.
21
+ For Claude Code:
23
22
 
24
- ### **perplexity_reason**
25
- Advanced reasoning and problem-solving backed by the Agent API `medium` preset. Perfect for complex analytical tasks.
23
+ ```bash
24
+ claude mcp add --transport http perplexity https://api.perplexity.ai/mcp --header "Authorization: Bearer YOUR_API_KEY"
25
+ ```
26
26
 
27
- > [!NOTE]
28
- > Presets are managed configurations (model, search setup, step budget) that Perplexity keeps tuned over time; see the [presets guide](https://docs.perplexity.ai/docs/agent-api/presets). Earlier versions of this server called the legacy `sonar-pro`, `sonar-reasoning-pro`, and `sonar-deep-research` models and accepted `strip_thinking` / `reasoning_effort` parameters. Those parameters are no longer part of the tool schemas and are ignored if sent; the Agent API produces no `<think>` tags.
27
+ See the [MCP integration docs](https://docs.perplexity.ai/docs/getting-started/integrations/mcp-server) for manual Cursor/VS Code configuration, usage from the Anthropic API, and setup for other clients.
29
28
 
30
- ## Configuration
29
+ ## Local MCP Server
31
30
 
32
31
  ### Get Your API Key
33
32
 
34
- 1. Get your Perplexity API Key from the [API Portal](https://www.perplexity.ai/account/api/group)
33
+ 1. Get your Perplexity API Key from the [API Portal](https://console.perplexity.ai)
35
34
  2. Replace `your_key_here` in the configurations below with your API key
36
35
  3. (Optional) Set timeout: `PERPLEXITY_TIMEOUT_MS=600000` (default: 5 minutes)
37
36
  4. (Optional) Set custom base URL: `PERPLEXITY_BASE_URL=https://your-custom-url.com` (default: https://api.perplexity.ai)
@@ -57,7 +56,11 @@ claude
57
56
  codex mcp add perplexity --env PERPLEXITY_API_KEY="your_key_here" -- npx -y @perplexity-ai/mcp-server
58
57
  ```
59
58
 
60
- ### Cursor, Claude Desktop, Kiro, Windsurf, and VS Code
59
+ ### Agent Plugins
60
+
61
+ This repository is packaged as an [Agent Plugin](https://agent-plugins.org), so clients that support the standard can install it directly from this repository. The Agent Plugins format does not carry secrets, so set the `PERPLEXITY_API_KEY` environment variable through your client's plugin or MCP settings.
62
+
63
+ ### Other MCP Clients
61
64
 
62
65
  Most clients can be configured manually using the same `mcpServers` wrapper in their client config (as shown for Cursor). If a client has a different schema, check its docs for the exact wrapper format.
63
66
 
@@ -116,7 +119,7 @@ If you'd rather use the standard variables, we support `HTTPS_PROXY` and `HTTP_P
116
119
  > The server checks proxy settings in this order: `PERPLEXITY_PROXY` → `HTTPS_PROXY` → `HTTP_PROXY`. If none are set, it connects directly to the internet.
117
120
  > URLs must include `https://`. Typical ports are `8080`, `3128`, and `80`.
118
121
 
119
- ### HTTP Server Deployment
122
+ ### Self-Hosted HTTP Mode
120
123
 
121
124
  For cloud or shared deployments, run the server in HTTP mode.
122
125
 
@@ -147,6 +150,23 @@ npm install && npm run build && npm run start:http
147
150
 
148
151
  The server will be accessible at `http://localhost:8080/mcp`
149
152
 
153
+ ## Available Tools
154
+
155
+ ### **perplexity_search**
156
+ Direct web search using the Perplexity Search API. Returns ranked search results with metadata, perfect for finding current information. Supports recency filters (`search_recency_filter`) and domain restrictions (`search_domain_filter`).
157
+
158
+ ### **perplexity_ask**
159
+ General-purpose conversational AI with real-time web search, backed by the Agent API `fast` preset. Great for quick questions and everyday searches.
160
+
161
+ ### **perplexity_research**
162
+ Deep, comprehensive research backed by the Agent API `high` preset. Ideal for thorough analysis and detailed reports. Runs can take minutes; the server streams the run and reports progress to clients that request it.
163
+
164
+ ### **perplexity_reason**
165
+ Advanced reasoning and problem-solving backed by the Agent API `medium` preset. Perfect for complex analytical tasks.
166
+
167
+ > [!NOTE]
168
+ > Presets are managed configurations (model, search setup, step budget) that Perplexity keeps tuned over time; see the [presets guide](https://docs.perplexity.ai/docs/agent-api/presets). Earlier versions of this server called the legacy `sonar-pro`, `sonar-reasoning-pro`, and `sonar-deep-research` models and accepted `strip_thinking` / `reasoning_effort` parameters. Those parameters are no longer part of the tool schemas and are ignored if sent; the Agent API produces no `<think>` tags.
169
+
150
170
  ## Use as a Library
151
171
 
152
172
  The package also exports the server factory for embedding in your own Node process:
package/dist/server.js CHANGED
@@ -4,7 +4,7 @@ import { fetch as undiciFetch, ProxyAgent } from "undici";
4
4
  import { AgentResponseSchema, SearchResponseSchema } from "./validation.js";
5
5
  const PERPLEXITY_API_KEY = process.env.PERPLEXITY_API_KEY;
6
6
  const PERPLEXITY_BASE_URL = process.env.PERPLEXITY_BASE_URL || "https://api.perplexity.ai";
7
- const VERSION = "1.2.0";
7
+ const VERSION = "1.2.1";
8
8
  // Agent API presets backing each tool: https://docs.perplexity.ai/docs/agent-api/presets
9
9
  export const ASK_PRESET = "fast";
10
10
  export const REASON_PRESET = "medium";
@@ -82,6 +82,7 @@ async function makeApiRequest(endpoint, body, serviceOrigin, signal, apiKey) {
82
82
  "Authorization": `Bearer ${resolvedApiKey}`,
83
83
  "User-Agent": `perplexity-mcp/${VERSION}`,
84
84
  "X-Source": "pplx-mcp-server",
85
+ "X-Pplx-Integration": `perplexity-mcp/${VERSION}`,
85
86
  };
86
87
  if (serviceOrigin) {
87
88
  headers["X-Service"] = serviceOrigin;
@@ -621,5 +622,31 @@ export function createPerplexityServer(serviceOrigin, serverOptions) {
621
622
  structuredContent: { results: result },
622
623
  };
623
624
  });
625
+ advertiseJsonSchema202012(server.server);
624
626
  return server.server;
625
627
  }
628
+ // The MCP TypeScript SDK stamps draft-07 on tools/list schemas
629
+ // (modelcontextprotocol/typescript-sdk#2084); 2020-12-only clients reject
630
+ // them. The schemas are valid under both dialects, so only the declared
631
+ // dialect needs rewriting. Remove once typescript-sdk#2085 ships.
632
+ const JSON_SCHEMA_2020_12 = "https://json-schema.org/draft/2020-12/schema";
633
+ function advertiseJsonSchema202012(server) {
634
+ // _requestHandlers is private SDK state; goes away with this shim.
635
+ const handlers = server._requestHandlers;
636
+ const listTools = handlers.get("tools/list");
637
+ if (!listTools) {
638
+ return;
639
+ }
640
+ handlers.set("tools/list", async (request, extra) => {
641
+ const result = await listTools(request, extra);
642
+ for (const tool of result.tools ?? []) {
643
+ if (tool.inputSchema?.$schema) {
644
+ tool.inputSchema.$schema = JSON_SCHEMA_2020_12;
645
+ }
646
+ if (tool.outputSchema?.$schema) {
647
+ tool.outputSchema.$schema = JSON_SCHEMA_2020_12;
648
+ }
649
+ }
650
+ return result;
651
+ });
652
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perplexity-ai/mcp-server",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "mcpName": "ai.perplexity/mcp-server",
5
5
  "description": "Real-time web search, reasoning, and research through Perplexity's API",
6
6
  "keywords": [