Interface McpTransportContext

All Known Implementing Classes:
DefaultMcpTransportContext

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
    Copies the contents of the context to allow further modifications without affecting the initial object.
    get(String key)
    Extract a value from the context.
    void
    put(String key, Object value)
    Inserts a value for a given key.
  • Field Details

  • Method Details

    • 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.
    • put

      void put(String key, Object value)
      Inserts a value for a given key.
      Parameters:
      key - a String representing the key
      value - the value to store
    • copy

      Copies the contents of the context to allow further modifications without affecting the initial object.
      Returns:
      a new instance with the underlying storage copied.