Package com.tnsai.mcp.goose
Class TnsAIGooseExtension
java.lang.Object
com.tnsai.mcp.goose.TnsAIGooseExtension
Makes TnsAI tools available as a Goose extension.
This class generates a Goose-compatible extension manifest from an MCP server's tool definitions. The manifest can then be exported as JSON and placed in Goose's extension directory.
Example usage:
McpClient client = McpClient.create(transport);
client.connect();
client.initialize();
ExtensionManifest manifest = TnsAIGooseExtension.generateManifest(client);
String json = TnsAIGooseExtension.toJson(manifest);
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRepresents a Goose-compatible extension manifest.static final recordRepresents a tool within a Goose extension manifest. -
Method Summary
Modifier and TypeMethodDescriptiongenerateManifest(McpClient client) Generates a Goose-compatible extension manifest from an MCP server's tools.static StringtoJson(TnsAIGooseExtension.ExtensionManifest manifest) Exports an extension manifest as a JSON string.
-
Method Details
-
generateManifest
public static TnsAIGooseExtension.ExtensionManifest generateManifest(McpClient client) throws IOException Generates a Goose-compatible extension manifest from an MCP server's tools.- Parameters:
client- the MCP client connected to the server- Returns:
- the extension manifest
- Throws:
IOException- if the MCP call fails
-
toJson
Exports an extension manifest as a JSON string.- Parameters:
manifest- the manifest to serialize- Returns:
- the JSON string
- Throws:
IOException- if serialization fails
-