xAI MCP Server
for AI Agents
Connect your AI agent to StackOne's xAI MCP server and give it 99 MCP tools out of the box. Auth, tool execution, and security all managed.
Coverage
99 Agent Actions
Agents can read, write and delete in xAI. Extend your agent's capabilities with custom actions.
Authentication
Agent Tool Authentication
Per-user OAuth in one call. Your xAI MCP server gets session-scoped tokens with zero credentials stored on your infra.
Agent Auth →Security
Agent Protection
Every xAI tool response scanned for prompt injection in about 2.5 ms, with 0.94 F1 on tool-response attacks, all running on a CPU.
Prompt Injection Defense →Performance
Max Agent Context. Min Cost.
Free up to 96% of your agent's context window to enhance reasoning and reduce cost, on every xAI call.
Tools Discovery →What is the xAI MCP Server?
A xAI MCP server lets AI agents read and write xAI data through the Model Context Protocol, Anthropic's open standard for connecting LLMs to external tools. StackOne's xAI MCP server ships with 99 pre-built actions, fully extensible via the Connector Builder, plus managed authentication, prompt injection defense, observability, and agent execution runtime. Connect it from MCP clients like Claude Desktop, Claude Code, Cursor, Goose, and VS Code, or from agent frameworks like OpenAI Agents SDK, LangChain, and Vercel AI SDK.
All xAI MCP Tools
Every StackOne action for xAI, ready for your agent. Read, write and delete, scoped to exactly what you need.
API Keys
- Create API Key
Create an API key in an xAI console team.
- List API Keys
List the API keys of an xAI console team.
- Update API Key
Change the name, limits, permissions or disabled state of an xAI API key.
- Delete API Key
Delete an xAI API key for good.
Requests
- Add Batch Requests
Add chat, responses, image or video requests to an xAI batch.
- List Batch Requests
List the requests in an xAI batch with the state of each, a page at a time.
Billing Infos
- Get Billing Info
Get the billing name, address, email and tax ID of an xAI console team.
- Set Billing Info
Save the billing name, address, email and tax ID of an xAI console team.
Spending Limits
- Get Spending Limits
Get the monthly postpaid spending limits of an xAI console team.
- Set Spending Limit
Set the monthly postpaid spending limit of an xAI console team.
Collections
- Create Collection
Create an xAI collection that indexes documents for search.
- Search Collections
Search the documents in one or more xAI collections and return the best-matching chunks.
- List Collections
List the collections of an xAI team, a page at a time.
- Get Collection
Get the settings of one xAI collection.
- Update Collection
Rename an xAI collection or change its chunking and document fields.
- Delete Collection
Delete an xAI collection for good.
Collection Documents
- Add Collection Document
Add an uploaded xAI file to a collection so it can be searched.
- List Collection Documents
List the documents in an xAI collection with their indexing status, a page at a time.
- Get Collection Document
Get one document of an xAI collection with its indexing status.
- Batch Get Collection Documents
Get several documents of an xAI collection in one call.
- Remove Collection Document
Remove a document from an xAI collection.
Files
- List Files
List the files stored in the xAI team, a page at a time.
- Get File
Get the details of one stored xAI file.
- Delete File
Delete a stored xAI file for good.
Grok Team Directory Groups
- List Grok Team Directory Groups
List the Grok team's directory groups with their member counts and spend limits.
- Get Grok Team Directory Group
Get one of the Grok team's directory groups by ID.
Unified Groups
- List Unified Groups
List unified directory groups in a Grok team.
- Get Unified Group
Get a unified Grok team directory group by ID.
Unified Roles
- List Unified Roles
List the built-in roles of a Grok team.
- Get Unified Role
Get a built-in Grok team role by ID.
Unified Users
- List Unified Users
List unified users in a Grok team.
- Get Unified User
Get a unified Grok team member by ID.
Models
- List Models
List the models the xAI API key can use, with prices.
- Get Model
Get one model by ID or alias, with its prices.
Language Models
- List Language Models
List the chat and image understanding models the xAI API key can use, with prices.
- Get Language Model
Get one chat and image understanding model by ID or alias, with its prices.
Image Generation Models
- List Image Generation Models
List the image generation models the xAI API key can use, with prices.
- Get Image Generation Model
Get one image generation model by ID or alias, with its prices.
Video Generation Models
- List Video Generation Models
List the video generation models the xAI API key can use, with prices.
- Get Video Generation Model
Get one video generation model by ID or alias, with its prices.
Embedding Models
- List Embedding Models
List the embedding models the xAI API key can use, with prices.
- Get Embedding Model
Get one embedding model by ID or alias, with its prices.
Responses
- Create Response
Generate a Grok model response from text, image or file input, stored for later retrieval.
- Get Response
Get a stored Grok model response by ID.
- Delete Response
Delete a stored Grok model response.
Skills
- List Skills
List the hosted skills uploaded to the xAI team, a page at a time.
- Get Skill
Get the details of one hosted xAI skill.
- Delete Skill
Delete a hosted xAI skill for good.
Phone Numbers
- Create Phone Number
Add a phone number that routes SIP calls to an xAI voice agent or webhook.
- List Phone Numbers
List the phone numbers of the xAI team, a page at a time.
- Delete Phone Number
Remove a Direct SIP or Twilio-imported phone number from the xAI team.
TTS Voices
- List TTS Voices
List the built-in xAI voices for text to speech.
- Get TTS Voice
Get one built-in xAI text to speech voice.
Custom Voices
- List Custom Voices
List the custom voices the xAI team has made, a page at a time.
- Get Custom Voice
Get one custom voice of the xAI team.
- Update Custom Voice
Change the name, description or labels of a custom xAI voice.
- Delete Custom Voice
Delete a custom xAI voice for good.
Other (42)
- Create Batch
Create an xAI batch to run many model requests in the background at a lower price.
- Create Chat Completion
Send a conversation to a Grok model and get its reply.
- Create Embeddings
Turn text into embedding vectors with an xAI embedding model.
- Create File Public URL
Publish a stored xAI file at a public URL anyone can open.
- Create Speech
Turn text into spoken audio with an xAI voice, returned as base64 with timings.
- Get API Key Info
Get the name, status and permissions of the xAI API key the connection uses.
- Get Me
Get the user, team and API key behind the xAI connection.
- Get API Key Propagation
Check whether an xAI API key has reached every inference cluster.
- List Audit Events
List the audit events of an xAI console team, such as API key and membership changes.
- List Batches
List the batches of the xAI team, a page at a time.
- Get Batch
Get one xAI batch with its progress counts.
- List Batch Results
List the answers of the finished requests in an xAI batch, a page at a time.
- List Invoices
List the invoices of an xAI console team, with line items and payment status.
- List Payment Methods
List the cards and bank accounts on file for an xAI console team.
- Get Prepaid Balance
Get the prepaid credit balance of an xAI console team and its history.
- Get Usage
Get the API usage and spend of an xAI console team over time, grouped as asked.
- Get Deferred Chat Completion
Fetch the result of a chat completion started with deferred set to true.
- List Grok Team Members
List every member of the Grok team with their role and removal status.
- List Grok Team Directory Group Members
List the members of one Grok team directory group.
- Get Unified Credentials
Get the current xAI connection's unified credentials and identity.
- Get Deferred Image
Fetch the result of an image generation or edit started with deferred set to true.
- List Response Input Items
List the input items of a stored Grok model response, a page at a time.
- List Team Models
List the models an xAI console team can use, with prices and rate limits.
- List Team Endpoint ACLs
List the endpoint ACLs that can be given to API keys of an xAI console team.
- Get Deferred Video
Fetch the status and result of a video generation, edit or extension.
- Set Default Payment Method
Make a payment method on file the default for an xAI console team.
- Rotate API Key
Replace the secret of an xAI API key, ending the old secret.
- Cancel Batch
Stop an xAI batch so its pending requests are not processed.
- Preview Postpaid Invoice
Preview what an xAI console team owes for postpaid usage this billing period.
- Top Up Prepaid Credits
Buy prepaid credits for an xAI console team, charged to its default payment method.
- Regenerate Collection Document
Rebuild the search index of one document in an xAI collection.
- Revoke File Public URL
Turn off the public URL of a stored xAI file.
- Generate Image
Generate images from a text prompt with a Grok image model.
- Edit Image
Edit one or more images from a text prompt with a Grok image model.
- Validate Management Key
Check the xAI management key the connection uses and return its scope and permissions.
- Compact Response Input
Shorten a long Responses input window into one compacted item to send next time.
- Tokenize Text
Split text into the tokens a Grok model reads, with each token id.
- Generate Video
Start generating a video from a text prompt, an image or reference images.
- Edit Video
Start editing a video from a text prompt.
- Extend Video
Start generating a continuation of a video from a text prompt.
- Transfer SIP Call
Transfer an active xAI SIP call to a phone number or SIP address.
- Hang Up SIP Call
End an active xAI SIP call.
Set Up Your xAI MCP Server in Minutes
One endpoint. Any framework. Your agent is talking to xAI in under 10 lines of code.
Agent Frameworks
{
"mcpServers": {
"stackone": {
"command": "npx",
"args": [
"-y",
"mcp-remote@latest",
"https://api.stackone.com/mcp?x-account-id=<account_id>",
"--header",
"Authorization: Basic <YOUR_BASE64_TOKEN>"
]
}
}
}Platform Resources
Comparing BM25, TF-IDF, and Hybrid Search for MCP Tool Discovery
Benchmarking BM25, TF-IDF, and hybrid search for MCP tool discovery across 916 tools. The 80/20 TF-IDF/BM25 hybrid hits 21% Top-1 accuracy in under 1ms.
10 min
Indirect Prompt Injection Defense for MCP Tools: A Technical Guide
MCP tools that read emails, CRM records, and tickets are indirect prompt injection vectors. Here's how we built a two-tier defense that scans tool results in ~11ms.
12 min
MCP vs A2A: Architecture, Security, and When to Use Each
MCP vs A2A: what each protocol standardizes, how they differ, the security risks they share, and when to use one, both or a hybrid.
12 min
MCP vs API: What Hundreds of Connector Builds Taught Us
MCP wraps APIs, it doesn't replace them. After building hundreds of connectors that serve both, here's when each approach wins.
14 min read
FAQ
xAI MCP Server FAQ
origin_owner_id.