Skip to main content
Glama
tianmu

Perplexica MCP Server

by tianmu
README.md
# Perplexica MCP Server

**Language**: [English](README.md) | [中文](README_zh.md)

A Model Context Protocol (MCP) server that provides access to Perplexica's AI-powered search engine capabilities.

## Features

- **Web Search**: General web search using AI
- **Academic Search**: Search academic sources and papers  
- **YouTube Search**: Find and summarize YouTube videos
- **Reddit Search**: Search Reddit discussions
- **Writing Assistant**: Get help with writing and research
- **Multi-model Support**: Use different chat and embedding models
- **Health Monitoring**: Check service status and availability

## Prerequisites

- Python 3.10+
- A running Perplexica instance (default: http://localhost:3000)
- Optional: OpenAI API key for enhanced search capabilities

## Installation

1. Clone this repository
2. Install dependencies:
   ```bash
   pip install -r requirements.txt
   pip install .
   ```
   or
   ```bash
   uv tool install .
   ```

## Configuration
### cline
Configure the server to cline:
```json
{
  "mcpServers": {
    "perplexica": {
      "command": "python",
      "args": [
        "-m", "perplexica_mcp_server.server"
      ],
      "env": {
        "PERPLEXICA_DEFAULT_CHAT_PROVIDER":"custom_openai",
        "PERPLEXICA_DEFAULT_CHAT_MODEL":"gpt-4.1",
        "PERPLEXICA_CUSTOM_OPENAI_BASE_URL":"https://api.poe.com/v1",
        "PERPLEXICA_CUSTOM_OPENAI_KEY":"your_api_key",
        "PERPLEXICA_DEFAULT_EMBEDDING_PROVIDER":"transformers",
        "PERPLEXICA_DEFAULT_EMBEDDING_MODEL":"xenova-bge-small-en-v1.5",
        "PERPLEXICA_OPTIMIZATION_MODE":"balanced",
        "PERPLEXICA_BASE_URL":"http://localhost:3000"
      },
      "timeout": 60,
      "transport": "stdio"
    }
  }
}

```
or
```json
{
  "mcpServers": {
    "perplexica": {
      "command": "uvx",
      "args": [
        "perplexica-mcp-server"
      ],
      "env": {
        "PERPLEXICA_DEFAULT_CHAT_PROVIDER":"custom_openai",
        "PERPLEXICA_DEFAULT_CHAT_MODEL":"gpt-4.1",
        "PERPLEXICA_CUSTOM_OPENAI_BASE_URL":"https://api.poe.com/v1",
        "PERPLEXICA_CUSTOM_OPENAI_KEY":"your_api_key",
        "PERPLEXICA_DEFAULT_EMBEDDING_PROVIDER":"transformers",
        "PERPLEXICA_DEFAULT_EMBEDDING_MODEL":"xenova-bge-small-en-v1.5",
        "PERPLEXICA_OPTIMIZATION_MODE":"balanced",
        "PERPLEXICA_BASE_URL":"http://localhost:3000"
      },
      "timeout": 60,
      "transport": "stdio"
    }
  }
}

```


## Development

Copy `env.example` to `.env` and modify as needed:

```bash
cp env.example .env
# Edit .env file to set your configuration
```


### Starting the Server

Run the MCP server with stdio transport:

```bash
python -m perplexica_mcp_server.server
```

### Testing

Test the server functionality:

```bash
python test/test_client.py
```

Run test for you perplexica:

```bash
python test/test_official_api.py
```


### Output Formats

Supports two output formats:
- `json`: Raw JSON data (default)
- `formatted`: Human-readable formatted text


## License

MIT License

TDQS

A3.6/5.0

Scored across 7 tools

Disambiguation5/5

Each tool targets a clearly distinct functionality: health check, available models, and four different search sources (web, academic, Reddit, YouTube) plus a writing assistant. An agent can easily differentiate them.

Naming Consistency5/5

All tool names follow a consistent snake_case pattern with verb-noun structure (e.g., get_available_models, search_web) or clear noun phrases (e.g., health_check, writing_assistant). No mixing of conventions.

Tool Count5/5

With 7 tools, the set is well-scoped for a search and writing assistant server. It covers essential operations without being overwhelming or too sparse.

Completeness4/5

The tool surface covers the main search modes (web, academic, Reddit, YouTube), utility functions, and writing assistance. A minor gap is the lack of specific modes like image or news search, but the core workflow is well-supported.

Maintenance

ActivityInactive
ResponsivenessNo issues