MCP integrations use the shared MCPApiModule for MCP protocol communication
All MCP integrations use the shared MCPApiModule to handle MCP protocol communication. You should not reimplement MCP logic, as the module provides everything you need:
Key classes and functions
test_connection(): Verify connectivity to the MCP server.
list_tools(server_name): Retrieve available tools.
call_tool(tool_name, arguments): Execute a tool.
close(): Clean up the connection.
Simple auth methods: BASIC, TOKEN, BEARER, API_KEY, RAW_TOKEN, CLIENT_CREDENTIALS.
OAuth methods requiring user authorization: AUTHORIZATION_CODE, DYNAMIC_CLIENT_REGISTRATION.
parse_custom_headers(text): Parse multiline header input.
extract_root_error_message(exception): Unwrap nested exceptions for error reporting.
generate_login_url(oauth_handler, ...): Generate OAuth login URLs.
REDIRECT_URI: Default OAuth redirect URI constant.
Refer to Packs/ApiModules/Scripts/MCPApiModule/MCPApiModule.py in the content repository for the complete API.