MCPApiModule
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
Client class: Handles all MCP communication
test_connection(): Verifies 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.
AuthMethods enum: Supported authentication types
Simple auth methods: BASIC, TOKEN, BEARER, API_KEY, RAW_TOKEN, CLIENT_CREDENTIALS.
OAuth methods requiring user authorization: AUTHORIZATION_CODE, DYNAMIC_CLIENT_REGISTRATION.
Utility functions
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.
For the complete API in the content repository, see thePacks/ApiModules/Scripts/MCPApiModule/MCPApiModule.py .
Last updated
Was this helpful?
