NOTICE:
Please note that this repo is strictly a prototype that will probably not be maintained. You are welcome to work on this if you like, just make a fork and do your own thing.
🤖 Studio 5000 AI-Powered PLC Programming Assistant
This revolutionary MCP (Model Context Protocol) server transforms PLC programming by providing AI-powered code generation, L5X routine creation, real .ACD file generation, and seamless Studio 5000 integration. Convert natural language specifications directly into working ladder logic and complete Studio 5000 projects!
⚡ TL;DR - For Impatient Teammates
# 1. Get Python 3.12 (NOT 3.11!) from python.org
python --version # Must show 3.12.x
# 2. Clone and install
git clone <repository-url>
cd Studio5000_MCP_Server
pip install -r requirements.txt
# 3. Install SDK (CRITICAL for .ACD files!)
pip install "C:\Users\Public\Documents\Studio 5000\Logix Designer SDK\python\logix_designer_sdk-*-py3-none-any.whl"
# 4. Test it works
python src/mcp_server/studio5000_mcp_server.py --test
That's it! ✅ Skip to Claude Desktop setup if tests pass.
📚 New Team Member Resources
🎯 Complete Team Guides Available:
🚀 Quick Start for Teammates
Ready to use this tool? Follow these steps:
Prerequisites ⚠️ CRITICAL
- Python 3.12 (NOT 3.11 or earlier - the SDK will not work!)
- Studio 5000 Logix Designer v36 or later installed on your machine
- Windows Operating System (Studio 5000 SDK is Windows-only)
Installation Steps
-
Verify Python 3.12:
python --version
# Must show Python 3.12.x - if not, install Python 3.12 from python.org
-
Clone and Install:
git clone <repository-url>
cd Studio5000_MCP_Server
pip install -r requirements.txt
-
Install Studio 5000 SDK (for .ACD files):
pip install "C:\Users\Public\Documents\Studio 5000\Logix Designer SDK\python\logix_designer_sdk-*-py3-none-any.whl"
-
Test the Installation:
python src/mcp_server/studio5000_mcp_server.py --test
✅ Should show: Documentation indexed, SDK available, tests passing
-
Ready to Use! - The server will auto-detect your Studio 5000 installation paths
Having Issues? See the Troubleshooting section below.
🚀 AI-Powered Features
🧠 Natural Language to PLC Code
- AI Code Generation: Convert plain English to working ladder logic
- "Start the motor when the start button is pressed and stop it when the stop button is pressed" → Complete ladder logic with proper start/stop interlocking
- Smart Pattern Recognition: Automatically detects start/stop, timer, counter, and basic I/O patterns
- Intelligent Tag Creation: Automatically generates appropriate I/O tags with descriptive names
- Instruction Validation: Validates generated code against official Studio 5000 documentation database
📁 L5X Project Generation
- Project Structure Creation: Generates L5X project files with programs, routines, and tags (can create routines to be imported into existing projects and can create empty l5x files to be manually developed)
- Multiple Controller Support: Support for various Allen-Bradley controllers (1756-L83E, 1756-L85E, etc.)
- ⚠️ Current Limitation: Generated L5X files may have RLL formatting issues requiring manual fixes
- Structured Output: XML structure follows Studio 5000 schema but may need validation
- 💡 Best Practice: Use for project templates, then add logic manually in Studio 5000
🏭 Real .ACD Project Creation
- Official Studio 5000 SDK Integration: Creates genuine .ACD files using Rockwell's official SDK
- Direct Studio 5000 Compatibility: .ACD files open directly in Studio 5000 without conversion
- ✅ Empty Project Creation: Clean ACD templates ready for manual development (RELIABLE)
- ⚠️ Complete Project Creation: Experimental - SDK partial import for MainProgram/MainTask (UNRELIABLE)
- Version Control: Supports different Studio 5000 major revisions (v36 default)
- 💡 Recommended: Use empty ACD creation + manual L5X import workflow
🔍 Vector-Powered Semantic Search
- Intelligent L5X Analysis: Semantic search through massive L5X files (tested with 49k+ lines)
- Production-Scale Processing: Handles complex industrial automation projects
- Smart Code Insertion: AI finds optimal positions for new logic in existing routines
- Dependency Analysis: Automatic detection of component relationships and dependencies
- Pattern Recognition: Understands conveyor control, encoder logic, fault handling, and timer patterns
- FAISS Vector Database: Lightning-fast semantic search with embedding-based similarity
📐 Technical Drawing Analysis
- PDF Engineering Drawings: Extract and search through technical drawings (P&IDs, electrical schematics, control logic diagrams)
- AutoCAD Integration: Parse CAD-generated PDFs with rich text and vector graphics content
- Equipment Context: Automatically find drawings referenced by equipment tags and system components
- Vision AI Enhancement: Advanced analysis of complex technical diagrams and equipment connections
- Cross-Reference Capability: Link drawings with existing L5X code and tag databases for complete system understanding
📊 Advanced L5X Analysis System
- Real Production Testing: Verified with actual 2.9MB L5X files from industrial systems
- Complexity Scoring: Automatic assessment of routine complexity and refactoring needs
- Component Mapping: Tracks timers, counters, tags, and their interconnections
- Surgical Modifications: Precise rung insertion without disrupting existing logic
- Professional Workflow: Read-only analysis with SDK-powered modification capabilities
📚 Documentation Access
- Comprehensive Instruction Database: Searches through official Studio 5000 documentation
- Smart Search: Find PLC instructions by name, description, category, or functionality
- Detailed Information: Get comprehensive details about instruction syntax, parameters, and usage
- Category Browsing: Browse instructions by functional categories (Alarm, Math, Motion, Timer, etc.)
- Language Support: Information about which programming languages support each instruction (Ladder, ST, FBD)
- Real-time Validation: Instant validation using official Rockwell documentation
📋 Detailed Installation Guide
Prerequisites - READ THIS FIRST! ⚠️
🚨 CRITICAL REQUIREMENT: Python 3.12 ONLY
- This project REQUIRES Python 3.12 - earlier versions will fail
- Studio 5000 SDK is incompatible with Python 3.11 and earlier
- Verify your Python version FIRST before proceeding
System Requirements:
- Python 3.12.x (Download from python.org)
- Studio 5000 Logix Designer v36 or later installed
- Windows Operating System (Studio 5000 SDK is Windows-only)
- Administrator privileges may be required for initial setup
Step-by-Step Setup
Step 1: Install Python 3.12
- Download: Go to python.org and download Python 3.12
- Install: During installation, CHECK "Add Python to PATH" ✅
- Verify: Open Command Prompt and run:
python --version
# Must show: Python 3.12.x (if not, restart command prompt)
Step 2: Get the Project
- Clone the repository:
git clone <repository-url>
cd Studio5000_MCP_Server
Step 3: Install Dependencies (CRITICAL!)
-
Install all required packages:
pip install -r requirements.txt
This installs:
- Core Components: BeautifulSoup, XML processing, async support
- AI & Vector Search: PyTorch, sentence-transformers, FAISS vector database
- Semantic Analysis: Vector embeddings for instruction and L5X search
- Performance: Optimized versions for production use
If you get errors, try:
python -m pip install --upgrade pip
pip install -r requirements.txt
Note: Vector database components (torch, sentence-transformers, faiss-cpu) are included for semantic search capabilities. These enable advanced L5X analysis and instruction search features.
Step 3.5: Install Studio 5000 SDK (CRITICAL for .ACD files!) 🚨
⚠️ TEAMMATES MUST DO THIS STEP - Skip only if you don't need .ACD file creation
-
Find the SDK wheel file in your Studio 5000 installation:
# Look for this file (version may vary):
dir "C:\Users\Public\Documents\Studio 5000\Logix Designer SDK\python\logix_designer_sdk-*-py3-none-any.whl"
-
Install the SDK wheel file:
# Replace with your actual file path and version:
pip install "C:\Users\Public\Documents\Studio 5000\Logix Designer SDK\python\logix_designer_sdk-2.0.1-py3-none-any.whl"
-
Alternative - if you can't find the wheel file:
# Navigate to the SDK directory and install from there:
cd "C:\Users\Public\Documents\Studio 5000\Logix Designer SDK\python"
pip install logix_designer_sdk-*-py3-none-any.whl
Without this step: Documentation and L5X generation will work, but .ACD file creation will fail!
Step 4: Test Your Installation ✅
-
Run the test command:
python src/mcp_server/studio5000_mcp_server.py --test
-
You should see:
- ✅ "Documentation indexed successfully" (500+ instructions found)
- ✅ "SDK Available: True" (if you installed the SDK wheel file correctly)
- ✅ "SDK Available: False" (OK if you skipped SDK installation - L5X generation still works)
- ✅ Sample search results and code generation tests
-
If SDK Available shows False but you installed the wheel file:
- Check the wheel file path was correct
- Try:
python -c "import logix_designer_sdk; print('SDK OK')"
-
If tests fail completely, check the Troubleshooting section
🎉 You're Ready to Use the Tool! 🎉
The server will automatically detect your Studio 5000 installation paths. Skip to the Configuration for Claude Desktop section to start using it!
Step 5: Configure Environment Variables (Advanced Users Only)
⚠️ SKIP THIS STEP - Only needed if Studio 5000 is installed in non-standard locations
Option A: Set via Windows Environment Variables
Option B: Create .env file (in project root):
STUDIO5000_DOC_PATH=C:\Program Files (x86)\Rockwell Software\Studio 5000\Logix Designer\ENU\v36\Bin\Help\ENU\rs5000
STUDIO5000_SDK_PATH=C:\Users\Public\Documents\Studio 5000\Logix Designer SDK\python
PYTHON312_PATH=C:\Users\YourUsername\AppData\Local\Programs\Python\Python312\python.exe
-
Find Your Studio 5000 Paths:
Documentation Path: Look for this file in your Studio 5000 installation:
<Studio5000_Install>\Logix Designer\ENU\v36\Bin\Help\ENU\rs5000\17691.htm
Common locations:
- `C:\Program Files (x86)\Rockwell Software\Studio 5000\Logix Designer\ENU\v36\Bin\Help\