Labsco
Bob-lance logo

Grok MCP Plugin

โ˜… 25

from Bob-lance

Integrate with the Grok AI API to access its powerful language models.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedAccount requiredNeeds API keys

Grok MCP Plugin

<!-- Add badges here -->

npm version <!-- Replace with your actual package name if different --> Smithery Build Status <!-- Replace with your actual repo path -->

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

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

npm run build

Running

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