| Name | Type | Description |
|---|---|---|
server_label* | str | A label for this MCP server, used to identify it in tool calls. |
server_url | Optional[str] | Default: NoneThe URL for the MCP server. Either |
connector_id | Optional[str] | Default: None |
allowed_tools | Optional[McpAllowedTools] | Default: None |
headers | Optional[Dict[str, str]] | Default: None |
require_approval | Optional[McpRequireApproval] | Default: None |
server_description | Optional[str] | Default: None |
authorization | Optional[str] | Default: None |
A tool that gives the model access to an external MCP server.
Allows the model to call tools exposed by a remote Model Context Protocol (MCP) server within a single conversational turn.
Wraps :class:openai.types.responses.tool_param.Mcp.
Example::
from langchain_azure_ai.tools.builtin import McpTool
tool = McpTool(
server_label="my_server",
server_url="https://my-mcp-server.example.com",
)
model_with_mcp = model.bind_tools([tool])
Identifier for a built-in service connector (e.g.
"connector_gmail"). Either server_url or
connector_id must be provided.
List of tool names, or a
:class:~openai.types.responses.tool_param.McpAllowedToolsMcpToolFilter
dict, that the model is allowed to call on this server.
Optional HTTP headers to send with every request to the MCP server (e.g. for authentication).
Whether tool calls require human
approval before execution. Use
:data:~openai.types.responses.tool_param.McpRequireApproval
("always", "never", or an approval-filter dict).
Optional description of the MCP server.
OAuth access token for the MCP server.