Package com.tnsai.mcp.composio
Class ComposioDiscovery
java.lang.Object
com.tnsai.mcp.composio.ComposioDiscovery
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 Summary
ConstructorsConstructorDescriptionComposioDiscovery(ComposioClient client) Creates a new ComposioDiscovery with the given client. -
Method Summary
Modifier and TypeMethodDescriptionDiscovers all available Composio tools and converts them to MCP tool definitions.discoverTools(String appName) Discovers tools for a specific Composio app and converts them to MCP tool definitions.Converts discovered Composio apps to MCP server entries for registry integration.
-
Constructor Details
-
ComposioDiscovery
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
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
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
Converts discovered Composio apps to MCP server entries for registry integration.Each Composio app is represented as a separate
McpServerEntrywith the source set to "composio".- Returns:
- list of MCP server entries representing Composio apps
- Throws:
IOException- if the API call fails
-