Skip to main content
Glama

Perplexity AI MCP Server

by mkusaka

Perplexity AI MCP Server

An MCP server implementation that integrates Perplexity AI's API, providing advanced search capabilities with multiple model options.

Features

  • Search using Perplexity AI's models

  • Support for all official Sonar models

  • Configurable result count

  • Detailed error handling and logging

  • MCP Inspector compatible

Available Models

  • sonar-reasoning-pro (127k context)

  • sonar-reasoning (127k context)

  • sonar-pro (200k context)

  • sonar (127k context)

Installation

pnpm install pnpm build

Configuration

API Key

  1. Sign up for a Perplexity AI account

  2. Get your API key from the dashboard

  3. Set the environment variable:

export PERPLEXITY_API_KEY=your_api_key_here

Usage

Direct Execution

node dist/index.js # or if you made it executable ./dist/index.js

Development

pnpm dev

Testing with MCP Inspector

pnpm inspect

Tool Reference

perplexity_search

Performs a search using Perplexity AI's models.

Parameters:

  • query (string, required): The search query

  • model (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)

Development

Project Structure

src/perplexity/ ├── index.ts # Main server implementation ├── lib/ │ └── logger.ts # Logging configuration └── adr.md # Architectural decisions

Logging

Logs are written to perplexity-mcp.log in the project root directory.

License

MIT

Contributing

  1. Fork the repository

  2. Create your feature branch

  3. Commit your changes

  4. Push to the branch

  5. Create a new Pull Request

Deploy Server
A
security – no known vulnerabilities
-
license - not tested
A
quality - confirmed to work

Related MCP Servers

  • A
    security
    -
    license
    A
    quality
    This server allows users to perform web searches using Perplexity AI, providing a tool for retrieving search results through a simple API interface.
    Last updated -
    1
    288
    3
  • -
    security
    -
    license
    -
    quality
    MCP Server for the Perplexity API.
    Last updated -
    62
    MIT License
    • Linux
    • Apple
  • -
    security
    -
    license
    -
    quality
    This server provides access to the Perplexity AI API, enabling interaction through chatting, searching, and documentation retrieval within MCP-based systems.
  • A
    security
    -
    license
    A
    quality
    An MCP server that enables Claude to perform web searches using Perplexity's API with intelligent model selection based on query intent and support for domain and recency filtering.
    Last updated -
    3
    MIT License
    • Apple

View all related MCP servers

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mkusaka/mcp-server-perplexity'

If you have feedback or need assistance with the MCP directory API, please join our Discord server