MCP Server for the Perplexity API.
Project description
Perplexity MCP Server
MCP Server for the Perplexity API.
Components
Tools
- ask_perplexity: Request expert programming assistance through Perplexity. Focuses on coding solutions, error debugging, and technical explanations. Returns responses with source citations and alternative suggestions.
- chat_perplexity: Maintains ongoing conversations with Perplexity AI. Creates new chats or continues existing ones with full history context. Returns chat ID for future continuation.
Key Features
- Streaming Responses with Progress Reporting: Provides a more interactive experience by streaming responses and reporting progress during long queries.
- Simplified Tool Parameters: The
ask_perplexitytool now only requires aqueryparameter, simplifying its usage. - Model Configuration via Environment Variable: Allows you to specify the Perplexity model using the
PERPLEXITY_MODELenvironment variable for flexible model selection. You can also specifyPERPLEXITY_MODEL_ASKandPERPLEXITY_MODEL_CHATto use different models for theask_perplexityandchat_perplexitytools, respectively. These will overridePERPLEXITY_MODEL. - Improved Error Handling and Robustness: Incorporates better error handling and more robust API interaction.
- Longer Chat IDs Chat IDs are now longer.
Quickstart
Installation
Prerequisites
- Python 3.10+
- uvx (recommended)
How to install uvx on Windows: Open PowerShell as Administrator and run:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
Windows Installation Notes:
- Ensure Python 3.10+ is installed and added to PATH
- The installation script will handle uvx setup
- Your MCP client will manage package installation via the provided configuration
Configure your MCP Client
To use this MCP server, you need to configure your MCP client to connect to it. The configuration method will vary depending on your specific client.
Below is an example configuration in JSON format:
"mcpServers": {
"Perplexity": {
"command": "uvx",
"args": [
"mcp-perplexity"
],
"env": {
"PERPLEXITY_API_KEY": "your-perplexity-api-key",
"PERPLEXITY_MODEL": "sonar-pro"
}
}
}
Important notes:
- Replace
"your-perplexity-api-key"with your actual Perplexity API key. - The
"PERPLEXITY_MODEL": "sonar-pro"line is optional. If you omit it, the server will use the default Perplexity model. - You can also set
PERPLEXITY_MODEL_ASKandPERPLEXITY_MODEL_CHATto overridePERPLEXITY_MODELfor the individual tools. - Consult your MCP client's documentation for details on where to place this configuration and any client-specific settings.
- Use the mcp-server-starter script to easily start the server.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_perplexity-0.1.2.tar.gz.
File metadata
- Download URL: mcp_perplexity-0.1.2.tar.gz
- Upload date:
- Size: 18.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd608924d9ccd091265a36b7a7aa71ce99ad388e996f26345a0b05190c8c66e6
|
|
| MD5 |
c9120613de608a12b390b1e85aa9f3f7
|
|
| BLAKE2b-256 |
ad8f64c868ecd0758debacc75ced9def000bd2d529e9431393fd473ec6a9ba53
|
Provenance
The following attestation bundles were made for mcp_perplexity-0.1.2.tar.gz:
Publisher:
pypi-publish.yml on daniel-lxs/mcp-perplexity
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_perplexity-0.1.2.tar.gz -
Subject digest:
fd608924d9ccd091265a36b7a7aa71ce99ad388e996f26345a0b05190c8c66e6 - Sigstore transparency entry: 169029649
- Sigstore integration time:
-
Permalink:
daniel-lxs/mcp-perplexity@b19ff4008d00383e9bd385952a547aaa4f950346 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/daniel-lxs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@b19ff4008d00383e9bd385952a547aaa4f950346 -
Trigger Event:
release
-
Statement type:
File details
Details for the file mcp_perplexity-0.1.2-py3-none-any.whl.
File metadata
- Download URL: mcp_perplexity-0.1.2-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2e85798c9b9f6910793d1aa0c1e0496d5a0c5e009b131462d214d5bc08f815c
|
|
| MD5 |
6210c8590581935380d31f371216279d
|
|
| BLAKE2b-256 |
6779be80a4e421943bc5cfc581b401f17e8d7c54e24f7e1493d1e540e79f21e4
|
Provenance
The following attestation bundles were made for mcp_perplexity-0.1.2-py3-none-any.whl:
Publisher:
pypi-publish.yml on daniel-lxs/mcp-perplexity
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_perplexity-0.1.2-py3-none-any.whl -
Subject digest:
c2e85798c9b9f6910793d1aa0c1e0496d5a0c5e009b131462d214d5bc08f815c - Sigstore transparency entry: 169029650
- Sigstore integration time:
-
Permalink:
daniel-lxs/mcp-perplexity@b19ff4008d00383e9bd385952a547aaa4f950346 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/daniel-lxs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@b19ff4008d00383e9bd385952a547aaa4f950346 -
Trigger Event:
release
-
Statement type: