Skip to content

API Reference parrot.auth.oauth2.mcp_provider

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.auth.oauth2.mcp_provider

View source

MCPOAuth2Provider — OAuth2 provider for MCP server connections.

Registers MCP OAuth2 servers in the unified OAuth2ProviderRegistry so that :class:~parrot.auth.oauth2.service.IntegrationsService.list_for_user returns them alongside O365, Jira, and other providers.

MCP tools arrive via the MCP protocol itself — the toolkit_factory returns None to signal that no separate toolkit is needed.

Example::

from parrot.auth.oauth2.mcp_provider import register_mcp_oauth2_provider
from parrot.mcp.oauth2_config import MCPOAuth2Config

cfg = MCPOAuth2Config(client_id="my-id", scopes=["mcp"])
register_mcp_oauth2_provider("netsuite", cfg)

Alias CredentialResolver

Re-exported from parrot.auth.credentials.CredentialResolver.

Alias MCPOAuth2Config

Re-exported from parrot.mcp.oauth2_config.MCPOAuth2Config.

Class MCPOAuth2Provider

OAuth2 provider for an MCP server connection.

Each MCP server that uses OAuth2 gets its own provider instance. The provider_id follows the format "mcp:{server_name}" (e.g. "mcp:netsuite"), which makes it unique in the registry even when multiple MCP servers are configured simultaneously.

MCP tools are exposed via the MCP protocol — toolkit_factory returns None to signal that no separate toolkit registration is required by the integrations service.

Parameter Type Default Description
server_name str MCP server slug (e.g. "netsuite").
config MCPOAuth2Config OAuth2 configuration for this server.
storage Optional['VaultMCPTokenStorage'] None Optional token storage adapter. None is acceptable when registration is informational only.

Attributes:

Attribute Type Description
provider_id str "mcp:{server_name}".
display_name str "MCP: {server_name}".
default_scopes List[str] Scopes from the MCPOAuth2Config.
manager Any Return the underlying OAuth manager. MCP OAuth2 flows are driven by the MCP SDK's OAuthContext at the transport layer, not by a separate manager object.

Method MCPOAuth2Provider.toolkit_factory

Build a toolkit instance.

MCP servers expose their tools via the MCP protocol rather than through the toolkit registration mechanism. This method returns None to signal that no toolkit registration is required.

toolkit_factory(credential_resolver: 'CredentialResolver') -> Any

Parameter Type Default Description
credential_resolver 'CredentialResolver' Resolver for user credentials (unused).

Returns: Any — None — MCP tools arrive via the MCP protocol.

Alias OAuth2Provider

Re-exported from parrot.auth.oauth2.registry.OAuth2Provider.

Alias VaultMCPTokenStorage

Re-exported from parrot.mcp.oauth2_storage.VaultMCPTokenStorage.

Attribute logger

Function register_mcp_oauth2_provider

Create an :class:MCPOAuth2Provider and register it in the global registry.

Convenience wrapper for application startup. Idempotent: registering the same server_name twice overwrites the previous entry.

register_mcp_oauth2_provider(server_name: str, config: MCPOAuth2Config, storage: Optional['VaultMCPTokenStorage'] = None) -> MCPOAuth2Provider

Parameter Type Default Description
server_name str MCP server slug (e.g. "netsuite").
config MCPOAuth2Config OAuth2 configuration for this server.
storage Optional['VaultMCPTokenStorage'] None Optional token storage adapter.

Returns: MCPOAuth2Provider — The newly registered :class:MCPOAuth2Provider instance.

Alias register_oauth2_provider

Re-exported from parrot.auth.oauth2.registry.register_oauth2_provider.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally