Set Up an MCP Client

Use the MCP Client Snap Pack to connect your SnapLogic agent pipelines to external MCP servers, enabling your AI agents to discover and invoke tools hosted outside of SnapLogic.

Overview

The MCP Client Snap Pack lets your SnapLogic pipelines act as MCP clients — connecting to any MCP-compatible server to discover its tools and invoke them on behalf of an AI agent. This is the complement to the MCP Server: where the MCP Server exposes your SnapLogic pipelines as tools, the MCP Client lets your pipelines consume tools from elsewhere.

Use the MCP Client Snap Pack to:

  • Call tools hosted on external MCP servers — such as web search, code execution, or data retrieval services — from within a SnapLogic agent pipeline
  • Connect to a SnapLogic MCP Server from a different pipeline or organization
  • Chain tools from multiple MCP servers together in a single agent workflow
  • Expose MCP resources (resources/list, resources/read) to your AI agent alongside tools

The Snap Pack contains two Snaps that work together:

  • MCP Function Generator: Connects to the MCP server and queries it for available tools (tools/list). Converts the server's tool definitions into a list of function definitions formatted for LLM tool calling.
  • MCP Invoke: Executes a tool or resource operation on the MCP server (tools/call, resources/read, resources/list) and returns the result in a unified structure for downstream processing.

How it works

MCP Client Snaps are designed to work within agent pipelines built using AgentCreator Snaps. In a typical pipeline, the MCP Function Generator and MCP Invoke Snaps bracket the LLM tool-calling step:

  1. MCP Function Generator connects to the external MCP server using the configured account. It calls tools/list to fetch available tools and converts each tool's name, description, and parameter schema into a function definition. Optionally, it also adds list_resources and read_resource as callable functions.
  2. The function definitions are passed to an LLM tool-calling Snap (Anthropic Claude, OpenAI, Azure OpenAI, or Google). The LLM evaluates the user's request, selects the appropriate tool, and generates the call parameters.
  3. MCP Invoke receives the LLM's tool call decision and executes the selected operation on the MCP server, passing the tool name and parameters. It returns the result in a unified structure.
  4. A Function Result Generator Snap formats the tool result and returns it to the LLM, which incorporates it into its response or triggers further tool calls.

Prerequisites

  • The URL of the external MCP server you want to connect to, including transport path (/sse or /mcp)
  • Authentication credentials for the server, if required (bearer token, or OAuth2 client ID and secret)
  • An AgentCreator pipeline containing a supported LLM tool-calling Snap (Anthropic Claude, OpenAI, Azure OpenAI, or Google)

Step 1: Create an MCP Client account

Choose the account type that matches your MCP server's transport protocol and authentication method, then follow the setup steps in Configure MCP Client Accounts.

Account type Transport Use when
MCP SSE Account SSE The server exposes a /sse endpoint and requires no authentication beyond optional header fields
MCP SSE OAuth2 Account SSE + OAuth2 The server exposes a /sse endpoint and requires OAuth2 authentication (client credentials, authorization code, or password grant)
MCP Streamable HTTP Account Streamable HTTP The server exposes a /mcp endpoint and requires no authentication beyond optional header fields
MCP Streamable HTTP OAuth2 Account Streamable HTTP + OAuth2 The server exposes a /mcp endpoint and requires OAuth2 authentication

Step 2: Build the MCP Client pipeline

Add the MCP Client Snaps to your agent pipeline alongside the LLM Snaps that handle tool calling.

  1. Add an MCP Function Generator Snap to your pipeline and configure its account to use the account you created in Step 1.
  2. Expose Tools is selected by default. Leave it selected to include the server's tools as callable functions.
  3. Optionally, select Expose Resources to add list_resources and read_resource as additional functions the LLM can invoke.
  4. Connect the MCP Function Generator output to your LLM tool-calling Snap (Anthropic Claude, OpenAI, Azure OpenAI, or Google). The Snap passes the function definitions to the LLM with the user's prompt.
  5. Add an MCP Invoke Snap downstream of the LLM tool-calling Snap. Configure its settings:
    • Operation: Set to tools/call, or use $sl_metadata.operation to pass the operation from the LLM's tool call decision.
    • Tool Name: Set to $function.name to use the tool selected by the LLM.
    • Parameter: Set to $function.json_arguments to pass the LLM-generated parameters to the tool.
  6. Connect the MCP Invoke output to a Function Result Generator Snap (matching your LLM provider) to return the tool result to the LLM for further processing.
Note: You can chain multiple MCP Function Generator Snaps in a single pipeline — one per external MCP server — to expose tools from multiple servers to a single LLM in the same agent workflow.