Repository navigation
Add whoami tool to fast-time-server for header reflection - #43
Merged
Merged
Conversation
The tool returns the HTTP headers received with the tools/call request as a lowercased JSON map, so ContextForge plugin E2E suites (e.g. Vault tool_pre_invoke) can assert upstream header behavior without a bespoke echo backend. The authorization key is always present, null when the header is absent; header values never appear in server logs. Closes #41 Signed-off-by: Jonathan Springer <jps@s390x.com>
The rmcp macro auto-generates outputSchema from the Json<T> return type; schemars renders serde_json::Value as a typeless schema, which violates the MCP requirement that outputSchema be an object schema and failed the conformance tools-list scenario in CI. Use a transparent BTreeMap newtype so the generated schema is a valid object schema. Verified locally with @modelcontextprotocol/conformance@0.1.16: baseline check passes. Signed-off-by: Jonathan Springer <jps@s390x.com>
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.
Summary
Adds a
whoamitool to fast-time-server that reflects the HTTP headers of thetools/callrequest as a lowercased JSON map, so ContextForge plugin E2E suites (e.g. Vaulttool_pre_invoke) can assert upstream header behavior without the bespokeecho_mcp.pyFastMCP backend.authorizationkey always present,nullwhen absenthttp::request::Partsinto request extensions on session and stateless paths)structuredContentplus mirrored text contentVerification
cargo fmt,cargo clippy --all-targets,cargo testall pass (39 tests, incl. 2 new whoami tests)X-Vault-Tokensheaders reflected; second call returns"authorization": null; zero header values in server logsDownstream
IBM/mcp-context-forge consumes this image pinned by digest in
docker-compose.yml; suite migration waits on an image publish and a digest bump after merge.Closes #41