Skip to main content
Glama

Manus MCP

CI Live

一个 MCP 服务器,通过官方 Manus API v2 为 Claude Code 提供对 Manus.im 的完全程序化控制。实现了 全部 30 个已记录的端点3 个用于常见工作流的复合工具,以及一个带有 RSA-SHA256 签名验证的 本地 Webhook 接收器

  • 状态: 生产就绪(单用户) — v0.1.1

  • 语言: Python 3.11+

  • 传输: stdio (Claude Code 原生)

  • 基础 URL: https://api.manus.ai

验证覆盖率 (v0.1.1)

层级

指标

单元测试

60+ (server.py 分发、Webhook ASGI 应用、密钥泄露防护、模式稳定性)

实时端到端测试

23 (包括 task.update / sendMessage / confirmAction / agent.update / website.publish)

复合实时测试

4 (包括 F2 拒绝检查)

Webhook 实时端到端

1 (cloudflared 隧道 + 接收器 + Manus 投递)

已执行的 Manus API 端点

30/30 (仅在账户缺少先决条件时优雅跳过 — 无代理 / 无网站)

覆盖率

≥ 80% (CI 中强制要求)

mypy --strict

0 错误

ruff check

0 错误

请参阅 docs/SECURITY.mddocs/RELEASE.md 了解生产流程。

包含内容

30 个直接 API 封装

类别

工具

任务 (9)

manus_task_create, manus_task_detail, manus_task_list, manus_task_update, manus_task_stop, manus_task_delete, manus_task_send_message, manus_task_list_messages, manus_task_confirm_action

项目 (2)

manus_project_create, manus_project_list

技能 (1)

manus_skill_list

代理 (3)

manus_agent_list, manus_agent_detail, manus_agent_update

文件 (3)

manus_file_create, manus_file_detail, manus_file_delete

Webhooks (4)

manus_webhook_create, manus_webhook_list, manus_webhook_delete, manus_webhook_public_key

使用情况 (3)

manus_usage_list, manus_usage_team_statistic, manus_usage_team_log

连接器 (1)

manus_connector_list

浏览器 (1)

manus_browser_online_list

网站 (3)

manus_website_status, manus_website_list_checkpoints, manus_website_publish

3 个复合工具

  • manus_file_upload — 创建预签名 URL,上传字节,并等待 status=uploaded。接受 pathbase64 或公共 url

  • manus_task_wait — 轮询任务直到其达到终止状态 (stopped / waiting / error) 并返回新消息以及等待详情 (event_id + 响应模式)。

  • manus_website_publish_and_wait — 发布网站并等待直到其变为 publishedfailed

3 个 Webhook 工具 (从本地 SQLite 数据库读取)

  • manus_webhook_events_list — 列出带有过滤器的已接收事件。

  • manus_webhook_events_get — 通过 event_id 获取事件。

  • manus_webhook_events_clear — 删除已接收的事件。

总计: 36 个 MCP 工具

安装

cd path/to/Manus-MCP
python -m venv .venv
# Windows:
.venv\Scripts\activate
# macOS/Linux:
# source .venv/bin/activate

pip install -e ".[dev]"

API 密钥配置

在项目根目录放置一个 .env 文件(提供了一个 .env.example 模板)。两种变量名均可接受:

MANUS_API_KEY=sk-...
# or, for backwards compatibility:
# ManusAPI=sk-...

优先级: process.env > .env

可选设置:

MANUS_BASE_URL=https://api.manus.ai
MANUS_HTTP_TIMEOUT=60
MANUS_LOG_LEVEL=INFO

在 Claude Code 中注册

将以下内容添加到 .claude/settings.json (项目级) 或 ~/.claude/settings.json (全局):

{
  "mcpServers": {
    "manus": {
      "command": "python",
      "args": ["-m", "manus_mcp"],
      "cwd": "path/to/Manus-MCP"
    }
  }
}

如果未全局设置 MANUS_API_KEY,请显式传递它:

{
  "mcpServers": {
    "manus": {
      "command": "python",
      "args": ["-m", "manus_mcp"],
      "cwd": "path/to/Manus-MCP",
      "env": { "MANUS_API_KEY": "sk-..." }
    }
  }
}

重启 Claude Code — manus_* 工具将出现在工具列表中。

验证

无需启动服务器:

python scripts/list_tools.py

针对真实 API:

python scripts/smoke.py

单元测试:

pytest

Lint 和类型检查:

ruff check .
mypy manus_mcp

来自 Claude Code 的使用示例

manus_task_create { "message": { "content": "Give me a 5-bullet summary of today's AI news" } }

响应包含一个 task_id。然后:

manus_task_wait { "task_id": "<id>", "timeout_sec": 600 }

当它完成时,你会得到包含最终回复的 last_assistant_message 和包含对话历史的 new_messages

上传文件并将其附加到任务:

manus_file_upload { "source": { "path": "C:/docs/report.pdf" } }
manus_task_create {
  "message": {
    "content": [
      { "type": "text", "text": "Summarize this report" },
      { "type": "file", "file_id": "<file_id>" }
    ]
  }
}

Webhook 接收器 (可选)

一个用于 task_created / task_stopped 事件的本地接收器,具有根据 ManusAPIDocs/webhooks/security.md 的完整 RSA-SHA256 签名验证。

1. 配置环境变量

MANUS_WEBHOOK_PUBLIC_URL=https://your-tunnel.example.com/manus/webhook
MANUS_WEBHOOK_HOST=127.0.0.1
MANUS_WEBHOOK_PORT=8787
# MANUS_WEBHOOK_DB_PATH=...  # defaults to %LOCALAPPDATA%\manus-mcp\events.db on Windows

MANUS_WEBHOOK_PUBLIC_URL 必须与 Manus 调用的 URL 完全匹配。Manus 签名负载包含此 URL,因此即使是一个拼写错误也会导致每个事件被拒绝。

2. 启动隧道

例如,使用 Cloudflare Tunnel:

cloudflared tunnel --url http://localhost:8787

或 ngrok:

ngrok http 8787

3. 运行接收器

python -m manus_mcp.webhook_receiver
# or: manus-mcp-webhook --host 127.0.0.1 --port 8787

4. 向 Manus 注册 Webhook

在 Claude Code 中:

manus_webhook_create { "url": "https://your-tunnel.example.com/manus/webhook" }

5. 读取事件

manus_webhook_events_list { "event_type": "task_stopped", "limit": 20 }
manus_webhook_events_get { "event_id": "..." }
manus_webhook_events_clear { "before_received_at": 1704000000 }

架构

manus_mcp/
├── __main__.py          # stdio entrypoint
├── server.py            # MCP Server bootstrap
├── config.py            # pydantic-settings
├── logger.py            # stderr-only logger
├── client/
│   ├── manus_client.py  # async httpx client + retry
│   ├── rate_limiter.py  # per-endpoint token bucket (from rate-limits.md)
│   ├── retry.py         # exponential backoff + jitter
│   └── errors.py        # ManusApiError / ManusNetworkError
├── schemas/             # pydantic models for each resource (tasks, projects, ...)
├── tools/               # @manus_tool registration for all 36 tools
│   ├── tasks.py projects.py skills.py agents.py
│   ├── files.py webhooks.py usage.py connectors.py
│   ├── browser.py website.py
│   └── composite.py     # task_wait / file_upload / website_publish_and_wait
└── webhook_receiver/
    ├── signature.py     # RSA-SHA256 verification using {ts}.{url}.{sha256_hex(body)}
    ├── storage.py       # SQLite WAL
    ├── server.py        # Starlette + uvicorn
    ├── tools.py         # events_list / events_get / events_clear
    └── __main__.py

速率限制

客户端遵守 API 限制(60 秒滑动窗口),并透明地重试 429 响应,采用退避 + 抖动策略。限制来自 ManusAPIDocs/getting-started/rate-limits.md

  • 10/分钟: task.create, task.sendMessage

  • 40/分钟: 所有变更操作

  • 100/分钟: 所有只读调用

  • 600/分钟: usage.*

安全性

  • API 密钥从不被记录。

  • Webhook 接收器验证签名并拒绝超过 5 分钟的时间戳。

  • 公钥缓存 1 小时。

  • SQLite 以 WAL 模式打开,设置 check_same_thread=False 以实现安全的多读取器访问。

许可证

MIT。

Install Server
A
license - permissive license
A
quality
-
maintenance - not tested

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/aruxojuyu665/Manus-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server