UNPKG

perplexity-mcp-server

Version:

A Perplexity API Model Context Protocol (MCP) server that unlocks Perplexity's search-augmented AI capabilities for LLM agents. Features robust error handling, secure input validation, and transparent reasoning with the showThinking parameter. Built with

26 lines (25 loc) 592 B
// Type definitions for the MCP (Message Control Protocol) protocol // Helper functions export const createToolResponse = (text, isError) => ({ content: [{ type: "text", text }], isError }); export const createResourceResponse = (uri, text, mimeType) => ({ contents: [{ uri, text, mimeType }] }); export const createPromptResponse = (text, role = "assistant") => ({ messages: [{ role, content: { type: "text", text } }] });