---
sidebar:
  hidden: true
title: roboto.ai.mcp.operations
---
## Module Contents

### AdminRegisterMcpServerRequest

```python
class roboto.ai.mcp.operations.AdminRegisterMcpServerRequest(/, **data: Any)
```

`from roboto.ai.mcp import AdminRegisterMcpServerRequest`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/ai/mcp/operations.py#L137-L199)

Bases: `pydantic.BaseModel`

Request body for `POST /v1/mcp/admin/servers`.

Registers an external MCP server for the organizations in `org_ids`, or for every organization. Only Roboto administrators may send it. No SDK method sends it. Unlike `RegisterMcpServerRequest`, it always creates a new server, even when one is already registered at `server_url`, and it stores `allowed_tools`. The two requests share their other behavior: `RegisterMcpServerRequest` describes how `registration_mode` decides which fields Roboto uses, and which values Roboto and `pydantic.ValidationError` reject.

**Parameters**

- **data** (`Any`)

**Attributes**

- **AdminRegisterMcpServerRequest.allowed_tools** (`dict[str, bool] | None`) = `None`: Tools Roboto's AI may call on the server, as a map of tool name to whether it is enabled.

  The AI cannot call a tool missing from the map. `None` leaves the allowlist unset until the AI first lists the server's tools, when Roboto fills it in with every tool the server offers: if any tool carries the MCP `readOnlyHint` annotation, only tools marked read-only are enabled, and otherwise every tool is.

- **AdminRegisterMcpServerRequest.authorization_endpoint** (`str | None`) = `None`: URL of the OAuth 2.0 authorization endpoint. Used only with `RegistrationMode.MANUAL`.

- **AdminRegisterMcpServerRequest.client_id** (`str | None`) = `None`: OAuth 2.0 client ID from the provider's developer settings. Used only with `RegistrationMode.MANUAL`.

- **AdminRegisterMcpServerRequest.client_secret** (`str | None`) = `None`: OAuth 2.0 client secret from the provider's developer settings. Used only with `RegistrationMode.MANUAL`.

- **AdminRegisterMcpServerRequest.display_name** (`str`) = `None`: Human-readable name of the server, such as `GitHub`: 1 to 32 letters, digits, hyphens and underscores.

- **AdminRegisterMcpServerRequest.extra_auth_params** (`dict[str, str]`) = `None`: Further query parameters for the provider's authorization URL, such as `{"audience": "api.atlassian.com"}`.

  Standard OAuth 2.0, PKCE and OpenID Connect parameter names, such as `state`, `scope` and `prompt`, raise `RobotoInvalidRequestException`.

- **AdminRegisterMcpServerRequest.oauth_issuer_url** (`str | None`) = `None`: URL of the OAuth 2.0 authorization server, such as `https://github.com`.

  With `RegistrationMode.DCR`, `None` uses `server_url`.

- **AdminRegisterMcpServerRequest.org_ids** (`list[str]`) = `None`: IDs of the organizations that can use the server. An empty list makes it visible to every organization.

- **AdminRegisterMcpServerRequest.registration_mode** (`RegistrationMode`): How Roboto gets the server's OAuth client. Defaults to `RegistrationMode.MANUAL`.

- **AdminRegisterMcpServerRequest.revocation_endpoint** (`str | None`) = `None`: URL of the OAuth 2.0 token revocation endpoint, or `None` if the provider has none.

  Used only with `RegistrationMode.MANUAL`.

- **AdminRegisterMcpServerRequest.scopes** (`list[str]`) = `None`: OAuth 2.0 scopes to request when a user connects the server. Defaults to none.

- **AdminRegisterMcpServerRequest.server_url** (`str`): URL of the server's MCP endpoint, which must use the Streamable HTTP transport.

- **AdminRegisterMcpServerRequest.token_endpoint** (`str | None`) = `None`: URL of the OAuth 2.0 token endpoint. Used only with `RegistrationMode.MANUAL`.

### CopyMcpServerAllowedToolsRequest

```python
class roboto.ai.mcp.operations.CopyMcpServerAllowedToolsRequest(/, **data: Any)
```

`from roboto.ai.mcp import CopyMcpServerAllowedToolsRequest`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/ai/mcp/operations.py#L245-L253)

Bases: `pydantic.BaseModel`

Request body for `POST /v1/mcp/admin/servers/{server_id}/copy-allowed-tools`.

Replaces the server's tool allowlist with another server's. Only Roboto administrators may send it. No SDK method sends it.

**Parameters**

- **data** (`Any`)

**Attributes**

- **CopyMcpServerAllowedToolsRequest.source_server_id** (`str`): ID of the server whose tool allowlist to copy.

### OAuthCallbackRequest

```python
class roboto.ai.mcp.operations.OAuthCallbackRequest(/, **data: Any)
```

`from roboto.ai.mcp import OAuthCallbackRequest`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/ai/mcp/operations.py#L121-L134)

Bases: `pydantic.BaseModel`

Request body for `POST /v1/mcp/oauth/callback`.

Completes the flow `StartOAuthFlowResponse` began: Roboto exchanges `code` for the user's tokens and stores them. The user who started the flow must send it, in the same organization. A `state` that is unknown, more than 10 minutes old, or already used raises `RobotoNotFoundException`; one another user or organization started raises `RobotoUnauthorizedException`. A provider that rejects the code raises `RobotoInvalidRequestException`.

**Parameters**

- **data** (`Any`)

**Attributes**

- **OAuthCallbackRequest.code** (`str`): Authorization code the provider returned after the user authorized Roboto.
- **OAuthCallbackRequest.state** (`str`): `StartOAuthFlowResponse.state` of the flow this request completes.

### RegisterMcpServerRequest

```python
class roboto.ai.mcp.operations.RegisterMcpServerRequest(/, **data: Any)
```

`from roboto.ai.mcp import RegisterMcpServerRequest`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/ai/mcp/operations.py#L33-L103)

Bases: `pydantic.BaseModel`

Request body for `POST /v1/mcp/servers`.

Registers an external Model Context Protocol (MCP) server, whose tools Roboto's AI can call, for the caller's organization only. Only organization administrators may send it. No SDK method sends it. When a server at `server_url` is already registered for the organization, Roboto returns that server and changes nothing.

How Roboto gets the server's OAuth client depends on `registration_mode`:

- `RegistrationMode.DCR` reads the endpoints from the metadata `oauth_issuer_url` publishes and registers a client there, ignoring `authorization_endpoint`, `token_endpoint`, `revocation_endpoint`, `client_id` and `client_secret`. An authorization server that publishes no such metadata, or does not offer Dynamic Client Registration, raises `RobotoInvalidRequestException`; register the server with `RegistrationMode.MANUAL` instead.
- `RegistrationMode.MANUAL` takes the client from the request. Leaving out `oauth_issuer_url`, `authorization_endpoint`, `token_endpoint`, `client_id` or `client_secret` raises `RobotoInvalidRequestException`.

A URL that does not use `https` or resolve to a public address raises `RobotoInvalidRequestException`. Building it raises `pydantic.ValidationError` when:

- `display_name` is empty.
- `display_name` is longer than 32 characters.
- `display_name` holds a character other than a letter, digit, hyphen or underscore.

**Parameters**

- **data** (`Any`)

**Attributes**

- **RegisterMcpServerRequest.allowed_tools** (`dict[str, bool] | None`) = `None`: the server starts with no tool allowlist, which Roboto fills in when the AI first lists its tools.

  `AdminRegisterMcpServerRequest.allowed_tools` describes how Roboto fills it in.

- **RegisterMcpServerRequest.authorization_endpoint** (`str | None`) = `None`: URL of the OAuth 2.0 authorization endpoint. Used only with `RegistrationMode.MANUAL`.

- **RegisterMcpServerRequest.client_id** (`str | None`) = `None`: OAuth 2.0 client ID from the provider's developer settings. Used only with `RegistrationMode.MANUAL`.

- **RegisterMcpServerRequest.client_secret** (`str | None`) = `None`: OAuth 2.0 client secret from the provider's developer settings. Used only with `RegistrationMode.MANUAL`.

- **RegisterMcpServerRequest.display_name** (`str`) = `None`: Human-readable name of the server, such as `GitHub`: 1 to 32 letters, digits, hyphens and underscores.

- **RegisterMcpServerRequest.extra_auth_params** (`dict[str, str]`) = `None`: Further query parameters for the provider's authorization URL, such as `{"audience": "api.atlassian.com"}`.

  Standard OAuth 2.0, PKCE and OpenID Connect parameter names, such as `state`, `scope` and `prompt`, raise `RobotoInvalidRequestException`.

- **RegisterMcpServerRequest.oauth_issuer_url** (`str | None`) = `None`: URL of the OAuth 2.0 authorization server. With `RegistrationMode.DCR`, `None` uses `server_url`.

- **RegisterMcpServerRequest.registration_mode** (`RegistrationMode`): How Roboto gets the server's OAuth client. Defaults to `RegistrationMode.DCR`.

- **RegisterMcpServerRequest.revocation_endpoint** (`str | None`) = `None`: URL of the OAuth 2.0 token revocation endpoint, or `None` if the provider has none.

  Used only with `RegistrationMode.MANUAL`.

- **RegisterMcpServerRequest.scopes** (`list[str]`) = `None`: OAuth 2.0 scopes to request when a user connects the server. Defaults to none.

- **RegisterMcpServerRequest.server_url** (`str`): URL of the server's MCP endpoint, which must use the Streamable HTTP transport.

- **RegisterMcpServerRequest.token_endpoint** (`str | None`) = `None`: URL of the OAuth 2.0 token endpoint. Used only with `RegistrationMode.MANUAL`.

### RegistrationMode

```python
class roboto.ai.mcp.operations.RegistrationMode
```

`from roboto.ai.mcp import RegistrationMode`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/ai/mcp/operations.py#L13-L24)

Bases: `str`, `enum.Enum`

Registration mode of an MCP server: how Roboto gets the OAuth 2.0 client it connects users to the server with.

**Attributes**

- **RegistrationMode.DCR** = `'dcr'`: Roboto registers its own client with the server's authorization server, by Dynamic Client Registration.

  It reads the OAuth endpoints from the metadata that authorization server publishes. Dynamic Client Registration is defined by RFC 7591: [https://datatracker.ietf.org/doc/html/rfc7591](https://datatracker.ietf.org/doc/html/rfc7591)

- **RegistrationMode.MANUAL** = `'manual'`: The caller supplies the OAuth endpoints, client ID and client secret.

### SetMcpServerOrgContextRequest

```python
class roboto.ai.mcp.operations.SetMcpServerOrgContextRequest(/, **data: Any)
```

`from roboto.ai.mcp import SetMcpServerOrgContextRequest`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/ai/mcp/operations.py#L259-L270)

Bases: `pydantic.BaseModel`

Request body for `PUT /v1/mcp/servers/{server_id}/context`.

Sets text that tells Roboto's AI how the caller's organization uses an MCP server, such as which repositories or projects to work in, replacing any already set. Only organization administrators may send it. No SDK method sends it. The AI receives the text with its instructions in every conversation in the organization, including those of members who have not connected the server. The 4000-character limit bounds how much organization-written text the AI receives as instructions. A longer `context` raises `pydantic.ValidationError`.

**Parameters**

- **data** (`Any`)

**Attributes**

- **SetMcpServerOrgContextRequest.context** (`str`) = `None`: Text to give the AI, at most 4000 characters. An empty string clears it.

### SetMcpServerOrgCredentialRequest

```python
class roboto.ai.mcp.operations.SetMcpServerOrgCredentialRequest(/, **data: Any)
```

`from roboto.ai.mcp import SetMcpServerOrgCredentialRequest`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/ai/mcp/operations.py#L273-L286)

Bases: `pydantic.BaseModel`

Request body for `PUT /v1/mcp/servers/{server_id}/org-credential`.

Sets the organization-wide token the caller's organization uses for the server, replacing any already set. Only organization administrators may send it. No SDK method sends it. An empty `secret_name` raises `pydantic.ValidationError`.

**Parameters**

- **data** (`Any`)

**Attributes**

- **SetMcpServerOrgCredentialRequest.secret_name** (`str`) = `None`: Name of a [`Secret`](/docs/reference/python-sdk/roboto/domain/secrets/secret#roboto.domain.secrets.secret.Secret) in the caller's organization, whose value is the token.

  Roboto sends the token to the server as a bearer token. A name that matches no secret raises `RobotoInvalidRequestException`.

### StartOAuthFlowResponse

```python
class roboto.ai.mcp.operations.StartOAuthFlowResponse(/, **data: Any)
```

`from roboto.ai.mcp import StartOAuthFlowResponse`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/ai/mcp/operations.py#L106-L118)

Bases: `pydantic.BaseModel`

Response body of `POST /v1/mcp/servers/{server_id}/oauth/start`.

Roboto returns it when it starts connecting the caller's own account to an MCP server, in the caller's organization. Send the user to `authorization_url`, then pass the `code` and `state` the provider returns in `OAuthCallbackRequest` within 10 minutes.

**Parameters**

- **data** (`Any`)

**Attributes**

- **StartOAuthFlowResponse.authorization_url** (`str`): URL of the provider's authorization page to send the user to.
- **StartOAuthFlowResponse.state** (`str`): Single-use token that ties the provider's response to this flow. Pass it back in `OAuthCallbackRequest`.

### UpdateMcpServerAllowedToolsRequest

```python
class roboto.ai.mcp.operations.UpdateMcpServerAllowedToolsRequest(/, **data: Any)
```

`from roboto.ai.mcp import UpdateMcpServerAllowedToolsRequest`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/ai/mcp/operations.py#L231-L242)

Bases: `pydantic.BaseModel`

Request body for `PUT /v1/mcp/admin/servers/{server_id}/allowed-tools`.

Only Roboto administrators may send it. No SDK method sends it.

**Parameters**

- **data** (`Any`)

**Attributes**

- **UpdateMcpServerAllowedToolsRequest.allowed_tools** (`dict[str, bool] | None`) = `None`: Tools Roboto's AI may call on the server, as a map of tool name to whether it is enabled.

  `None` clears the allowlist, and Roboto fills it in again the next time the AI lists the server's tools, as `AdminRegisterMcpServerRequest.allowed_tools` describes.

### UpdateMcpServerOrgsRequest

```python
class roboto.ai.mcp.operations.UpdateMcpServerOrgsRequest(/, **data: Any)
```

`from roboto.ai.mcp import UpdateMcpServerOrgsRequest`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/ai/mcp/operations.py#L218-L228)

Bases: `pydantic.BaseModel`

Request body for `PUT /v1/mcp/admin/servers/{server_id}/orgs`.

Only Roboto administrators may send it. No SDK method sends it. `org_ids` replaces the organizations that can see the server. A non-empty list deletes the server's OAuth connections and organization-wide tokens in every organization outside it, including when it scopes a server every organization could see. An empty list makes the server visible to every organization and deletes nothing.

**Parameters**

- **data** (`Any`)

**Attributes**

- **UpdateMcpServerOrgsRequest.org_ids** (`list[str]`) = `None`: IDs of the organizations that can use the server. An empty list makes it visible to every organization.

### UpdateMcpServerRequest

```python
class roboto.ai.mcp.operations.UpdateMcpServerRequest(/, **data: Any)
```

`from roboto.ai.mcp import UpdateMcpServerRequest`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/ai/mcp/operations.py#L202-L215)

Bases: `pydantic.BaseModel`

No SDK method or Roboto route uses this model.

A `display_name` that is empty, longer than 32 characters, or holds a character other than a letter, digit, hyphen or underscore raises `pydantic.ValidationError`.

**Parameters**

- **data** (`Any`)

**Attributes**

- **UpdateMcpServerRequest.display_name** (`str | None`) = `None`: Human-readable name of the server: 1 to 32 letters, digits, hyphens and underscores.
- **UpdateMcpServerRequest.scopes** (`list[str] | None`) = `None`: OAuth 2.0 scopes to request when a user connects the server.
