-
Notifications
You must be signed in to change notification settings - Fork 299
[MCP] Centralize JSON‑RPC error handling, standardize MCP response envelope, and add default anonymous role for stdio mode. #3035
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
b783c73
Addressed comments
anushakolan 6979a8d
Added copyright header for McpStdioHelper
anushakolan d634f8e
Merge branch 'main' into dev/anushakolan/mcp-stdio-followup
anushakolan 264af55
Merge branch 'main' into dev/anushakolan/mcp-stdio-followup
anushakolan a2d3b68
Merge branch 'main' into dev/anushakolan/mcp-stdio-followup
Aniruddh25 f642960
Merge branch 'main' into dev/anushakolan/mcp-stdio-followup
anushakolan a20bb09
Addressed comments
ce2c0b6
Minor fix
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
36 changes: 36 additions & 0 deletions
36
src/Azure.DataApiBuilder.Mcp/Model/McpStdioJsonRpcErrorCodes.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| namespace Azure.DataApiBuilder.Mcp.Model | ||
| { | ||
| /// <summary> | ||
| /// JSON-RPC 2.0 standard error codes used by the MCP stdio server. | ||
| /// These values come from the JSON-RPC 2.0 specification and are shared | ||
| /// so they are not hard-coded throughout the codebase. | ||
| /// </summary> | ||
| internal static class McpStdioJsonRpcErrorCodes | ||
| { | ||
| /// <summary> | ||
| /// Invalid JSON was received by the server. | ||
| /// An error occurred on the server while parsing the JSON text. | ||
| /// </summary> | ||
| public const int PARSE_ERROR = -32700; | ||
|
|
||
| /// <summary> | ||
| /// The JSON sent is not a valid Request object. | ||
| /// </summary> | ||
| public const int INVALID_REQUEST = -32600; | ||
|
|
||
| /// <summary> | ||
| /// The method does not exist / is not available. | ||
| /// </summary> | ||
| public const int METHOD_NOT_FOUND = -32601; | ||
|
|
||
| /// <summary> | ||
| /// Invalid method parameter(s). | ||
| /// </summary> | ||
| public const int INVALID_PARAMS = -32602; | ||
|
|
||
| /// <summary> | ||
| /// Internal JSON-RPC error. | ||
| /// </summary> | ||
| public const int INTERNAL_ERROR = -32603; | ||
| } | ||
| } |
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
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.