Interface McpTransportContext


public interface McpTransportContext
Context associated with the transport layer. It allows to add transport-level metadata for use further down the line. Specifically, it can be beneficial to extract HTTP request metadata for use in MCP feature implementations.
Author:
Dariusz Jędrzejczyk
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final McpTransportContext
    An empty, unmodifiable context.
    static final String
    Key for use in Reactor Context to transport the context to user land.
  • Method Summary

    Modifier and Type
    Method
    Description
    create(Map<String,Object> metadata)
    Create an unmodifiable context containing the given metadata.
    get(String key)
    Extract a value from the context.
  • Field Details

  • Method Details

    • create

      static McpTransportContext create(Map<String,Object> metadata)
      Create an unmodifiable context containing the given metadata.
      Parameters:
      metadata - the transport metadata
      Returns:
      the context containing the metadata
    • get

      Object get(String key)
      Extract a value from the context.
      Parameters:
      key - the key under the data is expected
      Returns:
      the associated value or null if missing.