-
Notifications
You must be signed in to change notification settings - Fork 291
[MCP] Added support for --mcp-stdio flag to dab start
#2983
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
base: main
Are you sure you want to change the base?
Conversation
|
/azp run #Resolved |
|
Azure Pipelines successfully started running 6 pipeline(s). #Resolved |
|
/azp run #Resolved |
|
Azure Pipelines successfully started running 6 pipeline(s). #Resolved |
|
/azp run #Resolved |
|
Azure Pipelines successfully started running 6 pipeline(s). #Resolved |
--mcp-stdio flag to dab start
|
No pipelines are associated with this pull request. #Resolved |
2 similar comments
|
No pipelines are associated with this pull request. #Resolved |
|
No pipelines are associated with this pull request. #Resolved |
|
/azp run |
|
Azure Pipelines successfully started running 6 pipeline(s). |
aaronburtle
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.
Looks good!
souvikghosh04
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.
Added some comments to have common role parsing and retrieval logic along with some refactoring/modularization.
Addressed all comments. |
|
/azp run |
|
Azure Pipelines successfully started running 6 pipeline(s). |
souvikghosh04
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.
Thanks for addressing the comments.
Why make this change?
dab-config.json.What is this change?
Service entrypoint
--mcp-stdioearly, configures stdin/stdout encodings, and redirects all non‑MCP output to STDERR to keep STDOUT clean for MCP JSON.role:<name>argument (e.g. role:anonymous, role:authenticated) and injects it into configuration asMCP:Role, defaulting toanonymouswhen omitted.Runtime:Host:Authentication:Provider = "Simulator"via in‑memory configuration so the requested role is always available during MCP sessions.host.Run().CLI Integration
--mcp-stdiotodab startto launch the engine in MCP stdio mode.roleargument (e.g.role:anonymous) captured asStartOptions.McpRole.dab startunchanged.Note
ExecuteEntityToolnow looks for MCP tool inputs under arguments (the standard MCP field) and falls back to the legacy parameters property only if arguments is missing. This aligns our server with how current MCP clients (like VS Code) actually send tool arguments, and preserves backward compatibility for any older clients that still use parameters.How was this tested?
Integration-like manual testing via MCP clients against:
dotnet Azure.DataApiBuilder.Service.dll --mcp-stdio role:authenticated.dab start --mcp-stdio role:authenticated.Manual verification of all MCP tools:
describe_entitiesshows correct entities and effective permissions for the active role.read_records,create_record,update_record,delete_record,execute_entitysucceed when the role has the appropriate permissions.Sample Request(s)
{ "mcpServers": { "dab-with-exe": { "command": "C:\\DAB\\data-api-builder\\out\\publish\\Debug\\net8.0\\win-x64\\dab\\Microsoft.DataApiBuilder.exe", "args": ["start", "--mcp-stdio", "role:authenticated", "--config", "C:\\DAB\\data-api-builder\\dab-config.json"], "env": { "DAB_ENVIRONMENT": "Development" } } }2. MCP server via engine DLL
{ "mcpServers": { "dab": { "command": "dotnet", "args": [ "C:\\DAB\\data-api-builder\\out\\publish\\Debug\\net8.0\\win-x64\\dab\\Azure.DataApiBuilder.Service.dll", "--mcp-stdio", "role:authenticated", "--config", "C:\\DAB\\data-api-builder\\dab-config.json" ], "type": "stdio" } } }