Package com.tnsai.mcp.composio
Class ComposioAuthBridge
java.lang.Object
com.tnsai.mcp.composio.ComposioAuthBridge
Bridges Composio's API key authentication to MCP-compatible auth headers.
Composio uses API keys for authentication, while MCP typically uses OAuth. This bridge generates the appropriate auth headers for Composio API calls and can verify API key validity.
Example usage:
ComposioAuthBridge bridge = new ComposioAuthBridge("your-api-key");
if (bridge.verifyApiKey()) {
Map<String, String> headers = bridge.getAuthHeaders();
// Use headers for Composio API calls
}
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionComposioAuthBridge(String apiKey) Creates a new ComposioAuthBridge with the given API key. -
Method Summary
Modifier and TypeMethodDescriptionReturns the API key used by this bridge.Creates authentication headers for Composio API calls.booleanVerifies that the API key is valid by making a test API call.
-
Constructor Details
-
ComposioAuthBridge
Creates a new ComposioAuthBridge with the given API key.- Parameters:
apiKey- the Composio API key- Throws:
IllegalArgumentException- if apiKey is null or blank
-
-
Method Details
-
getAuthHeaders
Creates authentication headers for Composio API calls.- Returns:
- map of header name to header value
-
verifyApiKey
Verifies that the API key is valid by making a test API call.- Returns:
- true if the API key is valid, false otherwise
- Throws:
IOException- if a network error occurs (not an auth failure)
-
getApiKey
Returns the API key used by this bridge.- Returns:
- the API key
-