nat.front_ends.mcp.mcp_front_end_plugin_worker#

Attributes#

Classes#

MCPFrontEndPluginWorkerBase

Base class for MCP front end plugin workers.

MCPFrontEndPluginWorker

Default MCP front end plugin worker implementation.

Module Contents#

logger#
class MCPFrontEndPluginWorkerBase(config: nat.data_models.config.Config)#

Bases: abc.ABC

Base class for MCP front end plugin workers.

Initialize the MCP worker with configuration.

Args:

config: The full NAT configuration

full_config#
front_end_config: nat.front_ends.mcp.mcp_front_end_config.MCPFrontEndConfig#
_setup_health_endpoint(mcp: mcp.server.fastmcp.FastMCP)#

Set up the HTTP health endpoint that exercises MCP ping handler.

abstractmethod add_routes(
mcp: mcp.server.fastmcp.FastMCP,
builder: nat.builder.workflow_builder.WorkflowBuilder,
)#
Async:

Add routes to the MCP server.

Args:

mcp: The FastMCP server instance builder (WorkflowBuilder): The workflow builder instance

_get_all_functions(
workflow: nat.builder.workflow.Workflow,
) → dict[str, nat.builder.function.Function]#

Get all functions from the workflow.

Args:

workflow: The NAT workflow.

Returns:

Dict mapping function names to Function objects.

class MCPFrontEndPluginWorker(config: nat.data_models.config.Config)#

Bases: MCPFrontEndPluginWorkerBase

Default MCP front end plugin worker implementation.

Initialize the MCP worker with configuration.

Args:

config: The full NAT configuration

async add_routes(
mcp: mcp.server.fastmcp.FastMCP,
builder: nat.builder.workflow_builder.WorkflowBuilder,
)#

Add default routes to the MCP server.

Args:

mcp: The FastMCP server instance builder (WorkflowBuilder): The workflow builder instance