Perplexity MCP Server

by MCP-Mirror

317 downloads
Not rated
GitHub

About

This is an MCP (Model Context Protocol) server that enables web searches using the Perplexity AI API. It provides a single tool for integrating Perplexity-powered search into any MCP-compatible client.

Details

Author
MCP-Mirror
Downloads
317
Categories
AI

- Provides a single tool perplexity_search for web searches
- Requires a Perplexity AI API key
- Written in TypeScript
- Supports development and production modes
- Installation and usage instructions for Windows

Install Node.js 18+, clone the repository, install dependencies with npm install, and create a .env file in the root directory containing your Perplexity AI API key as PERPLEXITY_API_KEY=your_key. For development, run npm run dev; for production, build with npm run build then start with npm start. The server exposes the perplexity_search tool, which accepts a query string argument.

Perplexity MCP Server

This is a simple MCP server that allows you to search the web using Perplexity AI.

Installation

Prerequisites

- Node.js 18+ (Download from nodejs.org) - Git (Download from git-scm.com) - A Perplexity AI API key

Steps for Windows

1. Clone the repository:

git clone [repository-url]
cd perplexity-mcp-server

2. Install dependencies:

npm install

3. Create environment file:
- Create a new file named .env in the root directory
- Add your Perplexity AI API key:

   PERPLEXITY_API_KEY=your_api_key_here

Usage on Windows

Development Mode

npm run dev

Production Mode

1. Build the project:
npm run build

2. Start the server:

npm start

Troubleshooting Windows Issues

Common Issues

1. Permission Errors
- Run Command Prompt or PowerShell as Administrator
- Check file permissions in the project directory

2. Environment Variables
- Ensure .env file is in the root directory
- No spaces around the = sign in .env file
- Restart terminal after making changes to environment variables

3. Node.js Issues
- Verify Node.js installation: node --version
- Ensure npm is installed: npm --version

Error Messages

If you see Error: ENOENT: no such file or directory, ensure:
- All paths use correct Windows-style separators
- You're in the correct directory
- Required files exist

Project Structure

perplexity-mcp-server/
├── src/
│   └── index.ts          # Main server implementation
├── dist/                 # Compiled output
├── .env                  # Environment variables
├── package.json          # Project configuration
└── tsconfig.json         # TypeScript configuration

API Usage

The server provides a single tool perplexity_search for web searches:

{
  "name": "perplexity_search",
  "arguments": {
    "query": "your search query here"
  }
}

License

MIT

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.