Expose MCP JSON-RPC protocol metadata via $mcp.getClientInfo#1792
Merged
Expose MCP JSON-RPC protocol metadata via $mcp.getClientInfo#1792
Conversation
… info to getClientInfo
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.
Motivation
mcp-session-id.initializepayload/result with captured transport state for debugging and telemetry.Description
_mcpInfo(session,lastRequest,lastResponse,lastResponseHeaders) inside$jsonrpcand populate it on each call. (js/openaf.js)$jsonrpc.getClientInfo()viagetClientInfothat returns the collected_mcpInfo, and added$mcp.getClientInfo()to merge the MCPinitializeresult into the returned client info. (js/openaf.js)mcp-session-idfrom HTTP response headers and store it in the tracked session info, and record response headers for remote/SSE/notification flows. (js/openaf.js)mcp-session-idoninitializeand added a testtestGetClientInfoIncludesJSONRPCMCPDatathat assertsgetClientInfo()containslastRequest,lastResponseenvelope, capturedsession.mcpSessionId, and theinitializeresult. (tests/autoTestAll.MCP.js)Testing
tests/autoTestAll.MCP.js, includingtestGetClientInfoIncludesJSONRPCMCPDatawhich validates JSON-RPC/MCP metadata fields andmcp-session-idcapture; the test file was modified as part of this change.cd tests && ../openaf --ojob autoTestAll.MCP.yaml, which failed because theopenafCLI is not available in this environment.cd tests && java -jar ../openaf.jar --ojob autoTestAll.MCP.yaml, which failed becauseopenaf.jaris not present in this environment.