The Model Context Protocol (MCP) is an open-source standard that enables AI applications to connect with external systems through a universal interface. Groq supports remote tool use via MCP servers, allowing you to simply point to an MCP server URL and the Groq API will start using its tools without you having to implement any tool logic yourself.
This doc begins with a high-level overview of MCP and how it works. If you're already familiar with MCP, you can skip to the How to Use Remote MCP with Groq section.
Think of MCP as "USB-C for AI" - instead of building custom integrations for each service, you connect once to an MCP server and gain access to all its tools.
Traditional tool calling requires you to implement each tool yourself - you write the code, host the infrastructure, and maintain the integrations. MCP flips this model by letting external servers provide the tools, while you simply connect to them.
In the context of tool use, MCP servers feature two main RPC endpoints:
tools/list - Lists available tools from the MCP servertools/call - Executes a tool with the given argumentsThe MCP client (typically the application making requests to an LLM inference API like Groq; this could be your own application code or an LLM API client like ChatGPT or Claude Code) will first discover the available tools from the MCP server by making a request to the tools/list endpoint. The response will be a list of tools that the MCP server provides. These tools are then provided to the model at inference time, and any tools the model returns via its tool_calls parameter are then sent to the MCP server for execution using the tools/call endpoint.
MCP servers can be hosted locally (on your own machine or on the same server as your application) or remotely by you or a third party. Most servers are connected to via HTTP/SSE; local servers can be connected to via stdio.
Remote MCP on Groq is currently in beta. Please let us know your feedback in our Community.
Groq's Responses API supports remote tool use via MCP servers via HTTPS where Groq handles all orchestration. Instead of implementing the tool discovery and tool calling loop yourself, you can use Groq's Responses API to handle it for you.
With remote tool use, the Groq API will discover tools and pass them into the model at inference time. Any tool calls returned by the model are then sent to the MCP server for execution. Then the Groq API will parse the tool results and make another request to the model with the tool results. You don't implement anything - just provide the MCP server URL and authentication.
Your App → Makes request to Groq API with MCP server definitions ↓ Groq API → Discovers available tools from MCP server → Makes request to LLM with tool definitions ← Model returns tool_calls (or, if no tool calls are needed, returns final response) ↓ Groq API → Parses tool call arguments → Makes request to MCP server with tool call arguments ← MCP server returns results ↓ Groq API → Makes another request to LLM with tool results ← Model returns more tool_calls (returns to step 3), or returns final response ↓ Your App
Note: You can also integrate MCP servers into local tool calling loops, but typically you see lower latency with server-side tool calls via remote MCP.
MCP is ideal for:
MCP may not be the best choice for:
Alternative: For local MCP servers (stdio-based), you would need to implement the orchestration yourself, similar to local tool calling. In that case, regular local function calling might be simpler.
Remote MCP is available on all Groq models that support tool use:
| Model ID | Model |
|---|---|
openai/gpt-oss-20b | GPT-OSS 20B |
openai/gpt-oss-120b | GPT-OSS 120B |
qwen/qwen3-32b | Qwen3 32B |
moonshotai/kimi-k2-instruct-0905 | Kimi K2 Instruct |
meta-llama/llama-4-maverick-17b-128e-instruct | Llama 4 Maverick |
meta-llama/llama-4-scout-17b-16e-instruct | Llama 4 Scout |
llama-3.3-70b-versatile | Llama 3.3 70B |
llama-3.1-8b-instant | Llama 3.1 8B Instant |
Groq's implementation of MCP provides significant advantages:
MCP tools are added to your API request through the tools parameter. Each MCP tool specifies the server URL and authentication details.
{
"tools": [
{
"type": "mcp",
"server_label": "Huggingface",
"server_url": "https://mcp.huggingface.co",
"headers": {
"Authorization": "Bearer <YOUR_HF_TOKEN>"
},
"server_description": "Search and access AI models from Hugging Face",
"require_approval": "never",
"allowed_tools": null
}
]
}Key fields:
Here's a complete example using Hugging Face's MCP server to search for trending AI models:
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.GROQ_API_KEY,
baseURL: "https://api.groq.com/openai/v1",
});
const response = await client.responses.create({
model: "openai/gpt-oss-120b",
input: "What models are trending on Huggingface?",
tools: [
{
type: "mcp",
server_label: "Huggingface",
server_url: "https://huggingface.co/mcp",
}
]
});
console.log(response);import openai
import os
client = openai.OpenAI(
api_key=os.environ.get("GROQ_API_KEY"),
base_url="https://api.groq.com/openai/v1"
)
response = client.responses.create(
model="openai/gpt-oss-120b",
input="What models are trending on Huggingface?",
tools=[
{
"type": "mcp",
"server_label": "Huggingface",
"server_url": "https://huggingface.co/mcp",
}
]
)
print(response)curl -X POST "https://api.groq.com/openai/v1/responses" \
-H "Authorization: Bearer $GROQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-oss-120b",
"input": "What models are trending on Huggingface?",
"tools": [
{
"type": "mcp",
"server_label": "Huggingface",
"server_url": "https://huggingface.co/mcp"
}
]
}'When using MCP with the Responses API, you'll receive a structured response containing:
{
"id": "resp_01k59jhydefcd8wb7hbc460yav",
"object": "response",
"status": "completed",
"output": [
{
"type": "mcp_list_tools",
"id": "mcpl_1720577121",
"server_label": "Huggingface",
"tools": [...] // Available tools from the MCP server
},
{
"type": "reasoning",
"content": [
{
"type": "reasoning_text",
"text": "User asks: 'What are the trending models on Huggingface?' Need to fetch trending models..."
}
]
},
{
"type": "mcp_call",
"server_label": "Huggingface",
"name": "model_search",
"arguments": "{\"limit\":10,\"sort\":\"trendingScore\"}",
"output": "Showing first 10 models matching sorted by trendingScore..."
},
{
"type": "message",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "Here are the top 10 trending models on Hugging Face..."
}
]
}
]
}While MCP can work with the Chat Completions API, Groq's Responses API is specifically designed for agentic workflows involving tools and multi-step interactions.
Action-Oriented Design
Native MCP Support
Better Developer Experience
For detailed information on configuring the Responses API with Groq, see our Responses API documentation. Groq's remote MCP support is fully compatible with OpenAI's remote MCP API.
MCP servers have access to all data in your AI model's context, including your messages, system prompts, and previous conversation history. Only connect to MCP servers from trusted sources that you control or verify. Malicious servers could potentially exfiltrate sensitive information from your requests. Always review the server's documentation and security practices before integration.
Connect to Firecrawl's MCP server for automated web scraping and data extraction. You'll need a Firecrawl API key to authenticate.
Important Notes:
server_description to help the AI model understand when to use these toolsimport OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.GROQ_API_KEY,
baseURL: "https://api.groq.com/openai/v1",
});
const response = await client.responses.create({
model: "openai/gpt-oss-120b",
input: [
{
type: "message",
role: "user",
content: "What are the production models on https://console.groq.com/docs/models?"
}
],
tools: [
{
type: "mcp",
server_label: "firecrawl",
server_description: "Web scraping and content extraction capabilities",
server_url: "https://mcp.firecrawl.dev/<APIKEY>/v2/mcp",
require_approval: "never"
}
],
stream: false
});
console.log(response);import openai
import os
client = openai.OpenAI(
api_key=os.environ.get("GROQ_API_KEY"),
base_url="https://api.groq.com/openai/v1"
)
response = client.responses.create(
model="openai/gpt-oss-120b",
input=[
{
"type": "message",
"role": "user",
"content": "What are the production models on https://console.groq.com/docs/models?"
}
],
tools=[
{
"type": "mcp",
"server_label": "firecrawl",
"server_description": "Web scraping and content extraction capabilities",
"server_url": "https://mcp.firecrawl.dev/<APIKEY>/v2/mcp",
"require_approval": "never"
}
],
stream=False
)
print(response)curl -X POST "https://api.groq.com/openai/v1/responses" \
-H "Authorization: Bearer $GROQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-oss-120b",
"input": [
{
"type": "message",
"role": "user",
"content": "What are the production models on https://console.groq.com/docs/models?"
}
],
"tools": [
{
"type": "mcp",
"server_label": "firecrawl",
"server_description": "Web scraping and content extraction capabilities",
"server_url": "https://mcp.firecrawl.dev/<APIKEY>/v2/mcp",
"require_approval": "never"
}
],
"stream": false
}'A typical Firecrawl MCP response includes tool discovery, reasoning, and web scraping execution:
{
"id": "resp_01k5sv3np4fydva2jd9zzknbdv",
"object": "response",
"status": "completed",
"output": [
{
"type": "mcp_list_tools",
"server_label": "firecrawl",
"tools": [
{
"name": "firecrawl_scrape",
"description": "Scrape content from a single URL with advanced options..."
},
{
"name": "firecrawl_map",
"description": "Map a website to discover all indexed URLs..."
},
{
"name": "firecrawl_search",
"description": "Search the web and extract content from results..."
},
{
"name": "firecrawl_crawl",
"description": "Crawl a website and extract content from all pages..."
}
]
},
{
"type": "reasoning",
"content": [{
"type": "reasoning_text",
"text": "User wants models info from console.groq.com/docs/models. Will use firecrawl_search..."
}]
},
{
"type": "mcp_call",
"server_label": "firecrawl",
"name": "firecrawl_search",
"arguments": "{\"query\":\"Groq production models\",\"scrapeOptions\":{\"formats\":[\"markdown\"]}}",
"output": "{\"web\":[{\"url\":\"https://console.groq.com/docs/models\",\"markdown\":\"# Production Models...\"}]}"
},
{
"type": "message",
"role": "assistant",
"content": [{
"type": "output_text",
"text": "Here are the production models listed on Groq's documentation..."
}]
}
]
}Enable natural language web search for your AI agents with Parallel's MCP server. You'll need a Parallel API key.
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.GROQ_API_KEY,
baseURL: "https://api.groq.com/openai/v1",
});
const response = await client.responses.create({
model: "openai/gpt-oss-120b",
input: "What are the best models for agentic workflows on Groq? Search only on console.groq.com",
tools: [
{
type: "mcp",
server_label: "parallel_web_search",
server_url: "https://mcp.parallel.ai/v1beta/search_mcp/",
headers: {
"x-api-key": "<PARALLEL_API_KEY>"
},
require_approval: "never"
}
]
});
console.log(response);import openai
import os
client = openai.OpenAI(
api_key=os.environ.get("GROQ_API_KEY"),
base_url="https://api.groq.com/openai/v1"
)
response = client.responses.create(
model="openai/gpt-oss-120b",
input="What are the best models for agentic workflows on Groq? Search only on console.groq.com",
tools=[
{
"type": "mcp",
"server_label": "parallel_web_search",
"server_url": "https://mcp.parallel.ai/v1beta/search_mcp/",
"headers": {
"x-api-key": "<PARALLEL_API_KEY>"
},
"require_approval": "never"
}
]
)
print(response)curl -X POST "https://api.groq.com/openai/v1/responses" \
-H "Authorization: Bearer $GROQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-oss-120b",
"input": "What are the best models for agentic workflows on Groq? Search only on console.groq.com",
"tools": [
{
"type": "mcp",
"server_label": "parallel_web_search",
"server_url": "https://mcp.parallel.ai/v1beta/search_mcp/",
"headers": {
"x-api-key": "<PARALLEL_API_KEY>"
},
"require_approval": "never"
}
]
}'{
"id": "resp_01k59pzd4bfe698awmye9cnd99",
"object": "response",
"status": "completed",
"output": [
{
"type": "mcp_list_tools",
"server_label": "parallel_web_search",
"tools": [
{
"name": "web_search_preview",
"description": "Perform web searches with various search types and domain filtering...",
"input_schema": {
"properties": {
"objective": { "type": "string" },
"search_queries": { "type": "array" },
"search_type": { "enum": ["list", "targeted", "general", "single_page"] },
"include_domains": { "type": "array" }
}
}
}
]
},
{
"type": "reasoning",
"content": [{
"type": "reasoning_text",
"text": "Need to find best models for agentic workflows on Groq from console.groq.com..."
}]
},
{
"type": "mcp_call",
"server_label": "parallel_web_search",
"name": "web_search_preview",
"arguments": "{\"include_domains\":[\"console.groq.com\"],\"objective\":\"Find best models for agentic workflows\",\"search_queries\":[\"Groq agentic models\"],\"search_type\":\"targeted\"}",
"output": "[Results with relevant information from console.groq.com]"
},
{
"type": "message",
"role": "assistant",
"content": [{
"type": "output_text",
"text": "Best Groq models for agentic workflows based on console.groq.com documentation..."
}]
}
]
}Automate invoicing with Stripe's MCP server. You'll need a Stripe API key with appropriate permissions.
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.GROQ_API_KEY,
baseURL: "https://api.groq.com/openai/v1",
});
const response = await client.responses.create({
model: "openai/gpt-oss-120b",
input: "Create an invoice for $100 for customer Groq Labs Testing using Stripe.",
tools: [
{
type: "mcp",
server_label: "Stripe",
server_url: "https://mcp.stripe.com",
headers: {
Authorization: "Bearer <STRIPE_TOKEN>"
},
require_approval: "never"
}
]
});
console.log(response);import openai
import os
client = openai.OpenAI(
api_key=os.environ.get("GROQ_API_KEY"),
base_url="https://api.groq.com/openai/v1"
)
response = client.responses.create(
model="openai/gpt-oss-120b",
input="Create an invoice for $100 for customer Groq Labs Testing using Stripe.",
tools=[
{
"type": "mcp",
"server_label": "Stripe",
"server_url": "https://mcp.stripe.com",
"headers": {
"Authorization": "Bearer <STRIPE_TOKEN>"
},
"require_approval": "never"
}
]
)
print(response)curl -X POST "https://api.groq.com/openai/v1/responses" \
-H "Authorization: Bearer $GROQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-oss-120b",
"input": "Create an invoice for $100 for customer Groq Labs Testing using Stripe.",
"tools": [
{
"type": "mcp",
"server_label": "Stripe",
"server_url": "https://mcp.stripe.com",
"headers": {
"Authorization": "Bearer <STRIPE_TOKEN>"
},
"require_approval": "never"
}
]
}'MCP orchestrates multiple Stripe API calls to complete complex workflows. Here the model creates a customer, product, price, invoice, and finalizes it - all autonomously:
{
"id": "resp_01k59tasz2eg4as5q4n37kaqch",
"object": "response",
"status": "completed",
"output": [
{
"type": "mcp_list_tools",
"server_label": "Stripe",
"tools": [
{ "name": "create_customer" },
{ "name": "create_product" },
{ "name": "create_price" },
{ "name": "create_invoice" },
{ "name": "create_invoice_item" },
{ "name": "finalize_invoice" }
]
},
{
"type": "reasoning",
"content": [{
"text": "Need to create $100 invoice for Groq Labs Testing. Steps: 1. Create customer 2. Create product/price 3. Create invoice 4. Add item 5. Finalize..."
}]
},
{ "type": "mcp_call", "name": "create_customer", "output": "{\"id\":\"cus_ABC\"}" },
{ "type": "mcp_call", "name": "create_product", "output": "{\"id\":\"prod_XYZ\"}" },
{ "type": "mcp_call", "name": "create_price", "output": "{\"id\":\"price_123\"}" },
{ "type": "mcp_call", "name": "create_invoice", "output": "{\"id\":\"in_456\"}" },
{ "type": "mcp_call", "name": "create_invoice_item" },
{ "type": "mcp_call", "name": "finalize_invoice", "output": "{\"status\":\"open\",\"url\":\"https://invoice.stripe.com/...\"}" },
{
"type": "message",
"content": [{
"text": "Invoice created and finalized for $100 USD for Groq Labs Testing..."
}]
}
]
}This demonstrates MCP's power for multi-step agentic workflows - the model autonomously determines the sequence of operations needed and executes them.
Other payment processors also support MCP, such as PayPal's MCP server.
Connect to multiple MCP servers in a single request, allowing AI to coordinate across different systems:
{
"tools": [
{
"type": "mcp",
"server_label": "parallel_web_search",
"server_url": "https://mcp.parallel.ai/<token>",
"headers": { "x-api-key": "<PARALLEL_API_KEY>" },
"server_description": "Search the web for real-time information"
},
{
"type": "mcp",
"server_label": "Stripe",
"server_url": "https://mcp.stripe.com",
"headers": { "Authorization": "Bearer <STRIPE_TOKEN>" },
"server_description": "Create invoices and manage payments"
},
{
"type": "mcp",
"server_label": "github",
"server_url": "https://mcp.github.com/v1",
"headers": { "Authorization": "Bearer <GITHUB_TOKEN>" },
"server_description": "Access GitHub repositories and create issues"
}
]
}The model will intelligently select which MCP server(s) to use based on the query.
MCP servers often require authentication. Groq handles credentials securely:
Best Practices:
Provide clear server_description fields to help the model understand when to use each MCP server:
❌ Bad:
{
"server_label": "stripe",
"server_description": "Stripe API"
}✅ Good:
{
"server_label": "stripe",
"server_description": "Use this to create invoices, process payments, manage subscriptions, and handle billing for customers. Can create customers, products, prices, and finalize invoices."
}If you receive a 424 Failed Dependency error:
{
"error": {
"message": "Error retrieving tool list from MCP server: 'Stripe' Http status code: 401 (Unauthorized)",
"type": "external_connector_error",
"param": "tools",
"code": "http_error"
}
}Common causes:
Debugging steps:
If the model isn't using your MCP tools:
mcp_list_toolsIf require_approval is set to "always", the Groq API will wait for human approval before executing the tool call.
If this is the case, Groq returns the following response:
{
"type": "mcp_approval_request",
"id": "req_12345",
"server_label": "github",
"name": "create_issue",
"arguments": "{\"title\":\"Bug fix\"}"
}You can then approve or reject the tool call by passing an mcp_approval_response in your next request to the Groq API.
{
"type": "mcp_approval_response",
"approval_request_id": "req_12345",
"approve": true
}You can also set require_approval to "never", which will cause the model to execute the tool call without human approval. This is the default behavior if require_approval is not set.
Groq's MCP implementation is fully compatible with OpenAI's remote MCP specification. Existing integrations typically only need to change:
https://api.openai.com/v1 → https://api.groq.com/openai/v1openai/gpt-oss-120bWhile we recommend the Responses API for MCP, you can also use it with the Chat Completions API:
The Chat Completions API retrofits MCP onto a conversation-based interface. For the best MCP experience with multi-step workflows, use the Responses API.
import Groq from "groq-sdk";
const groq = new Groq({
apiKey: process.env.GROQ_API_KEY,
});
const completion = await groq.chat.completions.create({
model: "openai/gpt-oss-120b",
messages: [
{
role: "user",
content: "What models are trending on Huggingface?"
}
],
tools: [
{
type: "mcp",
server_label: "Huggingface",
server_url: "https://huggingface.co/mcp"
}
]
});
console.log(completion.choices[0].message);import os
from groq import Groq
client = Groq(
api_key=os.environ.get("GROQ_API_KEY"),
)
completion = client.chat.completions.create(
model="openai/gpt-oss-120b",
messages=[
{
"role": "user",
"content": "What models are trending on Huggingface?"
}
],
tools=[
{
"type": "mcp",
"server_label": "Huggingface",
"server_url": "https://huggingface.co/mcp"
}
]
)
print(completion.choices[0].message)curl -X POST "https://api.groq.com/openai/v1/chat/completions" \
-H "Authorization: Bearer $GROQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-oss-120b",
"messages": [
{
"role": "user",
"content": "What models are trending on Huggingface?"
}
],
"tools": [
{
"type": "mcp",
"server_label": "Huggingface",
"server_url": "https://huggingface.co/mcp"
}
]
}'Several organizations provide public MCP servers:
You can also build your own MCP server using the MCP specification.