fix(mcp): serialize multiple databases in list_connections and add list_databases tool#426
fix(mcp): serialize multiple databases in list_connections and add list_databases tool#426erneztox wants to merge 1 commit into
Conversation
…st_databases tool
|
Hey, thanks a lot for this! I reviewed it locally and I'm happy with it — the fix is correct and the new tool follows the existing patterns nicely. I verified everything end-to-end against the demo stack (
A few small things I noticed — none of them blocking, but since they're all quick I'd prefer to get them into this PR rather than leaving them behind:
One unrelated thing my testing surfaced: Thanks again! 🙏 |
Hey! As discussed in the issue, here is the PR to improve the MCP server database discovery.
What changed?
list_connectionsarray serialization: Insrc-tauri/src/mcp/mod.rs, changed thedatabaseproperty extraction from.to_string()(which called.primary()and dropped items) to.as_vec(). Now the MCP client correctly sees all databases configured in a single connection.list_databasestool: Added a nativelist_databasestool leveraging the existingdriver.get_databases()trait. This allows the LLM to query and discover all available databases natively through the connection without needing to manually run SQL queries.Testing
tabularis --mcpbinary.list_connectionsoutputs the full array.list_databasesconnects to the engine and returns the schemas correctly.cargo check.Let me know if you need any adjustments!