Skip to content

Implement tiger mcp list command#120

Merged
nathanjcochran merged 11 commits intomainfrom
nathan/list-mcp-tools
Dec 3, 2025
Merged

Implement tiger mcp list command#120
nathanjcochran merged 11 commits intomainfrom
nathan/list-mcp-tools

Conversation

@nathanjcochran
Copy link
Member

@nathanjcochran nathanjcochran commented Dec 2, 2025

This PR adds a new tiger mcp list command that lists all of the available MCP capabilities (tools, prompts, resources, and resource templates).

It accepts an -o/--output flag that controls the output format. The default format is table (or whatever is set via tiger config set output or the TIGER_OUTPUT env var), but it also supports json and yaml formats. The JSON and YAML formats are significantly more verbose than the table format (including things like the description, title, input/output JSON schemas, etc.). This is similar to how the JSON and YAML formats work for other commands that support them (such as tiger service list).

I plan to add another command for getting detailed info about a specific tool/prompt/resource in a future PR (tiger mcp get/tiger mcp describe or something like that).

Related: AGE-287

CC @billy-the-fish for docs update.

@nathanjcochran nathanjcochran self-assigned this Dec 2, 2025
// No client specified, prompt user to select one
var err error
clientName, err = selectClientInteractively(cmd.OutOrStdout())
clientName, err = selectClientInteractively(cmd.ErrOrStderr())
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated to this PR - just noticed it was using stdout before, but we're trying to standardize on stderr for non-structured output.

if err != nil {
return fmt.Errorf("failed to create MCP server: %w", err)
}
defer server.Close()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated to this PR, but I realized we weren't properly closing the server in case of an error. Close is idempotent, so it should be safe to call it again in the successful case too.

Comment on lines +24 to +41
serverTransport, clientTransport := mcp.NewInMemoryTransports()

client := mcp.NewClient(&mcp.Implementation{
Name: ServerName,
Version: config.Version,
}, nil)

serverSession, err := s.mcpServer.Connect(ctx, serverTransport, nil)
if err != nil {
return nil, fmt.Errorf("failed to connect server: %w", err)
}
defer serverSession.Close()

clientSession, err := client.Connect(ctx, clientTransport, nil)
if err != nil {
return nil, fmt.Errorf("failed to connect client: %w", err)
}
defer clientSession.Close()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creating an MCP client and connecting it to the server via an in-memory transport seemed like the easiest and most fool-proof way of listing all of the server's capabilities (including the proxied tools), without having to duplicate the list of tools/prompts, or complicate the way in which they're registered with the server.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost seems like something the sdk could provide to every server?
We could consider doing a PR upstream? Although I guess this doens't cover all mcp primitives only the ones we use.

Copy link
Member Author

@nathanjcochran nathanjcochran Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, if we had access to the mcp.Server's internals, I think we could just iterate over these fields directly, instead of creating a client connection via an in-memory transport. Not sure why they don't already support that, tbh. Maybe they just didn't think many people would have a use for it? We could submit a proposal and see what they say.

Comment on lines -185 to +187
The proxied documentation server ([tiger-docs-mcp-server](https://github.com/timescale/tiger-docs-mcp-server)) currently provides the following tools:
- `get_guide` - Retrieve comprehensive guides for TimescaleDB features and best practices
The proxied documentation server ([pg-aiguide](https://github.com/timescale/pg-aiguide)) currently provides the following tools:
- `view_skill` - Retrieve comprehensive guides for TimescaleDB features and best practices
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs MCP and this tool were both renamed upstream. This is just keeping things in-sync.

Copy link
Contributor

@Askir Askir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me!

@nathanjcochran nathanjcochran merged commit 81e1ac7 into main Dec 3, 2025
2 checks passed
@nathanjcochran nathanjcochran deleted the nathan/list-mcp-tools branch December 3, 2025 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments