# MCPTool

> **Class** in `langchain_azure_ai`

📖 [View in docs](https://reference.langchain.com/python/langchain-azure-ai/agents/_v2/prebuilt/tools/MCPTool)

A wrapper around the Foundry MCPTool for use in AgentServiceBaseToolV2.

This class exists to provide a consistent import path for users who want
to use the MCPTool with AgentServiceBaseToolV2, without needing
to import from azure.ai.projects.models directly.

## Signature

```python
MCPTool(
    self,
    server_label: str,
    server_url: str,
    headers: dict[str, str] | None = None,
    allowed_tools: list[str] | None = None,
    require_approval: Literal['always', 'never'] | None = None,
    project_connection_id: str | None = None,
)
```

## Extends

- `AgentServiceBaseTool`

## Constructors

```python
__init__(
    self,
    server_label: str,
    server_url: str,
    headers: dict[str, str] | None = None,
    allowed_tools: list[str] | None = None,
    require_approval: Literal['always', 'never'] | None = None,
    project_connection_id: str | None = None,
)
```

| Name | Type |
|------|------|
| `server_label` | `str` |
| `server_url` | `str` |
| `headers` | `dict[str, str] \| None` |
| `allowed_tools` | `list[str] \| None` |
| `require_approval` | `Literal['always', 'never'] \| None` |
| `project_connection_id` | `str \| None` |


---

[View source on GitHub](https://github.com/langchain-ai/langchain-azure/blob/7a6a664d617264df8dcb12fcfb1bacc09f21d504/libs/azure-ai/langchain_azure_ai/agents/_v2/prebuilt/tools.py#L127)