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

  • Name: MCPServer
  • Version: 1.0.0.0
  • Interface: TCP/IP
  • Runtime: .NET 2.0 (Multiplatform)
  • Configuration:
    • Scripts / Classes


Overview

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

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, and other MCP-compatible AI models

Integration Architecture

AI Model (Claude/GPT) ←→ MCP Protocol ←→ FrameworX Solution
                     [Structured Methods]
                     [Tag Data Access]
                     [Historian Queries]
                     [Alarm Monitoring]

Technical Specifications

PropertyValue
NameMCP Tool
ProtocolModel Context Protocol (MCP)
Interfacestdio/TCP
Runtime.NET 8.0
AI ModelsClaude, GPT-4, Custom
ConfigurationScripts → Classes

Prerequisites

  • FrameworX 10.1 or later
  • .NET 8.0 runtime
  • Claude Desktop or compatible MCP client
  • Network connectivity for TCP transport

Implementation Components

1. MCP Script Classes

Create specialized script classes that expose methods to AI models. These classes use decorator attributes to define AI-accessible functions.

Learn more: Scripts Classes Reference

2. AI-Ready Architecture

FrameworX's consistent object model and event-driven architecture provide the foundation for reliable AI integration.

Learn more: AI-Ready by Design

3. Solution Examples

Pre-built examples demonstrate MCP integration for real industrial scenarios.

Learn more: SolarPanels MCP Demo


Configuration Workflow

Step 1: Create MCP Script Class

  1. Navigate to Scripts → Classes
  2. Create new class, select MCP Tool type
  3. Define methods with MCP decorators:

csharp

[McpServerTool, Description("Get current tank level")]
public string GetTankLevel(
    [Description("Tank identifier")] string tankId)
{
    return @Tag[$"Tank_{tankId}_Level"].ToString();
}

Step 2: Configure AI Client

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

json

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

Step 3: Query Through AI

Once configured, the AI can access your solution data:

  • "What is the current production rate?"
  • "Show me active alarms for Line 1"
  • "Get historian data for temperature over the last hour"

Deployment Patterns

Green Light: Safe for Autonomous Use

  • Historical data analysis
  • Pattern recognition
  • Report generation
  • Read-only monitoring

Yellow Light: Requires Oversight

  • Optimization suggestions
  • Predictive maintenance scheduling
  • Quality predictions
  • Automated troubleshooting

Red Light: Not Suitable

  • Direct safety system control
  • Emergency response decisions
  • Critical process changes
  • Unvalidated write operations

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

Database Integration

Connect MCP Tools with external databases:

PostgreSQL Connector - Example of integrating MCP with PostgreSQL for historian data


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

csharp

[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";
    }
}

Advanced Features

Multi-Model Support

The MCP Tool Connector supports multiple AI models simultaneously:

  • Different models can access different method sets
  • Model-specific permissions and rate limits
  • Unified logging across all AI interactions

Custom Tool Definitions

Beyond standard methods, create specialized tools for:

  • Complex workflow orchestration
  • Multi-step industrial processes
  • Cross-system data aggregation
  • Custom business logic exposure

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

Data not updating

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

Related Documentation


The MCP Tool Connector represents FrameworX's commitment to practical AI integration in industrial automation - providing powerful capabilities while maintaining the safety, reliability, and determinism required for industrial operations.

In this section...