Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Page properties
hiddentrue
idconnector-metadata


Property

Value

Sector

AI Analysis & MCP

Group

Cloud Services

Connector

AI MCP for Runtime

Name

MCPServer



Enable AI-powered industrial automation through Model Context Protocol integration.

  • Name: MCPServer
  • Version: 1.0.0.0
  • Interface: TCP/IP
  • Configuration:
    • Scripts / Classes

Table of Contents
maxLevel2
minLevel2
stylenone


Overview

The MCP (Model Context Protocol) Tool Connector AI MCP for Runtime service bridges FrameworX solutions with AI language models, enabling intelligent automation assistance while maintaining industrial-grade safety and determinism. This connector exposes your solution's live data and functionality as structured tools that AI models can invoke with parameters, not just generate text responses.

Note: This connector is for querying live data from running solutions (connects to TServer.exe). For AI-assisted solution configuration, see AI MCP for Designer Connector.

Key Capabilities

  • Structured AI Integration - Expose specific methods and functions to AI models with type-safe parameters
    • Real-time Data Access
    -
    • Query live tag values, historian data, and alarm states through AI
  • Bi-directional Communication - AI can both read from and write to your industrial systems (with appropriate safeguards)
  • Platform Agnostic - Works with Claude, GPT
    • Unified Namespace Browsing — Explore your tag structure and discover available data
    • Historical Analysis — Query historian for trend analysis and past behavior investigation
    • Alarm Monitoring — Check active alarms and query alarm history
    • Custom Methods — Extend with your own solution-specific AI tools
    • Platform Agnostic — Works with Claude, GitHub Copilot, and other MCP-compatible AI models


    Integration Architecture


    When to Use MCP for Runtime

    Use CaseExample
    Process monitoring"What is the current temperature in Tank1?"
    Alarm investigation"Are there any active alarms? What's causing them?"
    Historical analysis"Show me the temperature trend for the last 24 hours"
    Data discovery"What tags are available under Plant1/Line2?"
    Operational questions"What is the system uptime?"

    Technical Specifications

    PropertyValue
    NameMCP Tool
    ProtocolModel Context Protocol (MCP)
    Interfacestdio/HTTP
    Runtime.NET 8.0
    AI ModelsClaude
    ConfigurationScripts → Classes

    Prerequisites

    • FrameworX 10.1 or later
    • .NET 8.0 runtime
    • Claude Desktop or compatible MCP client
    • Running FrameworX solution (TServer.exe)
    • Network connectivity

    Configuration

    Workflow

    The

    first step is to run the solution, which will automatically start the

    MCP Server

    . The second step is to configure the client LLM to perform the queries.

    According to the claude documentation, there are three ways of connection to the MCP Server:

    1. stdio
    2. HTTP
    3. SSE 

    stdio

    The following configuration uses stdio, which requires the MCP server to run on the same machine as the LLM. Therefore, if your solution is hosted on a remote machine, you must install the product in both environments: the local machine (where the LLM runs) and the remote machine (where the runtime is hosted).

    Configure your AI client (e.g., Claude Desktop) to connect to the MCP server:

    Code Block

    starts automatically when your solution runs. You need to configure your AI client to connect to it.

    Connection Methods

    MethodUse CaseRequirements
    stdioAI client on same machine as solutionLocal installation
    HTTPAI client on different machineNetwork access, optional SSL
    SSEServer-sent eventsNot yet tested

    stdio Configuration

    Use stdio when the AI client runs on the same machine as your solution.

    Configure Claude Desktop (claude_desktop_config.json):

    {
      "mcpServers": {
        "YourSolution": {
          "command": "C:\\FrameworX\\fx-10\\net8.0\\TMCPServerStdio\\TMCPServerStdio.exe",
          "args": ["/host:127.0.0.1", "/port:3101"],
          "transport": "stdio"
        }
      }
    }
    
    

    Note: For

    InfoIf you solution is

    Windows-only solutions,

    the command should be "

    use the path <ProductPath>\

    \

    fx-10\

    \

    TMCPServerStdio\

    \

    TMCPServerStdio.exe

    ".

    (without net8.0).

    HTTP Configuration

    Use HTTP when the AI client runs on a different machine than your solution.

    MCP Server Settings (TMCPServerHttp.json

    HTTP

    This method was only tested with GitHub Copilot. Other LLMs should work as well, but have not been tested.

    Program: TMCPServerHttp

    Install Path: <ProductPath>\fx-10\net8.0\TMCPServerHttp\ (NET 8.0 Runtime required to execute TMCPServerHttp.dll)

    LLM Setting 

    Arguments in LLM Setting, example: .mcp.json (GitHub Copilot) or claude_desktop_config (ClaudeAI) (location may vary depending on the LLM)

    1. Url:<url>: Endpoint containg Host:Port. Ex: http://localhost:3000, https://192.168.20.2:3000
      When using certificate HTTP/SSL, the url must include "https"

    2. Headers: X_API_KEY (optional) used by authentication

    MCP Server Setting

    Arguments in TMCPServerHttp.json (located

    in C:\Users\Public\Documents\FrameworX\MachineSettings

    ):
  • X_API_KEY: (optional) used by authentication. It is a string password that will be required when client connects to the MCP server.

  • /CertFileName:<filename>: Certificate file name. Used by HTTP/SSL. Work with “CertPass“.

  • /CertPass:<pass>: Certificate password. Used by HTTP/SSL. Work with “CertFileName“.

  • /CertHash:<hash>: Certificate Thumbprint. Used by HTTP/SSL. Located at: (StoreName.My, StoreLocation.LocalMachine)

  • /ListenPort:<port>: Port to listen (endpoint

    )

    . Default is 3000

    Runtime section:

  • /Host<host>: Runtime Host/IP where runtime is running. Default is localhost

  • /Port:<port>

    :

    Runtime Port where runtime is running. Default is 3101
  • /UserName<name>: User name used by connection to runtime

  • /Password:<pass>: User password used by connection to runtime

  • Multiple connections

    To connect to several runtimes and/or listen several ports, call TMCPServerHttp with argument “/instance:<number>“.

    1. Arguments in section “4” must include “instance”.

    2. Example: TMCPServerHttp /instance:2 => X_API_KEY2, ListenPort2, Runtime2, etc…

    code

    title.mcp.json (GitHub Copilot)
    {
    
      "
    servers
    appSettings": {
        "
    FrameworX Runtime - HeaderLayout
    X_API_KEY": 
    {
    "",
        
    "
    type
    CertFileName": "
    http
    ",
        
    "
    url
    CertPass": "
    http://localhost:3000
    ",
        
    "
    headers
    CertHash": 
    {
    "",
    
        
    "X-API-KEY
    "ListenPort": "3000",
        
    }
    "Runtime": {
        
    }
      
    } } Code Block
    title.TMCPServerHttp.json
    { "appSettings
    "Host": 
    {
    "localhost",
          "
    X_API_KEY
    Port": "3101",
          "
    CertFileName
    Username": "guest",
          "
    CertPass
    Password": ""
    ,
    
        
    "CertHash": "",
    }
      }
    }
    

    AI Client Settings (GitHub Copilot .mcp.json):

    {
      "
    ListenPort
    servers": 
    "3000",
    {
        "FrameworX Runtime": {
          "
    Host
    type": "
    localhost
    http",
          "
    Port
    url": "
    3101
    http://localhost:3000",
          "
    Username
    headers": 
    "guest",
    {
            "
    Password
    X-API-KEY": ""
          }
        }
      }
    
    }
    

    HTTP Settings Reference:

    SettingDescription
    X_API_KEYOptional authentication password
    CertFileNameSSL certificate file (for HTTPS)
    CertPassSSL certificate password
    CertHashSSL certificate thumbprint (alternative to file)
    ListenPortHTTP endpoint port (default: 3000)
    Runtime.HostFrameworX runtime host (default: localhost)
    Runtime.PortFrameworX runtime port (default: 3101)
    Runtime.UsernameRuntime authentication user
    Runtime.PasswordRuntime authentication password

    Multiple Connections: To connect to multiple runtimes, use /instance:<number> argument and matching numbered settings (e.g., X_API_KEY2, ListenPort2, Runtime2).

    Verifying Connection

    1. Click the LLM connector icon — you should see your solution name
    2. Go to Settings → Developer and verify the connection shows "running"
    3. Ask the AI a simple question like "What is the server uptime?"

    Available Tools

    AI MCP for Runtime provides these built-in tools:

    Data Access

    ToolPurpose
    get_valueGet current value of a tag or runtime object
    get_tag_metadataGet tag description, units, range, and data type
    get_childrenBrowse the Unified Namespace structure
    search_tagsFind tags by name pattern

    Historical Data

    ToolPurpose
    get_tag_historyQuery historical time-series data for a tag

    Alarms

    ToolPurpose
    get_active_alarmsGet currently active alarms
    query_alarm_databaseQuery historical alarm records

    Example Queries

    Reading Values:

    • "What is the current value of Tag.Temperature1?"
    • "Get the value of Tag.Plant1/Line2/Pressure"
    • "What is the Server.SystemMonitor.CPUUsage?"
    • "How many active alarms are there?" (uses Alarm.TotalCount)

    Browsing Data:

    • "What tags are available under Tag.Plant1?"
    • "Show me the members of Tag.Pump1" (for UserType tags)
    • "What alarm groups exist?"
    • "Find all tags containing 'Temperature'"

    Historical Analysis:

    • "Show me the temperature history for today"
    • "Get the historian data for Tag.Pressure from 8am to noon"
    • "What was the highest temperature value today and when did it occur?"

    Alarm Investigation:

    • "Are there any active alarms?"
    • "Show me alarms from the last 24 hours"
    • "How many alarms were acknowledged today?"
    • "Query the alarm history for Tag.Temperature1"

    Custom Methods

    You can extend the MCP server with your own solution-specific tools by creating custom methods in Scripts.

    Creating Custom Methods

    SSE

    SSE configuration was not tested.

    How to verify if the setting was done correctly

    1. Click in the LLM connector, you should see the <SolutionName> name.
    2. Go in Settings > Developer, and check if your solution is in a good state (running). (depends on the LLM).

    Query Through AI

    Once configured, the AI can access your solution data:

    General questions

    • What is the Server.SystemMonitor.Uptime of BottlingLine MCP Demo?
    • Get value of Tag.Machine1.Temperature1

    Alarm

    • Is there any active alarm, or has there been one recently? Any acknowledged?
    • Retrieve the alarms again, and check how many acknowledged alarms do we have? and how many are not?

    Historian

    • Retrieve the historical Brewery/BrewHouse/Temperature values from today.
    • Show a trend visualization (only the trend) with the historical values of Brewery/BrewHouse/Temperature from today in JSX format
    • Get all the historical value from today and return the highest and the time that hapenned

    Custom Methods (methods you created)

    • Get the last anomalies from the Bottling Line

    Available Methods

    When MCP server is running, by default you have three methods:

    1. Get Value
    2. Get Historian
    3. Get Alarms
    And you could have many more, by just creating a custom method, for that follow the steps below:

    1. Navigate to Scripts → Classes
    2. Create a new class
    , select
    1. with type MCP Tool
    type
    1. Define methods using MCP decorators
    , where:
  • Description is the question you will ask the LLM.

  • MethodName is what the LLM will call. Each capital letter will appear as a space in the LLM interface.

    Example
    1. :
    GetTankLevel will appear as "Get Tank Level".
  • ParametersDescription explains what is expected for each parameter.

  • Parameters define the inputs.

  • Content defines the behavior or response of the method.

  • Result is what the LLM will receive in order to generate the answer, which it will then convert into a more human-readable response.

  • Code Block
    languagec#
    [McpServerTool, Description("
    <Description>
    Get current tank level for a specific tank")]
    public string 
    <MethodName>
    get_tank_level(
        [Description("
    <ParametersDescription>
    Tank identifier (1-4)")]
    <Parameters>
     string tank_id = "1")
    {
    
    <Content>
        return 
    <Result>
    @Tag[$"Tank{tank_id}_Level"].ToString();
    }
    

    Example:

    Code Block

    Method Structure:

    ElementPurpose
    [McpServerTool]Marks method as MCP tool
    [Description("...")]Explains what the tool does (shown to AI)
    Method nameTool name (use snake_case)
    Parameter descriptionsExplains expected input to AI
    Return valueResult sent to AI

    Custom Method Examples

    Simple Value Retrieval:

    languagec#

    [McpServerTool, Description("Get 
    current
    production count 
    tank
    for 
    level
    today")]
    public string 
    GetTankLevel( [Description("Tank identifier")] string tankId = "4")
    get_production_count()
    {
        return @Tag.
    Tank_{tankId}_Level"]
    Production.TodayCount.ToString();
    }
    Warning

    After every configuration change or after shutting down and restarting the solution, you must fully restart the Desktop LLM. This means not only closing the application window, but also terminating the process (either from the system tray icon or via the Task Manager). This is a requirement of the LLM.

    Error Handling

    Within the custom methods, you can also add safeguards to help identify potential errors, as shown below:

    Code Block
    languagec#
    
    

    With Error Handling:

    [McpServerTool, Description("
    Safe
    Get data 
    retrieval
    for a specific tag with validation")]
    public string 
    GetData(string tagName
    get_tag_data(
        [Description("Full tag path")] string tag_name)
    {
        try
        {
            if (!@Tag.Exists(
    tagName
    tag_name))
                return $"Error: Tag '{
    tagName
    tag_name}' not found";
            
            return @Tag[
    tagName
    tag_name].ToString();
        }
        catch (Exception ex)
        {
            @Info.Trace($"MCP Error: {ex.Message}");
            return "Error: Unable to retrieve data";
        }
    }
    

    Aggregated Data:

    [McpServerTool, Description("Get summary of all tank levels")]
    public string get_all_tank_levels()
    {
        var result = new StringBuilder();
        for (int i = 1; i <= 4; i++)
        {
            var level = @Tag[$"Tank{i}_Level"].Value;
            result.AppendLine($"Tank {i}: {level}%");
        }
        return result.ToString();
    }
    

    Important: After creating or modifying custom methods, fully restart the AI client (close from Task Manager, not just the window).


    Best Practices

    For AI Queries

    • Be specific about tag paths when asking for values
    • Use "active alarms" for current state, "alarm history" for past events
    • Specify time ranges clearly for historical queries
    • Ask the AI to browse the namespace if you're unsure of tag names

    For Custom Methods

    • Use descriptive names and descriptions — the AI relies on these
    • Include parameter validation and error handling
    • Return clear error messages that help the AI understand what went wrong
    • Follow snake_case naming convention for consistency
    • Keep methods focused on single tasks

    Security Considerations

    • Use X_API_KEY authentication for HTTP connections
    • Configure appropriate runtime user permissions
    • Be cautious with write operations — consider read-only access for AI
    • Review custom methods for security implications

    Troubleshooting

    MCP Server not starting

    • Verify .NET 8.0 runtime
    installation
    • is installed
    • Check firewall settings for the configured port
    • Confirm TMCPServerStdio.exe path is correct in AI client config

    AI cannot access methods

    • Ensure
    MCP decorators are properly appliedVerify
    • solution is running (
    Runtime → Startup
    • TServer.exe active)
    Check
    • Verify AI client configuration matches server settings
    Verify is .NET 8.0 is installed in your computer
    • Restart
    your LLM
    • AI client completely (close
    in the Windows task Manager) after run the solution.
    • via Task Manager)
    • Check that MCP decorators are properly applied to custom methods

    Data not updating

    • Confirm tags are properly configured in the solution
    • Verify real-time database connectivity
    • Check
    MCP
    • custom method error handling for exceptions

    Custom methods not appearing

    • Verify class type is set to "MCP Tool"
    • Check for syntax errors in method code
    • Restart AI client completely after changes

    HTTP connection failing

    • Verify ListenPort is not blocked by firewall
    • Check X_API_KEY matches between server and client
    • For HTTPS, verify certificate is properly configured
    • Test with http://localhost:3000 first before remote access

    Related Documentation

    Quick Start Tutorial

    Build your first MCP

    Tool and connect it to Claude AI

    connection step by step:

    • AI MCP for Runtime Tutorial
    - Step-by-step guide for creating
    • — Creating and deploying MCP Tools

    Example Implementation

    Explore a complete working example

    with MQTT integration

    :

    • SolarPanels MCP Demo
    -
    • Full solution demonstrating MCP Tools with solar panel monitoring

    Technology Information

    • AI-Ready by Design
     -
    • Platform architecture for AI integration

    Reference Information

    • Scripts Module Reference
    -
    • Complete scripting documentation

    AI MCP for Designer

    For AI-assisted solution configuration (creating tags, displays, alarms):

    • AI MCP for Designer Connector — Enable AI to configure solutions
    • AI MCP for Designer Tutorial — Step-by-step guide for AI-assisted configuration

    In this section...

    Page Tree
    root@parent