home / mcp / trae rules generator mcp server
Provides automated generation, reading, saving, and updating of Trae AI project rule files via MCP with multi-language support.
Configuration
View docs{
"mcpServers": {
"xiaochenwin-trae-rules-mcp": {
"command": "python3",
"args": [
"-m",
"trae_rules_mcp.main"
],
"env": {
"PYTHONPATH": "."
}
}
}
}You can run Trae Rules Generator as an MCP server to automatically generate, read, and manage rules for Trae AI projects. It supports local execution via Python and a separate runtime entry through UV, enabling you to tailor rule files for Web, API, AI, and other project types with multilingual support.
You interact with the MCP server through your Trae AI client by configuring an MCP server entry and invoking the provided tools. The server can read existing rules, generate new project rules based on type and features, and save or update rule files. Use the two runtime options shown below to run the MCP server locally.
Prerequisites you need before starting: Python 3.8 or newer, and a compatible package manager. If you plan to install from a published package, you will use pip to install the MCP server package and then wire it into Trae AI.
The MCP servers provided by Trae Rules Generator include two local runtime options. Use one entry per configuration and place them in your Trae AI MCP settings.
1) Local Python module execution (published package) 2) Local UV-driven execution (source-based runtime)
{
"mcpServers": {
"trae_rules_mcp": {
"command": "python3",
"args": ["-m", "trae_rules_mcp.main"],
"env": {
"PYTHONPATH": "."
}
},
"trae_rules_generator": {
"command": "uv",
"args": ["run", "python", "main.py"],
"cwd": "/path/to/trae-rules-mcp",
"env": {
"PYTHONPATH": "/path/to/trae-rules-mcp"
}
}
}
}Reads and returns details about existing rule files, including structure and content previews.
Generates new project-specific rule files based on project type and features.
Saves generated rule content to a specified file path.
Updates an existing rule file with provided changes.