-
Notifications
You must be signed in to change notification settings - Fork 299
Add entity-level MCP configuration support #2989
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
/azp run |
|
Azure Pipelines successfully started running 6 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces entity-level MCP (Model Context Protocol) configuration support, allowing fine-grained control over entity participation in MCP runtime tools. The changes enable entities to specify whether they participate in DML tools and custom tools through a new mcp property that accepts either a boolean or an object with dml-tools and custom-tool keys.
- Added
EntityMcpOptionsclass with custom JSON converter for flexible boolean/object serialization - Implemented schema validation to restrict
custom-toolproperty to stored procedures only - Updated all test configurations and entity constructors to include the new
Mcpparameter - Added CLI support for
--mcp.custom-tooland--mcp.dml-toolsflags
Reviewed changes
Copilot reviewed 67 out of 68 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| dab-config.PostgreSql.json | Added runtime-level MCP config and reordered rest/graphql sections for consistency |
| dab-config.MySql.json | Added runtime-level MCP config, reordered sections, and added Default_Books entity |
| dab-config.MsSql.json | Complete reformatting with whitespace changes and runtime-level MCP config addition |
| dab-config.CosmosDb_NoSql.json | Added runtime-level MCP config, removed telemetry section, reordered rest/graphql blocks |
| SqlMetadataProviderUnitTests.cs | Added Mcp: null to Entity constructor calls |
| RequestValidatorUnitTests.cs | Added Mcp: null parameter to Entity constructor |
| ConfigValidationUnitTests.cs | Added Mcp: null to multiple Entity constructor calls |
| TestHelper.cs | Added Mcp: null to Entity constructor in helper method |
| MsSqlGraphQLQueryTests.cs | Fixed Entity constructor parameter ordering issue |
| GraphQLQueryTestBase.cs | Added Mcp: null to Entity constructors |
| ConfigurationTests snapshots | Updated to reflect mapping changes from Fields to Mappings section |
| OpenApiDocumentor tests | Added Mcp: null to all Entity constructor calls |
| GraphQLBuilder tests | Added Mcp: null to Entity constructors in test helpers |
| CosmosTests | Added Mcp: null to Entity constructors across query and mutation tests |
Comments suppressed due to low confidence (1)
src/Service.Tests/SqlTests/GraphQLQueryTests/MsSqlGraphQLQueryTests.cs:1
- Missing parameter in Entity constructor call. The constructor expects 8 parameters but line 876 adds an extra
nullparameter before the permissions array, shifting the parameter positions incorrectly. TheMcpparameter should be added after permissions, not before.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Aniruddh25
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Posting comments so far
...Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_036a859f50ce167c.verified.txt
Outdated
Show resolved
Hide resolved
|
/azp run |
|
Azure Pipelines successfully started running 6 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 6 pipeline(s). |
Going OOF for a few days - dont want to block
… Usr/sogh/entity-level-mcp-config
|
/azp run |
|
Azure Pipelines successfully started running 6 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 6 pipeline(s). |
Aniruddh25
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some suggestions to optimise test code. But main requesting change is to ensure DmlToolsEnabled is true even if not provided.
src/Cli.Tests/Snapshots/AddEntityTests.AddStoredProcedureWithBothMcpProperties.verified.txt
Outdated
Show resolved
Hide resolved
RubenCerna2079
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Address issues with tests and give answers to comments that were resolved with no visible changes
- Updated MCP DML tools default value to true in EntityMcpOptions. - Simplified MCP properties in various test snapshots by removing unnecessary fields. - Consolidated test methods for updating table entities with MCP DML tools into a single parameterized test. - Removed obsolete test snapshots related to MCP DML tools. - Enhanced MCP configuration tests to assert default values and behavior more effectively. - Updated CLI command options help text to reflect new default values for MCP properties.
|
/azp run |
|
Azure Pipelines successfully started running 6 pipeline(s). |
Aniruddh25
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for addressing all the feedback!
|
/azp run |
|
Azure Pipelines successfully started running 6 pipeline(s). |
RubenCerna2079
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for the changes :)
|
/azp run |
|
Azure Pipelines successfully started running 6 pipeline(s). |
Why make this change?
This change allows entity-level MCP configuration to control which entities participate in MCP runtime tools, providing granular control over DML operations and custom tool exposure.
What is this change?
This change introduces an optional mcp property at the entity level that controls participation in MCP's runtime tools. This is a prerequisite for custom tools support.
The MCP property supports two formats:
"mcp": trueor"mcp": false{"dml-tools": boolean, "custom-tool": boolean}Property Behavior:
"mcp": true/false)"mcp": true: Enables DML tools only; custom tools remain disabled."mcp": false: Disables all MCP functionality for the entity.("mcp": { ... }){ "dml-tools": true, "custom-tool": true }: Enables both (valid only for stored procedures).{ "dml-tools": true, "custom-tool": false }: DML only.{ "dml-tools": false, "custom-tool": true }: Custom tool only (stored procedures).{ "dml-tools": false, "custom-tool": false }: Fully disabled.Single-property cases:
{"dml-tools": true}: Enables DML only; auto-serializes to"mcp": true.{"custom-tool": true}: Enables custom tool only; serializes as given.dml-toolswill still be enabled by default and no other change is behaviorHow was this tested?
Sample CLI commands:
Add table with DML tools enabled
dab add Book --source books --permissions "anonymous:*" --mcp.dml-tools trueAdd stored procedure with custom tool enabled
dab add GetBookById --source dbo.get_book_by_id --source.type stored-procedure --permissions "anonymous:execute" --mcp.custom-tool trueAdd stored procedure with both properties
dab add UpdateBook --source dbo.update_book --source.type stored-procedure --permissions "anonymous:execute" --mcp.custom-tool true --mcp.dml-tools false