Merged
Conversation
Add create_proxy() factory function for creating proxy servers. Matches Python's fastmcp.server.create_proxy() API. - Supports std::string URL (auto-detects HTTP/HTTPS/WS/WSS) - Supports client::Client instances (creates fresh sessions) - Session strategy: Always fresh sessions per request (for safety) - Note: unique_ptr<ITransport> not supported (use Client instead) Refers to Python fastmcp commit 3163e61e which replaced FastMCP.as_proxy() with create_proxy(). Completes parity task from kb/sync/review_result.md Phase 1, Task 1. Fixes: Feature gap - create_proxy() factory function Changes: - include/fastmcpp/proxy.hpp: Add create_proxy() template declaration - src/proxy.cpp: Implement URL and Client specializations
- Add unit tests for create_proxy() factory function: - test_create_proxy_from_client: Create proxy from Client instance - test_create_proxy_url_detection: Verify URL scheme auto-detection - test_create_proxy_with_local_tools: Verify local+remote tool mixing - Add Proxy server section to README with usage examples - Documents URL auto-detection (http/https -> HTTP, ws/wss -> WebSocket) - Documents local override precedence Completes Phase 1 Task 2 and Phase 2 Task 3 from review_result.md
Add main header that includes all commonly used components: - Core types, exceptions, content, settings - Client and transports - Server and context - Tools, resources, prompts managers - MCP handler - Proxy with create_proxy() factory - High-level FastMCP app Add compile test to verify header works correctly. Completes Phase 2 Task 4 from review_result.md
- proxy.cpp: Use string value directly instead of dump() for string results to avoid double JSON serialization - handler.cpp: Unwrap single-element content arrays for prompts/get to match MCP protocol expectations
The template-only API required rvalue std::string, breaking common
usage patterns like create_proxy("http://localhost:8080/mcp").
Now provides non-template overloads:
- create_proxy(const std::string& url, ...) - lvalue strings
- create_proxy(const char* url, ...) - string literals
- create_proxy(client::Client&& client, ...) - rvalue clients
All documented examples now work as expected.
Replace raw JSON-RPC construction with clean high-level methods: - client.initialize() for MCP session setup - client.list_tools() for tool discovery - client.call_tool() for invoking tools - result.text() helper for extracting text results Examples now show the recommended API usage pattern.
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
create_proxy()template factory function matching Python fastmcp's APIfastmcpp.hppheader for convenient single-include usageChanges
1.
create_proxy()factory functionImplements the
create_proxy()factory function to match Python fastmcp's convenience API:Features:
2. Unified header
Adds
fastmcpp.hppmain header for single-include convenience:3. Tests & Documentation
create_proxy()intests/proxy/basic.cppTest Results
Test plan
ctest --test-dir build -C Releasepasses (76/76)create_proxy()with URLs and Clients