Tekla MCP Server

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.

Category
访问服务器

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:

  1. 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"
}
  1. Customize config/element_types.json for your Tekla classes
  2. Customize config/base_components.json with your component catalog numbers
  3. Customize config/lifting_anchor_types.json for 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

  1. MCP Server (mcp_server.py): Handles MCP protocol communication and routes tool calls
  2. Tekla Utilities (tekla_utils.py): Wraps Tekla .NET API for Python access via pythonnet
  3. Data Models (models.py): Pydantic models for type-safe data handling
  4. 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

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选