Skip to main content
Glama
UrwLee

Trae CN MCP Server

by UrwLee

Trae CN Skill for OpenClaw

这个 Skill 为 OpenClaw 提供了 Trae CN AI IDE 的集成能力。

功能特性

  • 🚀 启动和管理 Trae IDE

  • 📁 创建 AI 编程项目

  • 🎨 AI 代码生成

  • ⚙️ MCP Server 配置

  • 📊 量化交易工具集成

Related MCP server: PineScript MCP Server

安装

1. 安装 Trae IDE (如果尚未安装)

brew install --cask trae-cn

2. 安装依赖

# 在 skill 目录下
cd skills/trae-cn

# 安装 Python 依赖 (如果需要 MCP Server)
pip3 install mcp --user

使用方法

OpenClaw 中使用

# 在 OpenClaw 中直接调用
@trae-cn launch        # 启动 Trae
@trae-cn create-project --name my-app  # 创建项目
@trae-cn generate --prompt "创建登录功能"  # AI 代码生成

命令行使用

cd skills/trae-cn

# 显示帮助
python3 scripts/trae.py help

# 启动 Trae
python3 scripts/trae.py launch

# 创建项目
python3 scripts/trae.py create --name my-project --template python

# AI 代码生成
python3 scripts/trae.py generate --prompt "创建用户认证模块" --language python

# 配置 MCP Server
python3 scripts/trae.py configure-mcp --server stock --command "python3 mcp_server.py"

# 列出 MCP Server
python3 scripts/trae.py list-mcp

MCP Server 模式

在 Trae IDE 中使用 OpenClaw 功能:

# 1. 启动 MCP Server
python3 scripts/mcp_server.py

# 2. 在 Trae 中配置 MCP
# Trae 设置 → MCP → 添加 Server
# Command: python3 /path/to/skills/trae-cn/scripts/mcp_server.py

# 3. 在 Trae 对话中使用
# "帮我查一下 600519 的股价"
# "用 OpenClaw 选一下股"

MCP Tools

当配置为 MCP Server 时,提供以下工具:

工具名

功能

参数

stock_quote

获取股票行情

symbol: 股票代码

stock_pick

AI 智能选股

stocks: 股票列表, method: 评分方法

risk_analysis

风险管理分析

symbol, shares, price

technical_indicator

技术指标

symbol, indicator

create_project

创建项目

name, template

run_strategy

运行回测

strategy, symbol

配置文件

Trae MCP 配置示例

在 Trae 中添加 MCP Server:

{
  "mcpServers": {
    "openclaw": {
      "command": "python3",
      "args": ["/path/to/skills/trae-cn/scripts/mcp_server.py"],
      "env": {}
    }
  }
}

环境变量

# 可选: 设置 AI 模型
export TRAE_MODEL="deepseek-v3"

# 可选: 设置 API Key
export OPENCLAW_API_KEY="your-key"

项目结构

trae-cn/
├── SKILL.md           # Skill 说明文档
├── package.json       # 配置文件
├── README.md          # 本文件
└── scripts/
    ├── trae.py        # Trae 工具脚本
    └── mcp_server.py   # MCP Server

集成 OpenClaw 功能

这个 Skill 集成了以下 OpenClaw 功能:

1. 股票数据

from src.data.stock_api import StockDataAPI

api = StockDataAPI(data_source="sina")
quotes = api.get_realtime_quote(["600519", "000001"])

2. AI 选股

from src.strategies.ai_stock_picker import AIStockPicker

picker = AIStockPicker()
results = picker.pick_by_ai_score(["600519", "000001"])

3. 风险管理

from src.utils.risk_manager import RiskManager

risk = RiskManager(initial_capital=10000)
risk.add_position("600519", 100, 1500.0)

常见问题

Q: 如何在 Trae 中使用这个 Skill? A: 启动 MCP Server 后,在 Trae 对话中直接描述需求即可。

Q: 需要安装 Trae IDE 吗? A: 不需要。MCP Server 模式可以在任何 IDE 中使用 OpenClaw 功能。

Q: 支持哪些编程语言? A: Python 是原生支持,其他语言可以通过 Trae IDE 的 AI 功能实现。

参考

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    Not graded
    maintenance
    Enables Claude to integrate with Altary error management service for retrieving, analyzing, and completing errors directly within the IDE. Supports project management, AI-powered error analysis, and automated completion of similar errors through similarity detection.
    -
  • A
    license
    Not graded
    quality
    F
    maintenance
    Enables creation, optimization, and management of PineScript trading strategies with Claude Desktop integration for AI-assisted development.
    11 npm
    105
    MIT
  • F
    license
    Not graded
    quality
    C
    maintenance
    Connects Claude Code to your locally running TradingView Desktop app via Chrome DevTools Protocol for AI-assisted chart analysis, Pine Script development, and workflow automation.
    -