trmm-mcp
trmm-mcp
一个只读的 MCP 服务器,将 Tactical RMM 实例暴露为 agent 工具,使 LLM 能够获取设备、客户端和审计数据——而没有任何更改能力。
按理设计就是只读。 未实现任何
run-script、run-command、reboot、install、edit、create或delete工具。即使 API 密钥具有写权限,影响范围也为零。请务必同时搭配一个只读的 service user(纵深防御)。Python + FastMCP。同一套代码支持两种传输:stdio 用于本地 MCP 客户端,Streamable HTTP(带共享 bearer-token 认证)用于团队连接的共享远程服务器——参见远程部署。
配置只从环境变量读取——代码中不存机密。如果必需的变量缺失,启动时会快速失败。
工具
所有工具均为 readOnlyHint: true、destructiveHint: false、idempotentHint: true、openWorldHint: true,返回带输出模式的结构化内容,并在适用条件下支持分页。
工具 | 说明 |
| 所有客户端/租户(可选内嵌站点摘要)。 |
| 站点,可按客户端筛选。 |
| 代理/设备的摘要字段;可按客户端/站点/类型/平台/状态/主机名过滤。 |
| 单个代理的完整详情(风险)操作系统、硬件、状态、检查统计); |
| 检查结果(cpu/mem/disk/ping/service/script/event),含通过/失败状态。 |
| 单个代理的命令/脚本/任务执行历史(最新在前)。 |
| 按代理/客户端/用户/操作/对象类型/时间范围查询审计日志。 |
| 一个或所有代理已排队的重启/更新/脚本。 |
| 单个代理已安装软件清单。 |
| 单个代理已知的 Windows update 条目。 |
| 服务器健康/状态/版本/计数(需要 |
参见 docs/API_CONTRACT.md 了解具体接口和审计日志载荷。
Related MCP server: KVMFleet MCP Server
配置
变量 | 必要条件 | 默认值 | 说明 |
| ✅ | — | API 基础 URL,使用 |
| ✅ | — |
|
| — | (unset) | 只有 |
| — |
| 每请求的超时时间(秒)。 |
| — |
| 只有使用自签名证书时才设为 |
| — |
| 临时性 5xx / 网络错误的重试次数。 |
在 TRMM 中获取 API key:Settings → Global Settings → API Keys(选择你的只读服务用户)。该 key 会绕过 2FA 并继承该用户的角色权限。
安装
需要 Python 3.10+。
cd tactical-rmm-mcp
python -m venv .venv
# Windows: .venv\Scripts\activate
# macOS/Linux: source .venv/bin/activate
pip install -r requirements.txt(或运行 pip install -e . 获得 trmm-mcp 命令。)
运行
该服务器通过 stdio 使用 MCP 协议,通常由你的 MCP 客户端启动。要手动运行(它会等待 stdin 上有 MCP 客户端):
# set env first, then:
python -m trmm_mcp
# or
python server.py如果缺少 TRMM_API_URL 或 TRMM_API_KEY,它会在 stderr 中打印清晰的错误并以非零状态退出。
在 MCP 客户端中注册(stdio)
Claude Code —— 项目的 .mcp.json
在你的项目中创建 .mcp.json(使用 server.py 的绝对路径,以及你虚拟环境中的 Python,以便依赖能够解析):
{
"mcpServers": {
"trmm": {
"command": "C:\\Users\\admin\\your-workspace\\tactical-rmm-mcp\\.venv\\Scripts\\python.exe",
"args": ["C:\\Users\\admin\\your-workspace\\tactical-rmm-mcp\\server.py"],
"env": {
"TRMM_API_URL": "https://api.yourdomain.com",
"TRMM_API_KEY": "your-readonly-key",
"TRMM_MON_TOKEN": "optional-mon-token"
}
}
}
}Claude Desktop —— claude_desktop_config.json
结构相同,放在顶层的 "mcpServers" 键下:
{
"mcpServers": {
"trmm": {
"command": "/abs/path/tactical-rmm-mcp/.venv/bin/python",
"args": ["/abs/path/tactical-rmm-mcp/server.py"],
"env": {
"TRMM_API_URL": "https://api.yourdomain.com",
"TRMM_API_KEY": "your-readonly-key"
}
}
}
}在 macOS 上,这个文件位于 ~/Library/Application Support/Claude/claude_desktop_config.json;在 Windows 上位于 %APPDATA%\Claude\claude_desktop_config.json。编辑后重启应用。
远程部署(团队成员共同访问)
将 trmm-mcp 作为共享 HTTPS 服务器运行,这样工程师 / 服务台成员将其用作 Claude 连接器,而不必每个人都本地安装一份。TRMM API key 保留在服务器上;客户端用共享的 bearer token 进行认证。
1. 生成 bearer token 并配置
python -c "import secrets; print(secrets.token_urlsafe(32))"在 .env(或你的 Portainer 栈环境)中:
TRMM_API_URL=https://api.yourdomain.com
TRMM_API_KEY=<read-only service-user key>
TRMM_MCP_TRANSPORT=http
TRMM_MCP_AUTH_TOKEN=<the token you just generated>如果没有 TRMM_MCP_AUTH_TOKEN,服务器在 http 模式下会拒绝启动。
2. 用 Docker / Portainer
docker compose up -d --build
curl http://localhost:8080/healthz # -> {"status":"ok",...}在 Portainer 中从这个仓库部署一个 stack,并在该 stack 上设置环境变量——与现有的 build → push → Portainer webhook 重新部署流程一致。镜像以非 root 用户运行,并带有其对 /healthz 的 Docker HEALTHCHECK。
3. 放到 HTTPS + 一个网络门禁后面
在容器前面终止 TLS 并控制访问权限——推荐使用反向代理(Caddy / Nginx / Traefik)提供例如 https://trmm-mcp.example.com,放在 VPN 或 Cloudflare Access 后面。bearer token 只是纵深防御的一层,不是唯一防线。切勿将 8080 端口未经认证直接暴露到公网。
4. 连接 Claude(Claude Code / Desktop)
远端的 .mcp.json —— 成员电脑上无需 Python、代码仓库或 TRMM key:
{
"mcpServers": {
"trmm": {
"type": "http",
"url": "https://trmm-mcp.example.com/mcp",
"headers": { "Authorization": "Bearer <shared-token>" }
}
}
}claude.ai 网页版和移动端
网页 / 移动端自定义连接器 UI 使用 OAuth 认证,而不是静态 header —— 因此上面的 bearer token 方案覆盖的是 Claude Code + Desktop 的。对于网页版和移动端,在服务器前再套一层 Cloudflare Tunnel + 一个 MCP Server Portal:它会向 Claude 完成 OAuth/SSO(Entra)流程,并在上游注入 bearer token,所以不需要额外的服务器代码。完整步骤:docs/REMOTE_OAUTH_CLOUDFLARE.md。使用docker-compose.cloudflare.yml(带有 sidecar,不发布端口)。
端点
路径 | 认证 | 用途 |
| Bearer | 客户端实际连接的 MCP 端点 |
| 无 | Docker / 容器编排器使用的健康检查探针 |
用 MCP Inspector 测试
npx @modelcontextprotocol/inspector \
-e TRMM_API_URL=https://api.yourdomain.com \
-e TRMM_API_KEY=your-readonly-key \
-- python server.py然后在 Inspector UI 中:列出工具,调用 trmm_list_clients,再尝试 trmm_search_audit_log 并传入 within_days: 7,确认分页和审计日志过滤器在实时数据上工作正常。
评测
evaluation.xml 包含 10 个只读 MSP 相关的问题,并带验证过的答案。使用随 mcp-builder 技能提供的测试工具运行它们:
python scripts/evaluation.py \
-t stdio -c python -a server.py \
-e TRMM_API_URL=https://api.yourdomain.com \
-e TRMM_API_KEY=your-readonly-key \
-o evaluation_report.md \
evaluation.xml
evaluation.xml中的答案是针对其验证时的那个实例;换用不同数据集时需要重新生成。
安全说明
所有机密都只来自环境变量;不向 stdout 记录任何内容(stdio 服务器必须保持 stdout 干净——诊断请写到 stderr)。
错误会被转化为可操作的提示,区分认证(401)、权限(403)、未找到(404)、网络/超时等(404)等情况,且不泄露内部实现。
此服务器不会调用任何会改变状态的 API。将来如果需要类似有修改能力的动作服务器,那将是另一个独立项目的范畴。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables read-only access to SentinelOne's platform through MCP, allowing security investigations, threat hunting, and asset inventory queries via natural language.MIT

KVMFleet MCP Serverofficial
AlicenseAqualityCmaintenanceRead-only MCP server that allows AI assistants to query and monitor KVM Fleet devices, audit logs, and console sessions through the official REST API.5141MIT- AlicenseNot gradedqualityBmaintenanceEnables read-only interaction with App Store Connect via MCP tools, including listing apps, versions, builds, and review submissions, with compliance boundaries and no write operations by default.MIT
- AlicenseAqualityCmaintenanceRead-only MCP server for the Action1 RMM REST API, enabling access to endpoints, missing updates, vulnerabilities, installed software, policies, automations, and reports.21Apache 2.0
Related MCP Connectors
Read-only MCP access to sessions, funnels, campaigns, errors, live visitors, and anomalies.
Read-only Dant3 MCP for public rooms, agents, jobs and provisional machine onboarding.
Read-only Remote MCP for externally grounded AI agent trust receipts.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/JohnGilligan2/tactical-rmm-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server