Package com.tnsai.mcp.composio
Class ComposioClient
java.lang.Object
com.tnsai.mcp.composio.ComposioClient
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRepresents a Composio app (e.g., GitHub, Slack, Gmail).static final recordRepresents a Composio tool.static final recordRepresents the connection status for a Composio app. -
Constructor Summary
ConstructorsConstructorDescriptionComposioClient(String apiKey) Creates a new ComposioClient with the given API key. -
Method Summary
Modifier and TypeMethodDescriptioncom.fasterxml.jackson.databind.JsonNodeexecuteTool(String toolName, Map<String, Object> params) Executes a Composio tool with the given parameters.Returns the API key used by this client.getConnectionStatus(String appName) Gets the connection status for a Composio app.listApps()Lists available Composio apps (GitHub, Slack, Gmail, etc.).Lists tools for a specific Composio app.
-
Constructor Details
-
ComposioClient
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
Lists available Composio apps (GitHub, Slack, Gmail, etc.).- Returns:
- list of available apps
- Throws:
IOException- if the API call fails
-
listTools
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 IOExceptionExecutes a Composio tool with the given parameters.- Parameters:
toolName- the tool name to executeparams- the parameters for the tool- Returns:
- the execution result as JSON
- Throws:
IOException- if the API call fails
-
getConnectionStatus
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
Returns the API key used by this client.- Returns:
- the API key
-