roboto.ai.mcp#
Submodules#
Package Contents#
- class roboto.ai.mcp.AdminRegisterMcpServerRequest(/, **data)#
Bases:
pydantic.BaseModelAdmin request to register an MCP server. Supports both DCR and manual modes.
Admins can scope the server to specific orgs via org_ids, or leave it empty for global visibility.
- Parameters:
data (Any)
- allowed_tools: dict[str, bool] | None = None#
map of tool name to enabled flag. None = configure later (auto-populates on first discovery).
- Type:
Tool allowlist
- authorization_endpoint: str | None = None#
OAuth2 authorization endpoint URL.
- client_id: str | None = None#
OAuth2 client ID from the provider’s developer settings.
- client_secret: str | None = None#
OAuth2 client secret from the provider’s developer settings.
- display_name: str = None#
User-friendly display name (e.g., ‘GitHub’). Alphanumerics, hyphens, and underscores only.
- extra_auth_params: dict[str, str] = None#
Extra query parameters appended to the OAuth authorization URL. For example, Atlassian requires {“audience”: “api.atlassian.com”, “prompt”: “consent”}.
- oauth_issuer_url: str | None = None#
//github.com’).
- Type:
OAuth2 authorization server base URL (e.g., ‘https
- org_ids: list[str] = None#
Org IDs this server is scoped to. Empty = global (visible to all orgs).
- registration_mode: RegistrationMode#
- revocation_endpoint: str | None = None#
OAuth2 token revocation endpoint URL, if supported.
- scopes: list[str] = None#
OAuth2 scopes to request during authorization.
- server_url: str#
MCP server Streamable HTTP endpoint URL.
- token_endpoint: str | None = None#
OAuth2 token endpoint URL.
- class roboto.ai.mcp.CopyMcpServerAllowedToolsRequest(/, **data)#
Bases:
pydantic.BaseModelAdmin request to copy the tool allowlist from another server.
- Parameters:
data (Any)
- source_server_id: str#
Server ID to copy the allowed_tools dict from.
- class roboto.ai.mcp.McpServerOrgContextRecord(/, **data)#
Bases:
pydantic.BaseModelPer-org context for an MCP server.
Org admins set this plaintext to provide the AI with org-specific instructions about how the server should be used (e.g., which repos, project names, conventions).
- Parameters:
data (Any)
- context: str#
Plaintext context injected into the AI system prompt.
- created: datetime.datetime#
- created_by: str#
- modified: datetime.datetime#
- modified_by: str#
- org_id: str#
Org that owns this context.
- server_id: str#
Server this context applies to.
- class roboto.ai.mcp.McpServerRecord(/, **data)#
Bases:
pydantic.BaseModelA registered external MCP server. May be global or scoped to specific orgs.
- Parameters:
data (Any)
- allowed_tools: dict[str, bool] | None = None#
Map of tool name to enabled flag. None = not yet configured (auto-populates on first discovery). Keys are all known tools from the server; True = allowed, False = blocked.
- client_id: str#
OAuth2 client ID.
- created: datetime.datetime#
Timestamp when this server was registered.
- created_by: str#
User who first registered this server.
- display_name: str#
User-friendly display name (e.g., ‘GitHub’, ‘GitLab’).
- extra_auth_params: dict[str, str] = None#
Extra query parameters appended to the OAuth authorization URL (e.g. audience for Atlassian).
- modified: datetime.datetime#
Timestamp when this server record was last modified.
- modified_by: str#
User who last modified this server record.
- oauth_issuer_url: str#
OAuth2 authorization server URL for this MCP server.
- org_ids: list[str] = None#
Org IDs this server is scoped to. Empty = global (visible to all orgs).
- registration_mode: str = 'dcr'#
‘dcr’ or ‘manual’.
- Type:
How this server was registered
- scopes: list[str] = None#
OAuth2 scopes requested during authorization.
- server_id: str#
Unique identifier for this server registration.
- server_url: str#
MCP server Streamable HTTP endpoint URL.
- status: McpServerStatus#
Current status of the server registration.
- class roboto.ai.mcp.McpServerStatus#
Bases:
roboto.compat.StrEnumStatus of a registered MCP server.
- ACTIVE = 'active'#
Server is registered and ready for use.
- ERROR = 'error'#
Server registration encountered an error.
- PENDING_SETUP = 'pending_setup'#
Server registration is in progress (e.g., awaiting Dynamic Client Registration).
- class roboto.ai.mcp.McpTokenRecord(/, **data)#
Bases:
pydantic.BaseModelPer-user, per-org OAuth token metadata for an MCP server.
Token values (access_token, refresh_token) are never exposed — this record contains only status metadata for display in the UI.
- Parameters:
data (Any)
- created: datetime.datetime#
Timestamp when this token was first created.
- expires_at: datetime.datetime | None = None#
When the access token expires, if known.
- modified: datetime.datetime#
Timestamp when this token was last refreshed or modified.
- org_id: str#
Org context this token is scoped to.
- scopes: list[str] = None#
Scopes granted by this token.
- server_id: str#
Server this token is for.
- token_status: McpTokenStatus#
Current status of the token.
- user_id: str#
User who authorized this token.
- class roboto.ai.mcp.McpTokenStatus#
Bases:
roboto.compat.StrEnumStatus of a user’s OAuth token for an MCP server.
- EXPIRED = 'expired'#
Access token has expired. May be refreshable via refresh token.
- REFRESH_FAILED = 'refresh_failed'#
Refresh token failed. User must re-authorize.
- VALID = 'valid'#
Token is valid and can be used for requests.
- class roboto.ai.mcp.McpToolInfo(/, **data)#
Bases:
pydantic.BaseModelDescribes a tool discovered from a remote MCP server.
- Parameters:
data (Any)
- description: str#
Human-readable description of the tool.
- input_schema: dict[str, Any]#
JSON Schema describing the tool’s input parameters.
- name: str#
Tool name as reported by the MCP server.
- server_id: str#
Server this tool belongs to.
- class roboto.ai.mcp.OAuthCallbackRequest(/, **data)#
Bases:
pydantic.BaseModelRequest to complete an OAuth flow after the user has authorized.
- Parameters:
data (Any)
- code: str#
Authorization code from the OAuth provider.
- state: str#
CSRF state token from the original flow start.
- class roboto.ai.mcp.RegisterMcpServerRequest(/, **data)#
Bases:
pydantic.BaseModelRequest to register an MCP server. Used by org admins.
In DCR mode, OAuth metadata is auto-discovered and client credentials are obtained via Dynamic Client Registration.
In Manual mode, the caller provides all OAuth credentials upfront.
- Parameters:
data (Any)
- allowed_tools: dict[str, bool] | None = None#
map of tool name to enabled flag. None = configure later (auto-populates on first discovery).
- Type:
Tool allowlist
- authorization_endpoint: str | None = None#
OAuth2 authorization endpoint URL.
- client_id: str | None = None#
OAuth2 client ID from the provider’s developer settings.
- client_secret: str | None = None#
OAuth2 client secret from the provider’s developer settings.
- display_name: str = None#
User-friendly display name (e.g., ‘GitHub’). Alphanumerics, hyphens, and underscores only.
- extra_auth_params: dict[str, str] = None#
Extra query parameters appended to the OAuth authorization URL. For example, Atlassian requires {“audience”: “api.atlassian.com”, “prompt”: “consent”}.
- oauth_issuer_url: str | None = None#
OAuth2 authorization server URL. Required for DCR if different from server_url. Required for Manual mode.
- registration_mode: RegistrationMode#
- revocation_endpoint: str | None = None#
OAuth2 token revocation endpoint URL, if supported.
- scopes: list[str] = None#
OAuth2 scopes to request during authorization.
- server_url: str#
MCP server Streamable HTTP endpoint URL.
- token_endpoint: str | None = None#
OAuth2 token endpoint URL.
- class roboto.ai.mcp.RegistrationMode#
Bases:
str,enum.Enumstr(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to ‘utf-8’. errors defaults to ‘strict’.
- DCR = 'dcr'#
- MANUAL = 'manual'#
- class roboto.ai.mcp.SetMcpServerOrgContextRequest(/, **data)#
Bases:
pydantic.BaseModelRequest to set per-org context for an MCP server.
The context is plaintext that gets injected into the AI system prompt so the AI knows how the org uses this server. Bounded to keep prompt size predictable and to limit the blast radius of injection from org-controlled text. Set to empty string to clear.
- Parameters:
data (Any)
- context: str = None#
Plaintext context (max 4000 chars). Empty string clears it.
- class roboto.ai.mcp.StartOAuthFlowResponse(/, **data)#
Bases:
pydantic.BaseModelResponse from starting an OAuth flow.
- Parameters:
data (Any)
- authorization_url: str#
URL to redirect the user to for authorization.
- state: str#
CSRF state token. Must be passed back in the callback.
- class roboto.ai.mcp.UpdateMcpServerAllowedToolsRequest(/, **data)#
Bases:
pydantic.BaseModelAdmin request to set the tool allowlist for an MCP server.
Keys are tool names, values indicate whether the tool is enabled (True) or blocked (False). Set to None to clear the allowlist (reverts to auto-populate on first discovery).
- Parameters:
data (Any)
- allowed_tools: dict[str, bool] | None = None#
- class roboto.ai.mcp.UpdateMcpServerOrgsRequest(/, **data)#
Bases:
pydantic.BaseModelAdmin request to update the org scoping for an MCP server.
The provided org_ids fully replace the current set. An empty list makes the server global (visible to all orgs). Tokens for removed orgs are cascade-deleted.
- Parameters:
data (Any)
- org_ids: list[str] = None#
New set of org IDs. Empty = global (visible to all orgs).