feat(mcp): advertise discovery tool per connection in list_connections - #135
Merged
Conversation
Each sqlkit connection now carries a 'discover' field pointing at sqlkit__list_tables as the first step to explore its objects, so agents know how to start querying any connection. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Expose 9 previously-implemented adapter methods as MCP tools: list_indexes, list_foreign_keys, list_views, list_procedures, list_functions, list_triggers, get_object_ddl, get_table_info, get_foreign_keys. Each handler covers all ActiveConnection variants. Adds 14 unit tests (missing config + required-arg validation). Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
… test list_indexes, list_foreign_keys, list_triggers, get_object_ddl: database marked required in schema but treated as optional in handler — now optional, consistent with list_tables. discover_tool_for: simplified no-op match to direct return. Added test for missing object_type validation in get_object_ddl. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Improves sqlkit MCP capability completeness and discoverability.
Changes
Discoverability
list_connectionsnow includes adiscoverfield per connection, pointing atsqlkit__list_tablesas the first step to explore a connection's objects before querying.New tools (9)
Registers previously-implemented adapter methods as MCP tools, each covering all
ActiveConnectionvariants (Postgres, MySQL, SQLite, SQLServer, ClickHouse, JDBC, HttpSQL, Rqlite, Turso):sqlkit__list_indexessqlkit__list_foreign_keyssqlkit__list_viewssqlkit__list_proceduressqlkit__list_functionssqlkit__list_triggerssqlkit__get_object_ddlsqlkit__get_table_infosqlkit__get_foreign_keysMCP tool count grows from 11 → 20.
Testing
cargo test --libpasses: 347/347 (was 333)cargo checkpasses