Skip to content

Commit 43e5e64

Browse files
authored
MCP parity: request metadata and 165 interaction tests (#11)
* Add 165 server interaction tests for Python parity Comprehensive test coverage matching Python's test_server_interactions.py: - TestTools, TestToolParameters, TestOutputSchema, TestContentTypes - TestResource, TestResourceTemplates, TestResourceAnnotations - TestPrompts, TestPromptVariations, TestMeta - TestCapabilities, TestProgressAndNotifications, TestRootsNotification - TestCancelledNotification, TestLogging, TestImageContent - TestEmbeddedResource, TestToolInputValidation, TestResourceSubscribe - TestCompletionEdgeCases, TestBatchOperations, TestTransportEdgeCases - Unicode, pagination, large data, error handling, and edge cases Also fixes iterator dereference bug in client.hpp when accessing structuredContent without registered outputSchema. * Add request meta fields to Context with coverage * Add optional request metadata to Context and tests * Fix UTF-16 encoding in context_meta.cpp * Fix typed struct access in InitializeResult tests The InitializeResult type is a typed struct, not JSON - use proper struct field access instead of JSON-style accessor methods.
1 parent 5b3522a commit 43e5e64

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

tests/server/context_meta.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "fastmcpp/prompts/manager.hpp"
1+
#include "fastmcpp/prompts/manager.hpp"
22
#include "fastmcpp/resources/manager.hpp"
33
#include "fastmcpp/server/context.hpp"
44

tests/server/interactions.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4168,6 +4168,7 @@ void test_server_info()
41684168
client::Client c(std::make_unique<client::LoopbackTransport>(srv));
41694169

41704170
auto info = c.initialize();
4171+
assert(!info.serverInfo.name.empty());
41714172
assert(info.serverInfo.name == "test_server");
41724173
assert(info.serverInfo.version == "1.0.0");
41734174

0 commit comments

Comments
 (0)