# Perplexity AI MCP

> Perplexity AI connects real-time web search and citation retrieval directly to your AI agent. Ask questions, get grounded answers with verifiable sources, and run deep reports on any topic. This tool gives you source citations for every fact it pulls from the live internet.

## Overview
- **Category:** ai-frontier
- **Price:** Free
- **Tags:** web-search, research-assistant, citations, natural-language, information-retrieval

## Description

**Perplexity AI** connects real-time web search and source citation retrieval straight to your agent. You ask questions, get answers grounded in current facts, and run deep reports using verifiable sources for every claim. This server gives you citations for everything it pulls from the live internet.

When you use this server, your AI client runs specialized requests through dedicated tools. The system queries the live web, synthesizes what it finds, and returns an answer that links back to the original source URLs. You'll never have to jump between a search engine tab and your chat window again.

**Getting Quick, Cited Answers**

Use `chat_completion` for simple questions; you get an immediate answer with citations using basic query logic. If you need absolute certainty that every single fact is linked back to its original source URL, run `chat_with_citations`. For a full search result—including citations, related images, and suggested follow-up questions all at once—just use `search_query`.

**Deep Research & Analysis**

Need more than just an answer? Run `deep_research` for an exhaustive web search that generates a detailed, long-form report with thorough citation tracking. For complex logic tasks like math proofs or multi-step code reviews, use the `reasoning` tool to perform step-by-step analysis via logic chains. You can also force specialized context and role-playing by setting parameters using `system_prompt_query`, which tells the model exactly what job it's doing (like 'financial expert').

**Filtering Sources and Time Periods**

Want to trust your data source? Use `chat_with_domain_filter` to restrict search results only to a specific list of domains you provide, maybe just government sites or academic journals. If the timing matters—say, you need info on last week's market shift—run `chat_with_recency_filter`, which filters results by time period (hour, day, week, month).

**Maintaining Context and Data Integrity**

You don't have to repeat yourself. If you ask a follow-up question, the agent remembers the whole conversation history because of `follow_up` or `chat_with_history`. For visuals, run `chat_with_images`, which gets search results including relevant images and their associated URLs alongside the text answer. You can also generate suggested next steps for further research by calling `chat_with_related_questions` after you get your initial answer.

When you need the output to be programmatically usable, use `structured_query`. This forces Perplexity AI to return data that matches a precise JSON schema you define. For basic model introspection, run `list_models` to see all available models before starting your query.

**What You Get When You Use It:**

*   You get an immediate answer with citations using the basic query tool (`chat_completion`). 
*   You run extensive searches and generate full reports on complex topics, tracking every citation (`deep_research`). 
*   You restrict sources to trusted websites or academic domains (`chat_with_domain_filter`). 
*   The agent remembers previous conversation history for continuous questioning (`follow_up` / `chat_with_history`). 
*   You force the model to output data that matches a specific schema, making it ready for code ingestion (`structured_query`).
*   You analyze complex logic chains like mathematical proofs or step-by-step code analysis (`reasoning`).

## Tools

### chat_completion
Asks Perplexity AI a question and gets a grounded answer with citations using the basic query tool.

### chat_with_citations
Gets answers from Perplexity AI, ensuring every single claim or fact is linked to its original web source URL.

### chat_with_domain_filter
Restricts the search results only to sources coming from a specific list of domains you provide (e.g., government sites).

### chat_with_history
Allows Perplexity AI to maintain context when you ask follow-up questions in an ongoing conversation.

### chat_with_images
Gets a search result that includes relevant images and associated URLs along with the text answer.

### chat_with_recency_filter
Filters results by time period (hour, day, week, month) so you only get information based on recent events.

### chat_with_related_questions
Generates a list of suggested follow-up questions for further research after the initial answer is provided.

### deep_research
Runs an exhaustive web search and generates a detailed, long-form report with thorough citations.

### follow_up
Asks Perplexity AI a follow-up question while maintaining the context of previous messages in the chat history.

### list_models
Lists all available models to help you choose the right tool before running your query.

### reasoning
Performs complex tasks like step-by-step analysis, math problems, or code reviews using logic chains.

### search_query
Runs a full search result that includes citations, related images, and suggested follow-up questions at once.

### structured_query
Forces Perplexity AI to return the answer as JSON data matching a precise schema you define.

### system_prompt_query
Sets the model's behavior or role (e.g., 'You are a financial expert') for specialized context and formatting.

## Prompt Examples

**Prompt:** 
```
What are the latest developments in quantum computing as of this week?
```

**Response:** 
```
Based on recent developments this week, there are three major breakthroughs in quantum computing:

1. **IBM's 1000+ qubit processor** achieved new error correction milestones, reducing error rates by 50% compared to previous generations.
2. **Google Quantum AI** demonstrated quantum advantage in optimization problems for logistics, showing 100x speedup over classical algorithms.
3. **A team at MIT** developed a new topological qubit design that maintains coherence at higher temperatures.

📚 **Sources:** Nature.com, MIT News, IBM Research Blog

Would you like me to research any of these breakthroughs in more detail?
```

**Prompt:** 
```
Do deep research on the competitive landscape of electric vehicle manufacturers in Southeast Asia, including market share, pricing strategies, and government incentives.
```

**Response:** 
```
I've conducted comprehensive research on the EV competitive landscape in Southeast Asia. Here's the analysis:

## Market Leaders
1. **BYD** — 35% market share, aggressive pricing ($15K-30K), strong government partnerships in Thailand and Indonesia
2. **Tesla** — 18% market share, premium positioning ($40K+), expanding Supercharger network
3. **Neta (Hozon)** — 12% market share, budget-friendly ($10K-20K), popular in Vietnam

## Government Incentives
- **Thailand:** Up to ฿150,000 ($4,200) subsidy per EV, 0% import duty until 2025
- **Indonesia:** 0% luxury tax for EVs, $3,500 purchase incentive
- **Vietnam:** 0% registration fee until 2027, reduced road tax

## Key Strategies
- Local manufacturing to avoid import tariffs
- Battery swapping infrastructure partnerships
- Fleet sales to ride-hailing platforms (Grab, Gojek)

📚 **15 sources cited** including Reuters, BloombergNEF, and regional government reports.

Would you like me to dive deeper into any specific country or manufacturer?
```

**Prompt:** 
```
Search for news about AI regulation in the European Union from the last month, restricted to europa.eu and reuters.com domains.
```

**Response:** 
```
I found 5 recent articles about AI regulation in the EU from the last month, restricted to europa.eu and reuters.com:

1. **EU Commission publishes implementation guidelines for the AI Act** — europa.eu, 2 weeks ago
2. **European countries scramble to meet AI Act compliance deadlines** — reuters.com, 1 week ago
3. **EU establishes new AI Office to enforce regulations** — europa.eu, 3 weeks ago
4. **Industry leaders respond to EU AI Act risk classification system** — reuters.com, 4 days ago
5. **EU member states finalize national AI regulatory frameworks** — europa.eu, 5 days ago

📚 **Citations:** All 5 sources from europa.eu and reuters.com with direct links.

Would you like me to summarize any of these articles in detail?
```

## Capabilities

### Generate Quick, Cited Answers
Use the basic query tool to get an immediate answer that cites its sources.

### Run Deep Literature Reviews
Perform extensive searches and generate full reports on complex topics with thorough citation tracking.

### Restrict Sources by Domain
Force the search to only pull information from a specific list of trusted websites or academic domains.

### Maintain Context Over Turns
Ask follow-up questions, and the agent remembers the conversation history for continuity.

### Extract Data into JSON Format
Force the model to output data that matches a specific schema you define, making it ready for code.

### Analyze Complex Logic Chains
Run specialized reasoning tasks like mathematical proofs or step-by-step code analysis.

## Use Cases

### Academic Literature Review
An academic researcher needs a comprehensive overview of quantum computing breakthroughs. They run `deep_research`, which returns an exhaustive report with citations from multiple sources, saving them hours of manual paper searching.

### Market Intelligence Gathering
A market analyst only trusts government data for compliance rules. They use `chat_with_domain_filter` to limit their search strictly to 'gov.uk' and 'who.int', guaranteeing the answers are from authoritative sources.

### Building a Data Pipeline
A developer needs product specs (name, weight, price) for 5 items mentioned in an article. Instead of parsing messy text, they use `structured_query` to force the output into clean JSON that their application can read immediately.

### Troubleshooting Code Logic
A developer hits a complex bug involving math and code logic. They run the `reasoning` tool, which provides step-by-step analysis of the problem, pointing out exactly where the mathematical assumption failed.

## Benefits

- Get verifiable facts every time. Instead of trusting the LLM's memory, use `chat_with_citations` to ensure every statement is backed by a real URL source.
- Tackle massive topics with `deep_research`. This tool generates detailed reports that go far beyond simple summaries—it’s built for literature reviews and competitive analysis.
- Filter out noise. If you only care about academic papers, use `chat_with_domain_filter` to restrict searches to domains like 'arxiv.org', eliminating irrelevant web results.
- Use data directly in your code. When you need structured information (like a list of names and prices), run `structured_query` to get clean JSON for immediate programming use.
- Build contextually aware agents. With `chat_with_history`, the agent remembers what was discussed 10 minutes ago, letting you ask multi-turn follow-ups without repeating yourself.

## How It Works

The bottom line is: it gives your AI agent live, verifiable data sources instead of relying on its training cutoff date.

1. Subscribe to the server and provide your Perplexity API key.
2. Your AI client calls a specific tool (e.g., `chat_with_citations`), passing the query and any necessary parameters (like domains or time filters).
3. The server executes the web search, synthesizes the answer, and returns the structured result, including all required citations.

## Frequently Asked Questions

**How do I make sure the answer from chat_completion is accurate?**
Always use `chat_with_citations`. This tool forces the AI to link every fact it states back to a live web source, eliminating hallucination. It's non-negotiable for any serious research.

**What should I use if I need to compare multiple technical concepts?**
Try `reasoning`. This specialized tool excels at multi-step logical analysis and code reviews, which is better suited than a general chat query when the logic gets complicated.

**Can I limit my search results to only academic papers?**
Yes. Use `chat_with_domain_filter` and provide domains like 'edu' or specific university sites. This keeps your research highly focused on trusted, academic sources.

**Is there a way to get the output for my app?**
Use `structured_query`. You define your required JSON schema (e.g., what keys and data types you need), and the tool delivers clean, machine-readable data.

**Does chat_with_history remember things I said earlier?**
Yes, it's built for that. Use `chat_with_history` or simply use the follow-up capability to maintain context across multiple questions in a single session.

**How do I get visual results for product searches using `chat_with_images`?**
The response includes an images array with URLs to relevant pictures found during the search. Use this when you're researching physical products or need visuals alongside your answer.

**What if I need the model to adopt a specific persona using `system_prompt_query`?**
You define the model’s behavior right in the system prompt. This allows you to force it into a role—like 'medical expert' or 'senior architect'—or set strict formatting rules.

**How can I limit my data search to recent news using `chat_with_recency_filter`?**
You specify the time frame (hour, day, week, month, or year) when calling this tool. This guarantees your answer uses only fresh data, which is critical for breaking news.

**How do I get a Perplexity API key?**
Log in to your [**Perplexity AI account**](https://www.perplexity.ai/), go to **Settings > API**, and generate a new API key. Copy the key (it starts with `pplx-`) immediately. Paste it into the API key field below. This key authenticates all requests to https://api.perplexity.ai.

**What's the difference between Sonar, Sonar Pro, Deep Research, and Reasoning Pro models?**
**Sonar** is the fastest model for quick factual answers and basic synthesis. **Sonar Pro** handles complex queries better with more thorough analysis and follow-up support. **Sonar Deep Research** performs exhaustive web searches and generates comprehensive reports with thorough citations — best for research papers and deep investigations. **Sonar Reasoning Pro** excels at logical reasoning, multi-step analysis, mathematical problems, and chain-of-thought tasks.

**Can I restrict search results to specific domains or time periods?**
Yes! Use `chat_with_domain_filter` to restrict search to specific domains (e.g., arxiv.org, nih.gov, github.com). Use `chat_with_recency_filter` to get results only from the last hour, day, week, month, or year. You can also combine both for domain-specific recent information. Citations are automatically included to verify sources.

**How does Perplexity AI differ from regular search engines?**
Unlike regular search engines that return a list of links, Perplexity AI reads the web in real-time, synthesizes information from multiple sources, and provides a direct, concise answer with citations. It's like having a research assistant that reads dozens of pages and summarizes the key findings with source links. You get answers, not just links.