Tekla MCP Server
Enables AI-driven interaction with Tekla Structures through natural language commands, allowing users to select elements, insert components, and automate modeling workflows.
README
Tekla MCP Server
This server facilitates interaction with Tekla Structures, helping users speed up modeling processes. It acts as a bridge between users and Tekla, enabling automated workflows and improving efficiency.
π What is MCP?
MCP stands for Model Context Protocol, a communication protocol introduced by Anthropic to enable more efficient and secure interactions between large language models and other systems.
Tekla MCP Server uses AI-powered natural language processing to make interactions more human-readable, allowing you to work with Tekla Structures using plain text commands.
π Features
Tools Available
| Tool | Description |
|---|---|
put_components |
Insert Tekla components into selected elements with custom properties |
remove_components |
Remove Tekla components from selected elements |
select_elements_by_filter |
Select elements by type, name, profile, material, finish, phase |
select_elements_by_filter_name |
Select elements using predefined filter names |
select_elements_by_guid |
Select elements by their GUID |
select_elements_assemblies_or_main_parts |
Get assemblies or main parts of selected elements |
draw_elements_labels |
Draw temporary labels showing element properties |
zoom_to_selection |
Zoom view to fit selected elements |
show_only_selected |
Show only selected elements in active view |
cut_elements_with_zero_class_parts |
Perform boolean cuts using class 0 elements |
convert_cut_parts_to_real_parts |
Convert cut geometry to real model parts |
set_elements_udas |
Set custom attributes on selected elements |
get_all_elements_udas |
Retrieve all custom attributes from elements |
get_elements_properties |
Get detailed element properties including weight and custom fields |
π Requirements
- Tekla Structures 2023 (or compatible version)
- Python 3.11 or newer
- Required Python packages (see
requirements.txt)
π§ Installation
1. Install Dependencies
# Using uv (recommended)
uv pip install -r requirements.txt
# Using pip
pip install -r requirements.txt
β οΈ Note: You may experience a naming conflict with the clr string styling package. If this happens, rename or delete the folder:
C:\Users\<User>\AppData\Local\Programs\Python\Python311\Lib\site-packages\clr
2. Configure Settings
The configuration files are already set up for Tekla 2023. If you need to adjust paths:
- Edit
config/settings.json:
{
"tekla_path": "C:\\Program Files\\Tekla Structures\\2023.0\\bin",
"content_attributes_file_path": "C:\\Program Files\\Tekla Structures\\2023.0\\bin\\applications\\Tekla\\Tools\\TplEd\\settings\\contentattributes_global.lst"
}
- Customize
config/element_types.jsonfor your Tekla classes - Customize
config/base_components.jsonwith your component catalog numbers - Customize
config/lifting_anchor_types.jsonfor lifting anchor components
3. Set Up MCP Client
Configure mcp_server.py as a custom MCP server in your MCP client:
For Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"tekla": {
"command": "python",
"args": ["d:\\VS\\TeklaMCPServer\\mcp_server.py"]
}
}
}
For other MCP clients: Consult your client's documentation for custom server configuration.
π§ͺ Testing
The project includes comprehensive unit and functional tests:
# Run all unit tests
uv run pytest tests/unit/
# Run all tests (functional tests skip if Tekla not running)
uv run pytest tests/
# Run specific test file
uv run pytest tests/unit/test_models.py
# Run functional tests (requires Tekla running)
uv run pytest tests/functional/ --run-functional
β οΈ Warning: Functional tests modify the actual Tekla model. Run them only in test/development environment.
π¦ Distribution
Create a standalone executable using PyInstaller:
# Install PyInstaller
uv pip install pyinstaller
# Build executable
uv run pyinstaller mcp_server.py
The executable will be in dist/mcp_server/. Include the _internals directory when distributing.
Note: When using the executable, copy configuration files to _internals/config/.
π‘ Usage Examples
With Natural Language (via MCP Client)
"Select all beams with IPE300 profile and add lifting anchors"
"Get properties of selected columns"
"Show only elements in phase 1"
"Zoom to selected elements"
Direct Tool Usage
The server exposes MCP tools that can be called programmatically:
# Example: Select elements by filter
{
"tool": "select_elements_by_filter",
"arguments": {
"element_type": "beam",
"profile": "IPE300",
"material": "S355"
}
}
π How It Works
Architecture
βββββββββββββββββββ
β MCP Client β (Claude Desktop, DeepChat, etc.)
β (AI Model) β
ββββββββββ¬βββββββββ
β MCP Protocol
β
ββββββββββΌβββββββββ
β mcp_server.py β β Main server implementation
ββββββββββ¬βββββββββ
β
βββ models.py (Data structures)
βββ tekla_utils.py (Tekla API wrapper)
βββ config/*.json (Configuration)
β
βΌ
ββββββββββββββββ
β Tekla β (via .NET API)
β Structures β
ββββββββββββββββ
Key Components
- MCP Server (mcp_server.py): Handles MCP protocol communication and routes tool calls
- Tekla Utilities (tekla_utils.py): Wraps Tekla .NET API for Python access via pythonnet
- Data Models (models.py): Pydantic models for type-safe data handling
- Configuration: JSON files for customizing behavior per project
MCP Protocol Integration
The server uses the mcp Python package to:
- Register available tools via
@app.list_tools() - Handle tool execution requests via
@app.call_tool() - Communicate over stdio with MCP clients
- Provide structured responses using Pydantic models
Tekla API Usage
Tekla integration uses pythonnet (CLR) to:
- Load Tekla .NET assemblies dynamically
- Access Tekla.Structures.Model namespace
- Perform modeling operations (select, modify, insert components)
- Query element properties and user-defined attributes
β Verified Compatibility
Tekla Version: 2023
MCP Clients:
- DeepChat
- chatmcp
AI Models:
- GPT-4o
- DeepSeek
- Gemini 2.0 Flash
- Qwen3
π License
This software is open-source and released under the GPLv3 license. You are free to use, modify, and distribute it, as long as all modifications remain open-source under the same license.
See LICENSE for full details.
β οΈ Disclaimer
This software is provided as is, without any warranties or guarantees of functionality, reliability, or security. The developer assumes no responsibility for any damages, data loss, or other issues arising from its use.
Use at your own risk.
π€ Contributing
Contributions are welcome! Please ensure:
- All tests pass before submitting PR
- New features include appropriate tests
- Code follows existing style conventions
- Configuration remains backward compatible
π Support
For issues and questions:
- Check existing GitHub issues
- Review test files for usage examples
- Consult Tekla API documentation for advanced usage
πΊοΈ Roadmap
Future enhancements (contributions welcome):
- Support for Tekla 2024+
- Additional intelligent components
- Enhanced filtering capabilities
- Drawing automation tools
- Report generation features
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.