Back to Blog
TutorialMay 29, 202614 min read

Test MCP With Grok (xAI): Setup Guide for Grok 4.3 + Remote MCP Tools (2026)

NT

Nikhil Tiwari

MCP Playground

📖 TL;DR — Test MCP with Grok (May 2026)

  • Grok 4.3 (live on the xAI API since May 5, 2026) supports Remote MCP Tools natively — in the xAI SDK, the OpenAI-compatible Responses API, and the Voice Agent API.
  • Configure it by adding {"type": "mcp", "server_url": "…", "server_label": "…"} to your tools array. Only Streamable HTTP and SSE transports are supported.
  • Grok Build (xAI’s terminal CLI, GA May 25, 2026) ships with MCP compatibility — any MCP server you wired for Claude Code works with zero changes.
  • For point-and-click setup, use grok.com/connectors → New Connector → Custom and paste your MCP server URL.
  • 1M-token context, 128 tools per request, parallel tool calls by default — Grok 4.3 is the cheapest frontier-tier model with native MCP support.

I spent the last week wiring MCP servers into Grok across all three xAI surfaces — the API, the new Grok Build CLI, and the grok.com Connectors UI. If you already test MCP servers against Claude or GPT-5, the punchline is short: you can test MCP with Grok today, and Grok 4.3 is the cheapest model in the frontier tier that supports it natively.

This guide is the fast path — every code sample is copy-pasteable, every limit is from the official xAI Remote MCP docs, and everything was verified against the May 2026 release notes. If you want to skip the API plumbing entirely, the free MCP Agent Studio lets you point Grok 4.3 at any MCP server in your browser with no keys.

1. What changed: Grok and MCP in May 2026

If you last tried wiring Grok to MCP in 2025, the answer was “not really” — tool calling worked, but MCP servers needed a wrapper. That shipped fast in May 2026:

  • May 5, 2026Grok 4.3 goes live on the xAI API with a 1M-token context window, 128 tools per request, and parallel tool calls by default.
  • May 14, 2026Grok Build beta launches: a terminal-native agentic CLI with up to 8 parallel sub-agents and native MCP support.
  • May 15, 2026grok-code-fast-1 deprecated; requests are routed to grok-build-0.1 ($0.20/M input tokens). Full retirement on August 15, 2026.
  • May 25, 2026 — Grok Build expands to all SuperGrok and X Premium+ subscribers.
  • Remote MCP Tools are now supported across three xAI APIs: the native SDK, the OpenAI-compatible Responses API, and the Voice Agent API.

In short, MCP is no longer a side-quest on xAI. It is a first-class capability. If you want the broader 2026 protocol picture, see the MCP 2026 roadmap.

2. Grok 4.3 specs that matter for MCP

Most model specs do not matter for MCP work. These five do:

Spec Grok 4.3 Why it matters for MCP
Context window1,000,000 tokensBig MCP toolsets and long tool-result chains fit without truncation.
Tools per requestUp to 128Enough for ~5–6 MCP servers connected at once.
Parallel tool callsDefault onIndependent MCP calls run concurrently — fewer round trips.
MCP transportsStreamable HTTP, SSENo STDIO from the API — your MCP server must be reachable on the public internet.
APIs that accept MCPxAI SDK, Responses, Voice AgentSame MCP config works in three places, including voice agents.

Sources: docs.x.ai/developers/models/grok-4.3 and docs.x.ai/developers/tools/remote-mcp, retrieved May 29, 2026.

3. Four ways to test MCP with Grok

Pick the surface that matches your goal:

  1. xAI native SDK — best for production code in Python or TypeScript.
  2. OpenAI-compatible Responses API — best if your codebase already speaks OpenAI.
  3. Grok Build CLI — best for terminal-native agentic coding loops.
  4. grok.com Connectors UI — best for zero-code one-off testing.

Below is the exact configuration for each. All four use the same MCP server — I'll use the public https://mcp.deepwiki.com/mcp server as a reference because it is the example in xAI’s own docs.

4. Method 1 — Remote MCP Tools via the xAI native SDK

The cleanest path. Drop your MCP server into the tools array and Grok handles discovery, schema injection, and parallel calls.

Required and optional MCP parameters

Field Status Purpose
server_urlRequiredThe MCP server endpoint. Streamable HTTP or SSE only.
server_labelRequiredIdentifier prefixed onto tool calls. Use a short, descriptive name.
server_descriptionOptionalFree-text hint about what the server does. Helps Grok pick the right tools.
allowed_toolsOptionalSubset of tool names to expose. Empty means all.
authorizationOptionalBearer token sent in the Authorization header.
headersOptionalExtra HTTP headers for the MCP server.

Python example

from xai_sdk import Client
from xai_sdk.chat import user

client = Client(api_key="YOUR_XAI_KEY")
chat = client.chat.create(
    model="grok-4.3",
    tools=[{
        "type": "mcp",
        "server_url": "https://mcp.deepwiki.com/mcp",
        "server_label": "deepwiki",
        "server_description": "DeepWiki docs lookup for any public GitHub repo.",
    }],
)
chat.append(user("What does the modelcontextprotocol/python-sdk repo do?"))
print(chat.sample().content)

Grok 4.3 will discover the server’s tools, call them in parallel where independent, and surface a final answer. You do not need to ship any tool definitions yourself.

Connecting multiple MCP servers at once

tools=[
    {"type": "mcp", "server_url": "https://mcp.deepwiki.com/mcp", "server_label": "deepwiki"},
    {"type": "mcp", "server_url": "https://your-postgres-mcp.example.com/sse", "server_label": "postgres",
     "authorization": "YOUR_DB_TOKEN", "allowed_tools": ["query", "list_tables"]},
]

Stay under 128 total tools across all servers — Grok silently drops the trailing tools over the cap. Use allowed_tools to keep the toolset tight.

⚠️ Common mistake

Pointing server_url at a STDIO-only MCP server. From the xAI API, only Streamable HTTP and SSE work. If you have a STDIO server, host it behind a Streamable HTTP wrapper first — our deployment guide covers five free options.

5. Method 2 — OpenAI-compatible Responses API

If your code already targets OpenAI’s Responses API, you can swap the base URL and keep the same MCP config. Grok’s implementation mirrors OpenAI’s tool schema with one caveat.

⚠️ Not supported (May 2026)

The require_approval and connector_id parameters from OpenAI’s Responses API are not currently supported by xAI’s implementation. Send them and the call still works — they just get ignored.

from openai import OpenAI

client = OpenAI(
    api_key="YOUR_XAI_KEY",
    base_url="https://api.x.ai/v1",
)
response = client.responses.create(
    model="grok-4.3",
    input="List the open issues on modelcontextprotocol/typescript-sdk",
    tools=[{
        "type": "mcp",
        "server_url": "https://mcp.deepwiki.com/mcp",
        "server_label": "deepwiki",
    }],
)
print(response.output_text)

Use HTTPS, set a descriptive server_label, and — if you already use Grok’s built-in tools — know that web_search, x_search, and code_interpreter execute server-side on xAI infrastructure. Your MCP tools run on your own server.

If you want a deeper comparison of MCP vs raw function calling, see MCP vs function calling vs REST APIs.

Test any MCP server with Grok 4.3 — no API key required

Paste any MCP URL into MCP Playground and switch between Grok 4.3, Claude, GPT-5.4, and 30+ other models in one tab.

Test an MCP server free →

6. Method 3 — Grok Build CLI (terminal-native MCP)

Grok Build is xAI’s answer to Claude Code: a terminal-native agentic CLI with up to 8 parallel sub-agents, a plan-first execution loop, and native MCP support. It launched in beta May 14 and rolled out to all SuperGrok and X Premium+ subscribers on May 25, 2026.

The big win: any MCP server you already configured for Claude Code works with Grok Build with zero reconfiguration — GitHub, Linear, Slack, your internal DB, your CI system. If you have a .mcp.json or a claude_desktop_config.json, Grok Build can read it.

Underlying model and pricing

  • Coding model: grok-build-0.1
  • Pricing: $0.20 per million input tokens
  • Replaces the deprecated grok-code-fast-1, which retires August 15, 2026

If your existing MCP config already powers Claude Code, point Grok Build at the same file and run.

7. Method 4 — Grok Connectors UI (zero-code custom MCP)

For one-off testing or non-engineering users, xAI shipped Bring Your Own MCP inside the Grok web app. Steps:

  1. Open grok.com/connectors.
  2. Click New Connector.
  3. Select Custom.
  4. Paste the MCP server URL and complete any auth flow the server prompts for.
  5. Grok discovers the tools and exposes them in your next chat.

Built-in connectors already cover SharePoint, Outlook, OneDrive, Google Workspace, Notion, GitHub, and Linear. The Custom flow is for everything else — your homegrown MCP server, an internal MCP gateway, or any third-party MCP endpoint.

Key requirement: the MCP server must be reachable on the public internet. For local servers, run a tunnel (ngrok, cloudflared) or deploy to a host. We list five free options in where to host MCP servers for free.

8. How MCP Playground helps you test Grok faster

Wiring API keys for a one-off test is a lot of ceremony. MCP Agent Studio lets you paste any MCP server URL, pick Grok 4.3 from the model dropdown, and start chatting in seconds — no xAI key, no SDK install. Every tool call, argument, and response is visible in the run log so you can debug schema or auth issues against the same model you’ll ship.

Better still, you can swap to Claude Opus 4.6, GPT-5.4, or 30+ other models against the same MCP server in the same session — useful when you’re choosing which model to commit to. Free credits on sign-up.

9. Limitations and gotchas (May 2026)

Three things will trip you up on day one:

  1. STDIO is not supported from the API. The API expects Streamable HTTP or SSE. If your MCP server runs over STDIO (the default for many Python and Node templates), wrap it in a Streamable HTTP transport.
  2. OpenAI Responses parity is incomplete. require_approval and connector_id are silently dropped. If you depend on human-in-the-loop approval, implement it in your application layer.
  3. 128 tools is a hard ceiling. Tools above 128 are dropped. If you connect three large MCP servers (each with 60+ tools), use allowed_tools to whitelist what you actually need.

There are also the usual operational concerns — token-budget bloat from long tool schemas and prompt injection via MCP tool descriptions. If you’re shipping Grok agents to production, run the MCP security scanner against every server you connect, and read safeguarding MCP servers from prompt injection first.

10. Grok 4.3 vs Claude vs GPT-5.4 for MCP tool calling

Where does Grok land? The April 2026 benchmarks tell a clear story — GPT-5.4 and GLM-5.1 lead pure MCP tool-calling benchmarks, Claude Opus 4.6 leads real-world agentic work, and Grok 4.3 is the value play.

Model Context Native MCP in API Best at
Grok 4.31MYes (3 surfaces)Cheapest frontier-tier MCP, voice agents
Claude Opus 4.6200kYes (mcp_servers)Real-world agentic work (SWE-bench 80.8%)
GPT-5.41MYes (Responses)Best all-rounder, leads BenchLM at 89.3
Gemini 3.1 Pro1M+Yes (ADK v2.0)Cross-server orchestration (69.2% MCP-Atlas)

For the full 30+ model leaderboard with prices, see best AI model for MCP tool calling in 2026. The short version: start with Grok 4.3 when cost matters, switch to Claude or GPT-5.4 when reliability on multi-step workflows matters more.

11. FAQ

Does Grok support MCP?
Yes. As of May 2026, Grok 4.3 supports Remote MCP Tools natively in the xAI SDK, the OpenAI-compatible Responses API, and the Voice Agent API. Grok Build (the CLI) also speaks MCP natively. Only Streamable HTTP and SSE transports are accepted — STDIO is not.
How do I connect a custom MCP server to Grok without writing code?
Go to grok.com/connectors, click New Connector → Custom, paste the MCP server URL, finish any auth flow, and Grok will discover and expose the server’s tools in your next chat. The server must be reachable on the public internet.
What models on xAI support MCP?
grok-4.3 is the documented model for Remote MCP Tools across the SDK, Responses API, and Voice Agent API. grok-build-0.1 powers Grok Build CLI and also speaks MCP. grok-code-fast-1 was deprecated on May 15, 2026 — requests now route to grok-build-0.1.
How many MCP tools can Grok 4.3 handle in one request?
Up to 128 tools per request across all connected MCP servers, with parallel tool calls on by default. Exceeding the cap silently drops trailing tools — use allowed_tools to keep each server’s exposed set tight.
Can I use Grok with the same MCP config as Claude Code?
Yes. Grok Build is designed for drop-in compatibility — any MCP server already configured for Claude Code (GitHub, Linear, Slack, internal DBs, CI) works with zero reconfiguration. For Claude Code config locations, see our Claude Code MCP setup guide.
Why does my Responses API call ignore require_approval?
xAI’s implementation of the OpenAI-compatible Responses API does not currently support require_approval or connector_id. The call still succeeds, but those fields are dropped. Implement approval flows in your application layer for now.
How do I test Grok against an MCP server without an xAI key?
Use MCP Agent Studio. Paste the MCP server URL, pick Grok 4.3 from the model dropdown, and start chatting — no xAI key needed. Every tool call and response is logged. Free credits on sign-up.

Wrapping up

Grok 4.3 lands MCP support across three APIs and one CLI, with the cheapest frontier pricing and a 1M-token context. The setup is short: drop your MCP server URL in the tools array, mind the Streamable HTTP / SSE constraint, and stay under 128 tools.

If you’re deciding between Grok and Claude or GPT-5.4 for a real MCP workload, the fastest answer is to run the same task against all three. MCP Agent Studio lets you swap models against one MCP server in a single browser tab — free to start.

NT

Written by Nikhil Tiwari

15+ years in product development. AI enthusiast building developer tools that make complex technologies accessible to everyone.

Test any MCP server with 30+ AI models — free

Connect any MCP endpoint and chat with Claude, GPT-5, Gemini, DeepSeek and more. Watch every tool call live.

✦ Free credits on sign-up · no credit card needed

Try for Free →
Test MCP With Grok (xAI): Setup Guide for Grok 4.3 + Remote MCP Tools (2026) | MCP Playground