MCP开放式法律
与OpenClaw API集成的模型上下文协议(MCP)服务器,使人工智能助手能够发送消息、执行命令、管理日历事件、发送电子邮件和跟踪任务状态。
特性
- 发送消息:向Telegram、WhatsApp和Discord发送消息
- 执行命令:在OpenClaw环境中运行命令(同步或异步)
- 日程管理:创建包含与会者和提醒的日历事件
- 电子邮件:发送支持CC/BCC的电子邮件
- 任务状态:跟踪异步命令的状态
安装
全球安装
npm install -g mcp-openclaw本地安装
npm install mcp-openclaw配置
设置以下环境变量:
export OPENCLAW_API_URL="https://api.openclaw.example.com"
export OPENCLAW_API_KEY="your-api-key-here"可选配置:
export OPENCLAW_TIMEOUT="30000" # Request timeout in milliseconds (default: 30000)
export OPENCLAW_MAX_RETRIES="3" # Maximum retry attempts (default: 3)
export SERVER_NAME="mcp-openclaw" # Server name (default: mcp-openclaw)
export SERVER_VERSION="1.0.0" # Server version (default: 1.0.0)
export LOG_LEVEL="info" # Log level: debug, info, warn, error (default: info)用法
使用克劳德桌面
添加到您的Claude Desktop配置文件中:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json 视窗: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"openclaw": {
"command": "node",
"args": ["/path/to/mcp-openclaw/dist/index.js"],
"env": {
"OPENCLAW_API_URL": "https://api.openclaw.example.com",
"OPENCLAW_API_KEY": "your-api-key-here"
}
}
}
}可用工具
1.发送消息
向支持的平台发送消息。
{
"platform": "telegram",
"recipient": "@username",
"message": "Hello from OpenClaw!"
}支持的平台: telegram, whatsapp, discord
2.执行命令
在OpenClaw环境中执行命令。
{
"command": "ls -la",
"timeout": 30,
"async": false
}3.创建日历事件
创建新的日历事件。
{
"title": "Team Meeting",
"description": "Weekly team sync",
"startTime": "2024-01-15T10:00:00Z",
"endTime": "2024-01-15T11:00:00Z",
"location": "Conference Room A",
"attendees": ["user1@example.com", "user2@example.com"],
"reminder": 15
}4.发送电子邮件
发送一封电子邮件。
{
"to": "recipient@example.com",
"subject": "Hello from OpenClaw",
"body": "This is the email content",
"cc": "cc@example.com",
"bcc": "bcc@example.com",
"html": false
}5.任务状态
检查异步命令的状态。
{
"taskId": "task-abc123"
}发展
设置
git clone https://github.com/yourusername/mcp-openclaw.git
cd mcp-openclaw
npm install构建
npm run build测试
npm test棉绒
npm run lint
npm run lint:fix格式
npm run format项目结构
mcp-openclaw/
├── src/
│ ├── index.ts # MCP Server entry point
│ ├── types.ts # TypeScript type definitions
│ ├── openclaw-client.ts # OpenClaw API client
│ └── tools/
│ ├── index.ts # Tools registry
│ ├── send-message.ts
│ ├── execute-command.ts
│ ├── create-calendar-event.ts
│ ├── send-email.ts
│ └── get-task-status.ts
├── tests/ # Test files
├── examples/ # Usage examples
├── docs/ # Documentation
└── scripts/ # Build and utility scripts建筑
有关详细的体系结构信息,请参见 docs/ARCHITECTURE.md.
API 参考
有关API的完整参考,请参阅 docs/API.md文件.
贡献
欢迎投稿!请参阅 贡献.md 作为指导方针。
许可证
MIT许可证-请参阅 许可证 了解详情。
更新日志
看 更改日志.md 版本历史。
支持
- 问题:
- 文档: docs/
