https://github.com/mkusaka/mcp-server-perplexity
https://github.com/mkusaka/mcp-server-perplexity
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mkusaka/mcp-server-perplexity
- Owner: mkusaka
- License: mit
- Created: 2025-02-09T12:34:37.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-02-09T14:59:58.000Z (4 months ago)
- Last Synced: 2025-04-19T23:15:57.750Z (2 months ago)
- Language: JavaScript
- Size: 35.2 KB
- Stars: 1
- Watchers: 1
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- mcp-index - Perplexity AI MCP Server - Integrates Perplexity AI's API for advanced search capabilities, supporting multiple models with configurable result counts and detailed error handling. (APIs and HTTP Requests)
README
# 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
```bash
pnpm install
pnpm build
```## Configuration
### API Key
1. Sign up for a [Perplexity AI account](https://www.perplexity.ai)
2. Get your API key from the dashboard
3. Set the environment variable:
```bash
export PERPLEXITY_API_KEY=your_api_key_here
```## Usage
### Direct Execution
```bash
node dist/index.js
# or if you made it executable
./dist/index.js
```### Development
```bash
pnpm dev
```### Testing with MCP Inspector
```bash
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