Create the MCP Server Pipeline

Build a pipeline that exposes tools for AI agents using Function Generator Snaps and the MCP Server Router.

Overview

An MCP Server Pipeline defines the tools that AI agents can discover and invoke. The pipeline must handle two MCP protocol methods:

  • tools/list: Returns the list of available tools with their schemas
  • tools/call: Executes the requested tool and returns results

SnapLogic supports four tool source types that you can use individually or combine in a single MCP Server:

  • Pipeline as Tool: Expose existing SnapLogic pipelines as MCP tools
  • OpenAPI: Convert OpenAPI specifications into MCP tools
  • APIM Service: Expose APIM-managed APIs as MCP tools
  • MCP Client: Re-expose tools from external MCP Servers

Pipeline Architecture

All MCP Server Pipelines follow the same core architecture pattern:

  1. Function Generator - Defines available tools and their schemas
  2. MCP Server Router - Routes requests to list or call handlers
  3. Pipeline Execute - Executes the tool logic
  4. Mapper - Transforms output (removes internal metadata)
  5. Union - Merges the list and call response streams

Pipeline as Tool

Use the Multi Pipeline Function Generator Snap to expose existing SnapLogic pipelines as MCP tools. Each pipeline becomes an invocable tool.



Tool Pipeline Requirements

Pipelines used as tools must:

  • Be tagged with tool in Pipeline Settings


  • Define parameters in the pipeline parameter table (these become tool input parameters)


  • Include a purpose description in pipeline Info (becomes the tool description)


  • Have a defined input and output view

Pipeline Structure

Multi Pipeline Function Generator Settings

  • Pipeline Paths: List of pipeline paths to expose as tools (relative to the project)
  • Strict Mode: When enabled, requires exact parameter matches


Pipeline Execute Settings

  • Pipeline: Set to expression $sl_tool_metadata.path to dynamically execute the requested tool pipeline
  • Executable during suggest: Enable for real-time tool discovery


OpenAPI Tool

Use the OpenAPI Function Generator Snap to convert OpenAPI (Swagger) specifications into MCP tools. Each API operation becomes a separate tool.

OpenAPI Function Generator Settings

  • Input Type: Choose between Text editor, File, or URL
  • OpenAPI Spec: Paste or reference your OpenAPI/Swagger specification (JSON or YAML)
  • Base URL: The base URL for API calls (overrides the spec's server URL)
  • Tool Path: Path to the tool pipeline that executes the API calls
  • Preferred Content Type: Default content type for requests (e.g., application/json)
  • Account: Optional account for authenticated API calls

Tool Pipeline

Create a separate pipeline (tagged with tool) that handles the actual API execution. This pipeline receives the operation details and parameters, executes the HTTP request, and returns the response.

APIM Service Tool

Use the APIM Function Generator Snap to expose APIs managed by SnapLogic API Management as MCP tools.

APIM Function Generator Settings

  • Project Path: The SnapLogic project containing the APIM service (e.g., projects/MyProject)
  • Service Name: The name of the APIM service
  • Service Version: The version of the APIM service
  • Base URL: The APIM gateway URL for the service
  • Tool Path: Path to the tool pipeline that executes API calls
  • Filter Type: Choose to use all paths or filter by specific paths/tags
  • Preferred Content Type: Default content type for requests

MCP Client Tool

Use the MCP Function Generator Snap to re-expose tools from external MCP Servers. This enables MCP Server composition, allowing you to aggregate tools from multiple sources.

MCP Function Generator Settings

  • Account: MCP Streamable HTTP Account configured to connect to the external MCP Server
  • Tool Path: Path to the tool pipeline that invokes the external MCP tools
  • Expose Tools: Enable to expose the external server's tools
  • Expose Resources: Enable to expose the external server's resources (if supported)

Tool Pipeline Requirements

The tool pipeline uses the MCP Invoke Snap to call tools on the external MCP Server:

  • Account: The same MCP Streamable HTTP Account
  • Operation: Set to $sl_tool_metadata.operation
  • Tool Name: Set to $sl_tool_name
  • Parameters: Filter out internal metadata fields

Combining Multiple Tool Types

In a pipeline with multiple tool types, the different tools should be linked in a series (using the various types of Function Generator Snaps) rather than in parallel (only using the Multi Function Generator Snap). You can combine multiple Function Generators in a single MCP Server Pipeline to expose tools from different sources:

Chain the Function Generators together so each one passes its output to the next. The combined tool list flows to the MCP Server Router, which handles both listing all tools and routing tool calls to the appropriate execution path.

Create an MCP Server Pipeline
  1. In Designer, create a new pipeline.
  2. Add a Function Generator Snap based on your tool source type.
    • Multi Pipeline Function Generator for pipeline-based tools
    • OpenAPI Function Generator for OpenAPI/Swagger specs
    • APIM Function Generator for APIM services
    • MCP Function Generator for external MCP Server tools
  3. Configure the Function Generator with your tool definitions or source references.
  4. Add an MCP Server Router Snap and connect the Function Generator output to its input.

    Configure the Request property to $original to pass the original MCP request.

  5. Connect the Router's Tool list view output directly to a Union Snap.

    This path handles tools/list requests.

  6. Connect the Router's Tool call view output to a Pipeline Execute Snap.

    Configure Pipeline Execute:

    • Pipeline: $sl_tool_metadata.path (expression)
    • Executable during suggest: Enabled
  7. Add a Mapper Snap after Pipeline Execute to remove internal metadata.

    Configure the Mapper transformation:

    $.filter((value, key) => !key.startsWith("original"))

    This removes the original request data from the response.



  8. Connect the Mapper output to the Union Snap's second input.
  9. Add the mcp_server tag to the pipeline.

    Go to Pipeline Settings and add mcp_server to the Tags field. This tag is required for the pipeline to be registered as an MCP Server.



  10. Save and validate the pipeline.

Example Pipelines

Download these example pipelines to use as templates:

After creating your MCP Server Pipeline, proceed to Register MCP Server to create an MCP Server asset.