BESSER-MCP-Server

BESSER-MCP-Server

MCP server for BESSER low-code platform enabling AI assistants to create, manipulate, and generate code from domain models through natural language. Supports model creation, deletion, and multi-language code generation (SQL, Python, Java, etc.) via the Model Context Protocol.

Category
访问服务器

README

BESSER-MCP-Server

A minimal Model Context Protocol (MCP) server implementation for BESSER, the Python-based low-code modeling platform.

Overview

This MCP server provides access to BESSER's low-code platform modeling and code generation capabilities through the Model Context Protocol, enabling AI assistants and other MCP clients to interact with BESSER's features.

Features

The BESSER MCP Server can be used both locally or deployed on a server. To deploy it, the --dist or -d option needs to be added when starting the server Both the local and distant implementation open the server on the following address: http://127.0.0.1:8000/sse. However, the port can be changed through the --port or -p option. Help on the server option can be printed using the --help or -h option.

The BESSER MCP Server provides the following tools:

  • Information tools:
    • about: Get information about BESSER and this MCP server
    • get_model_info: Get detailed information about an existing domain model (classes, attributes, methods, relationships)
  • Creation tools:
    • new_model: Create a new B-UML DomainModel with a specified name
    • add_class: Add a new class in the model
    • add_method_to_class: Add a method to a given class
    • add_attribute_to_class: Add an attribute to a given class
    • add_binary_association: Add a binary association between two classes
    • add_association_class: Add an association class to an existing association
    • add_enumeration: Add an enumeration to the model
    • add_enumeration_literal: Add a literal to an enumeration
    • add_generalization: Add a generalization relation between two classes
    • add_ocl_constraint: Add an OCL constraint to a class
  • Deletion tools:
    • delete_class: Remove a class from the model
    • delete_method_to_class: Remove a method from a given class
    • delete_attribute_to_class: Remove an attribute from a given class
    • delete_binary_association: Remove a binary association between two classes
    • delete_association_class: Remove an association class from an existing association
    • delete_enumeration: Remove an enumeration from the model
    • delete_enumeration_literal: Remove a literal from an enumeration
    • delete_generalization: Remove a generalization relation between two classes
    • delete_ocl_constraint: Remove an OCL constraint
  • Generation tools:
    • sql_generation: Generate the SQL representation of the model
    • python_generation: Generate the set of Python classes implementing the model
    • backend_generation: Generate a backend implementation for the model
    • java_generation: Generate the set of Java classes implementing the model
    • json_schema_generation: Generate the JSON Schema of the model
    • json_smart_data_generation: Generate the Smart Data Schema for the model
    • pydantic_classes_generation: Generate a Pydentic representation of the model
    • rdf_generation: Generate the RDF vocabulary for the model
    • rest_api_generation: Generate a Rest API for the model
    • sql_alchemy_generation: Generate the SQLAlchemy code for the model

If the server is started locally, the server will directly access the file system for file generation. If the server is distant, the generated code will be sent back to the LLM. For this reason, generators producing multiple files are currently disabled in the distant mode.

Prerequisites

Before using the MCP server, ensure you have:

  • Python 3.8+ installed
  • Required packages:
    pip install mcp besser
    
    Or if using UV:
    uv add mcp besser
    

Usage

Running the Server

Production Mode

Run the MCP server directly:

python src/besser_mcp_server/server.py

Or install the package and run it:

pip install -e .
python -m besser_mcp_server.server

Development Mode

For development and debugging, use the MCP development server which includes the MCP inspector:

mcp dev src/besser_mcp_server/server.py

This will:

  • Start the server in development mode
  • Launch the MCP inspector in your browser for interactive testing
  • Provide detailed logging and debugging information
  • Allow you to test tools directly without configuring a client

Configuring MCP Clients

To use this server with MCP clients like Claude Desktop, Cursor and Cline, you need to configure them to connect to the server.

Recommended setup (Cline)

  1. Open the Cline panel on VScode
  2. Click on "Manage MCP Server" at the bottom, then the cog
  3. Clicking on "Configure MCP server" will open the configuration file
  4. Add the "besser-mcp-server" in the "mcpServers" section:
    {
      "mcpServers": {
        "besser-mcp": {
          "url": "http://127.0.0.1:8000/sse"
        }
      }
    }
    

Quick Setup (Windows)

Use the provided PowerShell installation script:

# For Cursor IDE
.\install-mcp-config.ps1 -Client cursor

# For Claude Desktop
.\install-mcp-config.ps1 -Client claude

# For both clients
.\install-mcp-config.ps1 -Client both

Manual Configuration

Cline
  1. Open the Cline panel on VScode
  2. Click on "Manage MCP Server" at the bottom, then the cog
  3. Clicking on "Configure MCP server" will open the configuration file
  4. Add the "besser-mcp-server" in the "mcpServers" section:
    {
      "mcpServers": {
        "besser-mcp": {
          "url": "http://127.0.0.1:8000/sse"
        }
      }
    }
    
Claude Desktop
  1. Locate the configuration directory:

    • macOS: ~/Library/Application Support/Claude/
    • Windows: %APPDATA%\Claude\
  2. Create or edit claude_desktop_config.json:

    {
      "mcpServers": {
        "besser-mcp": {
          "type": "sse",
          "url": "http://127.0.0.1:8000/sse"
        }
      }
    }
    
Cursor IDE
  1. Create the Cursor MCP configuration directory:

    mkdir -p ~/.cursor  # macOS/Linux
    # or
    mkdir %USERPROFILE%\.cursor  # Windows
    
  2. Create or edit ~/.cursor/mcp.json:

    {
      "mcpServers": {
        "besser-mcp": {
          "url": "http://127.0.0.1:8000/sse"
        }
      }
    }
    

Distant mode for collaboration

By using and sharing a URL where the model can be saved multiple users can edit the same model. To do so, you have to deploy the MCP server on distant mode using the -d or --dist option. You can change the port used for this server using the -p or --port option followed by the port number.

With this server, users can change the model by giving the URL as parameter. Example prompt:

Add a class representing users in the model available at the URL https://my-domain.com/model

Disclaimer: the distant mode currently has limitations regarding concurrent access and multi-file generation

Testing the Connection

After configuring your MCP client:

  1. Start the server
  2. Restart your MCP client
  3. Test the connection by asking:
    • "What is BESSER?" (uses the about tool)
    • "Create a new domain model called 'MyModel'" (uses new_model)
    • "Add a class named 'Person' to the model" (uses add_class)
    • "Show me information about the domain model" (uses get_model_info)
    • "Generate SQL from the domain model" (uses sql_generation)

Configuration Files

The repository includes several pre-configured files to help with setup:

  • mcp-config.json - Basic cross-platform configuration template
  • mcp-config-examples.json - Multiple configuration examples
  • claude-desktop-config-windows.json - Windows-specific Claude Desktop config
  • cursor-mcp-config-windows.json - Windows-specific Cursor config
  • install-mcp-config.ps1 - Automatic installation script for Windows

Documentation

For detailed setup instructions and troubleshooting:

  • QUICK-START.md - Fast setup guide
  • MCP-CLIENT-SETUP.md - Comprehensive setup instructions with troubleshooting

Example Usage

Once connected, you can interact with BESSER through natural language:

User: "Create a new domain model called 'ECommerceSystem'"
Assistant: [Uses new_model tool to create the model]

User: "Add a Customer class to the ECommerceSystem model"  
Assistant: [Uses add_class tool to add the Customer class]

User: "Add a Product class as well"
Assistant: [Uses add_class tool to add the Product class]

User: "Show me information about the current domain model"
Assistant: [Uses get_model_info tool to display model structure, classes, and relationships]

User: "Generate SQL from this domain model"
Assistant: [Uses sql_generation tool to create SQL representation]

User: "What is BESSER?"
Assistant: [Uses about tool to provide information about BESSER]

Troubleshooting

Common Issues

  1. "mcp is not found" or import errors:

    • Make sure you have the correct MCP package installed: pip install mcp
    • If you have an older version, upgrade it: pip install --upgrade mcp
    • Verify installation: python -c "import mcp.server; print('MCP installed correctly')"
  2. "Command not found" errors: Ensure Python is in your system PATH

  3. "Permission denied" errors: Ensure the server script has appropriate permissions

License

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

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

推荐服务器

Baidu Map

Baidu Map

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

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

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

官方
精选
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

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

官方
精选
本地
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

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

官方
精选
本地
TypeScript
VeyraX

VeyraX

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

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

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

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

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

官方
精选
Python
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 模型以安全和受控的方式获取实时的网络信息。

官方
精选