{
  "markdown": "# NinjaOne MCP Server\n\nA Model Context Protocol (MCP) server for interacting with NinjaOne, featuring a decision tree architecture for efficient tool loading.\n\n\n## One-Click Deployment\n\n> [!IMPORTANT]\n> **Before you click:** this server depends on `@wyre-ai/node-ninjaone`,\n> which is hosted on the **GitHub Packages** npm registry. GitHub Packages has no\n> anonymous access — even though the package is public, every `npm install` needs a\n> token. The cloud builder runs `npm install` for you, so you must give it one, or\n> the build fails with `npm error 401 Unauthorized ... npm.pkg.github.com`.\n>\n> 1. Create a GitHub **Personal Access Token** with the `read:packages` scope\n>    ([classic token](https://github.com/settings/tokens/new?scopes=read:packages&description=ninjaone-mcp%20deploy)).\n>    Any GitHub account works — you do **not** need to be a member of the\n>    `wyre-ai` org to read its public packages.\n> 2. Add it as a build variable when prompted by the deploy flow:\n>    - **Cloudflare Workers** → set a build variable named **`NODE_AUTH_TOKEN`** to your PAT\n>      (Workers → Settings → Build → Variables and Secrets).\n>    - **DigitalOcean App Platform** → set an encrypted env var named **`GITHUB_TOKEN`**\n>      with scope **Build Time** to your PAT (the `.do/app.yaml` already declares it).\n\n[![Deploy to DO](https://www.deploytodo.com/do-btn-blue.svg)](https://cloud.digitalocean.com/apps/new?repo=https://github.com/WYRE-AI/ninjaone-mcp/tree/main)\n\n[![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/WYRE-AI/ninjaone-mcp)\n\n> [!NOTE]\n> Both targets run the **full** MCP server. DigitalOcean builds the Docker image and\n> serves it over HTTP; Cloudflare Workers serves the same server via the SDK's Web\n> Standard Streamable HTTP transport (`src/worker.ts`). After deploying, set your\n> NinjaOne credentials as secrets — `NINJAONE_CLIENT_ID`, `NINJAONE_CLIENT_SECRET`,\n> and optionally `NINJAONE_REGION` — or set `AUTH_MODE=gateway` to take credentials\n> per-request from `X-Ninja-*` headers. The MCP endpoint is `/mcp`; `/health` is an\n> unauthenticated liveness probe.\n\n## Architecture\n\nThis MCP server uses a **hierarchical tool loading approach** instead of exposing all tools upfront:\n\n1. **Navigation Phase**: Initially exposes only a navigation tool (`ninjaone_navigate`)\n2. **Domain Selection**: User selects a domain (devices, organizations, alerts, tickets)\n3. **Domain Tools**: Server exposes domain-specific tools after selection\n4. **Lazy Loading**: Domain handlers and the NinjaOne client are loaded on-demand\n\nThis architecture provides:\n- Reduced cognitive load (fewer tools to choose from)\n- Faster initial load times\n- Better organization of related operations\n- Clear navigation state\n\n## Installation\n\nThis package is published to the **GitHub Packages** npm registry, which requires a\ntoken even for public packages. Authenticate once, then install:\n\n```bash\n# Authenticate npm to GitHub Packages (token needs the read:packages scope)\nexport NODE_AUTH_TOKEN=$(gh auth token)   # or a PAT with read:packages\n\nnpm install @wyre-ai/ninjaone-mcp\n```\n\nThe repo's `.npmrc` already points the `@wyre-ai` scope at GitHub Packages and\nreads the token from `NODE_AUTH_TOKEN`, so no further config is needed. The same applies\nto `npx @wyre-ai/ninjaone-mcp` below. Prefer a zero-setup option? Use the prebuilt\ncontainer image (`ghcr.io/wyre-ai/ninjaone-mcp`) or the `.mcpb` bundle attached to\neach [release](https://github.com/WYRE-AI/ninjaone-mcp/releases).\n\n## Configuration\n\nSet the following environment variables:\n\n| Variable | Required | Description |\n|----------|----------|-------------|\n| `NINJAONE_CLIENT_ID` | Yes | OAuth 2.0 Client ID |\n| `NINJAONE_CLIENT_SECRET` | Yes | OAuth 2.0 Client Secret |\n| `NINJAONE_REGION` | No | Region: `us` (default), `eu`, `oc`, `ca`, `us2`, or `fed` |\n| `NINJAONE_SCOPES` | No | OAuth scopes to request. Defaults to `monitoring,management`. Set this if your API app is granted a narrower set — see [OAuth scopes](#oauth-scopes) |\n\n### NinjaOne API Regions\n\n| Region | Base URL |\n|--------|----------|\n| `us` | `https://app.ninjarmm.com` |\n| `eu` | `https://eu.ninjarmm.com` |\n| `oc` | `https://oc.ninjarmm.com` |\n| `ca` | `https://ca.ninjarmm.com` |\n| `us2` | `https://us2.ninjarmm.com` |\n| `fed` | `https://fed.ninjarmm.com` |\n\n## Usage\n\n### Running Standalone\n\n```bash\n# Set credentials\nexport NINJAONE_CLIENT_ID=\"your-client-id\"\nexport NINJAONE_CLIENT_SECRET=\"your-client-secret\"\nexport NINJAONE_REGION=\"us\"\n\n# Run the server\nnpx @wyre-ai/ninjaone-mcp\n```\n\n### Claude Desktop Configuration\n\nAdd to your Claude Desktop `claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"ninjaone\": {\n      \"command\": \"npx\",\n      \"args\": [\"@wyre-ai/ninjaone-mcp\"],\n      \"env\": {\n        \"NINJAONE_CLIENT_ID\": \"your-client-id\",\n        \"NINJAONE_CLIENT_SECRET\": \"your-client-secret\",\n        \"NINJAONE_REGION\": \"us\"\n      }\n    }\n  }\n}\n```\n\n### Docker\n\n```bash\ndocker build -t ninjaone-mcp .\ndocker run -e NINJAONE_CLIENT_ID=xxx -e NINJAONE_CLIENT_SECRET=xxx -e NINJAONE_REGION=us ninjaone-mcp\n```\n\n## Available Domains\n\n### Devices\nManage endpoints, reboot devices, view services and alerts.\n\nTools:\n- `ninjaone_devices_list` - List devices, filterable by organization, device class, and online status. Paginated: a full page returns `hasMore: true` and a `cursor` to pass back for the next page.\n- `ninjaone_devices_get` - Get device details\n- `ninjaone_devices_reboot` - Schedule a device reboot\n- `ninjaone_devices_services` - List Windows services on a device\n- `ninjaone_devices_alerts` - Get device-specific alerts\n- `ninjaone_devices_activities` - View device activity log\n- `ninjaone_devices_get_custom_fields` - Get device custom fields\n- `ninjaone_devices_update_custom_fields` - Update device custom fields\n\n### Organizations\nManage customer organizations and their resources.\n\nTools:\n- `ninjaone_organizations_list` - List organizations\n- `ninjaone_organizations_get` - Get organization details\n- `ninjaone_organizations_create` - Create a new organization\n- `ninjaone_organizations_locations` - List organization locations\n- `ninjaone_organizations_devices` - List devices for an organization\n- `ninjaone_organizations_get_custom_fields` - Get organization custom fields\n- `ninjaone_organizations_update_custom_fields` - Update organization custom fields\n\n### Alerts\nView and manage alerts across all devices.\n\nTools:\n- `ninjaone_alerts_list` - List alerts with filters\n- `ninjaone_alerts_get` - Get a single alert by UID (renders as an interactive card in MCP Apps hosts)\n- `ninjaone_alerts_reset` - Reset/dismiss a single alert\n- `ninjaone_alerts_reset_all` - Reset all alerts for a device or organization\n- `ninjaone_alerts_summary` - Get alert count summary\n\nFeatures:\n- **Interactive Alert Card (MCP Apps, SEP-1865)**: `ninjaone_alerts_get` renders as an interactive card in MCP Apps hosts (Claude Desktop/web) with an in-card \"Reset alert\" round-trip via `ninjaone_alerts_reset`; neutral by default, brandable via `window.__BRAND__` injection or `MCP_BRAND_*` env vars; plain-JSON behavior is unchanged in other hosts\n\n### Tickets\nManage service tickets.\n\nTools:\n- `ninjaone_tickets_list` - List tickets from a board (requires `board_id`; `status`/`organization_id`/`device_id` filters are applied client-side, see notes below)\n- `ninjaone_tickets_get` - Get ticket details\n- `ninjaone_tickets_create` - Create a new ticket\n- `ninjaone_tickets_update` - Update an existing ticket\n- `ninjaone_tickets_add_comment` - Add a comment to a ticket\n- `ninjaone_tickets_comments` - Get ticket comments\n- `ninjaone_tickets_boards_list` - List ticket boards (to discover `board_id` values)\n\n> **Note:** NinjaOne queries tickets per board, and board IDs vary by tenant —\n> board 1 is *not* always the \"All Tickets\" board, so `ninjaone_tickets_list`\n> requires an explicit `board_id` rather than silently guessing one. Discover\n> IDs with `ninjaone_tickets_boards_list`; on tenants where that endpoint\n> returns 404, read the numeric ID from the board link's URL in the NinjaOne\n> web UI (e.g. the \"All tickets\" sidebar link).\n>\n> **Note:** NinjaOne's board-run API cannot filter tickets by status,\n> organization, or device server-side (attempting to throws a generic\n> `Bad request`). `ninjaone_tickets_list` therefore applies those filters\n> **client-side within one board page**. The response separates `count` (matches\n> in this page) from `scanned` (tickets examined) and includes `hasMore`/`cursor`\n> — page through until `hasMore` is `false` to get every match, and never treat a\n> single page's `count` as a board-wide total. Status is matched against each\n> ticket's status display name, so custom board statuses may not map to the\n> `OPEN`/`IN_PROGRESS`/`WAITING`/`CLOSED` values.\n>\n> Similarly, `ninjaone_devices_list` filters by `organization_id` through\n> NinjaOne's dedicated per-organization endpoint (the general `df=org` device\n> filter is unreliable and can silently return the full fleet).\n\n## Navigation Tools\n\nAlways available:\n- `ninjaone_navigate` - Select a domain to work with\n- `ninjaone_status` - Show current state and credential status\n- `ninjaone_back` - Return to main menu (when in a domain)\n\n## Example Workflow\n\n```\nUser: Check my devices\nClaude: [calls ninjaone_navigate with domain=\"devices\"]\n       -> Navigated to devices domain. Available tools: ...\n\nUser: List all Windows servers\nClaude: [calls ninjaone_devices_list with device_class=\"WINDOWS_SERVER\"]\n       -> [device list results]\n\nUser: Now show me alerts\nClaude: [calls ninjaone_back]\n       -> Navigated back to main menu.\n       [calls ninjaone_navigate with domain=\"alerts\"]\n       -> Navigated to alerts domain.\n```\n\n## Authentication\n\nNinjaOne uses OAuth 2.0 for authentication. You need to:\n\n1. Log in to your NinjaOne dashboard\n2. Go to Administration > Apps > API\n3. Create a new API application (application platform: **API Services**, grant type **Client Credentials**)\n4. Grant it the scopes you need — see below\n5. Note the Client ID and Client Secret\n6. Configure the environment variables\n\nThe client library handles token refresh automatically.\n\n### OAuth scopes\n\nBy default the server requests `monitoring management`. Which scopes you actually\nneed depends on what you use:\n\n| Scope | Needed for |\n|-------|-----------|\n| `monitoring` | All read operations — listing devices, organizations, alerts, and tickets |\n| `management` | Write operations — rebooting devices, resetting alerts, creating/updating tickets and organizations |\n| `control` | Not used by this server |\n\n**If your API app is granted fewer scopes than the default, set `NINJAONE_SCOPES`\nto match.** NinjaOne rejects a token request that asks for a scope the app was\nnever granted — it returns `400 invalid_scope` rather than narrowing the grant —\nso the failure happens at the token exchange and *every* tool call fails, including\nreads. For a monitoring-only app:\n\n```bash\nexport NINJAONE_SCOPES=\"monitoring\"\n```\n\nValues may be comma- or space-separated and are case-insensitive. In gateway\ndeployments the same value can be supplied per request via the `X-Ninja-Scopes`\nheader.\n\n## License\n\nApache-2.0\n",
  "bytes": 11262,
  "sha": "8b9a82ccfa0d9e283881088a5ab6e87f246e3f51facb121929487c6007f63095",
  "repo_slug": "wyre-technology/ninjaone-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_wyre_technology_ninjaone_mcp_e97da2a0/readme"
}