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.
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 serverget_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 nameadd_class: Add a new class in the modeladd_method_to_class: Add a method to a given classadd_attribute_to_class: Add an attribute to a given classadd_binary_association: Add a binary association between two classesadd_association_class: Add an association class to an existing associationadd_enumeration: Add an enumeration to the modeladd_enumeration_literal: Add a literal to an enumerationadd_generalization: Add a generalization relation between two classesadd_ocl_constraint: Add an OCL constraint to a class
- Deletion tools:
delete_class: Remove a class from the modeldelete_method_to_class: Remove a method from a given classdelete_attribute_to_class: Remove an attribute from a given classdelete_binary_association: Remove a binary association between two classesdelete_association_class: Remove an association class from an existing associationdelete_enumeration: Remove an enumeration from the modeldelete_enumeration_literal: Remove a literal from an enumerationdelete_generalization: Remove a generalization relation between two classesdelete_ocl_constraint: Remove an OCL constraint
- Generation tools:
sql_generation: Generate the SQL representation of the modelpython_generation: Generate the set of Python classes implementing the modelbackend_generation: Generate a backend implementation for the modeljava_generation: Generate the set of Java classes implementing the modeljson_schema_generation: Generate the JSON Schema of the modeljson_smart_data_generation: Generate the Smart Data Schema for the modelpydantic_classes_generation: Generate a Pydentic representation of the modelrdf_generation: Generate the RDF vocabulary for the modelrest_api_generation: Generate a Rest API for the modelsql_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:
Or if using UV:pip install mcp besseruv 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)
- Open the Cline panel on VScode
- Click on "Manage MCP Server" at the bottom, then the cog
- Clicking on "Configure MCP server" will open the configuration file
- 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
- Open the Cline panel on VScode
- Click on "Manage MCP Server" at the bottom, then the cog
- Clicking on "Configure MCP server" will open the configuration file
- Add the "besser-mcp-server" in the "mcpServers" section:
{ "mcpServers": { "besser-mcp": { "url": "http://127.0.0.1:8000/sse" } } }
Claude Desktop
-
Locate the configuration directory:
- macOS:
~/Library/Application Support/Claude/ - Windows:
%APPDATA%\Claude\
- macOS:
-
Create or edit
claude_desktop_config.json:{ "mcpServers": { "besser-mcp": { "type": "sse", "url": "http://127.0.0.1:8000/sse" } } }
Cursor IDE
-
Create the Cursor MCP configuration directory:
mkdir -p ~/.cursor # macOS/Linux # or mkdir %USERPROFILE%\.cursor # Windows -
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:
- Start the server
- Restart your MCP client
- Test the connection by asking:
- "What is BESSER?" (uses the
abouttool) - "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)
- "What is BESSER?" (uses the
Configuration Files
The repository includes several pre-configured files to help with setup:
mcp-config.json- Basic cross-platform configuration templatemcp-config-examples.json- Multiple configuration examplesclaude-desktop-config-windows.json- Windows-specific Claude Desktop configcursor-mcp-config-windows.json- Windows-specific Cursor configinstall-mcp-config.ps1- Automatic installation script for Windows
Documentation
For detailed setup instructions and troubleshooting:
QUICK-START.md- Fast setup guideMCP-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
-
"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')"
- Make sure you have the correct MCP package installed:
-
"Command not found" errors: Ensure Python is in your system PATH
-
"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
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。