Skip to content

API Reference parrot.mcp.integration

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

parrot.mcp.integration

View source

Alias AbstractTool

Re-exported from parrot.tools.abstract.AbstractTool.

Alias AuthorizationRequired

Re-exported from parrot.auth.exceptions.AuthorizationRequired.

Alias ChromeManager

Re-exported from parrot.mcp.chrome.ChromeManager.

Alias InMemoryTokenStore

Re-exported from parrot.mcp.oauth.InMemoryTokenStore.

Class MCPClient

Complete MCP client with stdio and HTTP transport support.

Parameter Type Default Description
config MCPServerConfig
tool_name_prefix Optional[str] None

Method MCPClient.connect

Connect to MCP server using appropriate transport.

connect()

Method MCPClient.call_tool

Call an MCP tool.

Rate-limit responses (-32429) are retried with the server-suggested retryAfter delay (or an exponential fallback), up to rate_limit_max_retries. A suggested wait longer than rate_limit_max_wait fails fast instead of blocking the agent loop — the error is surfaced so the caller can move on rather than hammering a throttled server.

call_tool(tool_name: str, arguments: Dict[str, Any], headers: Optional[Dict[str, str]] = None)

Parameter Type Default Description
tool_name str
arguments Dict[str, Any]
headers Optional[Dict[str, str]] None

Method MCPClient.get_available_tools

Get raw available tools from server.

get_available_tools() -> List[Dict[str, Any]]

Returns: List[Dict[str, Any]]

Method MCPClient.get_tools_for_context

Get tools, filtered by context.

If a context is provided, tools will be filtered based on the context's scopes and roles. Tools may specify required scopes in their metadata.

get_tools_for_context(context: Optional[ReadonlyContext] = None) -> List[Dict[str, Any]]

Parameter Type Default Description
context Optional[ReadonlyContext] None Optional ReadonlyContext for filtering

Returns: List[Dict[str, Any]] — List of tool dictionaries accessible to the context

Method MCPClient.get_tools

Get tools filtered by configuration and context.

Filtering precedence:

  1. tool_filter (new dynamic filtering) - highest priority
  2. allowed_tools / blocked_tools (legacy) - fallback
  3. No filter - all tools

get_tools(context: Optional[ReadonlyContext] = None) -> List[MCPToolProxy]

Parameter Type Default Description
context Optional[ReadonlyContext] None Optional ReadonlyContext for context-aware decisions

Returns: List[MCPToolProxy] — List of MCPToolProxy objects that are available

Method MCPClient.disconnect

Disconnect from MCP server.

disconnect()

Alias MCPConnectionError

Re-exported from parrot.mcp.client.MCPConnectionError.

Class MCPEnabledMixin

Mixin to add complete MCP capabilities to agents.

Parameter Type Default Description
*args ()
**kwargs {}

Method MCPEnabledMixin.add_mcp_server

Add an MCP server with full feature support.

add_mcp_server(config: MCPServerConfig) -> List[str]

Parameter Type Default Description
config MCPServerConfig

Returns: List[str]

Method MCPEnabledMixin.add_local_mcp_server

Add a local stdio MCP server.

add_local_mcp_server(name: str, script_path: Union[str, Path], interpreter: str = 'python', **kwargs) -> List[str]

Parameter Type Default Description
name str
script_path Union[str, Path]
interpreter str 'python'
**kwargs {}

Returns: List[str]

Method MCPEnabledMixin.add_http_mcp_server

Add an HTTP MCP server.

add_http_mcp_server(name: str, url: str, auth_type: Optional[str] = None, auth_config: Optional[Dict[str, Any]] = None, headers: Optional[Dict[str, str]] = None, **kwargs) -> List[str]

Parameter Type Default Description
name str
url str
auth_type Optional[str] None
auth_config Optional[Dict[str, Any]] None
headers Optional[Dict[str, str]] None
**kwargs {}

Returns: List[str]

Method MCPEnabledMixin.add_api_key_mcp_server

Add an MCP server with API key auth.

add_api_key_mcp_server(name: str, url: str, api_key: str, header_name: str = 'X-API-Key', **kwargs) -> List[str]

Parameter Type Default Description
name str
url str
api_key str
header_name str 'X-API-Key'
**kwargs {}

Returns: List[str]

Method MCPEnabledMixin.add_oauth_mcp_server

Add an MCP server with OAuth2 authorization code support.

Accepts either a ready-built :class:~parrot.mcp.oauth2_config.MCPOAuth2Config (via the oauth2 parameter) or individual parameters for backward compatibility.

add_oauth_mcp_server(name: str, url: str, user_id: Optional[str] = None, oauth2: Optional[MCPOAuth2Config] = None, credential_provider: Optional[str] = None, client_id: Optional[str] = None, auth_url: Optional[str] = None, token_url: Optional[str] = None, scopes: Optional[List[str]] = None, client_secret: Optional[str] = None, **kwargs) -> List[str]

Parameter Type Default Description
name str Server name / registry key.
url str MCP server base URL.
user_id Optional[str] None User identifier for token storage scoping.
oauth2 Optional[MCPOAuth2Config] None Pre-built OAuth2 configuration.
credential_provider Optional[str] None
client_id Optional[str] None OAuth2 client ID (legacy).
auth_url Optional[str] None Authorization endpoint (legacy).
token_url Optional[str] None Token endpoint (legacy).
scopes Optional[List[str]] None OAuth2 scopes (legacy).
client_secret Optional[str] None OAuth2 client secret (legacy).
**kwargs {} Extra :class:~parrot.mcp.client.MCPClientConfig fields.

Returns: List[str] — List of registered MCP tool names.

Method MCPEnabledMixin.add_perplexity_mcp_server

Add a Perplexity MCP server capability.

add_perplexity_mcp_server(api_key: str, name: str = 'perplexity', **kwargs) -> List[str]

Parameter Type Default Description
api_key str
name str 'perplexity'
**kwargs {}

Returns: List[str]

Method MCPEnabledMixin.add_fireflies_mcp_server

Add Fireflies.ai MCP server capability.

add_fireflies_mcp_server(api_key: Optional[str] = None, **kwargs) -> List[str]

Parameter Type Default Description
api_key Optional[str] None Fireflies API key (optional; falls back to FIREFLIES_API_KEY env var)
**kwargs {} Additional MCPServerConfig parameters

Returns: List[str] — List of registered tool names

Method MCPEnabledMixin.add_chrome_devtools_mcp_server

Add Chrome DevTools MCP server capability.

add_chrome_devtools_mcp_server(browser_url: str = 'http://127.0.0.1:9222', name: str = 'chrome-devtools', headless: bool = False, user_data_dir: Optional[str] = None, channel: Optional[str] = None, viewport: Optional[str] = None, executable_path: Optional[str] = None, isolated: bool = False, no_usage_statistics: bool = True, auto_connect: bool = False, ensure_running: bool = True, **kwargs) -> List[str]

Parameter Type Default Description
browser_url str 'http://127.0.0.1:9222' URL where Chrome is listening for devtools protocol.
name str 'chrome-devtools' Server name.
headless bool False Run Chrome without UI.
user_data_dir Optional[str] None Path to Chrome profile directory.
channel Optional[str] None Chrome channel (stable/beta/dev/canary).
viewport Optional[str] None Initial viewport size, e.g. "1280x720".
executable_path Optional[str] None Path to custom Chrome executable.
isolated bool False Use temporary profile.
no_usage_statistics bool True Opt out of Google telemetry.
auto_connect bool False Auto-connect to local Chrome (144+).
ensure_running bool True Start (or reuse) a managed local Chrome behind browser_url before connecting, via :func:ensure_chrome_running. Only applies to loopback hosts and is skipped when auto_connect is set. Pass False when the browser is managed externally.
**kwargs {} Additional MCPServerConfig parameters.

Returns: List[str] — List of registered tool names.

Method MCPEnabledMixin.add_obscura_mcp_server

Add the native Obscura MCP server capability.

Registers Obscura's own obscura mcp stdio tool schema — a separate capability from Chrome DevTools MCP (:meth:add_chrome_devtools_mcp_server), which remains available and unaffected.

add_obscura_mcp_server(binary_path: Optional[str] = None, name: str = 'obscura', port: int = 9222, stealth: bool = False, allow_private_network: bool = False, env: Optional[Dict[str, str]] = None, **kwargs) -> List[str]

Parameter Type Default Description
binary_path Optional[str] None Path to (or PATH-resolvable name of) the Obscura binary.
name str 'obscura' Server name.
port int 9222 CDP port Obscura's native MCP mode should use internally.
stealth bool False Enable Obscura's stealth mode.
allow_private_network bool False Enable --allow-private-network.
env Optional[Dict[str, str]] None Additional environment variables for the stdio subprocess.
**kwargs {} Additional MCPServerConfig parameters.

Returns: List[str] — List of registered tool names.

Method MCPEnabledMixin.add_google_maps_mcp_server

Add Google Maps MCP server capability.

add_google_maps_mcp_server(name: str = 'google-maps', **kwargs) -> List[str]

Parameter Type Default Description
name str 'google-maps' Server name
**kwargs {} Additional MCPServerConfig parameters

Returns: List[str] — List of registered tool names

Method MCPEnabledMixin.add_quic_mcp_server

Add a QUIC/HTTP3 MCP server connection.

add_quic_mcp_server(name: str, host: str, port: int, cert_path: Optional[str] = None, **kwargs) -> List[str]

Parameter Type Default Description
name str
host str
port int
cert_path Optional[str] None
**kwargs {}

Returns: List[str]

Method MCPEnabledMixin.add_websocket_mcp_server

Add a WebSocket MCP server connection.

add_websocket_mcp_server(name: str, url: str, auth_type: Optional[str] = None, auth_config: Optional[Dict[str, Any]] = None, headers: Optional[Dict[str, str]] = None, **kwargs) -> List[str]

Parameter Type Default Description
name str Server name
url str WebSocket URL (ws:// or wss://)
auth_type Optional[str] None Authentication type ("bearer", "api_key", "oauth")
auth_config Optional[Dict[str, Any]] None Authentication configuration
headers Optional[Dict[str, str]] None Additional headers for WebSocket upgrade
**kwargs {} Additional MCPServerConfig parameters

Returns: List[str] — List of registered tool names

Method MCPEnabledMixin.remove_mcp_server

remove_mcp_server(server_name: str)

Parameter Type Default Description
server_name str

Method MCPEnabledMixin.reconfigure_mcp_server

Reconfigure an existing MCP server with new configuration.

reconfigure_mcp_server(config: MCPServerConfig) -> List[str]

Parameter Type Default Description
config MCPServerConfig New MCPServerConfig with updated parameters

Returns: List[str] — List of registered tool names

Method MCPEnabledMixin.reconfigure_fireflies_mcp_server

Reconfigure Fireflies MCP server with a new API key.

This is useful in multi-user scenarios where each user provides their own Fireflies API key. The method will disconnect the existing connection and reconnect with the new credentials.

reconfigure_fireflies_mcp_server(api_key: str, **kwargs) -> List[str]

Parameter Type Default Description
api_key str New Fireflies API key
**kwargs {} Additional MCPServerConfig parameters

Returns: List[str] — List of registered tool names

Method MCPEnabledMixin.reconfigure_perplexity_mcp_server

Reconfigure Perplexity MCP server with a new API key.

Useful for updating the API key without restarting the agent.

reconfigure_perplexity_mcp_server(api_key: str, name: str = 'perplexity', **kwargs) -> List[str]

Parameter Type Default Description
api_key str New Perplexity API key
name str 'perplexity' Server name (default: "perplexity")
**kwargs {} Additional MCPServerConfig parameters

Returns: List[str] — List of registered tool names

Method MCPEnabledMixin.list_mcp_servers

list_mcp_servers() -> List[str]

Returns: List[str]

Method MCPEnabledMixin.get_openai_mcp_tools

Get OpenAI-compatible MCP definitions for registered servers.

get_openai_mcp_tools(server_names: Optional[List[str]] = None) -> List[Dict[str, Any]]

Parameter Type Default Description
server_names Optional[List[str]] None Optional list of server names to filter by

Returns: List[Dict[str, Any]] — List of tool definitions in valid OpenAI MCP format

Method MCPEnabledMixin.add_alphavantage_mcp_server

Add AlphaVantage MCP server capability.

add_alphavantage_mcp_server(api_key: Optional[str] = None, name: str = 'alphavantage', **kwargs) -> List[str]

Parameter Type Default Description
api_key Optional[str] None AlphaVantage API key
name str 'alphavantage' Server name (default: "alphavantage")
**kwargs {} Additional MCPServerConfig parameters

Returns: List[str] — List of registered tool names

Method MCPEnabledMixin.add_netsuite_mcp_server

Add NetSuite MCP server capability via OAuth2 Authorization Code + PKCE.

Constructs the NetSuite MCP configuration from the given credentials and registers it with this agent. Scope is fixed to ["mcp"].

add_netsuite_mcp_server(account_id: str, client_id: str, user_id: Optional[str] = None, credential_provider: Optional[str] = None, **kwargs) -> List[str]

Parameter Type Default Description
account_id str NetSuite account ID (e.g. "4984231").
client_id str OAuth2 client ID from the NetSuite integration record.
user_id Optional[str] None Caller's user identifier for token storage scoping.
credential_provider Optional[str] None
**kwargs {} Additional keyword arguments forwarded to :func:create_netsuite_mcp_server (e.g. token_store, redirect_host, redirect_port).

Returns: List[str] — List of registered tool names from the NetSuite MCP server.

Method MCPEnabledMixin.add_netsuite_m2m_mcp_server

Add NetSuite MCP server via OAuth2 Client Credentials (M2M) with certificate.

No browser login is needed — the agent authenticates using a JWT signed with the provided private key.

add_netsuite_m2m_mcp_server(account_id: str, client_id: str, certificate_id: str, private_key_path: str, **kwargs) -> List[str]

Parameter Type Default Description
account_id str NetSuite account ID (e.g. "4984231").
client_id str OAuth2 client ID from the NetSuite integration record.
certificate_id str Mapping Key from the uploaded certificate in NetSuite.
private_key_path str Path to a PEM-encoded RSA private key file.
**kwargs {} Forwarded to :func:create_netsuite_m2m_mcp_server.

Returns: List[str] — List of registered tool names.

Method MCPEnabledMixin.add_genmedia_mcp_servers

Add all Google GenMedia MCP servers.

Available servers:

  • mcp-avtool-go
  • mcp-chirp3-go
  • mcp-gemini-go
  • mcp-imagen-go
  • mcp-lyria-go
  • mcp-veo-go

add_genmedia_mcp_servers(**kwargs) -> Dict[str, List[str]]

Parameter Type Default Description
**kwargs {}

Returns: Dict[str, List[str]]

Method MCPEnabledMixin.setup_mcp_servers

Setup multiple MCP servers during initialization.

This is useful for configuring an agent with multiple MCP servers at once, typically during agent creation or from configuration files.

setup_mcp_servers(configurations: List[MCPServerConfig]) -> None

Parameter Type Default Description
configurations List[MCPServerConfig] List of MCPServerConfig objects

Method MCPEnabledMixin.shutdown

shutdown(**kwargs)

Parameter Type Default Description
**kwargs {}

Alias MCPOAuth2Config

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

Alias MCPRateLimitError

Re-exported from parrot.mcp.client.MCPRateLimitError.

Alias MCPServerConfig

Re-exported from parrot.mcp.client.MCPClientConfig.

Class MCPToolProxy

Proxy tool that wraps an individual MCP tool.

Parameter Type Default Description
mcp_tool_def Dict[str, Any]
mcp_client MCPClient
server_name str
require_confirmation Union[bool, Callable[[str, Dict], bool]] False
**kwargs {}

Method MCPToolProxy.validate_args

Bypass Pydantic validation for MCP tools. Return raw kwargs so AbstractTool.execute uses original arguments.

validate_args(**kwargs) -> Dict[str, Any]

Parameter Type Default Description
**kwargs {}

Returns: Dict[str, Any]

Method MCPToolProxy.get_tool_schema

Override to return the MCP tool schema directly. MCP provides the full schema in inputSchema, which corresponds to the 'parameters' field.

get_tool_schema() -> Dict[str, Any]

Returns: Dict[str, Any]

Class MCPValidationError

Raised when an MCP HTTP server fails the handshake validation check.

Attribute NETSUITE_AUTH_URL

Attribute NETSUITE_MCP_URL

Attribute NETSUITE_SCOPES

Attribute NETSUITE_TOKEN_URL

Alias ReadonlyContext

Re-exported from parrot.mcp.context.ReadonlyContext.

Alias RedisTokenStore

Re-exported from parrot.mcp.oauth.RedisTokenStore.

Alias TokenStore

Re-exported from parrot.mcp.oauth.TokenStore.

Alias ToolResult

Re-exported from parrot.tools.abstract.ToolResult.

Alias VaultTokenStore

Re-exported from parrot.mcp.oauth.VaultTokenStore.

Function create_alphavantage_mcp_server

Create configuration for AlphaVantage MCP server.

create_alphavantage_mcp_server(api_key: Optional[str] = None, name: str = 'alphavantage', **kwargs) -> MCPServerConfig

Parameter Type Default Description
api_key Optional[str] None AlphaVantage API key (defaults to ALPHAVANTAGE_API_KEY env var)
name str 'alphavantage' Server name
**kwargs {} Additional MCPServerConfig parameters

Returns: MCPServerConfig — MCPServerConfig for AlphaVantage

Function create_api_key_mcp_server

Create configuration for API key authenticated MCP server.

create_api_key_mcp_server(name: str, url: str, api_key: str, header_name: str = 'X-API-Key', use_bearer_prefix: bool = False, **kwargs) -> MCPServerConfig

Parameter Type Default Description
name str Unique name for the MCP server
url str Base URL of the MCP server
api_key str API key for authentication
header_name str 'X-API-Key' Header name for the API key (default: "X-API-Key")
use_bearer_prefix bool False If True, prepend "Bearer " to the API key value (default: False)
**kwargs {} Additional MCPServerConfig parameters

Returns: MCPServerConfig — MCPServerConfig instance

Function create_chrome_devtools_mcp_server

Create configuration for Chrome DevTools MCP server.

This MCP server connects to a Chrome instance running with known remote debugging port. It automatically installs the chrome-devtools-mcp package using npx.

This factory is a pure config builder: it does not start Chrome. To start (or reuse) a managed local Chrome behind browser_url, use :func:ensure_chrome_running or MCPEnabledMixin.add_chrome_devtools_mcp_server(ensure_running=True).

create_chrome_devtools_mcp_server(browser_url: str = 'http://127.0.0.1:9222', name: str = 'chrome-devtools', headless: bool = False, user_data_dir: Optional[str] = None, channel: Optional[str] = None, viewport: Optional[str] = None, executable_path: Optional[str] = None, isolated: bool = False, no_usage_statistics: bool = True, auto_connect: bool = False, **kwargs) -> MCPServerConfig

Parameter Type Default Description
browser_url str 'http://127.0.0.1:9222' URL where Chrome is listening for devtools protocol.
name str 'chrome-devtools' Server name.
headless bool False Run Chrome without UI (default: False — visible).
user_data_dir Optional[str] None Path to Chrome user data directory (profile).
channel Optional[str] None Chrome channel — "stable", "beta", "dev", "canary".
viewport Optional[str] None Initial viewport size, e.g. "1280x720".
executable_path Optional[str] None Path to custom Chrome executable.
isolated bool False Use temporary user-data-dir, cleaned up on close.
no_usage_statistics bool True Opt out of Google usage statistics.
auto_connect bool False Auto-connect to locally running Chrome (144+).
**kwargs {} Additional MCPServerConfig parameters.

Returns: MCPServerConfig — MCPServerConfig configured for Chrome DevTools.

Function create_fireflies_mcp_server

Create configuration for Fireflies MCP server using stdio transport.

Fireflies MCP requires using npx mcp-remote as a command-line proxy.

create_fireflies_mcp_server(*, api_key: Optional[str] = None, api_base: str = 'https://api.fireflies.ai/mcp', **kwargs) -> MCPServerConfig

Parameter Type Default Description
api_key Optional[str] None Fireflies API key (optional; falls back to FIREFLIES_API_KEY env var)
api_base str 'https://api.fireflies.ai/mcp' Base URL of the Fireflies MCP endpoint
**kwargs {} Additional MCPServerConfig parameters

Returns: MCPServerConfig — MCPServerConfig instance configured for stdio transport

Raises:

  • ValueError — When no API key is available from argument or environment.

Function create_google_maps_mcp_server

Create configuration for Google Maps MCP server.

This MCP server connects to Google Maps Platform. It automatically installs the @googlemaps/code-assist-mcp package using npx.

create_google_maps_mcp_server(name: str = 'google-maps', **kwargs) -> MCPServerConfig

Parameter Type Default Description
name str 'google-maps' Server name
**kwargs {} Additional MCPServerConfig parameters

Returns: MCPServerConfig — MCPServerConfig configured for Google Maps

Function create_http_mcp_server

Create configuration for HTTP MCP server.

create_http_mcp_server(name: str, url: str, auth_type: Optional[str] = None, auth_config: Optional[Dict[str, Any]] = None, headers: Optional[Dict[str, str]] = None, **kwargs) -> MCPServerConfig

Parameter Type Default Description
name str
url str
auth_type Optional[str] None
auth_config Optional[Dict[str, Any]] None
headers Optional[Dict[str, str]] None
**kwargs {}

Returns: MCPServerConfig

Function create_local_mcp_server

Create configuration for local stdio MCP server.

create_local_mcp_server(name: str, script_path: Union[str, Path], interpreter: str = 'python', **kwargs) -> MCPServerConfig

Parameter Type Default Description
name str
script_path Union[str, Path]
interpreter str 'python'
**kwargs {}

Returns: MCPServerConfig

Function create_netsuite_m2m_mcp_server

Create a NetSuite MCP server using OAuth2 Client Credentials (M2M) with certificate.

This is the machine-to-machine variant — no browser login required. Authentication uses a JWT client_assertion signed with the private key whose matching X.509 certificate was uploaded to the NetSuite Integration Record.

create_netsuite_m2m_mcp_server(*, account_id: str, client_id: str, certificate_id: str, private_key_path: str, name: str = 'netsuite', token_store: Optional[TokenStore] = None, headers: Optional[Dict[str, Any]] = None) -> MCPServerConfig

Parameter Type Default Description
account_id str NetSuite account ID (e.g. "4984231").
client_id str OAuth2 client ID from the NetSuite integration record.
certificate_id str Certificate ID shown in NetSuite after uploading the public certificate (Mapping Key field).
private_key_path str Path to a PEM-encoded RSA private key file.
name str 'netsuite' Server name (default "netsuite").
token_store Optional[TokenStore] None Optional :class:~parrot.mcp.oauth.TokenStore.
headers Optional[Dict[str, Any]] None Extra HTTP headers.

Returns: MCPServerConfig — class:MCPServerConfig configured for NetSuite M2M.

Function create_netsuite_mcp_server

Create a NetSuite MCP server configuration using OAuth2 Authorization Code + PKCE.

Constructs NetSuite-specific auth/token URLs from the given account_id and uses the NetSuite preset from :mod:parrot.mcp.oauth2_config for the full OAuth2 flow. Scope is fixed to ["mcp"] as required by the NetSuite AI Connector.

create_netsuite_mcp_server(*, account_id: str, client_id: str, user_id: Optional[str] = None, name: str = 'netsuite', headers: Optional[Dict[str, Any]] = None, credential_provider: Optional[str] = None) -> MCPServerConfig

Parameter Type Default Description
account_id str NetSuite account ID (e.g. "4984231").
client_id str OAuth2 client ID from the NetSuite integration record.
user_id Optional[str] None Caller's user identifier used to scope token storage.
name str 'netsuite' Server name used as the registry key (default "netsuite"). Override when connecting two NetSuite accounts simultaneously (e.g. "netsuite-sandbox").
headers Optional[Dict[str, Any]] None Extra HTTP headers to include with every MCP request.
credential_provider Optional[str] None

Returns: MCPServerConfig — class:~parrot.mcp.client.MCPClientConfig configured for NetSuite.

Function create_oauth_mcp_server

Create an MCP server configuration with OAuth2 authorization code flow.

Accepts either a ready-built :class:~parrot.mcp.oauth2_config.MCPOAuth2Config or individual legacy parameters for backward compatibility.

create_oauth_mcp_server(*, name: str, url: str, user_id: Optional[str] = None, oauth2: Optional[MCPOAuth2Config] = None, credential_provider: Optional[str] = None, client_id: Optional[str] = None, auth_url: Optional[str] = None, token_url: Optional[str] = None, scopes: Optional[list] = None, client_secret: Optional[str] = None, headers: Optional[dict] = None, **kwargs) -> MCPServerConfig

Parameter Type Default Description
name str Server name / registry key.
url str MCP server base URL.
user_id Optional[str] None Optional user identifier. None selects delegated mode: the per-call broker credential is injected and credential_provider is required.
oauth2 Optional[MCPOAuth2Config] None Pre-built OAuth2 configuration. When None, a config is constructed from the legacy client_id / auth_url / etc. params.
credential_provider Optional[str] None Broker provider for delegated mode.
client_id Optional[str] None OAuth2 client ID (used when oauth2 is None).
auth_url Optional[str] None Authorization endpoint (used when oauth2 is None).
token_url Optional[str] None Token endpoint (used when oauth2 is None).
scopes Optional[list] None OAuth2 scopes (used when oauth2 is None).
client_secret Optional[str] None OAuth2 client secret (used when oauth2 is None).
headers Optional[dict] None Extra HTTP headers for every MCP request.
**kwargs {} Additional :class:~parrot.mcp.client.MCPClientConfig fields.

Returns: MCPServerConfig — class:~parrot.mcp.client.MCPClientConfig ready for use with class:~parrot.mcp.transports.http.HttpMCPSession.

Function create_obscura_mcp_server

Create configuration for the native Obscura MCP server.

This is Obscura's own obscura mcp stdio server exposing its native browser tool schema — a separate capability from Chrome DevTools MCP (:func:create_chrome_devtools_mcp_server), which remains available and unaffected.

Unlike Chrome DevTools MCP (which attaches to a separately launched Chrome via --browser-url), Obscura's native MCP mode is self-contained: the obscura mcp subprocess manages its own browser engine directly and is spawned/supervised by the MCP transport layer (StdioMCPSession) itself. This factory is therefore a pure config builder — like :func:create_chrome_devtools_mcp_server, it does not start or supervise anything. Process supervision for the separate CDP (obscura serve) mode used by :class:PlaywrightDriver is :class:parrot.mcp.obscura.ObscuraProcessManager's job and is unrelated to this native MCP configuration.

create_obscura_mcp_server(*, binary_path: Optional[str] = None, name: str = 'obscura', port: int = 9222, stealth: bool = False, allow_private_network: bool = False, env: Optional[Dict[str, str]] = None, **kwargs: Any) -> MCPServerConfig

Parameter Type Default Description
binary_path Optional[str] None Path to (or PATH-resolvable name of) the Obscura binary. Defaults to "obscura" (resolved via PATH by the stdio transport at connect time).
name str 'obscura' Server name.
port int 9222 CDP port Obscura's native MCP mode should use internally.
stealth bool False Enable Obscura's stealth mode.
allow_private_network bool False Enable --allow-private-network. Must not be enabled silently in general deployments.
env Optional[Dict[str, str]] None Additional environment variables for the stdio subprocess.
**kwargs Any {} Additional MCPServerConfig parameters.

Returns: MCPServerConfig — MCPServerConfig configured for the native Obscura MCP server.

Function create_perplexity_mcp_server

Create configuration for Perplexity MCP server.

The Perplexity MCP server provides 4 tools:

  • perplexity_search: Direct web search via Search API
  • perplexity_ask: Conversational AI with sonar-pro model
  • perplexity_research: Deep research with sonar-deep-research
  • perplexity_reason: Advanced reasoning with sonar-reasoning-pro

create_perplexity_mcp_server(api_key: str, *, name: str = 'perplexity', timeout_ms: int = 600000, **kwargs) -> MCPServerConfig

Parameter Type Default Description
api_key str Perplexity API key (get from perplexity.ai/account/api)
name str 'perplexity' Server name for tool prefixing
timeout_ms int 600000 Request timeout (default 600000ms for deep research)
**kwargs {} Additional MCPServerConfig parameters

Returns: MCPServerConfig — MCPServerConfig configured for Perplexity

Function create_quic_mcp_server

Create configuration for QUIC MCP server.

create_quic_mcp_server(name: str, host: str, port: int, cert_path: Optional[str] = None, serialization: str = 'msgpack', **kwargs) -> MCPServerConfig

Parameter Type Default Description
name str Server name
host str Server hostname
port int Server port
cert_path Optional[str] None Path to TLS certificate (optional for client if trusted)
serialization str 'msgpack' Serialization format ("msgpack" or "json")
**kwargs {} Additional MCPServerConfig parameters

Returns: MCPServerConfig — MCPServerConfig configured for QUIC transport

Function create_unix_mcp_server

Create a Unix socket MCP server configuration.

create_unix_mcp_server(name: str, socket_path: str, **kwargs) -> MCPServerConfig

Parameter Type Default Description
name str Server name
socket_path str Path to Unix socket
**kwargs {} Additional MCPServerConfig parameters

Returns: MCPServerConfig — MCPServerConfig configured for Unix socket transport

Function create_websocket_mcp_server

Create a WebSocket MCP server configuration.

create_websocket_mcp_server(name: str, url: str, auth_type: Optional[str] = None, auth_config: Optional[Dict[str, Any]] = None, headers: Optional[Dict[str, str]] = None, **kwargs) -> MCPServerConfig

Parameter Type Default Description
name str Server name
url str WebSocket URL (ws:// or wss://)
auth_type Optional[str] None Authentication type ("bearer", "api_key", "oauth", or None)
auth_config Optional[Dict[str, Any]] None Authentication configuration dict
headers Optional[Dict[str, str]] None Additional HTTP headers for WebSocket upgrade
**kwargs {} Additional MCPServerConfig parameters

Returns: MCPServerConfig — MCPServerConfig configured for WebSocket transport

Function ensure_chrome_running

Start (or reuse) the managed local Chrome behind browser_url.

Only loopback hosts are managed. For a remote browser_url the caller is expected to run the browser itself and None is returned without touching the registry. Managers are cached per port in _chrome_managers so repeated calls reuse the same process and MCPEnabledMixin.shutdown() can stop it.

A Chrome that fails to become ready is logged as a warning, not raised: the MCP connection that follows will surface the failure.

ensure_chrome_running(browser_url: str, headless: bool = False) -> Optional[ChromeManager]

Parameter Type Default Description
browser_url str URL where Chrome is (or should be) listening for the DevTools protocol, e.g. http://127.0.0.1:9222.
headless bool False Launch Chrome without a visible window when it has to be started.

Returns: Optional[ChromeManager] — The ChromeManager for the port, or None when the host is not local.

Alias get_mcp_oauth2_preset

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

Alias quic_attr

Re-exported from parrot.mcp._quic.quic_attr.

Function validate_mcp_http

Validate that an MCP HTTP server is reachable and lists its tools.

Connects to the MCP server described by config, retrieves the tool listing once, then disconnects. On any failure the client is always disconnected before the exception propagates.

validate_mcp_http(config: MCPServerConfig) -> None

Parameter Type Default Description
config MCPServerConfig An :class:MCPServerConfig (MCPClientConfig) instance describing the target MCP HTTP server (URL, auth, etc.).

Raises:

  • MCPValidationError — When the server is unreachable, times out, or returns an unexpected tool-listing response.

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