Assistants & MCP
Grok Bot & xAI MCP Integration
Equip Grok bots (Grok 3, Grok 3 Mini, Grok 2 Vision) with Model Context Protocol (MCP) tool calling — executing live GPU queries, multi-model completions, and image generation via OneInfer's MCP server.
Connect Grok bots to OneInfer using the streamable MCP endpoint https://mcp.oneinfer.ai/mcp. The Grok agent dynamically negotiates tools for model queries, pricing, image generation, and GPU provisioning.
Grok MCP Architecture & Setup
Rather than hardcoding REST calls, configure the Grok agent runner with OneInfer's MCP endpoint.
Configure your bot agent or IDE to communicate with OneInfer via MCP:
{
"mcpServers": {
"oneinfer": {
"type": "streamable-http",
"url": "https://mcp.oneinfer.ai/mcp"
}
}
}The Grok reasoning model accesses tools dynamically over HTTP/SSE without hardcoded API endpoints.
Configuring Grok Bot with OneInfer MCP
Add OneInfer to your bot or agent's MCP configuration manifest:
json
{
"mcpServers": {
"oneinfer": {
"type": "streamable-http",
"url": "https://mcp.oneinfer.ai/mcp"
}
}
}Executing MCP Tools from Grok 3
When running Grok 3 in an MCP-enabled agent harness, the model selects and executes OneInfer tools natively:
python
from mcp.client.sse import sse_client
from mcp import ClientSession
async with sse_client("https://mcp.oneinfer.ai/mcp") as (read, write):
async with ClientSession(read, write) as session:
await session.initialize()
# Grok bot asks for available models via MCP
result = await session.call_tool(
"oneinfer_list_models",
arguments={}
)
print("Available models:", result.content)