Perplexity Web Search MCP Server

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Supports loading API keys from .env files, providing a secure way to configure the server without hardcoding sensitive information.

  • Includes specific configuration instructions for Claude Desktop on macOS, detailing the path to the configuration file.

  • Provides web search functionality through Perplexity's API, allowing for comprehensive search results with sources and citations, and filtering by time period (day, week, month, year).

パープレキシティウェブ検索MCPサーバー

Perplexity APIを用いたウェブ検索機能を提供するシンプルなMCP(Model Context Protocol)サーバー。このサーバーにより、Claudeやその他のMCP対応AIアシスタントはウェブを検索し、最新情報を取得できます。

特徴

  • Perplexity の強力な検索機能でウェブを検索
  • 出典と引用を含む包括的な検索結果を取得
  • 期間(日、週、月、年)で結果をフィルタリングします
  • すぐに使えるウェブ検索用のプロンプトテンプレートが含まれています
  • 環境変数または.envファイルからのAPIキーの読み込みをサポート

インストール

  1. このリポジトリをクローンする
  2. 依存関係をインストールします:
    pip install -e .
    または
    uv pip install -e .

構成

Perplexity API キーを使用してPERPLEXITY_API_KEY環境変数を設定できます。

export PERPLEXITY_API_KEY="your-api-key-here"

あるいは、プロジェクト ルートに次の内容の.envファイルを作成することもできます。

PERPLEXITY_API_KEY=your-api-key-here

参照用にサンプルの.env.exampleファイルが提供されています。

Perplexity API キーを取得するには:

  1. Perplexity API設定にアクセス
  2. アカウントをお持ちでない場合は作成してください
  3. APIキーを生成する

使用法

サーバーの実行

python server.py

サーバーのテスト

付属のテスト スクリプトを使用すると、完全な MCP サーバーを実行せずにサーバーの機能をテストできます。

python test_server.py "your search query here" --recency month

--recencyのオプションは、日、週、月(デフォルト)、年です。

Claude Desktopでの使用

  1. Claude Desktop 構成ファイルを編集します。
    • macOSの場合: ~/Library/Application\ Support/Claude/claude_desktop_config.json
    • Windows の場合: %APPDATA%/Claude/claude_desktop_config.json
  2. 次の構成を追加します。
    { "perplexity-mcp": { "env": { "PERPLEXITY_API_KEY": "your-api-key-here" }, "command": "python", "args": [ "/path/to/server.py" ] } }
  3. Claudeデスクトップを再起動します

クロードの例題

  • 「人工知能に関する最新ニュースをウェブで検索」
  • 「Perplexity を使って、過去 1 週間に公開された気候変動に関する情報を見つけましょう」
  • 「過去1か月間の量子コンピューティングに関する最新の研究論文を検索する」

APIリファレンス

ツール: search_web(query: str, recency: str = "month") -> str

Perplexity API を使用して Web を検索し、結果を返します。

パラメータ:

  • query : 検索クエリ文字列
  • recency : 期間(「日」、「週」、「月」(デフォルト)、または「年」)で結果をフィルタリングします

**戻り値:**次の内容を含む包括的なテキスト応答:

  1. 検索結果の詳細な要約
  2. 発見された重要な事実と情報
  3. 検証用のURLを含むソース
  4. 矛盾する情報がある場合

プロンプト: web_search_prompt(query: str, recency: str = "month") -> str

Perplexity を使用して Web を検索するためのプロンプト テンプレートを作成します。

パラメータ:

  • query : 検索クエリ
  • recency : 期間フィルター - 「日」、「週」、「月」(デフォルト)、または「年」

戻り値: AI に次のことを指示するフォーマットされたプロンプト文字列:

  1. 指定されたクエリを検索する
  2. 指定された期間の結果に焦点を当てる
  3. 主な調査結果を要約する
  4. 重要な事実を強調する
  5. 矛盾する情報を言及する
  6. リンク付きのソースを引用する

ライセンス

マサチューセッツ工科大学

-
security - not tested
F
license - not found
-
quality - not tested

Claude やその他の MCP 互換 AI アシスタントが、期間別に結果をフィルタリングする機能を使用して、Perplexity API を使用して Web を検索し、最新情報を取得できるようにします。

  1. Features
    1. Installation
      1. Configuration
        1. Usage
          1. Running the server
          2. Testing the server
          3. Using with Claude Desktop
          4. Example Prompts for Claude
        2. API Reference
          1. Tool: search_web(query: str, recency: str = "month") -> str
          2. Prompt: web_search_prompt(query: str, recency: str = "month") -> str
        3. License
          ID: ewpzze4800