mewcp-perplexity
Perplexity API MCP Server
Documentation
Answer any question with live web search, citations, and AI reasoning — all in one call.
A Model Context Protocol (MCP) server that exposes Perplexity AI's API for real-time web search and conversational queries with cited sources.
Overview
The Perplexity MCP Server provides AI-powered web search with grounded, citation-backed responses:
- Query the live web and get LLM-synthesized answers with source references
- Control response length, temperature, and the underlying search model
- Browse available Perplexity models to choose the right capability for each task
Perfect for:
- Giving AI assistants access to current events, news, and real-time information
- Answering research questions that require up-to-date facts beyond the model's training cutoff
- Enriching AI workflows with cited, verifiable web sources
Tools
health_check — Check server readiness
Returns a status object confirming the server is running and reachable.
Inputs: _(none)_
Output:
{
"status": "ok",
"server": "CL Perplexity MCP Server"
}search — Search the web with Perplexity AI
Sends a query to Perplexity's online search models and returns an LLM-generated answer with citations from live web sources.
Inputs:
- `query` (string, required) — Search query to look up on the web
- `model` (string, optional) — Model to use (default: llama-3.1-sonar-small-128k-online)
- `max_tokens` (integer, optional) — Maximum tokens in the response, 1–4096
- `temperature` (float, optional) — Sampling temperature 0–2; higher = more creative (default: model default)Output:
{
"success": true,
"query": "latest AI research papers 2025",
"response": "Recent AI research has focused on...",
"model": "llama-3.1-sonar-small-128k-online",
"usage": {
"prompt_tokens": 12,
"completion_tokens": 320,
"total_tokens": 332
}
}get_models — List available Perplexity models
Returns all models available through the Perplexity API, grouped into online (web search) and offline (non-search) categories.
Inputs: _(none)_
Output:
{
"success": true,
"total_models": 6,
"online_models": [
"llama-3.1-sonar-small-128k-online",
"llama-3.1-sonar-large-128k-online",
"llama-3.1-sonar-huge-128k-online"
],
"other_models": [
"llama-3.1-sonar-small-128k-chat",
"llama-3.1-sonar-large-128k-chat"
],
"all_models": [...]
}API Parameters Reference
Model Selection
Online models (include live web search):
- `llama-3.1-sonar-small-128k-online` — Fast, cost-efficient; default for web search
- `llama-3.1-sonar-large-128k-online` — Higher quality answers, more thorough search
- `llama-3.1-sonar-huge-128k-online` — Best quality, most comprehensive; highest cost
Use `get_models` to retrieve the current full list — new models are added periodically.
Generation Parameters
- `temperature` — Controls randomness; `0.0` for focused factual answers, `1.0+` for creative responses (range: 0–2)
- `max_tokens` — Caps response length; useful for controlling cost and latency (range: 1–4096)
Getting Your Perplexity API Key
Steps
1. Go to the Perplexity API Settings
2. Sign in or create a Perplexity account
3. Under API Keys, click + Generate
4. Copy the generated key — store it securely, it will not be shown again
> Perplexity API usage is billed per request based on the model and token count. Online models consume additional credits for web search.
Troubleshooting
Missing or Invalid Headers
- Cause: API key not provided in request headers or incorrect format
- Solution:
1. Verify `Authorization: Bearer YOUR_API_KEY` and `X-Mewcp-Credential-Id: CREDENTIAL-ID` headers are present
2. Check API key is active in your MewCP account
Insufficient Credits
- Cause: API calls have exceeded your request limits
- Solution:
1. Check credit usage in your Curious Layer dashboard
2. Upgrade to a paid plan or add credits for higher limits
3. Contact support for credit adjustments
Credential Not Connected
- Cause: No Perplexity credential linked to your account
- Solution:
1. Go to Credentials in your MewCP dashboard
2. Add your Perplexity API key
3. Retry the request with the correct `X-Mewcp-Credential-Id` header
Malformed Request Payload
- Cause: JSON payload is invalid or missing required fields
- Solution:
1. Validate JSON syntax before sending
2. Ensure the `query` parameter is included and is a non-empty string
3. Check that `temperature` is between 0.0 and 2.0 and `max_tokens` is between 1 and 4096
Server Not Found
- Cause: Incorrect server name in the API endpoint
- Solution:
1. Verify endpoint format: `{server-name}/mcp/{tool-name}`
2. Use correct server name from documentation
3. Check available servers in your Curious Layer account
Perplexity API Error
- Cause: Upstream Perplexity API returned an error
- Solution:
1. Check Perplexity service status at Perplexity Status Page
2. Verify your API key has sufficient credits for the selected model
3. Review the error message for specific details (e.g. rate limit exceeded, invalid model ID)
Resources
- **Perplexity API Documentation** — Official API reference
- **Perplexity Model Cards** — Model capabilities and pricing
- **FastMCP Docs** — FastMCP specification
- **FastMCP Credentials** — FastMCP Credentials package for credential handling
Frequently asked questions
What is mewcp-perplexity?
mewcp-perplexity is Perplexity API MCP Server
How do I install mewcp-perplexity?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is mewcp-perplexity open source?
Yes — it is hosted on GitHub at https://github.com/AStheTECH/mewcp-perplexity.
Related MCP tools
Cognee is the open-source AI memory platform for agents. Give your AI agents persistent long-term memory across sessions with a self-hosted knowledge graph engine.
Automate browser based workflows with AI
Hindsight: Agent Memory That Learns
A privacy-first app that strips AI watermarks from content you own.
Agent framework and applications built upon Qwen>=3.0, featuring Function Calling, MCP, Code Interpreter, RAG, Chrome extension, etc.
The power of Claude Code / GeminiCLI / CodexCLI + [Gemini / OpenAI / OpenRouter / Azure / Grok / Ollama / Custom Model / All Of The Above] working as one.
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP