|
cxxmcp 1.1.6
C++ MCP SDK
|
Server-side transport abstraction for MCP JSON-RPC traffic. More...
#include <functional>#include <memory>#include <optional>#include <string>#include <string_view>#include <unordered_map>#include "cxxmcp/core/result.hpp"#include "cxxmcp/protocol/capabilities.hpp"#include "cxxmcp/protocol/types.hpp"#include "cxxmcp/server/auth.hpp"Go to the source code of this file.
Classes | |
| struct | mcp::server::SessionContext |
| Per-message connection metadata supplied to server handlers. More... | |
| class | mcp::server::Transport |
| Abstract server transport for receiving client JSON-RPC messages. More... | |
Typedefs | |
| using | mcp::server::SessionClient = ClientPeer |
| Clearer alias for the session-bound client handle returned from server handler contexts. | |
| using | mcp::server::ClientHandle = ClientPeer |
| Alias for applications that want to avoid colliding mentally with the top-level mcp::ClientPeer client-side peer. | |
| using | mcp::server::RequestHandler = std::function< core::Result< protocol::JsonRpcResponse >(const protocol::JsonRpcRequest &, const SessionContext &)> |
| Callback used by transports to dispatch inbound JSON-RPC requests. | |
| using | mcp::server::NotificationHandler = std::function< core::Result< core::Unit >(const protocol::JsonRpcNotification &, const SessionContext &)> |
| Callback used by transports to dispatch inbound JSON-RPC notifications. | |
Server-side transport abstraction for MCP JSON-RPC traffic.
Transports own the server-facing I/O loop and adapt protocol messages into request and notification callbacks. Implementations may be blocking or event-driven, but they all report transport and handler failures through core::Result rather than throwing.
| using mcp::server::NotificationHandler = typedef std::function<core::Result<core::Unit>( const protocol::JsonRpcNotification&, const SessionContext&)> |
Callback used by transports to dispatch inbound JSON-RPC notifications.
| notification | Parsed JSON-RPC notification. The object is owned by the caller. |
| context | Session and connection metadata for this notification. |
| using mcp::server::RequestHandler = typedef std::function<core::Result<protocol::JsonRpcResponse>( const protocol::JsonRpcRequest&, const SessionContext&)> |
Callback used by transports to dispatch inbound JSON-RPC requests.
| request | Parsed JSON-RPC request. The object is owned by the caller. |
| context | Session and connection metadata for this request. |