@perplexity-ai/mcp-server 1.2.1 → 1.3.0

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.1"
9
+ "version": "1.3.0"
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.1",
16
+ "version": "1.3.0",
17
17
  "author": {
18
18
  "name": "Perplexity AI",
19
19
  "email": "api@perplexity.ai"
package/README.md CHANGED
@@ -153,7 +153,7 @@ The server will be accessible at `http://localhost:8080/mcp`
153
153
  ## Available Tools
154
154
 
155
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`).
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`), domain restrictions (`search_domain_filter`), and [Fast Search](https://docs.perplexity.ai/docs/search/fast-search) (`search_type: "fast"`) for lower latency and cost.
157
157
 
158
158
  ### **perplexity_ask**
159
159
  General-purpose conversational AI with real-time web search, backed by the Agent API `fast` preset. Great for quick questions and everyday searches.
package/dist/server.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Message, AgentResponse, AgentToolOptions, AgentCallHooks, ApiKeyProvider, PerplexityServerOptions, SearchResponse } from "./types.js";
1
+ import type { Message, AgentResponse, AgentToolOptions, AgentCallHooks, ApiKeyProvider, PerplexityServerOptions, SearchOptions, SearchResponse } from "./types.js";
2
2
  export type { ApiKeyProvider, PerplexityServerOptions } from "./types.js";
3
3
  export declare const ASK_PRESET = "fast";
4
4
  export declare const REASON_PRESET = "medium";
@@ -25,7 +25,7 @@ export declare function extractAgentText(response: AgentResponse): string;
25
25
  export declare function formatAgentResponseText(response: AgentResponse): string;
26
26
  export declare function performAgentResponse(messages: Message[], preset: string, serviceOrigin?: string, options?: AgentToolOptions, hooks?: AgentCallHooks, apiKey?: ApiKeyProvider): Promise<string>;
27
27
  export declare function formatSearchResults(data: SearchResponse): string;
28
- export declare function performSearch(query: string, maxResults?: number, maxTokensPerPage?: number, country?: string, filters?: Pick<AgentToolOptions, "search_recency_filter" | "search_domain_filter">, serviceOrigin?: string, apiKey?: ApiKeyProvider): Promise<string>;
28
+ export declare function performSearch(query: string, maxResults?: number, maxTokensPerPage?: number, country?: string, filters?: SearchOptions, serviceOrigin?: string, apiKey?: ApiKeyProvider): Promise<string>;
29
29
  export declare function createPerplexityServer(serviceOrigin?: string, serverOptions?: PerplexityServerOptions): import("@modelcontextprotocol/sdk/server/index.js").Server<{
30
30
  method: string;
31
31
  params?: {
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.1";
7
+ const VERSION = "1.3.0";
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";
@@ -425,6 +425,7 @@ export async function performSearch(query, maxResults = 10, maxTokensPerPage = 1
425
425
  ...(country && { country }),
426
426
  ...(filters?.search_recency_filter && { search_recency_filter: filters.search_recency_filter }),
427
427
  ...(filters?.search_domain_filter && { search_domain_filter: filters.search_domain_filter }),
428
+ ...(filters?.search_type && { search_type: filters.search_type }),
428
429
  };
429
430
  const response = await makeApiRequest("search", body, serviceOrigin, undefined, apiKey);
430
431
  let data;
@@ -463,7 +464,7 @@ export function createPerplexityServer(serviceOrigin, serverOptions) {
463
464
  version: VERSION,
464
465
  }, {
465
466
  instructions: "Perplexity AI server for web-grounded search, research, and reasoning, backed by the Perplexity Agent API. " +
466
- "Use perplexity_search for finding URLs, facts, and recent news. Supports recency filters and domain restrictions. " +
467
+ "Use perplexity_search for finding URLs, facts, and recent news. Supports recency filters, domain restrictions, and fast search. " +
467
468
  "Use perplexity_ask for quick AI-answered questions with citations. Supports recency filters, domain restrictions, and search context size control. " +
468
469
  "Use perplexity_research for in-depth multi-source investigation (slow, can take minutes). " +
469
470
  "Use perplexity_reason for complex analysis requiring step-by-step logic. Supports recency filters, domain restrictions, and search context size control. " +
@@ -588,6 +589,8 @@ export function createPerplexityServer(serviceOrigin, serverOptions) {
588
589
  .describe("ISO 3166-1 alpha-2 country code for regional results (e.g., 'US', 'GB')"),
589
590
  search_recency_filter: searchRecencyFilterField,
590
591
  search_domain_filter: searchDomainFilterField,
592
+ search_type: z.enum(["web", "fast"]).optional()
593
+ .describe("Search backend. 'web' (default) is the standard web search. 'fast' is lower latency and lower cost; prefer it for routine lookups inside agent loops, and keep 'web' for rare or ambiguous questions."),
591
594
  };
592
595
  const searchOutputSchema = {
593
596
  results: z.string().describe("Formatted search results, each with title, URL, snippet, and date"),
@@ -597,7 +600,7 @@ export function createPerplexityServer(serviceOrigin, serverOptions) {
597
600
  description: "Search the web and return a ranked list of results with titles, URLs, snippets, and dates. " +
598
601
  "Best for: finding specific URLs, checking recent news, verifying facts, discovering sources. " +
599
602
  "Returns formatted results (title, URL, snippet, date) with no AI synthesis. " +
600
- "Supports recency filters and domain restrictions. " +
603
+ "Supports recency filters, domain restrictions, and a lower-latency fast search mode. " +
601
604
  "For AI-generated answers with citations, use perplexity_ask instead.",
602
605
  inputSchema: searchInputSchema,
603
606
  outputSchema: searchOutputSchema,
@@ -608,13 +611,14 @@ export function createPerplexityServer(serviceOrigin, serverOptions) {
608
611
  destructiveHint: false,
609
612
  },
610
613
  }, async (args) => {
611
- const { query, max_results, max_tokens_per_page, country, search_recency_filter, search_domain_filter } = args;
614
+ const { query, max_results, max_tokens_per_page, country, search_recency_filter, search_domain_filter, search_type } = args;
612
615
  const maxResults = typeof max_results === "number" ? max_results : 10;
613
616
  const maxTokensPerPage = typeof max_tokens_per_page === "number" ? max_tokens_per_page : 1024;
614
617
  const countryCode = typeof country === "string" ? country : undefined;
615
618
  const filters = {
616
619
  ...(search_recency_filter && { search_recency_filter }),
617
620
  ...(search_domain_filter && { search_domain_filter }),
621
+ ...(search_type && { search_type }),
618
622
  };
619
623
  const result = await performSearch(query, maxResults, maxTokensPerPage, countryCode, filters, serviceOrigin, serverOptions?.apiKey);
620
624
  return {
package/dist/types.d.ts CHANGED
@@ -73,6 +73,10 @@ export interface SearchRequestBody {
73
73
  max_tokens_per_page: number;
74
74
  country?: string;
75
75
  }
76
+ export type SearchType = "web" | "fast";
77
+ export interface SearchOptions extends Pick<AgentToolOptions, "search_recency_filter" | "search_domain_filter"> {
78
+ search_type?: SearchType;
79
+ }
76
80
  export interface AgentToolOptions {
77
81
  search_recency_filter?: "hour" | "day" | "week" | "month" | "year";
78
82
  search_domain_filter?: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perplexity-ai/mcp-server",
3
- "version": "1.2.1",
3
+ "version": "1.3.0",
4
4
  "mcpName": "ai.perplexity/mcp-server",
5
5
  "description": "Real-time web search, reasoning, and research through Perplexity's API",
6
6
  "keywords": [