Perplexity AI MCP Server for Vercel AI SDK 14 tools — connect in under 2 minutes
The Vercel AI SDK is the TypeScript toolkit for building AI-powered applications. Connect Perplexity AI through Vinkius and every tool is available as a typed function. ready for React Server Components, API routes, or any Node.js backend.
ASK AI ABOUT THIS MCP SERVER
Vinkius supports streamable HTTP and SSE.
import { createMCPClient } from "@ai-sdk/mcp";
import { generateText } from "ai";
import { openai } from "@ai-sdk/openai";
async function main() {
const mcpClient = await createMCPClient({
transport: {
type: "http",
// Your Vinkius token. get it at cloud.vinkius.com
url: "https://edge.vinkius.com/[YOUR_TOKEN_HERE]/mcp",
},
});
try {
const tools = await mcpClient.tools();
const { text } = await generateText({
model: openai("gpt-4o"),
tools,
prompt: "Using Perplexity AI, list all available capabilities.",
});
console.log(text);
} finally {
await mcpClient.close();
}
}
main();
* Every MCP server runs on Vinkius-managed infrastructure inside AWS - a purpose-built runtime with per-request V8 isolates, Ed25519 signed audit chains, and sub-40ms cold starts optimized for native MCP execution. See our infrastructure
About Perplexity AI MCP Server
Connect your Perplexity AI API key to any AI agent and harness the power of real-time web search with AI-generated answers, citations, and related questions through natural conversation.
The Vercel AI SDK gives every Perplexity AI tool full TypeScript type inference, IDE autocomplete, and compile-time error checking. Connect 14 tools through Vinkius and stream results progressively to React, Svelte, or Vue components. works on Edge Functions, Cloudflare Workers, and any Node.js runtime.
What you can do
- Answer Questions — Ask any question and get grounded answers with real-time web search and source citations
- Deep Research — Perform exhaustive research on complex topics with comprehensive reports and thorough citations
- Logical Reasoning — Solve complex problems requiring step-by-step analysis and chain-of-thought reasoning
- Domain-Filtered Search — Restrict search results to specific domains for academic, technical, or trusted-source queries
- Recency Filtering — Get answers based on recent information only (hour, day, week, month, or year)
- Multi-Turn Conversations — Maintain context across multiple questions for iterative research sessions
- Structured Output — Get responses in JSON format following a defined schema for programmatic integration
- Visual Results — Include relevant images and related questions in search results
The Perplexity AI MCP Server exposes 14 tools through the Vinkius. Connect it to Vercel AI SDK in under two minutes — no API keys to rotate, no infrastructure to provision, no vendor lock-in. Your configuration, your data, your control.
How to Connect Perplexity AI to Vercel AI SDK via MCP
Follow these steps to integrate the Perplexity AI MCP Server with Vercel AI SDK.
Install dependencies
Run npm install @ai-sdk/mcp ai @ai-sdk/openai
Replace the token
Replace [YOUR_TOKEN_HERE] with your Vinkius token
Run the script
Save to agent.ts and run with npx tsx agent.ts
Explore tools
The SDK discovers 14 tools from Perplexity AI and passes them to the LLM
Why Use Vercel AI SDK with the Perplexity AI MCP Server
Vercel AI SDK provides unique advantages when paired with Perplexity AI through the Model Context Protocol.
TypeScript-first: every MCP tool gets full type inference, IDE autocomplete, and compile-time error checking out of the box
Framework-agnostic core works with Next.js, Nuxt, SvelteKit, or any Node.js runtime. same Perplexity AI integration everywhere
Built-in streaming UI primitives let you display Perplexity AI tool results progressively in React, Svelte, or Vue components
Edge-compatible: the AI SDK runs on Vercel Edge Functions, Cloudflare Workers, and other edge runtimes for minimal latency
Perplexity AI + Vercel AI SDK Use Cases
Practical scenarios where Vercel AI SDK combined with the Perplexity AI MCP Server delivers measurable value.
AI-powered web apps: build dashboards that query Perplexity AI in real-time and stream results to the UI with zero loading states
API backends: create serverless endpoints that orchestrate Perplexity AI tools and return structured JSON responses to any frontend
Chatbots with tool use: embed Perplexity AI capabilities into conversational interfaces with streaming responses and tool call visibility
Internal tools: build admin panels where team members interact with Perplexity AI through natural language queries
Perplexity AI MCP Tools for Vercel AI SDK (14)
These 14 tools become available when you connect Perplexity AI to Vercel AI SDK via MCP:
chat_completion
The Sonar model searches the web, synthesizes information, and provides a concise answer. This is the basic query tool for factual questions, summaries, and general knowledge. Use this for quick lookups where you need accurate, up-to-date information. Ask Perplexity AI a question and get a grounded, cited answer
chat_with_citations
Each claim or fact in the response is linked to its original source. This is essential for research, fact-checking, and academic work where sources matter. The response includes a citations array with URLs of all referenced sources. Ask Perplexity AI and get answers with source citations
chat_with_domain_filter
Provide domains as a comma-separated list (e.g., "arxiv.org,nih.gov,github.com"). Only sources from the specified domains will be used in generating the answer. Use this for domain-specific research, academic papers, or trusted sources only. Citations are automatically included to verify sources. Ask Perplexity AI restricting search to specific domains
chat_with_history
Provide messages as a JSON array of {role: "user"|"assistant"|"system", content: "text"} objects. This enables follow-up questions where the model understands previous context. Use this for complex queries that build on previous answers or require contextual understanding. Example: [{ "role": "user", "content": "What is quantum computing?" }, { "role": "assistant", "content": "Quantum computing uses quantum bits..." }, { "role": "user", "content": "How does it differ from classical computing?" }] Ask Perplexity AI with multi-turn conversation history
chat_with_images
The response includes an images array with URLs to related images found during the search. Use this for visual topics, product searches, or when you need images to accompany the answer. Ask Perplexity AI and get relevant images with the answer
chat_with_recency_filter
Available recency filters: "hour", "day", "week", "month", "year". This ensures the answer is based on recent information only. Use this for news, recent events, or time-sensitive queries where outdated info is not useful. Ask Perplexity AI with results filtered by time recency
chat_with_related_questions
The response includes a related_questions array with suggested questions for further exploration. Use this for research, learning, and discovering related topics you might want to explore. Ask Perplexity AI and get related follow-up questions
deep_research
This model performs extensive web searches and generates detailed reports with thorough citations. It takes longer than regular queries but provides much more depth and breadth. Use this for complex topics, literature reviews, competitive analysis, or thorough investigations. Maximum tokens default to 4096 for comprehensive responses. Perform deep research with exhaustive web search and comprehensive report
follow_up
Provide the conversation history as a JSON array of messages and the follow-up question. This maintains context from previous turns in the conversation. Use this for multi-turn research sessions where each question builds on previous answers. Ask a follow-up question in an ongoing conversation with Perplexity AI
list_models
Use this to discover what models are available before choosing which one to use for your queries. List all available Perplexity AI models
reasoning
This model excels at multi-step reasoning, mathematical problems, code analysis, and chain-of-thought tasks. Use this for problems requiring step-by-step analysis, mathematical proofs, code reviews, or logical deductions. Citations are included where external information is referenced. Ask Perplexity AI for complex logical reasoning and step-by-step analysis
search_query
This combines all search features: cited sources, relevant images, and follow-up questions. Use this when you want the fullest possible search result with all supplementary information. The response includes content, citations array, images array, and related_questions array. Perform a comprehensive web search with citations, images, and related questions
structured_query
The model will return the answer as JSON matching your schema definition. Provide the JSON schema as a string. This is useful for programmatic data extraction, API integrations, and when you need consistent, parseable responses. Example schema: { "type": "object", "properties": { "name": { "type": "string" }, "age": { "type": "number" } } } Ask Perplexity AI and get a structured JSON response following a schema
system_prompt_query
The system prompt defines how the model should respond (e.g., "You are a medical expert...", "Answer in bullet points..."). Use this for specialized queries, role-playing, formatting requirements, or domain-specific expertise. Example system prompt: "You are a senior software architect. Explain concepts with code examples." Ask Perplexity AI with a custom system prompt to set behavior and context
Example Prompts for Perplexity AI in Vercel AI SDK
Ready-to-use prompts you can give your Vercel AI SDK agent to start working with Perplexity AI immediately.
"What are the latest developments in quantum computing as of this week?"
"Do deep research on the competitive landscape of electric vehicle manufacturers in Southeast Asia, including market share, pricing strategies, and government incentives."
"Search for news about AI regulation in the European Union from the last month, restricted to europa.eu and reuters.com domains."
Troubleshooting Perplexity AI MCP Server with Vercel AI SDK
Common issues when connecting Perplexity AI to Vercel AI SDK through the Vinkius, and how to resolve them.
createMCPClient is not a function
npm install @ai-sdk/mcpPerplexity AI + Vercel AI SDK FAQ
Common questions about integrating Perplexity AI MCP Server with Vercel AI SDK.
How does the Vercel AI SDK connect to MCP servers?
createMCPClient from @ai-sdk/mcp and pass the server URL. The SDK discovers all tools and provides typed TypeScript interfaces for each one.Can I use MCP tools in Edge Functions?
Does it support streaming tool results?
useChat and streamText that handle tool calls and display results progressively in the UI.Connect Perplexity AI with your favorite client
Step-by-step setup guides for every MCP-compatible client and framework:
Anthropic's native desktop app for Claude with built-in MCP support.
AI-first code editor with integrated LLM-powered coding assistance.
GitHub Copilot in VS Code with Agent mode and MCP support.
Purpose-built IDE for agentic AI coding workflows.
Autonomous AI coding agent that runs inside VS Code.
Anthropic's agentic CLI for terminal-first development.
Python SDK for building production-grade OpenAI agent workflows.
Google's framework for building production AI agents.
Type-safe agent development for Python with first-class MCP support.
TypeScript toolkit for building AI-powered web applications.
TypeScript-native agent framework for modern web stacks.
Python framework for orchestrating collaborative AI agent crews.
Leading Python framework for composable LLM applications.
Data-aware AI agent framework for structured and unstructured sources.
Microsoft's framework for multi-agent collaborative conversations.
Connect Perplexity AI to Vercel AI SDK
Get your token, paste the configuration, and start using 14 tools in under 2 minutes. No API key management needed.
