Grok MCP 插件 logo

Grok MCP 插件

Community
Bob-lance

MCP server for Grok AI API integration

PublisherBob-lance
Repositorygrok-mcp
LanguageJavaScript
Forks
11
Stars
25
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    Grok MCP 插件 exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    25 stars and 11 forks from the linked repository.

Grok MCP Plugin

npm version Smithery Build Status

A Model Context Protocol (MCP) plugin that provides seamless access to Grok AI's powerful capabilities directly from Cline.

Features

This plugin exposes three powerful tools through the MCP interface:

  1. Chat Completion - Generate text responses using Grok's language models
  2. Image Understanding - Analyze images with Grok's vision capabilities
  3. Function Calling - Use Grok to call functions based on user input

Prerequisites

  • Node.js (v16 or higher)
  • A Grok AI API key (obtain from console.x.ai)
  • Cline with MCP support

Installation

  1. Clone this repository:

    bash
    git clone https://github.com/Bob-lance/grok-mcp.git
    cd grok-mcp
  2. Install dependencies:

    bash
    npm install
  3. Build the project:

    bash
    npm run build
  4. Add the MCP server to your Cline MCP settings:

    For VSCode Cline extension, edit the file at:

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

    Add the following configuration:

    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": []
        }
      }
    }

    Replace /path/to/grok-mcp with the actual path to your installation and your-grok-api-key with your Grok AI API key.

Usage

Once installed and configured, the Grok MCP plugin provides three tools that can be used in Cline:

Chat Completion

Generate text responses using Grok's language models:

javascript
<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>

Image Understanding

Analyze images with Grok's vision capabilities:

javascript
<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>

You can also use base64-encoded images:

javascript
<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>

Function Calling

Use Grok to call functions based on user input:

javascript
<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 Reference

Chat Completion

Generate a response using Grok AI chat completion.

Parameters:

  • messages (required): Array of message objects with role and content
  • model (optional): Grok model to use (defaults to grok-3-mini-beta)
  • temperature (optional): Sampling temperature (0-2, defaults to 1)
  • max_tokens (optional): Maximum number of tokens to generate (defaults to 16384)

Image Understanding

Analyze images using Grok AI vision capabilities.

Parameters:

  • prompt (required): Text prompt to accompany the image
  • image_url (optional): URL of the image to analyze
  • base64_image (optional): Base64-encoded image data (without the data:image prefix)
  • model (optional): Grok vision model to use (defaults to grok-2-vision-latest)

Note: Either image_url or base64_image must be provided.

Function Calling

Use Grok AI to call functions based on user input.

Parameters:

  • messages (required): Array of message objects with role and content
  • tools (required): Array of tool objects with type, function name, description, and parameters
  • tool_choice (optional): Tool choice mode (auto, required, none, defaults to auto)
  • model (optional): Grok model to use (defaults to grok-3-mini-beta)

Development

Project Structure

  • src/index.ts - Main server implementation
  • src/grok-api-client.ts - Grok API client implementation

Building

bash
npm run build

Running

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

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements

Installation

TypingMind
{
  "mcpServers": {
    "grok-mcp": {
      "command": "node",
      "args": [
        "/path/to/grok-mcp/build/index.js"
      ],
      "env": {
        "XAI_API_KEY": "<XAI_API_KEY>"
      }
    }
  }
}

Use Grok MCP 插件 MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Grok MCP 插件 is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Grok MCP 插件 as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Grok MCP 插件 MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "grok-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "grok-mcp"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Grok MCP 插件 MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Grok MCP 插件 MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Grok MCP 插件 to help me with this task?
Grok MCP 插件
Sure. I read it.
Here is what I found using Grok MCP 插件.

Frequently asked questions

What is the Grok MCP 插件 MCP server used for?

Grok MCP 插件 is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Grok MCP 插件 MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Grok MCP 插件 with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Grok MCP 插件 MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Grok MCP 插件 connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Grok MCP 插件 MCP to TypingMind?

Grok MCP 插件 runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Grok MCP 插件 MCP provide in TypingMind?

Grok MCP 插件 exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Grok MCP 插件 MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Grok MCP 插件 requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇