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

# Connect with an SDK

> List DataTurner MCP tools using a Python client and a scoped access token.

After your client is approved for your tenant and has obtained an access
token, set `MCP_ACCESS_TOKEN` securely in the client environment. Set
`MCP_RESOURCE_URL` to the full HTTPS MCP URL for that environment.

This example uses the [MCP Python SDK 2.3.0](https://github.com/modelcontextprotocol/python-sdk/tree/v2.3.0)
and lists the tools advertised by the Resource Server.

```python theme={null}
import asyncio
import os

import httpx2
from mcp import ClientSession
from mcp.client.streamable_http import streamable_http_client


async def main():
    token = os.environ["MCP_ACCESS_TOKEN"]
    url = os.environ["MCP_RESOURCE_URL"]
    async with httpx2.AsyncClient(headers={"Authorization": f"Bearer {token}"}) as http:
        async with streamable_http_client(url, http_client=http) as (reader, writer):
            async with ClientSession(reader, writer) as session:
                await session.initialize()
                for tool in (await session.list_tools()).tools:
                    print(tool.name)


asyncio.run(main())
```

See the [Hosted MCP protocol](https://docs.dataturner.io/mcp/overview.md) for HTTP errors and tool
refusals. The tool reference lists the scope for each call.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.