home / mcp / perplexity agent mcp server
An opinionated, coding-specialized, Model Context Protocol server that integrates Perplexity AI's Sonar models into AI coding assistants like Claude Code or Codex CLI.
Configuration
View docs{
"mcpServers": {
"jercik-perplexity-agent-mcp": {
"command": "perplexity-agent-mcp",
"args": [],
"env": {
"PERPLEXITY_API_KEY": "your-api-key-here"
}
}
}
}You run a lean MCP server that exposes two coding-focused tools via a local process. It connects to your coding environment to provide quick fact checks and deep research for migrations and architecture decisions, while keeping your context window slim and efficient.
To use this MCP server, start it locally and connect your MCP client to the provided stdio endpoint. The server exposes two tools you can invoke from your client: lookup for quick facts from documentation and API syntax, and answer for in-depth research with actionable recommendations. Use the client to send your coding questions or migration tasks, and let the server return concise, actionable guidance.
Prerequisites you must have installed before starting are Node.js v22.14.0 or newer and npm available on your system.
Install the MCP server package globally.
npm install -g perplexity-agent-mcpConfigure your MCP client to load the server by adding the following to your client configuration (adjust the file path to your environment): it defines a stdio MCP server named perplexity with the required environment variable.
{
"mcpServers": {
"perplexity": {
"command": "perplexity-agent-mcp",
"env": {
"PERPLEXITY_API_KEY": "your-api-key-here"
}
}
}
}Restart your client after saving the configuration, then you can start issuing requests to the perplexity MCP server through your usual workflow.
The MCP server is exposed as a local stdio service. You run the server executable and connect via your client interface; no HTTP remote URL is required for this setup.
Key environment variable you must provide is the Perplexity API key. This key authorizes the server to access Perplexity models for both quick fact extraction and deeper reasoning.
An example prompt that initiates use of the MCP server from your agent might look like this: Please update the "foo" dependency to the latest version. Use Perplexity for the migration guide. This prompts the client to route the task through the perplexity MCP server to obtain a reliable migration path and recommended steps.
Quick fact extraction from API docs and code references to verify syntax, config keys, and other documentation details.
Deep research tool that analyzes options, compares approaches, and provides actionable recommendations and migration guidance.