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

ParametersJSON Schema
NameRequiredDescriptionDefault
max_tokensNoMaximum number of tokens to generate
messagesYesArray of message objects with role and content
modelNoGrok model to use (e.g., grok-2-latest, grok-3, grok-3-reasoner, grok-3-deepsearch, grok-3-mini-beta)grok-3-mini-beta
temperatureNoSampling temperature (0-2)

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure but offers minimal information. It states what the tool does but doesn't describe rate limits, authentication requirements, response formats, error conditions, or any operational constraints. For a generative AI tool with significant behavioral implications, this is inadequate.

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

Conciseness5/5

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

The description is a single, efficient sentence that states the core purpose without unnecessary elaboration. It's appropriately sized for a tool with comprehensive schema documentation and gets straight to the point with zero wasted words.

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 generative AI tool with no annotations and no output schema, the description is insufficient. It doesn't explain what kind of response is generated, how to interpret results, error handling, or operational constraints. The agent lacks crucial context about this tool's behavior and outputs despite the comprehensive input schema.

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 the schema fully documents all 4 parameters. The description adds no parameter-specific information beyond what's already in the schema. According to scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in description.

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 action ('Generate a response') and the resource/technology ('using Grok AI chat completion'), which is specific and unambiguous. However, it doesn't differentiate this tool from its sibling tools (function_calling, image_understanding) - all three appear to be different Grok AI capabilities, but the description doesn't explain how chat completion differs from function calling or image understanding.

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 its siblings. There's no mention of appropriate contexts for chat completion versus function calling or image understanding, nor any prerequisites or constraints. The agent must infer usage from the tool name alone.

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

function_callingC

Use Grok AI to call functions based on user input

ParametersJSON Schema
NameRequiredDescriptionDefault
messagesYesArray of message objects with role and content
modelNoGrok model to use (e.g., grok-2-latest, grok-3, grok-3-reasoner, grok-3-deepsearch, grok-3-mini-beta)grok-3-mini-beta
tool_choiceNoTool choice mode (auto, required, none)auto
toolsYesArray of tool objects with type, function name, description, and parameters

TDQS

C2.7/5.0
Behavior2/5

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

With no annotations, the description carries full burden but only states the basic action without disclosing behavioral traits like rate limits, authentication needs, error handling, or output format. It mentions Grok AI but doesn't explain what that entails operationally, leaving significant gaps in transparency.

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

Conciseness5/5

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

The description is a single, efficient sentence with zero waste, front-loading the core purpose. It's appropriately sized for the tool's complexity, making it easy to parse without unnecessary elaboration.

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's complexity (4 parameters, no annotations, no output schema), the description is incomplete. It doesn't explain the return values, error conditions, or how function calling integrates with user input, leaving the agent under-informed for effective use.

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 the schema fully documents all 4 parameters. The description adds no meaning beyond what the schema provides, not explaining how parameters like messages or tools relate to function calling. Baseline 3 is appropriate as the schema does the heavy lifting.

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

Purpose3/5

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

The description states the tool 'call[s] functions based on user input' using Grok AI, which gives a general purpose but lacks specificity about what functions are called or how this differs from sibling tools like chat_completion. It's vague about the exact verb+resource combination beyond invoking AI capabilities.

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 alternatives like chat_completion or image_understanding. The description implies it's for function calling but doesn't specify contexts, prerequisites, or exclusions, leaving the agent without clear usage direction.

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

image_understandingC

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

ParametersJSON Schema
NameRequiredDescriptionDefault
base64_imageNoBase64-encoded image data (without the data:image prefix)
image_urlNoURL of the image to analyze
modelNoGrok vision model to use (e.g., grok-2-vision-latest, potentially grok-3 variants)grok-2-vision-latest
promptYesText prompt to accompany the image

TDQS

C2.8/5.0
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool analyzes images but does not describe what the analysis entails (e.g., object detection, captioning, OCR), potential limitations (e.g., image size restrictions, rate limits), or authentication needs. The note about Grok 3 adds confusion rather than transparency.

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 brief but includes a parenthetical note that is speculative and not directly relevant to the tool's current functionality, reducing efficiency. It is front-loaded with the core purpose, but the extra sentence detracts from conciseness without adding value.

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 tool with no annotations and no output schema, the description is incomplete. It lacks details on what the analysis returns (e.g., text descriptions, structured data), error conditions, or behavioral traits like rate limits. The note about Grok 3 does not compensate for these gaps, leaving the agent with insufficient context for effective use.

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 the schema already documents all four parameters thoroughly. The description adds no additional meaning about parameters beyond what the schema provides, such as explaining interactions between base64_image and image_url or elaborating on model options. Baseline 3 is appropriate as the schema does the heavy lifting.

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 as 'Analyze images using Grok AI vision capabilities' with a specific verb ('Analyze') and resource ('images'), distinguishing it from sibling tools like chat_completion and function_calling. However, it includes a parenthetical note about Grok 3 potentially supporting image creation, which slightly dilutes the clarity by introducing unrelated future capabilities.

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 alternatives like chat_completion or function_calling. It mentions Grok 3 may support image creation, but this is speculative and not actionable for current usage decisions. No explicit when/when-not scenarios or prerequisites are included.

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. 3 tool updatesv1.0.0
    • First observedchat_completion
    • First observedfunction_calling
    • First observedimage_understanding

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.

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.
    24 npm
    15
    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
    26 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
    8
    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