Merged
Conversation
- Add `title` and `icons` fields to client types: ToolInfo, ResourceInfo, ResourceTemplate, PromptInfo - Add JSON serialization/deserialization for new fields - Add `to_json`/`from_json` for ResourceTemplate (was missing) - Add comprehensive unit tests for title/icons serialization - Add integration tests (api_icons.cpp) for round-trip verification: - Tools with icons from server to client - Resources with icons - Resource templates with icons - Prompts with icons
560fd81 to
926daf7
Compare
- Add optional title, description, icons fields to tools::Tool - Add builder pattern setters (set_title, set_description, set_icons) - Update MCP handler to serialize icons in tools/list response - Enables servers to expose icon metadata matching Python fastmcp
- Remove duplicate Transfer-Encoding header in sse_server.cpp (set_chunked_content_provider already sets it) - Fix make_mcp_handler(server, tools, descriptions) to keep ToolManager access for tools/call invocation - Include title/description/icons from Tool in tools/list response T1 interop (C++ server + Python client) now passes 18/25 tests. Remaining failures are resources/prompts which are documented as not yet implemented.
Add SSE client transport to connect C++ clients to Python fastmcp servers: - SseClientTransport class with SSE event stream listener - JSON-RPC request/response matching with promise/future - Handle CRLF line endings in SSE responses (Windows/HTTP) - Properly unwrap JSON-RPC response envelope - Handle single object content in prompt responses (fastmcp format) - MCP initialization handshake before tool calls
- Implement resources/list and resources/read methods in McpHandler - Implement prompts/list and prompts/get methods in McpHandler - Add ResourceContent struct with text/binary variant for resource data - Add provider functions for lazy resource content generation - Add PromptArgument struct for prompt parameter definitions - Add PromptMessage struct for MCP prompt responses - Update Resource struct format with explicit fields (uri, name, id, kind, metadata) - Add base64 encoding for binary resources in MCP responses - Update test files to use new Resource API format T1 interop tests pass 21/25 (84%) - core functionality working
Strip trailing slashes from resource URIs for compatibility with Python fastmcp client which may append trailing slashes to URIs.
3b53351 to
1087e71
Compare
Update context_introspection.cpp and tool_injection_middleware.cpp to use explicit field assignment instead of aggregate initialization, as the Resource struct field order has changed.
PromptManager::get() now throws NotFoundError, update the test to match.
- PromptManager::add() now properly sets stored.name before storing - Updated api_basic.cpp to expect 4 resources (includes icon resource) - Updated api_advanced.cpp to expect 3 resource templates - Added icon_tool to test mock for client_api_icons tests
- Add title and icons parsing to parse_list_resource_templates_result() - Update api_basic.cpp test assertions for 7 tools (after icon_tool addition)
Update prompt count expectation from 2 to 3 to account for icon_prompt
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
titleandiconsfields to client types:ToolInfo,ResourceInfo,ResourceTemplate,PromptInfoto_json/from_jsonforResourceTemplate(was missing)Changes
include/fastmcpp/client/types.hpp- Add optional title and icons fields to 4 structstests/client/test_helpers.hpp- Add helper function for C++17 compatible struct initializationtests/json_types.cpp- Add 6 test functions for serializationTest plan