class documentation

class StatelessMCPServerProvider: (source)

Constructor: StatelessMCPServerProvider(name, server_factory)

View In Hierarchy

A stateless MCP server implementation for Temporal workflows.

This class wraps a function to create MCP servers to make them stateless by executing each MCP operation as a separate Temporal activity. Each operation (list_tools, call_tool, etc.) will connect to the underlying server, execute the operation, and then clean up the connection.

This approach will not maintain state across calls. If the desired MCPServer needs persistent state in order to function, this cannot be used.

Method __init__ Initialize the stateless temporal MCP server.
Property name Get the server name.
Method _create_server Undocumented
Method _get_activities Undocumented
Instance Variable _name Undocumented
Instance Variable _server_accepts_arguments Undocumented
Instance Variable _server_factory Undocumented
def __init__(self, name: str, server_factory: Callable[[], MCPServer] | Callable[[(Any | None)], MCPServer]): (source)

Initialize the stateless temporal MCP server.

Parameters
name:strThe name of the MCP server.
server_factory:Callable[[], MCPServer] | Callable[[(Any | None)], MCPServer]A function which will produce MCPServer instances. It should return a new server each time so that state is not shared between workflow runs.

Get the server name.

def _create_server(self, factory_argument: Any | None) -> MCPServer: (source)

Undocumented

def _get_activities(self) -> Sequence[Callable]: (source)

Undocumented

Undocumented

_server_accepts_arguments = (source)

Undocumented

_server_factory = (source)

Undocumented