An MCP server implementation that integrates Perplexity AI's API, providing advanced search capabilities with multiple model options.
- Search using Perplexity AI's models
- Support for all official Sonar models
- Configurable result count
- Detailed error handling and logging
- MCP Inspector compatible
- sonar-reasoning-pro (127k context)
- sonar-reasoning (127k context)
- sonar-pro (200k context)
- sonar (127k context)
pnpm install
pnpm build- Sign up for a Perplexity AI account
- Get your API key from the dashboard
- Set the environment variable:
export PERPLEXITY_API_KEY=your_api_key_herenode dist/index.js
# or if you made it executable
./dist/index.jspnpm devpnpm inspectPerforms a search using Perplexity AI's models.
Parameters:
query(string, required): The search querymodel(string, optional): Model to use (default: "sonar")- Available options: sonar-reasoning-pro, sonar-reasoning, sonar-pro, sonar
count(number, optional): Number of results (1-10, default: 5)
src/perplexity/
├── index.ts # Main server implementation
├── lib/
│ └── logger.ts # Logging configuration
└── adr.md # Architectural decisions
Logs are written to perplexity-mcp.log in the project root directory.
MIT
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a new Pull Request