Class ComposioClient

java.lang.Object
com.tnsai.mcp.composio.ComposioClient

public class ComposioClient extends Object
Client for the Composio platform API.

Composio aggregates tools from various services (GitHub, Slack, Gmail, etc.) and exposes them as MCP-compatible tools. This client provides access to Composio's REST API for discovering and executing tools.

Example usage:


 ComposioClient client = new ComposioClient("your-api-key");
 List<ComposioApp> apps = client.listApps();
 List<ComposioTool> tools = client.listTools("github");
 JsonNode result = client.executeTool("github_create_issue", Map.of("title", "Bug report"));
 
See Also:
  • Constructor Details

    • ComposioClient

      public ComposioClient(String apiKey)
      Creates a new ComposioClient with the given API key.
      Parameters:
      apiKey - the Composio API key for authentication
      Throws:
      IllegalArgumentException - if apiKey is null or blank
  • Method Details

    • listApps

      public List<ComposioClient.ComposioApp> listApps() throws IOException
      Lists available Composio apps (GitHub, Slack, Gmail, etc.).
      Returns:
      list of available apps
      Throws:
      IOException - if the API call fails
    • listTools

      public List<ComposioClient.ComposioTool> listTools(String appName) throws IOException
      Lists tools for a specific Composio app.
      Parameters:
      appName - the app name (e.g., "github", "slack")
      Returns:
      list of tools for the app
      Throws:
      IOException - if the API call fails
    • executeTool

      public com.fasterxml.jackson.databind.JsonNode executeTool(String toolName, Map<String,Object> params) throws IOException
      Executes a Composio tool with the given parameters.
      Parameters:
      toolName - the tool name to execute
      params - the parameters for the tool
      Returns:
      the execution result as JSON
      Throws:
      IOException - if the API call fails
    • getConnectionStatus

      public ComposioClient.ConnectionStatus getConnectionStatus(String appName) throws IOException
      Gets the connection status for a Composio app.
      Parameters:
      appName - the app name to check
      Returns:
      the connection status
      Throws:
      IOException - if the API call fails
    • getApiKey

      public String getApiKey()
      Returns the API key used by this client.
      Returns:
      the API key