mcp-perplexity-api
A MCP Perplexity API server written in Typescript with stdio and SSE transport support.
Documentation
MCP Perplexity Server
Overview
This repository contains the code for the Model Context Protocol (MCP) Perplexity Server, which is a server that provides an API to ask a question to a model behind the Perplexity API.
Quickstart via Portainer or Docker Compose
Use the following `docker-compose.yml` to quickly set up the server via Portainer (as a stack) or Docker Compose:
services:
mcp-sse-server:
image: ghcr.io/sibbl/mcp-perplexity-api:main
ports:
- "8080:8080"
restart: unless-stopped
environment:
- MCP_TRANSPORT=sse
- MCP_PERPLEXITY_API_KEY=ENTER_YOUR_PERPLEXITY_API_KEY
# - MCP_SSE_AUTH_HEADER_VALUE=Bearer some_token_which_is_required # enables optional bearer authentication against the MCP server with hard coded valueSave it for Docker compose in a new directory and run `docker compose up` in it. `http://localhost:8080/sse` is your endpoint.
Prerequisites
- Nodejs
- pnpm
- Docker
Important: Copy the `.env.sample` to `.env` and set your Perplexity API key.
Installation via Docker
To quickly set up the server, run:
docker compose upInstallation via Node.js
To install the required dependencies, run the following command:
pnpm installTo start the server, run:
# with stdio transport
export MCP_TRANSPORT=stdio # optional, stdio is default
pnpm start
# or
# with SSE transport
export MCP_TRANSPORT=sse
pnpm startConfiguration
All configuration options:
- `MCP_PERPLEXITY_API_KEY`: Perplexity API key to use. *Required*.
- `MCP_TRANSPORT`: Either `stdio` or `sse`. Default is `stdio`.
- `MCP_PERPLEXITY_DEFAULT_MODEL`: The perplexity default model to use. Default is `sonar-pro`.
- `MCP_PERPLEXITY_MODELS`: Comma separated list of models to use. Default is `sonar,sonar-pro`.
- `MCP_PERPLEXITY_TOOL_DESCRIPTION_SUFFIX`: The suffix to use for the tool description. Empty by default.
- `MCP_SSE_ENDPOINT`: The endpoint to use for SSE. Default is `/sse`.
- `MCP_SSE_PORT`: The port to use for SSE. Default is `8080`.
- `MCP_SSE_AUTH_HEADER_KEY`: The auth header key to use for SSE. Default is `Authorization`.
- `MCP_SSE_AUTH_HEADER_VALUE`: The auth header value to use for SSE. By default no value is set, which means that no authorization is required.
Frequently asked questions
What is mcp-perplexity-api?
mcp-perplexity-api is A MCP Perplexity API server written in Typescript with stdio and SSE transport support.
How do I install mcp-perplexity-api?
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 mcp-perplexity-api open source?
Yes — it is hosted on GitHub at https://github.com/sibbl/mcp-perplexity-api and has 2 stars.
Related MCP tools
The official TypeScript SDK for Model Context Protocol servers and clients Trusted by 10500+ developers. Trusted by 10500+ developers.
Visual testing tool for MCP servers TypeScript-based implementation. Trusted by 7300+ developers. Trusted by 7300+ developers.
It's like v0 but in your Cursor/WindSurf/Cline. 21st dev Magic MCP server for working with your frontend like Magic TypeScript-based implementation.
Model Context Protocol Server for Mobile Automation and Scraping (iOS, Android, Emulators, Simulators and Real Devices) TypeScript-based implementation.
Https://github.com/user-attachments/assets/364b6705-14d4-4e6d-bea7-fb9f12664fab for the Model Context Protocol. Enhance AI assistants with powerful integrations
MCP server that provides tools and resources for interacting with n8n API TypeScript-based implementation. Trusted by 1400+ developers.
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP