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

async _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.

_setup_debug_endpoints(
mcp: mcp.server.fastmcp.FastMCP,
functions: collections.abc.Mapping[str, nat.builder.function_base.FunctionBase],
) None#

Set up HTTP debug endpoints for introspecting tools and schemas.

Exposes:
  • GET /debug/tools/list: List tools. Optional query param name (one or more, repeatable or comma separated) selects a subset and returns details for those tools.

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