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 Tools  Servefor 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 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 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
    • 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, and other MCP-compatible AI models
  • Integration Architecture

    HTML
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 500">
      <defs>
        <!-- Gradients -->
        <linearGradient id="aiGradient" x1="0%" y1="0%" x2="100%" y2="100%">
          <stop offset="0%" style="stop-color:#667eea"/>
          <stop offset="100%" style="stop-color:#764ba2"/>
        </linearGradient>
        <linearGradient id="mcpGradient" x1="0%" y1="0%" x2="100%" y2="100%">
          <stop offset="0%" style="stop-color:#f093fb"/>
          <stop offset="100%" style="stop-color:#f5576c"/>
        </linearGradient>
        <linearGradient id="fwxGradient" x1="0%" y1="0%" x2="100%" y2="100%">
          <stop offset="0%" style="stop-color:#4facfe"/>
          <stop offset="100%" style="stop-color:#00f2fe"/>
        </linearGradient>
        <linearGradient id="methodGradient" x1="0%" y1="0%" x2="100%" y2="100%">
          <stop offset="0%" style="stop-color:#43e97b"/>
          <stop offset="100%" style="stop-color:#38f9d7"/>
        </linearGradient>
        
        <!-- Shadow filter -->
        <filter id="shadow" x="-20%" y="-20%" width="140%" height="140%">
          <feDropShadow dx="3" dy="3" stdDeviation="4" flood-opacity="0.2"/>
        </filter>
        
        <!-- Arrow marker -->
        <marker id="arrowhead" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
          <polygon points="0 0, 10 3.5, 0 7" fill="#6b7280"/>
        </marker>
      </defs>
      
      <!-- Background -->
      <rect width="800" height="500" fill="#f8fafc"/>
      
      <!-- Title -->
      <text x="400" y="40" text-anchor="middle" font-family="Arial, sans-serif" font-size="22" font-weight="bold" fill="#1e293b">MCP Protocol Architecture</text>
      
      <!-- AI Model Box -->
      <rect x="50" y="100" width="180" height="100" rx="12" fill="url(#aiGradient)" filter="url(#shadow)"/>
      <text x="140" y="145" text-anchor="middle" font-family="Arial, sans-serif" font-size="16" font-weight="bold" fill="white">AI Model</text>
      <text x="140" y="170" text-anchor="middle" font-family="Arial, sans-serif" font-size="13" fill="rgba(255,255,255,0.9)">(Claude / GPT)</text>
      
      <!-- MCP Protocol Box -->
      <rect x="310" y="100" width="180" height="100" rx="12" fill="url(#mcpGradient)" filter="url(#shadow)"/>
      <text x="400" y="145" text-anchor="middle" font-family="Arial, sans-serif" font-size="16" font-weight="bold" fill="white">MCP Protocol</text>
      <text x="400" y="170" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" fill="rgba(255,255,255,0.9)">Model Context Protocol</text>
      
      <!-- FrameworX Box -->
      <rect x="570" y="100" width="180" height="100" rx="12" fill="url(#fwxGradient)" filter="url(#shadow)"/>
      <text x="660" y="145" text-anchor="middle" font-family="Arial, sans-serif" font-size="16" font-weight="bold" fill="white">FrameworX</text>
      <text x="660" y="170" text-anchor="middle" font-family="Arial, sans-serif" font-size="13" fill="rgba(255,255,255,0.9)">Solution</text>
      
      <!-- Bidirectional Arrows between boxes -->
      <!-- AI to MCP -->
      <line x1="230" y1="140" x2="305" y2="140" stroke="#6b7280" stroke-width="2.5" marker-end="url(#arrowhead)"/>
      <line x1="305" y1="160" x2="230" y2="160" stroke="#6b7280" stroke-width="2.5" marker-end="url(#arrowhead)"/>
      
      <!-- MCP to FrameworX -->
      <line x1="490" y1="140" x2="565" y2="140" stroke="#6b7280" stroke-width="2.5" marker-end="url(#arrowhead)"/>
      <line x1="565" y1="160" x2="490" y2="160" stroke="#6b7280" stroke-width="2.5" marker-end="url(#arrowhead)"/>
      
      <!-- Vertical Arrow from MCP to Methods -->
      <line x1="400" y1="200" x2="400" y2="260" stroke="#6b7280" stroke-width="2.5" marker-end="url(#arrowhead)"/>
      
      <!-- Structured Methods Label -->
      <rect x="280" y="270" width="240" height="35" rx="8" fill="#1e293b" filter="url(#shadow)"/>
      <text x="400" y="294" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="white">Structured Methods</text>
      
      <!-- Method boxes -->
      <!-- Tag Data Access -->
      <rect x="80" y="340" width="150" height="70" rx="10" fill="url(#methodGradient)" filter="url(#shadow)"/>
      <image href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23065f46' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z'/%3E%3C/svg%3E" x="130" y="350" width="24" height="24"/>
      <text x="155" y="395" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#065f46">Tag Data Access</text>
      
      <!-- Historian Queries -->
      <rect x="250" y="340" width="150" height="70" rx="10" fill="url(#methodGradient)" filter="url(#shadow)"/>
      <image href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23065f46' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4'/%3E%3C/svg%3E" x="300" y="350" width="24" height="24"/>
      <text x="325" y="395" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#065f46">Historian Queries</text>
      
      <!-- Alarm Monitoring -->
      <rect x="420" y="340" width="150" height="70" rx="10" fill="url(#methodGradient)" filter="url(#shadow)"/>
      <image href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23065f46' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9'/%3E%3C/svg%3E" x="470" y="350" width="24" height="24"/>
      <text x="495" y="395" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#065f46">Alarm Monitoring</text>
      
      <!-- Real-Time Events -->
      <rect x="590" y="340" width="150" height="70" rx="10" fill="url(#methodGradient)" filter="url(#shadow)"/>
      <image href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23065f46' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M13 10V3L4 14h7v7l9-11h-7z'/%3E%3C/svg%3E" x="640" y="350" width="24" height="24"/>
      <text x="665" y="395" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#065f46">Real-Time Events</text>
      
      <!-- Connecting lines from label to method boxes -->
      <path d="M 320 305 Q 320 322 155 340" stroke="#94a3b8" stroke-width="1.5" fill="none" stroke-dasharray="4,3"/>
      <path d="M 360 305 Q 360 322 325 340" stroke="#94a3b8" stroke-width="1.5" fill="none" stroke-dasharray="4,3"/>
      <path d="M 440 305 Q 440 322 495 340" stroke="#94a3b8" stroke-width="1.5" fill="none" stroke-dasharray="4,3"/>
      <path d="M 480 305 Q 480 322 665 340" stroke="#94a3b8" stroke-width="1.5" fill="none" stroke-dasharray="4,3"/>
      
    </svg>
    • 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

    AI ModelMCP ProtocolFrameworX Solution
    Claude, GPT, GitHub Copilot
    Model Context Protocol
    TServer.exe (Runtime)
    Structured Methods


    Tag Data AccessHistorian QueriesAlarm MonitoringCustom Methods
    Live values from UNSHistorical time-series dataActive & historical alarmsYour solution-specific tools


    This diagram shows an AI model (such as Claude or GPT) communicating with a FrameworX solution through the MCP Protocol, which acts as a standardized bridge for exchanging context and invoking tools. FrameworX then exposes structured methods that the model can call to access tag data, query historical records, monitor alarms, and run custom operations.

    When to Use AI 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?"

    Why Custom Tools Matter

    Some platforms may offer only built-in MCP tools that let AI read or write tags, or run queries, or perform specific tasks in the platform. In practice, this approach has limited value:

    • Real solutions have hundreds of equipment items and thousands of tags
    • Operators don't memorize tag names and their needs goes beyond plain data, it requires context, aggregation, and analysis
    • Open access to running systems creates safety concerns and privacy issues
    • LLM hallucination risk makes direct control inappropriate

    FrameworX approach: Custom Runtime Tools

    Because FrameworX compiles .NET code at runtime, you can create domain-specific tools that expose exactly what you want, with descriptions that guide AI to correct usage. External applications query at the semantic level: "get tank levels" instead of "read Tag.Area1.Tank3.LT001.PV".

    This gated access model means:

    Generic ToolsCustom Tools
    AI needs to know exact tag pathsAI uses semantic descriptions
    Full system access (security risk)You control what's exposed
    Requires tag naming knowledgeNatural language queries
    Hallucination can cause errorsValidation in your code

    Prerequisites

    • FrameworX 10.1 or later
    • Cross-platform .NET Desktop Runtime matching your FrameworX version: .NET 8 for 10.1.4 and earlier, .NET 10 for 10.1.5 and later
    • Claude Desktop or compatible MCP client
    • Running FrameworX solution (TServer.exe)
    • Network connectivity

    Configuration

    The MCP Server starts automatically when your solution runs. You need to configure your AI client to have the solution connector.

    Connection Methods

    MethodUse CaseRequirements
    stdioAI client on same machine as solutionLocal installation
    HTTPAI client on different machineNetwork access, optional SSL

    Local Access: stdio Configuration

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

    Step 1 — Open the Claude configuration folder

    Press Win + R, type %APPDATA%\Claude, and press Enter.

    Step 2 — Edit claude_desktop_config.json

    Open the file and add the following configuration. Adjust the runtime folder in the path to match your FrameworX version (net8.0 for 10.1.4 and earlier, net10.0 for 10.1.5 and later):

    Code Block
    {
      "mcpServers": {
        "MCPRuntime": {
          "command": "C:\\Program Files\\Tatsoft\\FrameworX\\fx-10\\net8.0\\RuntimeMCP.exe",
          "args": ["/host:127.0.0.1", "/port:3101"],
          "transport": "stdio"
        }
      }
    }


    Info

    The product path may vary depending on where you performed the installation, but this is the default location.

    The connector name can be modified changing MCPRuntime in the file above to any other name.

    Remote Access: HTTP Configuration

    Use HTTP mode when the AI client runs on a different machine from the FrameworX solution.


    Server Setup

    1. (Optional) Configure server settings

    If you need to change the port, set an API key, or configure TLS, edit this file before starting the server:

    C:\Users\Public\Documents\FrameworX\MachineSettings\RuntimeMCPHttp.json
    

    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: 10120)
    Runtime.HostFrameworX runtime host (default: localhost)
    Runtime.PortFrameworX runtime port (default: 3101)
    Runtime.UsernameRuntime authentication user
    Runtime.PasswordRuntime authentication password

    {
      "appSettings": {
        "X_API_KEY": "",
        "CertFileName": "",
        "CertPass": "",
        "CertHash": "",
        "ListenPort": "10120",
        "Runtime": {
          "Host": "localhost",
          "Port": "3101",
          "Username": "guest",
          "Password": ""
        }
      }
    }


    Info

    Security note: Set a strong X_API_KEY if the server is accessible over a network. Leave CertFileName empty to use plain HTTP.


    2. Start the HTTP server

    Run "C:\Users\<user>\Documents\FrameworX\Utilities\StartRuntimeMCPHttp.bat" on the machine where your FrameworX solution is running.


    Client Setup

    Replace <RemoteIP> with the IP address or hostname of the server machine.

    GitHub Copilot (.mcp.json)

    {
      "servers": {
        "FrameworX Runtime": {
          "type": "http",
          "url": "http://<RemoteIP>:10120",
          "headers": {
            "X-API-KEY": "<your-api-key>"
          }
        }
      }
    }
    

    Claude Desktop / Claude.ai (.mcp.json)

    Info

    Prerequisite: Node.js must be installed on the client machine.

    {
      "mcpServers": {
        "FrameworX Runtime": {
          "command": "C:\\WINDOWS\\System32\\cmd.exe",
          "args": [
            "/C",
            "C:\\Program Files\\nodejs\\npx.cmd",
            "-y",
            "mcp-remote",
            "http://<RemoteIP>:10120/mcp",
            "--allow-http"
          ]
        }
      }
    }
    Info

    --allow-http is required when not using TLS. For production environments, configure a certificate and use https:// instead.

    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 Runtime provides 11 built-in platform tools plus solution-authored custom tools, organized by category. Each category is gated independently in Solution Settings → Data Servers → MCP for Runtime; the Info tools (runtime_connect, runtime_describe_binding) are gated only by the master toggle so AI clients can bootstrap and verify the target before any sub-category is enabled.

    Info (2 tools)

    Tool

    Purpose

    runtime_connect

    Connect to a FrameworX runtime and receive the Context Package (solution identity, profile, namespaces, quality codes, tool workflows, objType schemas, custom tools). Call this first at the start of every session. No-args returns the current Context Package for the runtime this MCP is bound to. On HTTP retargetable instances, accepts optional solution and profile arguments to rebind to a different running TServer before returning.

    runtime_describe_binding

    Pre-auth introspection — calls the anonymous /health endpoint and returns the runtime's binding identity: solution name, execution profile (on supporting builds), version, uptime, and start time. Requires no authentication. Use it before authenticated calls to confirm the target runtime is bound to the solution you expect. A no-argument call probes the runtime this MCP is bound to; pass tserver_url to probe an arbitrary running runtime without rebinding (useful for multi-runtime verification).

    UNS Tools (5 tools, gate: Enable UNS Tools)

    Tools for querying live data and structure from the runtime Object Model — the 12-root hierarchy that includes the Unified Namespace (Tag.*) plus the built-in namespaces (Server, Client, Alarm, Device, Historian, Dataset, Script, Display, Security, Report, Info).

    Tool

    Purpose

    runtime_get_value

    Get the current LIVE value of a tag or runtime object, including quality (0=Bad, 64=Uncertain, 192=Good), timestamp, and metadata (description, units, min/max). For historical values, use runtime_get_tag_history.

    runtime_browse_object_model

    Browse the live runtime object-model tree — returns child nodes at the specified path. Works across all roots: Tag → root tag folders; Tag.Plant1/Line2 → tags inside a folder; Tag.Pump1 → UserType members; Server, Alarm.Group, Device.Channel, and so on. Bounded by max_results.

    runtime_search_uns

    Ranked semantic search across the live UNS — UserTypes, Tags, members, Enumerations, and AssetTree folders. Scores across Name, DisplayText, Labels, SourceIri, and Attributes annotation content. Returns ranked matches with matchReason, snippet, and score. Tag matches include live value, quality, and timestamp.

    runtime_describe_object

    Describe a single UNS object — inheritance chain, derived UDTs, and (for Tag paths) live current value, quality, timestamp, and alarm state. Pass either path or iri. The iri form reverse-looks up by external SourceIri from an ontology import.

    runtime_list_instances

    List all live tags of a given UDT (UserType), with current value, quality, and timestamp for each. Optional include_derived=true expands to subclass UDTs. Optional name_mask narrows to a wildcard pattern (e.g., Motor*, Area1/*, *_Pump).

    Alarm Tools (2 tools, gate: Enable Alarm Tools)

    Dedicated alarm-query tools that hit the alarm subsystem's state machine and historian. Reading an Alarm.* namespace value through runtime_get_value, or reading a tag's current alarm-state through runtime_describe_object, stays under UNS Tools — those are UNS data reads, not dedicated alarm queries.

    Tool

    Purpose

    runtime_get_active_alarms

    Get currently ACTIVE alarms — alarms in alarm state right now, not yet normalized. Returns tag name, message, priority, active time, area, and group. For past normalized alarms, use runtime_query_alarm_history.

    runtime_query_alarm_history

    Query historical alarm records from the Alarm Historian database. Only SELECT statements are allowed; INSERT, UPDATE, DELETE, and other modifying statements are blocked. Available columns: TagName, Message, ActiveTime, AckTime, NormTime, UserName, Priority, Area, GroupName.

    Historian Tools (2 tools, gate: Enable Historian Tools)

    Tools for querying historical time-series data.

    Tool

    Purpose

    runtime_get_tag_history

    Query historical time-series data for a tag from the Historian database. The tag must be configured for Historian storage. Returns raw stored samples (truncated at 2000 points). For the current live value, use runtime_get_value; for summarized or down-sampled data, use runtime_get_aggregated_history.

    runtime_get_aggregated_history

    Bucketed aggregation over historical time-series data — the kernel reduces each time bucket into a single value rather than returning raw samples. Specify an ISO-8601 time range and interval bucket width (e.g., PT5M, PT1H, P1D). Seven aggregation kinds: Average (time-weighted, OPC-UA Part 13), Minimum, Maximum, Total (time-weighted integral), Count, StandardDeviation (population), and Range. Samples below quality 64 (Bad) are excluded; empty buckets return null. Use it when raw-sample counts would exceed the 2000-point cap, when summary statistics are needed, or for evenly-spaced chart points.

    Custom Tools (gate: Enable Custom Tools)

    Wiki Markup
    Solution-authored {{\[McpServerTool\]}} methods on Scripts ? Classes of type *MCP Tool*. See the Custom Methods section below for authoring guidance.

    Reading Live Values (runtime_get_value):

    • "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 the Object Model (runtime_browse_object_model):

    • "What tags are available under Tag.Plant1?"
    • "Show me the members of Tag.Pump1" (for UserType tags)
    • "What alarm groups exist?"
    • "Browse the Server namespace"

    Searching the UNS (runtime_search_uns):

    • "Find all tags containing 'Temperature'"
    • "Search for UserTypes related to 'motor'"
    • "Find anything with 'pump' in the description or labels"

    Historical Analysis (runtime_get_tag_history):

    • "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?"

    Active Alarms (runtime_get_active_alarms):

    • "Are there any active alarms?"
    • "What alarms are currently in alarm state?"
    • "Show me all unacknowledged alarms"

    Alarm History (runtime_query_alarm_history):

    • "Show me alarms from the last 24 hours"
    • "How many alarms were acknowledged today?"
    • "Query the alarm history for Tag.Temperature1"
    • "What alarms occurred during the night shift?"

    Custom Methods

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

    Tool names in runtime: When naming your runtime tools, it's strongly recommended that you keep the pattern runtime_<toolName>. When AI is also running AI Designer, or other third-party tools, that helps to correctly identify the right tool to use. For adherence with MCP standards use snake_case for method names (e.g., runtime_get_tank_level), instead of RuntimeGetTankLevel that would be a typical C# convention.

    Creating Custom Methods

    1. Navigate to Scripts → Classes
    2. Create a new class with type MCP Tool
    3. Define methods using MCP decorators:
    [McpServerTool, Description("Get current tank level for a specific tank")]
    public string runtime_get_tank_level(
        [Description("Tank identifier (1-4)")] string tank_id = "1")
    {
        return @Tag[$"Tank{tank_id}_Level"].ToString();
    }
    

    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:

    [McpServerTool, Description("Get production count for today")]
    public string runtime_get_production_count()
    {
        return @Tag.Production.TodayCount.ToString();
    }
    

    With Error Handling:

    [McpServerTool, Description("Get data for a specific tag with validation")]
    public string runtime_get_tag_data(
        [Description("Full tag path")] string tag_name)
    {
        try
        {
            if ([email protected](tag_name))
                return $"Error: Tag '{tag_name}' not found";
    
            return @Tag[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 runtime_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).


    Deprecated / Removed Tools

    Customers upgrading from 10.1.4 should update any AI prompts, solution-authored wrappers, or integration scripts that reference the old tool names. Bit positions in ModelOptions are unchanged — existing solutions decode identically; only the tool surface and category labels changed.

    Old name (10.1.4 and earlier)10.1.5 replacementNotes
    runtime_get_inforuntime_connectSame payload on no-args. HTTP retargetable instances accept optional solution / profile to rebind to a different running TServer.
    runtime_set_targetruntime_connect(solution, profile)Merged as the with-args branch of runtime_connect.
    runtime_browse_unsruntime_browse_object_modelSame parameters plus a bounding max_results. Renamed because the tool walks all 12 runtime roots, not just the strict UNS (Tag.*).
    runtime_get_object_contextruntime_describe_objectSame single-object intent; absorbs external-IRI lookup via a new iri parameter.
    runtime_find_by_iriruntime_describe_object(iri=...)Merged into runtime_describe_object — different lookup key, same single-object response.
    runtime_list_by_typeruntime_list_instancesRenamed. Adds max_results and name_mask wildcard filter.
    runtime_list_derived_types— (removed)Redundant: runtime_describe_object already returns derivedTypes in its context block.
    runtime_search_tagsruntime_search_unsBroader scope — searches UserTypes, members, Enumerations, and AssetTree folders in addition to Tags.

    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

    AI Runtime server not starting

    • Verify the cross-platform .NET Desktop Runtime matching your FrameworX version is installed (.NET 8 for 10.1.4 and earlier, .NET 10 for 10.1.5 and later)
    • Check firewall settings for the configured port
    • Confirm RuntimeMCP.exe path is correct in AI client config

    AI cannot access methods

    • Ensure solution is running (the TServer.exe application is running)
    • Verify AI client configuration matches server settings
    • Restart AI client completely (close 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 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:10120 first before remote access

    Related Documentation

    Quick Start Tutorial

    Example Implementation

    • 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 Designer

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


    Change Log

    VersionDateChanges
    1.32026-0611 platform tools (was 9)
    1.22026-059 platform tools (was 7) plus solution-authored custom tools. Session bootstrap unified as runtime_connect (merges runtime_get_info + runtime_set_target). Tool renames for scope-accurate categories: runtime_browse_unsruntime_browse_object_model (walks all 12 runtime roots); runtime_search_tagsruntime_search_uns (searches UserTypes, members, enums, folders); runtime_get_object_contextruntime_describe_object (absorbs runtime_find_by_iri via iri parameter); runtime_list_by_typeruntime_list_instances with wildcard name_mask. runtime_list_derived_types removed (folded into runtime_describe_object.derivedTypes). Gate-bit categories relabeled to Enable *Tools.
    1.12026-027 built-in tools; Updated architecture diagram; Added runtime_ prefix best practices.

    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
    • Network connectivity

    Configuration Workflow

    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
    {
      "mcpServers": {
        "YourSolution": {
          "command": "C:\\FrameworX\\fx-10\\net8.0\\TMCPServerStdio\\TMCPServerStdio.exe",
          "args": ["/host:127.0.0.1", "/port:3101"],
          "transport": "stdio"
        }
      }
    }
    Info

    If you solution is Windows-only, the command should be "<ProductPath>\\fx-10\\TMCPServerStdio\\TMCPServerStdio.exe".

    HTTP

    1. Program: TMCPServerHttp.

    2. Install Path (installed using standard Install program):

      1. fx-10\net8.0\TMCPServerHttp\ (NET 8.0 Runtime required to execute TMCPServerHttp.dll)

    3. Arguments in MCP Client (Ex: .mcp.json):

      1. Url:<url>: Endpoint containg Host:Port. Ex: http://localhost:3000, https://192.168.20.2:3000

      2. Headers: X_API_KEY (optional) used by authentication

    4. Arguments in TMCPServerHttp.json (MachineSettings):

      1. X_API_KEY: (optional) used by authentication

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

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

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

      5. /ListenPort:<port>: Port to listen (endpoint). Default is 3000

      6. Runtime section:

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

        2. /Port:<port>: Runtime Port where runtime is running. Default is 3101

        3. /UserName<name>: User name used by connection to runtime

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

    5. 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 Block
    title.mcp.json (Visual Studio/GitHub Copilot)
    {
       "servers": {
        "FrameworX Runtime - HeaderLayout": {
          "type": "http",
          "url": "http://localhost:3000",
          "headers": {
            "X-API-KEY": ""
          }
        }
      }
    }
    Code Block
    title.TMCPServerHttp.json (MachineSettings):
    {
      "appSettings": {
        "X_API_KEY": "",
        "CertFileName": "",
        "CertPass": "",
        "CertHash": "",
        "ListenPort": "3000",
        "Runtime": {
          "Host": "localhost",
          "Port": "3101",
          "Username": "guest",
          "Password": ""
        }
      }
    }

    SSE

    SSE configuration was not tested.

    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 new class, select MCP Tool type
    3. 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: 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>")]
    public string <MethodName>(
    [Description("<ParametersDescription>")] <Parameters>)
    {
    	<Content>
        return <Result>;
    }

    Example:

    Code Block
    languagec#
    [McpServerTool, Description("Get current tank level")]
    public string GetTankLevel(
    [Description("Tank identifier")] string tankId = "4")
    {
        return @Tag.Tank_{tankId}_Level"].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.

    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

    Getting Started

    Quick Start Tutorial

    Build your first MCP Tool and connect it to Claude AI:

    How to Build an MCP Tool - Step-by-step guide for 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

    Best Practices

    Security Considerations

    • Authentication - Implement proper authentication for MCP endpoints
    • Authorization - Define clear permission levels for AI operations
    • Validation - Always validate AI-generated parameters before execution
    • Audit Trail - Log all AI-initiated actions for compliance

    Performance Optimization

    • Cache frequently accessed data
    • Implement rate limiting for AI queries
    • Use asynchronous methods for long-running operations
    • Monitor resource usage of MCP server process

    Error Handling

    Code Block
    languagec#
    [McpServerTool, Description("Safe data retrieval")]
    public string GetData(string tagName)
    {
        try
        {
            if (!@Tag.Exists(tagName))
                return $"Error: Tag {tagName} not found";
            
            return @Tag[tagName].ToString();
        }
        catch (Exception ex)
        {
            @Info.Trace($"MCP Error: {ex.Message}");
            return "Error: Unable to retrieve data";
        }
    }

    Troubleshooting

    MCP Server not starting

    • Verify .NET 8.0 runtime installation
    • Check firewall settings for configured port
    • Confirm TMCPServerStdio.exe path is correct

    AI cannot access methods

    • Ensure MCP decorators are properly applied
    • Verify solution is running (Runtime → Startup)
    • Check AI client configuration matches server settings
    • Verify is .NET 8.0 is installed in your computer
    • Restart your LLM completely after run the solution.

    Data not updating

    • Confirm tags are properly configured
    • Verify real-time database connectivity
    • Check MCP method error handling

    Related Documentation

  • AI-Ready by DAI-Ready by Designesign - Platform architecture for AI integration
  • Scripts Module Reference - Complete scripting documentation
  • MCP Tool Tutorial - Step-by-step tutorial on how to create a MCP tool
  • SolarPanels MCP Demo - Working example solution



    In this section...

    Page Tree
    root@parent