|
cxxmcp 1.1.6
C++ MCP SDK
|
Per-message connection metadata supplied to server handlers. More...
#include <transport.hpp>
Public Member Functions | |
| SessionClient | client () const noexcept |
| Return a non-owning handle for the client on this session. | |
Public Attributes | |
| std::string | session_id |
| Logical MCP session id when the transport has one. | |
| std::string | remote_address |
| Best-effort remote endpoint description such as "stdio" or an address. | |
| std::unordered_map< std::string, std::string > | headers |
| Transport-supplied request headers or metadata for this message. | |
| std::optional< std::string > | http_method |
| HTTP request method for HTTP-based transports. | |
| std::optional< std::string > | http_url |
| Absolute HTTP request URL for HTTP-based transports. | |
| std::optional< AuthIdentity > | auth_identity |
| Authenticated principal produced by the configured AuthProvider. | |
| Transport * | transport = nullptr |
| Borrowed transport used to create a ClientPeer for outbound messages. | |
| std::weak_ptr< void > | transport_lifetime |
| Weak lifetime token supplied by the transport. | |
Per-message connection metadata supplied to server handlers.
The context is passed by value or const reference for the duration of a handler invocation. It does not own the transport; transport is a borrowed pointer that remains valid only while the underlying transport instance is alive and the session is active.
|
inlinenoexcept |
Return a non-owning handle for the client on this session.
| std::weak_ptr<void> mcp::server::SessionContext::transport_lifetime |
Weak lifetime token supplied by the transport.
ClientPeer checks this before using the borrowed transport pointer so stored contexts fail closed after the transport has been destroyed.