feat(mcp): generative-UI MVP demo tools#25
Open
razeone wants to merge 1 commit into
Open
Conversation
Adds top_queries, missing_indexes, wait_stats, blocking_sessions, fk_graph, column_stats, db_health_checks. All tools are SELECT-only with the existing identifier allow-list + SqlParameter discipline. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Adds 7 read-only SQL Server MCP tools that feed the generative-UI demo flows (Performance Tuning, Health Audit, Schema Discovery).
Tools added
Performance
top_queries— top-N by total worker time fromsys.dm_exec_query_stats(capped 50)missing_indexes—sys.dm_db_missing_index_*ordered by improvement_measure (top 50)wait_stats—sys.dm_os_wait_statswith idle/system noise filtered (capped 50)blocking_sessions— blocked sessions fromsys.dm_exec_requestswith blocker/blocked loginsDiscovery
fk_graph— full FK graph (one row per FK column)column_stats—sys.stats+sys.dm_db_stats_propertiesfor a given tableHealth
db_health_checks— 10 curated checks (auto_close, auto_shrink, recovery model, page verify, compat level, query store, last full/log backups, unused indexes, DBCC CHECKDB recency)Safety
SqlParameter— never concatenated.column_stats) pass the existingSqlIdentifierallow-list AND anINFORMATION_SCHEMAexistence check before being bracket-quoted.SqlExceptiondetails are logged in full but onlyNumber+ first-line message reach the client.db_health_checksso msdb / DBCC permission errors degrade toInfo: skippedinstead of failing the whole tool.Verification
dotnet build src/CloudEngAgent.Mcp.Server✅dotnet test tests/CloudEngAgent.Mcp.Server.Tests— 51/51 passed ✅dotnet build CloudEngAgent.slnx✅New tests cover identifier validation on
column_stats, top-bounds ontop_queries/wait_stats, and assembly-level discovery of all 7 tool names.