Cover image
Try Now
2025-03-29

Text2SIM MCP服务器是一款支持多个建模范式的模拟引擎,包括离散事件模拟(DES)和系统动力学(SD)。它使用模型上下文协议(MCP)与LLMS集成,从而在Claude Desktop等自然语言环境中实现强大的仿真功能。

3 years

Works with Finder

1

Github Watches

0

Github Forks

1

Github Stars

Header Image

Text2Sim MCP Server

Multi-paradigm Simulation Engine for LLM Integration

Text2Sim MCP Server is a simulation engine that supports multiple modeling paradigms, including Discrete-Event Simulation (DES) and System Dynamics (SD). It integrates with LLMs using the Model Context Protocol (MCP), enabling powerful simulation capabilities within natural language environments like Claude Desktop.

Text2Sim MCP Server (demo)


🚀 Features

  • Large Language Model (LLM) Integration
    Create simulation models using plain English descriptions to LLMs.

  • Multi-Paradigm Support

    • Discrete-Event Simulation (DES) using SimPy for process-oriented models
    • System Dynamics (SD) using PySD for feedback-driven continuous models
  • Multi-Domain Support
    Build simulations for domains such as airport operations, healthcare, manufacturing, supply chains, and more.

  • Flexible Model Configuration

    • DES: Configurable entities with stochastic process logic
    • SD: Stock-and-flow models with feedback loops and time-based equations
  • Real-Time Metrics

    • DES: Performance indicators such as wait times and throughput
    • SD: Time series data for stocks, flows, and auxiliaries
  • Secure Implementation
    Uses regex-based parsing (not eval()) for processing distribution inputs and safe model execution.


🔧 Installation

Prerequisites

Install uv

On macOS and Linux:

curl -LsSf https://astral.sh/uv/install.sh | sh

On Windows (PowerShell):

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Learn more: astral-sh/uv


🛠️ Usage

Clone the repository

git clone https://github.com/IamCatoBot/text2sim-MCP-server.git

Integration with Claude Desktop

  1. Open:

Claude > Settings > Developer > Edit Config > claude_desktop_config.json

  1. Add the following block:
{
  "mcpServers": {
    "Text2Sim MCP Server": {
      "command": "uv",
      "args": [
        "--directory",
        "PATH_TO_TEXT2SIM_MCP_SERVER", 
        "run",
        "mcp_server.py"
      ],
      "env": {}
    }
  }
}

Note: If the uv command is not found, run which uv (Unix) or Get-Command uv (PowerShell) and use the full path in the "command" field.


📚 API Reference

Overview

The MCP server provides tools for both Discrete-Event Simulation and System Dynamics modeling:

  • Discrete-Event Simulation: Process-oriented modeling with SimPy
  • System Dynamics: Stock-and-flow modeling with PySD

When using a Large Language Model (e.g. Claude) client, natural language prompts are translated into appropriate configurations via the Model Context Protocol (MCP).


🏗️ Architecture

Text2Sim is structured into modular components:

  • MCP Server – Handles natural language requests via MCP.
  • Discrete-Event Simulation (DES) Module
    • Simulation Model – Core SimPy engine that executes process flows.
    • Entity Class – Represents units flowing through the system.
    • Process Steps – Encapsulate logic for each process stage.
    • Metrics Collector – Gathers statistics like wait times and throughput.
    • Secure Distribution Parser – Parses probability distributions safely.
  • System Dynamics (SD) Module
    • Model Registry – Manages available SD models.
    • PySD Integration – Runs stock-and-flow models using PySD.
    • Simulation Controls – Time steps, durations, and parameter adjustments.
    • Results Formatter – Structures time series data for output.

For detailed documentation of each module, see:


🔐 Security Considerations

  • No eval() usage
    Regex-based parsing prevents arbitrary code execution.

  • Input Validation
    Distribution types, parameters, and model configurations are validated before execution.

  • Robust Error Handling
    Errors are reported cleanly without leaking internal state.


🤝 Contributing

Pull requests are welcome! Please fork the repo and submit a PR. Suggestions, bug reports, and feature ideas are always appreciated.


📄 License

This project is licensed under the MIT License. See the LICENSE file for details.

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Bora Yalcin
  • Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Lists Tailwind CSS classes in monospaced font

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • Yasir Eryilmaz
  • AI scriptwriting assistant for short, engaging video content.

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • huahuayu
  • 统一的API网关,用于将多个Etherscan样区块链Explorer API与对AI助手的模型上下文协议(MCP)支持。

  • deemkeen
  • 用电源组合控制您的MBOT2:MQTT+MCP+LLM

  • jae-jae
  • MCP服务器使用剧作《无头浏览器》获取网页内容。

    Reviews

    2 (1)
    Avatar
    user_x027dGbu
    2025-04-16

    text2sim-MCP-server is an impressive tool developed by IamCatoBot. It provides seamless and efficient text-to-simulation capabilities, which is a great asset for any MCP application. I highly recommend checking it out at https://github.com/IamCatoBot/text2sim-MCP-server, especially if you're looking to enhance your user experience with dynamic text simulations.