Interface: XAIMcpTool
@providerprotocol/ai / xai / XAIMcpTool
Interface: XAIMcpTool
Section titled “Interface: XAIMcpTool”Defined in: src/providers/xai/types.ts:388
Remote MCP server tool configuration.
Enables Grok to connect to external Model Context Protocol servers. Pricing: Token-based only (no per-invocation charge).
Example
Section titled “Example”const tool: XAIMcpTool = { type: 'mcp', server_url: 'https://my-mcp-server.com/sse', server_label: 'my_tools',};Properties
Section titled “Properties”allowed_tool_names?
Section titled “allowed_tool_names?”
optionalallowed_tool_names:string[]
Defined in: src/providers/xai/types.ts:398
Specific tools to enable (empty = all available)
authorization?
Section titled “authorization?”
optionalauthorization:string
Defined in: src/providers/xai/types.ts:400
Authentication token
extra_headers?
Section titled “extra_headers?”
optionalextra_headers:Record<string,string>
Defined in: src/providers/xai/types.ts:402
Custom request headers
server_description?
Section titled “server_description?”
optionalserver_description:string
Defined in: src/providers/xai/types.ts:396
Description of server capabilities
server_label?
Section titled “server_label?”
optionalserver_label:string
Defined in: src/providers/xai/types.ts:394
Server label for tool call prefixing
server_url
Section titled “server_url”server_url:
string
Defined in: src/providers/xai/types.ts:392
MCP server URL (HTTP Streaming/SSE only)
type:
"mcp"
Defined in: src/providers/xai/types.ts:390
Tool type identifier