Class ComposioDiscovery

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

public class ComposioDiscovery extends Object
Discovers Composio tools and converts them to MCP-compatible definitions.

This class bridges the Composio platform with the MCP ecosystem by converting Composio tools into McpToolDefinition and McpServerEntry objects that can be used with the TnsAI MCP registry.

Example usage:


 ComposioClient client = new ComposioClient("api-key");
 ComposioDiscovery discovery = new ComposioDiscovery(client);

 // Discover all tools
 List<McpToolDefinition> allTools = discovery.discoverTools();

 // Discover tools for a specific app
 List<McpToolDefinition> githubTools = discovery.discoverTools("github");

 // Convert to registry entries
 List<McpServerEntry> entries = discovery.toServerEntries();
 
See Also:
  • Constructor Details

    • ComposioDiscovery

      public ComposioDiscovery(ComposioClient client)
      Creates a new ComposioDiscovery with the given client.
      Parameters:
      client - the Composio client to use for API calls
      Throws:
      IllegalArgumentException - if client is null
  • Method Details

    • discoverTools

      public List<McpToolDefinition> discoverTools() throws IOException
      Discovers all available Composio tools and converts them to MCP tool definitions.

      This method lists all apps, then for each connected app, lists its tools and converts them to MCP-compatible definitions.

      Returns:
      list of MCP tool definitions from all connected Composio apps
      Throws:
      IOException - if any API call fails
    • discoverTools

      public List<McpToolDefinition> discoverTools(String appName) throws IOException
      Discovers tools for a specific Composio app and converts them to MCP tool definitions.
      Parameters:
      appName - the app name (e.g., "github", "slack")
      Returns:
      list of MCP tool definitions for the specified app
      Throws:
      IOException - if the API call fails
    • toServerEntries

      public List<McpServerEntry> toServerEntries() throws IOException
      Converts discovered Composio apps to MCP server entries for registry integration.

      Each Composio app is represented as a separate McpServerEntry with the source set to "composio".

      Returns:
      list of MCP server entries representing Composio apps
      Throws:
      IOException - if the API call fails