AliMail Admin MCP
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| LOG_LEVEL | No | 日志级别:debug / info / warn / error。 | info |
| MCP_HTTP_HOST | No | HTTP 监听地址;Docker 镜像内为 0.0.0.0。 | 127.0.0.1 |
| MCP_HTTP_PORT | No | HTTP 端口。 | 3000 |
| MCP_AUTH_TOKEN | No | HTTP 模式下可选:设置后请求必须带 Authorization: Bearer <token>。 | |
| ALIMAIL_MAX_QPS | No | 本服务的请求速率上限(最大 40),需要给同域的其他应用留出余量。 | 20 |
| ALIMAIL_API_BASE | No | API 地址,不同集群不能混用。 | https://alimail-cn.aliyuncs.com |
| ALIMAIL_TOOLSETS | No | 启用的工具集。 | users,departments |
| ALIMAIL_AUDIT_LOG | No | 审计日志文件路径;默认为空,输出到 stderr。 | |
| ALIMAIL_CLIENT_ID | Yes | 必填,阿里邮箱应用 ID。 | |
| ALIMAIL_READ_ONLY | No | 设为 false 才会注册写操作和破坏性工具。 | true |
| MCP_ALLOWED_HOSTS | No | 允许的 Host 头,用于防御 DNS rebinding。 | localhost,127.0.0.1,[::1] |
| ALIMAIL_TIMEOUT_MS | No | 单次请求超时时间,单位毫秒。 | 15000 |
| ALIMAIL_CLIENT_SECRET | Yes | 必填,阿里邮箱应用 Secret。 | |
| ALIMAIL_ALLOWED_DOMAINS | No | 限定可操作的邮箱域名,逗号分隔,子域名同样适用;默认为空表示不限制。 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
本服务通过阿里邮箱开放平台 API 管理企业邮箱的用户与部门。 当前为只读模式:只提供查询类工具。 用户可用 ID 或邮箱定位;部门 ID 可用 $root 表示根部门。列表结果注意分页(nextCursor/hasMore 或 offset/total)。
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| logging | {} |
| prompts | {
"listChanged": true
} |
| resources | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_usersA | 按 filter 表达式查询组织内用户,游标分页(单页最多 100)。 filter 支持字段:email、name、nickname、employeeNo、status、domain、employeeType、delegateType、departmentId、jobTitle、workLocation、homeLocation、info、managerId、isSharedWithOthers。 示例:(departmentId=xxx) 直属成员;(departmentId=xxx*) 含子部门;(|(name=Jack)(email=jack));(&(employeeType=SERVICE)(email=abc));(&(departmentId=xxx)(!(status=FREEZE)))。 返回 hasMore=true 时用 nextCursor 继续翻页。 |
| get_userC | 根据用户 ID 或邮箱获取用户详情。 |
| get_users_by_idsA | 根据用户 ID 列表批量获取用户信息(最多 100 个),不存在的 ID 不返回。 |
| get_mailbox_settingsA | 获取用户邮箱设置(外部收发信限制、自动转发、附件大小、收件人数等)。字段多为可选字段,可用 select 指定,如 forbidSendMailToOutside,forwardingMode,attachmentSize。 |
| list_shared_membersB | 查询共享账号 / 委托账号的成员及其访问权限(LOGIN / SEND_AS / SEND_ON_BEHALF)与审批状态。 |
| get_departmentA | 根据部门 ID 获取部门信息;id 传 $root 返回组织根部门。 |
| get_departments_by_idsA | 根据部门 ID 列表批量获取部门信息(最多 100 个),不存在的 ID 不返回。 |
| list_sub_departmentsA | 查询指定部门的直属子部门(offset/limit 分页,limit 最大 100)。需要整棵树请用 get_department_tree。 |
| list_department_usersA | 查询指定部门的直属成员(offset/limit 分页,limit 最大 100)。如需含子部门成员,可用 list_users 的 filter (departmentId=xxx*)。 |
| get_department_chainA | 获取从根部门到目标部门的完整层级链。传 id 查询单个,传 ids 批量查询(最多 100 个)。 |
| get_department_treeA | 从指定部门(默认根部门)递归获取完整部门树,自动处理分页。可选包含每个部门的直属成员。大型组织请设置 maxDepth / maxNodes 控制规模,结果中 truncated=true 表示被截断。 |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| onboard_employee | 引导完成:确认部门 → 创建账号 → 设置别名/邮箱策略 → 汇总结果 |
| offboard_employee | 引导完成:核对账号 → 撤销登录态 → 冻结/重置密码 → 交接共享 → (可选)删除 |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| department-tree | 从根部门开始的完整部门树(不含成员),缓存 5 分钟。 |
TDQS
Scored across 11 tools
The get/list department trio (get_department, get_departments_by_ids, get_department_chain) and the tree-vs-subdepartment pair (get_department_tree vs list_sub_departments) have some conceptual overlap, but descriptions explicitly cross-reference each other ("需要整棵树请用 get_department_tree") to route the agent correctly. Single-vs-batch (get_user vs get_users_by_ids) and user-vs-department listing are clearly distinguished.
All 11 tools follow a strict verb_noun snake_case convention: list_*, get_*, with suffixes clearly indicating batch (_by_ids, _ids). No mixing of styles or casing.
11 tools is well within the ideal 3-15 range for an org directory/mailbox admin server. Each tool earns its place by covering a distinct access pattern (single, batch, tree, filter, chain, settings).
The surface is entirely read-only: there is no create/update/delete for departments or users, and no update_mailbox_settings despite get_mailbox_settings existing, which is a notable gap for an 'Admin' server. Read coverage (single, batch, tree, filter, chain, shared accounts, mailbox settings) is otherwise solid.