Skip to main content
Glama

Grok MCPプラグイン

npmバージョン鍛冶屋の建設状況

Cline から Grok AI の強力な機能にシームレスに直接アクセスできるようにする Model Context Protocol (MCP) プラグイン。

特徴

このプラグインは、MCP インターフェースを通じて 3 つの強力なツールを公開します。

  1. チャット補完- Grok の言語モデルを使用してテキスト応答を生成する

  2. 画像理解- Grokのビジョン機能で画像を分析

  3. 関数呼び出し- Grok を使用して、ユーザー入力に基づいて関数を呼び出す

Related MCP server: Grok MCP Server

前提条件

  • Node.js (v16 以上)

  • Grok AI API キー ( console.x.aiから取得)

  • MCPサポート付きCline

インストール

  1. このリポジトリをクローンします:

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

    npm install
  3. プロジェクトをビルドします。

    npm run build
  4. Cline MCP 設定に MCP サーバーを追加します。

    VSCode Cline 拡張機能の場合は、次のファイルを編集します。

    ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

    次の構成を追加します。

    {
      "mcpServers": {
        "grok-mcp": {
          "command": "node",
          "args": ["/path/to/grok-mcp/build/index.js"],
          "env": {
            "XAI_API_KEY": "your-grok-api-key"
          },
          "disabled": false,
          "autoApprove": []
        }
      }
    }

    /path/to/grok-mcp実際のインストールパスに置き換え、 your-grok-api-key Grok AI API キーに置き換えます。

使用法

Grok MCP プラグインをインストールして構成すると、Cline で使用できる 3 つのツールが提供されます。

チャット完了

Grok の言語モデルを使用してテキスト応答を生成します。

<use_mcp_tool>
<server_name>grok-mcp</server_name>
<tool_name>chat_completion</tool_name>
<arguments>
{
  "messages": [
    {
      "role": "system",
      "content": "You are a helpful assistant."
    },
    {
      "role": "user",
      "content": "Hello, what can you tell me about Grok AI?"
    }
  ],
  "temperature": 0.7
}
</arguments>
</use_mcp_tool>

画像理解

Grok のビジョン機能を使用して画像を分析します。

<use_mcp_tool>
<server_name>grok-mcp</server_name>
<tool_name>image_understanding</tool_name>
<arguments>
{
  "image_url": "https://example.com/image.jpg",
  "prompt": "What is shown in this image?"
}
</arguments>
</use_mcp_tool>

base64 でエンコードされた画像も使用できます。

<use_mcp_tool>
<server_name>grok-mcp</server_name>
<tool_name>image_understanding</tool_name>
<arguments>
{
  "base64_image": "base64-encoded-image-data",
  "prompt": "What is shown in this image?"
}
</arguments>
</use_mcp_tool>

関数呼び出し

Grok を使用して、ユーザー入力に基づいて関数を呼び出します。

<use_mcp_tool>
<server_name>grok-mcp</server_name>
<tool_name>function_calling</tool_name>
<arguments>
{
  "messages": [
    {
      "role": "user",
      "content": "What's the weather like in San Francisco?"
    }
  ],
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "get_weather",
        "description": "Get the current weather in a given location",
        "parameters": {
          "type": "object",
          "properties": {
            "location": {
              "type": "string",
              "description": "The city and state, e.g. San Francisco, CA"
            },
            "unit": {
              "type": "string",
              "enum": ["celsius", "fahrenheit"],
              "description": "The unit of temperature to use"
            }
          },
          "required": ["location"]
        }
      }
    }
  ]
}
</arguments>
</use_mcp_tool>

APIリファレンス

チャット完了

Grok AI チャット補完を使用して応答を生成します。

パラメータ:

  • messages (必須): 役割とコンテンツを持つメッセージオブジェクトの配列

  • model (オプション): 使用する Grok モデル (デフォルトは grok-2-latest)

  • temperature (オプション):サンプリング温度(0~2、デフォルトは1)

  • max_tokens (オプション): 生成するトークンの最大数 (デフォルトは16384)

画像理解

Grok AI ビジョン機能を使用して画像を分析します。

パラメータ:

  • prompt (必須): 画像に添えるテキストプロンプト

  • image_url (オプション): 分析する画像のURL

  • base64_image (オプション): Base64でエンコードされた画像データ(data:imageプレフィックスなし)

  • model (オプション): 使用する Grok ビジョン モデル (デフォルトは grok-2-vision-latest)

注: image_urlまたはbase64_imageいずれかを指定する必要があります。

関数呼び出し

Grok AI を使用して、ユーザー入力に基づいて関数を呼び出します。

パラメータ:

  • messages (必須): 役割とコンテンツを持つメッセージオブジェクトの配列

  • tools (必須): タイプ、関数名、説明、パラメータを持つツールオブジェクトの配列

  • tool_choice (オプション): ツール選択モード (自動、必須、なし、デフォルトは自動)

  • model (オプション): 使用する Grok モデル (デフォルトは grok-2-latest)

発達

プロジェクト構造

  • src/index.ts - メインサーバーの実装

  • src/grok-api-client.ts - Grok API クライアント実装

建物

npm run build

ランニング

XAI_API_KEY="your-grok-api-key" node build/index.js

ライセンス

このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細についてはLICENSEファイルを参照してください。

謝辞

Available Tools

3 tools
chat_completionC

Generate a response using Grok AI chat completion

Inputs: messages (required), max_tokens, model, temperature.

function_callingC

Use Grok AI to call functions based on user input

Inputs: messages (required), tools (required), model, tool_choice.

image_understandingC

Analyze images using Grok AI vision capabilities (Note: Grok 3 may support image creation)

Inputs: prompt (required), base64_image, image_url, model.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: chat_completion handles text generation, function_calling manages function execution, and image_understanding focuses on visual analysis. There is no overlap in functionality, making tool selection straightforward for an agent.

    Naming Consistency4/5

    The tools follow a consistent snake_case naming convention, but the pattern is not strictly verb_noun (e.g., chat_completion, function_calling, image_understanding). The naming is readable and logical, with only minor deviations from a perfect pattern.

    Tool Count3/5

    With only 3 tools, the set feels thin for a general-purpose AI plugin, potentially lacking operations like text summarization, translation, or audio processing. However, it covers core AI functionalities adequately for basic use cases.

    Completeness3/5

    The tools cover key AI areas (text, functions, images), but there are notable gaps such as missing text analysis tools (e.g., sentiment analysis, summarization) and no explicit support for audio or video processing. The surface is functional but not comprehensive for a full AI suite.

    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.
      34 npm
      ISC
    • A
      license
      B
      quality
      D
      maintenance
      Enables interaction with the Grok AI through an MCP server, supporting chat completions, text completions, embeddings, and model operations with streaming capabilities.
      5
      51 npm
      7
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      Provides seamless access to Grok AI models through the Model Context Protocol by wrapping the official Grok CLI, offering tools for general queries, multi-turn conversations, and code generation.
      3
      18 PyPI
      9
      MIT
    • A
      license
      B
      quality
      F
      maintenance
      Enables chat completions using x.ai's Grok API with support for multiple Grok models (grok-beta, grok-2-latest, grok-4-latest) and configurable parameters like temperature and max tokens.
      1
      4 npm
      MIT

    Appeared in Searches