You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow dab start to switch the MCP protocol to stdio
Add support for setting the context permissions role
Note
The default protocol for MCP in DAB is HTTP. Using this command line switch, we can change the protocol to STDIO. This aligns nicely to how local MCP servers are invoked via command line through files like mcp.json in VS Code.
Why
Local stdio support makes debugging the DAB MCP server easier
With stdio, developers can run DAB as a local MCP server
Any value after the role: prefix is used as the permissions role for stdio. The reason for this behavior is because HTTP headers are not part of stdio. Arbitrarily setting the role for the calling user is ONLY supported in DAB when authentication.provider is set to Simulator in the DAB configuration. As a result, using this command line switch will auto-set the authentication.provider to Simulator (in memory) for this session only.
--mcp-stdio switches the MCP protocol to stdio while starting DAB normally
The optional role:anonymous value forces the MCP permissions role
Auto-set authentication.provider to Simulator with this switch.
Behavior
Without the flag, the MCP server defaults to http
If no value is provided, the MCP server defaults to the anonymous role
What
dab startto switch the MCP protocol tostdioroleNote
The default protocol for MCP in DAB is HTTP. Using this command line switch, we can change the protocol to STDIO. This aligns nicely to how local MCP servers are invoked via command line through files like
mcp.jsonin VS Code.Why
stdiosupport makes debugging the DAB MCP server easierstdio, developers can run DAB as a local MCP serverA sample VS Code mcp.json file
{ "name": "data-api-builder", "command": "dab", "args": [ "start", "--mcp-stdio", "role:authenticated", "--config", "dab-config.json" ] }How
Add the
--mcp-stdioflagExample command:
Important
Any value after the
role:prefix is used as the permissions role forstdio. The reason for this behavior is because HTTP headers are not part ofstdio. Arbitrarily setting therolefor the calling user is ONLY supported in DAB whenauthentication.provideris set toSimulatorin the DAB configuration. As a result, using this command line switch will auto-set theauthentication.providertoSimulator(in memory) for this session only.--mcp-stdioswitches the MCP protocol tostdiowhile starting DAB normallyrole:anonymousvalue forces the MCP permissions roleauthentication.providertoSimulatorwith this switch.Behavior
httpanonymousrolehttpbehavior of the MCP endpoint is unaffected