Skip to main content
Glama
laodev1

Perplexity MCP Server

by laodev1

Perplexity MCP サーバー

概要

Perplexity MCPサーバーは、Anthropicのモデルコンテキストプロトコル(MCP)のNode.js実装であり、ClaudeがPerplexityの言語モデルとやり取りできるようにします。このサーバーは、ClaudeとPerplexity AIの機能の間に安全な橋渡しを提供し、ツールの使用を通じてAIとのやり取りを強化します。

Related MCP server: Perplexity MCP Server

利用可能なツール

現在、サーバーは次の 2 つの主要なツールを実装しています。

1. パープレキシティチャット

完全なメッセージ履歴をサポートする高度なチャット完了ツール。

{
  "name": "perplexity_chat",
  "description": "Generate a chat completion using Perplexity AI",
  "parameters": {
    "model": "string (optional) - One of: llama-3.1-sonar-small-128k-online, llama-3.1-sonar-large-128k-online, llama-3.1-sonar-huge-128k-online",
    "messages": "array of {role, content} objects - The conversation history",
    "temperature": "number (optional) - Sampling temperature between 0-2"
  }
}

2. 困惑の質問

簡単な質問のための簡素化された単一クエリ インターフェース。

{
  "name": "perplexity_ask",
  "description": "Send a simple query to Perplexity AI",
  "parameters": {
    "query": "string - The question or prompt to send",
    "model": "string (optional) - One of: llama-3.1-sonar-small-128k-online, llama-3.1-sonar-large-128k-online, llama-3.1-sonar-huge-128k-online"
  }
}

インストール

  1. リポジトリをクローンします。

    git clone https://github.com/yourusername/perplexity-mcp-server.git
    cd perplexity-mcp-server
  2. 依存関係をインストールします:

    npm install
  3. .envファイルを作成します:

    PERPLEXITY_API_KEY=your-api-key-here
  4. プロジェクトをビルドします。

    npm run build

クロードデスクトップ構成

このサーバーをClaude Desktopに追加するには、 claude_desktop_config.jsonを更新します。

{
  "mcpServers": {
    //more servers...
    "perplexity": {
      "command": "node",
      "args": ["path\\to\\perplexity-mcp-server\\dist\\index.js"],
      "env": {
        "PERPLEXITY_API_KEY": "YOUR_PERPLEXITY_API_KEY"
      }
    }
    //more servers...
  }
}

構成ファイルは通常、次の場所にあります。

  • Windows: %APPDATA%/Claude/config/claude_desktop_config.json

  • macOS: ~/Library/Application Support/Claude/config/claude_desktop_config.json

  • Linux: ~/.config/Claude/config/claude_desktop_config.json

発達

自動再コンパイルで開発サーバーを起動します。

npm run dev

サーバーは TypeScript を使用し、 @modelcontextprotocol/sdkパッケージを使用して MCP プロトコルを実装します。

建築

コアコンポーネント

  1. PerplexityServer クラス

    • MCPサーバープロトコルを実装

    • ツールの登録と実行を処理する

    • エラー処理とサーバーのライフサイクルを管理します

  2. ツールシステム

    • モジュラーツールの定義

    • 型安全なツールハンドラー

    • 構造化された入力検証

技術的な詳細

  • 型安全性のためにTypeScriptで構築

  • MCP実装には@modelcontextprotocol/sdkを使用します

  • stdioトランスポート経由で通信する

  • 環境ベースの構成

エラー処理

サーバーは包括的なエラー処理を実装します。

  • APIエラー報告

  • 無効なツール要求の処理

  • 接続エラー管理

  • プロセス信号処理

依存関係

  • @modelcontextprotocol/sdk : ^1.0.3

  • dotenv :^16.4.7

  • isomorphic-fetch : ^3.0.0

貢献

  1. リポジトリをフォークする

  2. 機能ブランチを作成します( git checkout -b feature/amazing-feature )

  3. 変更をコミットします ( git commit -m 'Add some amazing feature' )

  4. ブランチにプッシュする ( git push origin feature/amazing-feature )

  5. プルリクエストを開く

安全

  • APIキーは環境変数を通じて管理されます

  • すべてのツールパラメータの入力検証

  • エラーメッセージは出力前にサニタイズされます

  • MCPプロトコルによるプロセス分離

ライセンス

このプロジェクトは ISC ライセンスに基づいてライセンスされています。

トラブルシューティング

よくある問題と解決策:

  1. サーバーが見つかりません

    • claude_desktop_config.jsonのパスが正しいことを確認します

    • サーバーがビルドされていることを確認する( npm run build )

    • Node.jsがPATHにあるか確認する

  2. 認証エラー

    • .env で Perplexity API キーを確認します

    • APIキーに必要な権限があるか確認する

  3. ツール実行エラー

    • ツールパラメータがスキーマと一致していることを確認する

    • ネットワーク接続を確認する

    • 詳細なエラーメッセージについてはサーバーログを確認してください

Available Tools

2 tools
perplexity_askB

Send a simple query to Perplexity AI

ParametersJSON Schema
NameRequiredDescriptionDefault
modelNoThe model to use for completion
queryYesThe question or prompt to send

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations and a minimal description, the tool's behavior is opaque. It does not disclose whether the query is synchronous, what response format to expect, or any safety/reliability traits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single clear sentence that immediately conveys the tool's purpose. It is appropriately front-loaded and concise, though it could incorporate more detail without becoming wordy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple query tool with no output schema, the description lacks information about the response (e.g., text output, confidence scores). The agent would need to infer or discover the return type from usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so both parameters have descriptions. The description adds no extra value beyond the schema, but baseline 3 is appropriate as the schema already documents parameters adequately.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Send a simple query') and the target resource ('Perplexity AI'). It distinguishes from the sibling tool 'perplexity_chat' by implying this is for a single query, while 'chat' likely involves multi-turn conversation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus the sibling 'perplexity_chat'. There is no mention of prerequisites, limitations, or alternatives, leaving the agent to infer usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

perplexity_chatC

Generate a chat completion using Perplexity AI

ParametersJSON Schema
NameRequiredDescriptionDefault
modelNoThe model to use for completion
messagesYesArray of messages in the conversation
temperatureNoSampling temperature (0-2)

TDQS

C2.8/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No behavioral traits are disclosed beyond the minimal description. The schema includes a model with 'sonar-small-online' suggesting internet access, but this is not mentioned. With no annotations, the description should provide more context about side effects, permissions, or rate limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence, which is concise, but it is too brief to convey necessary information. It could be expanded without losing conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 3 parameters and a sibling tool, the description is insufficient. It does not explain the role of Perplexity AI, the meaning of different models, or how this tool differs from 'perplexity_ask'. The lack of output schema increases the need for a more complete description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all parameters are documented in the schema. The description adds no additional meaning beyond what is already in the schema. Baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: generating a chat completion using Perplexity AI. However, it does not differentiate from the sibling tool 'perplexity_ask', which likely performs a similar but distinct function.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus the sibling tool 'perplexity_ask'. The context hints at a distinction (chat vs. ask), but it is not explicitly stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 2 tool updatesv1.0.1
    • First observedperplexity_ask
    • First observedperplexity_chat

TDQS

C2.9/5.0

Scored across 2 tools

Disambiguation2/5

Both tools involve querying Perplexity AI, with only subtle differences in description ('simple query' vs 'chat completion'). An agent would likely struggle to decide which to use, as the boundaries are unclear.

Naming Consistency4/5

Both tools follow a consistent 'perplexity_<verb>' pattern. The verbs 'ask' and 'chat' are different but semantically related, and no mixing of naming conventions is present.

Tool Count3/5

With only 2 tools, the server feels minimal for a service like Perplexity AI, which typically offers more nuanced capabilities (e.g., different models, streaming). However, it covers basic query and chat needs.

Completeness3/5

The tool surface covers basic query and chat interactions but lacks operations such as specifying model parameters, context handling, or result streaming. This may limit agent flexibility.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    F
    maintenance
    A custom Model Context Protocol implementation that integrates Perplexity AI with Claude Desktop, allowing users to access Perplexity's AI models for both single questions and multi-turn conversations.
    35 npm
    15
    ISC
  • A
    license
    B
    quality
    D
    maintenance
    A Node.js implementation of the Kagi Model Context Protocol server that enables Claude AI to search the web and summarize documents, videos, and audio using Kagi's APIs.
    2
    18 npm
    MIT