> ## Documentation Index
> Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to set up the Atoti MCP Server in Python

> How to expose the Atoti MCP Server from an Atoti Python project through the `ai` plugin and an empty `AiConfig`, with the MCP endpoint location, authentication against the session's own security configuration, and steps to verify the tool list.

<Info>
  ### Atoti Intelligence SDK

  This is part of the Atoti Intelligence SDK offer.
</Info>

This guide explains how to expose the Atoti MCP Server from an Atoti Python project. Read more about best practices for configuring MCP across a deployment in [What are the best practices for MCP configuration?](../introduction#what-are-the-best-practices-for-mcp-configuration).

<Note>
  This guide covers exposing the Atoti MCP Server, so external clients can call session tools. It differs from connecting to other MCP Servers, where a session uses another server's tools as its own. See [Connect to other MCP Servers in Python](../connect-to-other-servers/setup-python).
</Note>

## Prerequisites

Before setting up the MCP Server, ensure the following requirements are met:

* An Atoti Python project
* A license including the Atoti Intelligence Extension tier, which itself requires Essentials

## How to install the package

Install the Atoti AI package:

```bash theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
uv add "atoti[ai]"
```

The `ai` plugin already brings the Atoti MCP Server through its own dependencies. No extra package or property is required, unlike the Java setup.

## How to enable the MCP Server

Pass an [`AiConfig`](https://docs.activeviam.com/products/atoti/python-sdk/latest/api/atoti_ai.AiConfig.html) to [`SessionConfig`](https://docs.activeviam.com/products/atoti/python-sdk/latest/api/atoti.config.SessionConfig.html) when starting the session. The MCP Server needs no LLM provider. An empty `AiConfig()` is enough, the same way Auto-Explain works without one:

```python theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
import atoti as tt
from atoti_ai import AiConfig

session = tt.Session.start(tt.SessionConfig(ai=AiConfig()))
```

## Where is the MCP endpoint?

The Atoti MCP Server is reachable at `f"{session.url}/mcp"`, over the Streamable HTTP transport.

## How to authenticate an MCP client

An MCP client authenticates against the session's own security configuration. The following example registers a user with HTTP Basic credentials and grants it a role:

```python theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
session.security.basic_authentication.credentials["mcp-user"] = "password"
session.security.individual_roles["mcp-user"] = {"ROLE_USER"}
```

An MCP client without valid credentials receives `401 Unauthorized`.

<Note>
  The Atoti Python SDK exposes no configuration for custom tools or for the OAuth 2.1 authentication modes. Both are set on a Java application; see [How to add custom tools](../custom-tools) and [Configure OAuth 2.1 discovery](./configure-oauth2-discovery). A Python session serves the built-in cube tools and authenticates through its own security configuration.
</Note>

## Verify the setup

After enabling the MCP Server, verify that it is available:

1. Start the Atoti session.
2. Create at least one cube, since the cube tools need one to be useful.
3. Point an MCP client at `{session.url}/mcp`.
4. Check that the tool list contains `runMdxQuery`.

## Related reading

* [How to set up the Atoti MCP Server in Java](./setup-java)
* [Connect to other MCP Servers in Python](../connect-to-other-servers/setup-python)
* [Connect with Postman](./connect-with-postman) to test the MCP Server
* [Connect with Claude](./connect-with-claude) to integrate with Claude AI
* [Configure OAuth 2.1 discovery](./configure-oauth2-discovery) to enable browser-based SSO
  against your IdP for MCP clients
* [Add custom tools](../custom-tools) to extend functionality
* [What is the Atoti MCP Server?](../introduction)
* [`atoti_ai.AiConfig`](https://docs.activeviam.com/products/atoti/python-sdk/latest/api/atoti_ai.AiConfig.html) API reference
