mcp-trmm

by Nels2

2 stars
168 downloads
Not rated
GitHub

About

This repo provides an MCP server to interact with an tRMM Instance. https://docs.tacticalrmm.com/functions/api/

Details

Author
Nels2
GitHub stars
2
Downloads
168
Categories
Other

- Small, curated tool surface for common IT operations.
- Model-friendly strongly-named tools with simple arguments.
- Read-first behavior encourages inspection before action.
- Backend-owned request formatting (no raw API paths).
- Safer operations with limited destructive tools.
- Consistent result handling and structured error reporting.

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name mcp-trmm
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Run the FastAPI app with Uvicorn: uvicorn server:app --host 0.0.0.0 --port 8000. The server mounts the MCP ASGI app at /mcp and includes bearer token protection and a /healthz endpoint. Connect an MCP client to the server’s URL to use the tools.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "mcp-trmm": {
            "mcp-trmm": {
                "command": "python",
                "args": [
                    "03_llm_cli__rag.py"
                ]
            }
        }
    }
}

McpServers

{
    "mcp-trmm": {
        "command": "python",
        "args": [
            "03_llm_cli__rag.py"
        ]
    }
}

TRMM MCP Server

A focused MCP server for TRMM-style remote management operations.

This project exposes a curated set of MCP tools for common IT operations tasks such as:

- agent lookup and control
- checks
- scripts
- services
- software
- Windows updates
- reporting
- alerts
- automation
- tasks

The server is designed specifically for local or smaller models that are not reliable at constructing raw API paths, HTTP methods, or JSON payloads.

Instead of exposing one generic “call any endpoint” tool, this server exposes small, strongly-named tools with only a few arguments. The backend then translates those arguments into valid API requests.

Why this exists

Smaller local models tend to struggle with:

- choosing the correct endpoint
- selecting the right HTTP method
- building valid JSON payloads
- keeping IDs and object types straight
- avoiding destructive or overly broad actions

This server solves that by giving the model:

- a small tool surface
- explicit tool names
- simple arguments
- backend-side request translation
- consistent result handling

In short, the model decides what it wants to do, and the backend decides how to call the real API.

---

Architecture

The project is split into four main layers:

server.py

Hosts the FastAPI application and mounts the MCP ASGI app at /mcp.

Also includes:

- bearer token protection for the MCP route
- a simple /healthz endpoint

rmm_tools.py

Defines the MCP tools exposed to the model.

These are the only functions the model should see.

Examples:

- list_agents()
- get_agent(agent_id)
- reboot_agent(agent_id, mode="normal")
- run_agent_command(agent_id, command, shell="cmd")

translator.py

Converts model-friendly arguments into actual API requests.

This layer handles:

- endpoint selection
- method selection
- JSON body construction
- argument normalization
- simple action mapping

Example:

- model calls reboot_agent(agent_id="abc", mode="force")
- translator turns that into PATCH /agents/{agent_id}/reboot/ with the correct request body

api_client.py

Sends the final HTTP request to the upstream TRMM/PAI API and returns a normalized result object.

This layer handles:

- authentication headers
- timeouts
- JSON parsing
- status handling
- structured error reporting

---

Design goals

This MCP server is intentionally opinionated.

1. Small tool surface

The server only includes useful tools, not every endpoint in the upstream schema.

2. Model-friendly tools

Each tool is designed to be easy for a smaller model to call correctly.

3. Read-first behavior

Where possible, the model should inspect first and act second.

4. Backend-owned request formatting

The model should never be responsible for building raw endpoint paths or request payloads.

5. Safer operations

Destructive or state-changing tools are kept limited and clearly named.

---

Current tool coverage

Agents

- list_agents - get_agent - get_agent_history - get_agent_notes - create_agent_note - get_agent_tasks - create_agent_task - reboot_agent - shutdown_agent - wake_agent - run_agent_command - run_agent_script - get_agent_eventlog - list_agent_processes - get_agent_process - kill_agent_process

Checks

- list_checks - get_check - list_agent_checks - run_checks - run_checks_for_agent - reset_check - reset_all_checks_for_agent

Software

- get_agent_software - uninstall_agent_software - list_choco_packages

Windows Updates

- get_agent_winupdates - scan_agent_winupdates - install_agent_winupdates

Services

- list_agent_services - get_agent_service - control_agent_service

Scripts

- list_scripts - get_script - download_script - test_script_on_agent

Reporting

- list_report_history - run_report_history - list_report_schedules - get_report_schedule - run_report_schedule

Alerts

- get_alert - update_alert_status

Automation

- get_automation_policies_overview - get_automation_policy - list_automation_policy_checks - list_automation_policy_tasks - run_automation_task - get_automation_task_status - get_automation_check_status

Tasks

- list_tasks - get_task - run_task

---

What is intentionally not included

This server does not attempt to expose every endpoint from the upstream schema.

The following kinds of endpoints are intentionally avoided unless they are truly needed:

- generic CRUD for every object type
- broad administrative mutation endpoints
- highly ambiguous update endpoints
- raw pass-through API tools
- configuration-heavy endpoints that require large request bodies
- tools that overlap too heavily with clearer existing tools

This keeps the model from being overwhelmed and reduces incorrect tool selection.

---

Example tool behavior

Example 1: Reboot an agent by name

The model should:

1. call list_agents
2. identify the correct agent
3. call reboot_agent(agent_id, mode="normal")

Example 2: Investigate a service issue

The model should:

1. find the agent
2. call get_agent_service(...) or list_agent_services(...)
3. inspect the result
4. only then call control_agent_service(...) if requested or clearly appropriate

Example 3: Check Windows updates

The model should:

1. call get_agent_winupdates(agent_id)
2. inspect the result
3. only call scan_agent_winupdates(...) or install_agent_winupdates(...) when requested

---

Running the server

Start the FastAPI app with Uvicorn:

```bash
uvicorn server:app --host 0.0.0.0 --port 8000

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.