MCP Server Router

Routes incoming MCP Server requests, enabling both tool discovery and tool invocation within a single pipeline.

Overview

Use this Snap to route input documents based on the request method (sl_method) within an MCP Server Pipeline. The MCP Server Router directs tools/list requests to the first output view and tools/call requests to the second output view. For tool call requests, the Snap also enriches the request object with the corresponding tool metadata before sending it downstream.



  • This is a Transform-type Snap.

Prerequisites

  • An MCP Server Pipeline containing one or more Function Generator Snaps connected to the Router's input.

Snap views

Type Description Examples of upstream and downstream Snaps
Input This Snap supports exactly one document input view.
  • Multi Pipeline Function Generator
  • OpenAPI Function Generator
  • APIM Function Generator
  • Function Generator
Output

This Snap supports exactly two document output views.

  • The first output view outputs the input document when the request method is tools/list.
  • The second output view outputs the request object when the request method is tools/call. If a tools list is provided in the input document, the Snap adds the corresponding tool metadata to the request object.
Learn more about Error handling.

Snap settings

Legend:
  • Expression icon (): Allows using JavaScript syntax to access SnapLogic Expressions to set field values dynamically (if enabled). If disabled, you can provide a static value. Learn more.
  • SnapGPT (): Generates SnapLogic Expressions based on natural language using SnapGPT. Learn more.
  • Suggestion icon (): Populates a list of values dynamically based on your Snap configuration. You can select only one attribute at a time using the icon. Type into the field if it supports a comma-separated list of values.
  • Upload : Uploads files. Learn more.
Learn more about the icons in the Snap settings dialog.
Field/Field set Type Description
Label String

Required. Specify a unique name for the Snap. Modify this to be more appropriate, especially if more than one of the same Snaps is in the pipeline.

Default value: MCP Server Router

Example: Firecrawl MCP Server Router

Request String/Expression

The request object generated from the MCP Server Adapter to the MCP Server Pipeline. It must include the sl_method field, which defines the request method. Supported request methods are tools/list and tools/call.

Default value: $

Example: $original

Snap execution Dropdown list
Choose one of the three modes in which the Snap executes. Available options are:
  • Validate & Execute: Performs limited execution of the Snap and generates a data preview during pipeline validation. Subsequently, performs full execution of the Snap (unlimited records) during pipeline runtime.
  • Execute only: Performs full execution of the Snap during pipeline execution without generating preview data.
  • Disabled: Disables the Snap and all Snaps that are downstream from it.

Default value: Validate & Execute

Example: Execute only