Returning Text Content from an FME MCP Tool

Jeremy Belcher
Jeremy Belcher
  • Updated

Introduction

FME Flow's MCP Server capabilities let you build custom servers that expose your data workflows as callable MCP tools.  Each tool is linked to a specific workspace that has been published to FME Flow, giving your MCP client secure, controlled access to your data workflows.

In this tutorial, we will cover how to build an MCP server and MCP tool in FME Flow, as well as how to author a workspace that returns text content to the MCP client, and then to the end user. We will cover how to create a text-based MCP workflow that will allow an LLM to query a SQLite database. In this particular case, the data will be theoretical (not real) data for queue levels at an airport.

To make the most of this new feature, workspaces that are intended for use as an MCP tool should be authored using the MCP writer. This format currently supports text, image, and audio output content to be passed to your client.

 

Requirements

  • FME Form and FME Flow version 2026.2 or later
  • LM Studio or another MCP-compatible client/AI service
    • If your FME Flow installation is publicly accessible, a cloud-based service can be used (e.g. Claude, Gemini, etc.)
    • If your FME Flow installation is not publicly accessible, a local service can be used (e.g. LM Studio), or you can connect to a cloud service that has a local “developer mode” (see this support article from Anthropic for more information)

 

Step-by-Step Instructions

This tutorial is divided into two parts. In Part 1, you will create an MCP Server and tool in FME Flow. In Part 2, you will build and publish the FME workspace that powers the tool.

 

Part 1: Creating an MCP Server

Before building the workspace, you will set up the MCP Server in FME Flow.

 

1. Create an MCP Server on FME Flow

If you have an existing MCP Server in FME Flow you would like to use, skip this step and proceed with setting up the underlying FME workspace in Part 2.

Log in to the FME Flow user interface, and navigate to the MCP Servers section in the left-hand menu bar. 

 

The MCP Servers page is your central registry for all MCP servers in FME Flow. Each server can host multiple tools, and access can be managed across user groups and use cases. Click Create to open the MCP server creation dialogue

 

 

To create a new MCP server, provide the following values:

  • Title: Airport Operations MCP Server
  • Name: airport-ops
  • Description: This MCP server hosts tools that query airport operations data, including gate capacity and queue status, and return results in plain language to any MCP client. 
  • Job Queue: Default
  • Authentication Method: Unauthenticated

Leave all other values as their defaults, and click Create. 

A well-written description helps your MCP Client understand the purpose of the MCP server, the tools it provides, and when those tools should be used. Also of note, the value entered for the name is included as part of the URL.

Now that our MCP server has been created on FME Flow, we are ready to start authoring our workspaces, which will do all of the work “under the hood” for our tools.

 

Part 2: Set up the Underlying FME Workspace 

With the MCP Server configured, you can now build the FME workspace that does the work. This workspace reads from the SQLite database, formats the results as text, and uses the MCP Writer to pass that content back to the calling client.

 

1. Open FME Workbench and Add a SQLite Reader

Start by downloading the sample data attached to this article. The sample data contains an SQLite database of theoretical airport queue information, and shows the kind of data that could be used in MCP tools.

Start FME Workbench and click New to create a blank workspace. 

To get started with building our workspace, navigate to the ribbon menu above the canvas, click Reader. In the Add Reader dialog:

  • Format: SQLite
  • Dataset: .\gates.sqlite

 

You should see your reader on the canvas. Run the workspace and click the eye icon to view a preview of the data.

 

2. Set Up User Parameter

In FME, user parameters become the inputs to your MCP tool. When a client calls the tool, it passes values to these parameters at runtime. The parameters you define here determine what information the client can send to narrow or shape the response.

The SQLite database has 4 fields. For this tutorial, we will focus on filtering by ‘status’. 

Adding a user parameter for this field lets the calling client pass in a specific status value at runtime, limiting the records returned by the workspace. With larger databases, this can reduce processing times and keeps the response concise, which matters when the output is being consumed by an MCP client. 

To create the parameter, open the Navigator, right-click on User Parameters, Manage User Parameters and click the Plus icon to create a new User Parameter. In the drop-down, choose Choice. This will allow the user to select one of the possible status values from a list of predefined options.

 

Enter the following details:

  • Parameter Identifier: CAPACITY
  • Label: Capacity Level
  • Required: Unchecked

Making the parameter optional will allow the user to leave it empty in order to load all records.

In the Choice Configuration, choose Dropdown:

  • Add Choices:
    • Value: not_full
      • Display: Not Full
    • Value: full
      • Display: Full
    • Value: overflowing
      • Display: Overflowing

 

When the readers and writers for this workspace are created, user parameters are automatically generated. This allows the user to specify different input files and output locations when running the workspace locally. However, we don’t need these for use in an MCP tool, as the workspace will be run on FME Flow when the tool is called. 

These parameters can be hidden in the user parameter manager to prevent them from being exposed as MCP tool parameters. To do this, right-click on the source dataset parameter, manage user parameters, and set:

  • Visibility: Always Hide.

Alternatively, these parameters can also be hidden in the MCP tool configuration in FME Flow. 

 

3. Create SQL Statement

Next, connect the parameter to the reader using a WHERE clause in the reader feature type. WHERE clauses filter records directly at the data source before they are loaded into the workspace. This is more efficient than reading the full dataset and filtering afterward with a transformer like a Tester or TestFilter, which still requires loading every record into memory first. 

For MCP tools, this is a useful pattern: by tying a WHERE clause to a user parameter, you give the calling client control over what data gets returned without loading more than necessary. 

Open the reader and add the following statement:

status = '$(CAPACITY)' OR '$(CAPACITY)' = ''

 

This statement returns records where the status matches the value passed in by the client. The second condition, '$(CAPACITY)' = '', handles the case where no value is passed: if the parameter is empty, all records are returned.

 

4. Add AttributeCreator 

Before writing output, you need to format each feature into a single text attribute. The MCP writer, which you will add in the next steps, expects an attribute named text containing the content to return to the calling client. Use an AttributeCreator to build this attribute for each feature, pulling in only the fields you want the client to receive. This is also an opportunity to exclude any fields that are not relevant or that you do not want to expose. Formatting each feature as a labeled list makes the output easier for the client to parse and present to the end user.

Connect the AttributeCreator to the output of the SQLite reader and add the following attribute:

  • Output Attribute: text
  • Value: Gate ID: @Value(gate_id)
  • Terminal: @Value(terminal)
  • Status: @Value(status)
  • Last Updated: @Value(last_updated)

 

5. Add MCP Writer

Finally, add the MCP writer to the canvas. In the ribbon menu, click Writer. In the Add Writer dialog:

  • Format: MCP (Model Context Protocol)
  • Dataset: .\mcp_data_current
    • Choose a local file location. This path is used for local testing in FME Form only. When the workspace is published and run through FME Flow, output is returned directly to the calling client rather than written to a file. 

Click OK.


The writer dialog will then present several feature type options, representing the current supported content types for the MCP writer. Since we are only concerned with text content in this tutorial, deselect all options other than Text Content.

 

Connect the output of the AttributeCreator to the input of the MCP writer. The final workspace should look like this.

Hide the Destination MCP Folder user parameter using the same steps you used to hide the Source Dataset parameter.


Now that our workspace is finished, we can publish it to FME Flow to be assigned to our MCP tool.

 

Part 3. Publish and Configure the MCP Tool

1. Publish Workspace to FME Flow

From FME Workbench, click Publish. When choosing a repository, click New and name it mcp-text or something similar. Choose a name for your workspace, such as airport-queues-mcp.

 

Select the Job Submitter service. 

Publish. 

 

2. Create MCP Tool in FME Flow

Return to FME Flow and select your newly-created MCP server. 

Under the Tools tab, click Create to create a new tool. FME Flow allows you to create and save MCP tools even if they do not have an associated workspace. We will simply create the tool for now, and then assign our workspace to it in the next section of this tutorial.

Provide the following values in the tool creation dialogue, under the Details tab:

  • Name: queue-capacity-tool
  • Title: Queue Capacity Tool
  • Description: Returns the current capacity status of airport gates. Call this tool when a user asks about gate crowding, queue levels, or capacity at the airport. Accepts an optional status filter (not_full, full, or overflowing) to narrow results. If no filter is provided, returns the status of all gates.

 

A tool description tells the MCP client when to invoke this tool. A clear, specific description improves how reliably the client selects the right tool for a given user request. At a minimum, describe what the tool does and what kinds of user questions should trigger it.

Leave all other values as their default, and click Create.
 

3. Add Parameter Descriptions

The user parameters you defined in the workspace now appear here. For each parameter you want to expose as a tool input, write a description that tells the calling client what to pass in. A good parameter description gives the calling client everything it needs to pass in a valid value. Depending on your parameter type, consider including:

  • Valid values: if the parameter accepts a fixed set of values, list them (e.g. not_full, full, overflowing)
  • Formatting requirements: if the parameter expects a specific format, such as a date, coordinate, or unit, specify it (e.g. 'Enter the date in YYYY-MM-DD format')
  • When to prompt for more information: if the parameter is required and the user has not provided a value, instruct the client to ask before calling the tool (e.g. 'If the user has not specified a value, ask them before proceeding')
  • When to leave it blank: if the parameter is optional, tell the client what the default behavior is (e.g. 'If no status is specified, leave this blank to return all gates')
  • Range or constraints: if the parameter accepts a numeric value, specify any limits (e.g. 'Enter a value between 1 and 100')

For the CAPACITY parameter, enter the following description:

  • Description: The capacity status to filter by. Accepted values are not_full, full, and overflowing. If the user has specified a status, pass it in exactly as written. If the user has not mentioned a status and the context does not make it clear, leave this blank to return all gates.

Ensure that Use Default is unchecked and don’t select any default value. 

 

If there are any other Parameters listed, unselect the Use as Tool Parameter option. 

Save and Publish your Tool.

It is now live on your MCP Server and available for discovery by any connected MCP client. The client can read the tool name, description, and parameter descriptions you configured to understand when and how to call it.

You can connect this server to your own MCP client at any point using the server URL found on the Server Details page in FME Flow. To follow along with a worked example using LM Studio and a local LLM, continue to the next section.

 

Part 4: Run Tool with an MCP Client 

With your workspace published and your tool configured, you can now connect a client to the MCP Server and run the tool. This section walks through the connection process using LM Studio with a local LLM. The exact steps will vary depending on your MCP client and whether your FME Flow instance is publicly accessible or on-premises. Refer to the documentation for your specific client for connection details.

 

1. Connect to the MCP Server from an MCP Client 

Click Start MCP Server. Then, using the URL value from the Server Details page in FME Flow, connect your MCP server to your MCP client.

 

Once your server is connected, you will have access to the tool we have created (you may need to give explicit access to the tool, depending on the client you are using).

In this tutorial, we will be using LM Studio with Gemma 4, although this tool can be used with any other MCP client as well. See instructions for setting up with LM Studio here.

 

2. Test with a Filtered Prompt

Once your MCP client is connected to your MCP server, enter a prompt similar to the following:

“list all gates which are overflowing”

You can also see how the MCP tool worked by expanding it as shown below. In this case, you will see that the MCP Result only includes records where the status is overflowing, and it is structured based on the text attribute created in FME Workbench. 

 

3. Test with an Open-Ended Prompt

Now let’s try a more generic prompt, enter: 

“what are gate queues like right now?”

We can see that the client does not use the parameter, instead returning all records in order to give an overall summary.

Was this article helpful?

We're sorry to hear that.

Please tell us why.

As of January 14th, 2026, comments on knowledge base articles have been closed. To make sure questions don’t get missed and to enable more community support, we’ve moved discussions to the FME Community. If you have a question or a comment about this article, please create a new post or create a support ticket.