- Home
- MCP servers
- Trae OpenSpec
Trae OpenSpec
- javascript
11
GitHub Stars
javascript
Language
5 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"leon30083-trae-openspec-mcp": {
"command": "node",
"args": [
"mcp-server.js"
]
}
}
}You can run and manage the Trae OpenSpec MCP toolkit as an MCP server, enabling GUI-driven project creation, OpenSpec spec generation, and code optimization without touching command lines. This server integrates with Trae AI to streamline project setup, specification generation, and automated testing, making it practical to build and validate OpenSpec-based projects quickly.
How to use
You interact with the MCP server through an MCP client that communicates over standard MCP channels. Use the provided tools to create new OpenSpec projects from natural language descriptions, generate specifications from requirements, and optimize existing code against OpenSpec norms. You can also run built-in tests to verify project quality as you develop.
How to install
Prerequisites you need before installing this MCP server:
-
Node.js 18.0.0 or higher
-
Trae AI latest version
-
Operating system: Windows, macOS, or Linux
Install methods
+ ```bash
+ # 1. Clone the MCP toolkit repository
+ git clone https://github.com/leon30083/trae-openspec-mcp.git
+ cd trae-openspec-mcp
+
+ # 2. Install dependencies
+ npm install
+
+ # 3. Start the server
+ npm start
+
+ ```bash
+ # 1. Install MCP toolkit globally
+ npm install -g trae-openspec-mcp
+
+ # 2. Start the server from anywhere
+ trae-openspec-mcp
+
+ ```bash
+ # 1. Clone the repository
+ git clone https://github.com/leon30083/trae-openspec-mcp.git
+ cd trae-openspec-mcp
+
+ # 2. Install development dependencies
+ npm install
+
+ # 3. Start in development mode (with debug info)
+ npm run dev
+
启动 MCP 服务器
根据安装方式使用相应的启动命令。最终启动时序是在开发或本地运行时确定的默认流程。服务器通过 STDIO 与 Trae 集成,无需额外的 HTTP 端口配置。
在 Trae 中配置
+ ```json
+{
+ "mcpServers": {
+ "trae-openspec-mcp": {
+ "command": "node",
+ "args": [
+ "mcp-server.js"
+ ],
+ "cwd": "<你的本地路径>/trae-openspec-mcp"
+ }
+ }
+}
+
说明:将 cwd 设置为仓库根目录(包含 mcp-server.js)。若已发布到 npm,可改为对等的配置:
开发与发布的进阶配置
+ ```json
+{
+ "mcpServers": {
+ "trae-openspec-mcp": {
+ "command": "npx",
+ "args": ["-y", "trae-openspec-mcp"]
+ }
+ }
+}
+
核心工具与模板
你可以使用以下工具将需求转化为工作产物:创建 OpenSpec 项目、生成 OpenSpec 规范、基于规范优化代码、执行实时测试等。每个工具都提供清晰的输入与输出,帮助你快速推进项目。
配置选项
+ ```json
+{
+ "server": {
+ "name": "trae-openspec-server",
+ "version": "0.1.0",
+ "timeout": 30000
+ },
+ "templates": {
+ "customTemplatesPath": "./custom-templates",
+ "enableCustomTemplates": true
+ },
+ "ai": {
+ "model": "gpt-4",
+ "temperature": 0.7,
+ "maxTokens": 2000
+ }
+}
+
故障排除
常见问题包括:无法启动 MCP 服务器、Trae 无法连接 MCP 服务器、工具调用失败。逐项检查 Node.js 版本、依赖安装、配置路径与网络状态,并查看控制台输出以获取详细信息。
示例场景
示例场景包括创建博客系统、生成用户管理规范等,演示了从需求到规范再到实现的完整流程。
更多内容
你可以在开发和集成阶段,结合上述配置和工具,快速搭建、扩展并验证基于 OpenSpec 的项目。
Available tools
create_openspec_project
Create an OpenSpec project from a natural language description, returning the project structure, generated specifications, and next-step guidance.
generate_openspec_spec
Generate an OpenSpec specification from a set of requirements and project type, returning the spec and related task lists.
optimize_code_by_spec
Optimize existing code against an OpenSpec specification, providing the upgraded code, optimization report, and improvement suggestions.
run_tests
Run built-in tests to validate project quality and compliance with the generated specifications.