NinjaOne MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@NinjaOne MCP Server List all devices and their active alerts"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
NinjaOne MCP Server
A comprehensive Model Context Protocol (MCP) server that integrates NinjaOne RMM with Claude. Manage devices, automate IT tasks, handle ticketing, monitor patch status, and execute remote scriptsβall through natural language conversation with Claude AI.
What is an MCP? A Model Context Protocol server extends Claude's capabilities by providing access to external systems and APIs. This server bridges Claude and NinjaOne, enabling AI-powered IT management.
β¨ Key Features
π₯οΈ Device Management
List, search, and get detailed information about devices
Monitor device status, health, and connectivity
Track active alerts and notifications
Search devices using NinjaOne filter syntax
π Device Actions
Reboot devices (graceful or forced)
Execute scripts and built-in actions remotely
Automate IT tasks across your infrastructure
π§ Patch & Software Management
View OS and software patch status
Track patch compliance
Inventory installed software across devices
Identify outdated or vulnerable software
π« Ticketing System
Create support tickets programmatically
Query existing tickets
Update ticket information
Add comments and notes
π Reporting & Monitoring
Device health reports
Antivirus status across fleet
Organization-wide reporting
Custom queries via generic API access
π Enterprise Security
OAuth 2.0 authentication with automatic token refresh
No credentials in version control (environment variables only)
Full support for NinjaOne's security model
TypeScript for type safety
βοΈ Production Ready
Node.js 20 LTS
Comprehensive error handling
Pagination support for large datasets
20+ API tools for complete NinjaOne integration
Related MCP server: datto-rmm-mcp
π Quick Start
Prerequisites
Node.js 20 LTS or higher (Download)
npm (included with Node.js)
NinjaOne account with API access
Claude Desktop (for MCP integration)
Installation (5 minutes)
Clone the repository:
git clone https://github.com/SoroushAlamdari/ninjaone-mcp.git
cd ninjaone-mcpInstall dependencies:
npm installBuild the server:
npm run buildConfigure NinjaOne credentials (see OAuth Setup below)
π OAuth Setup (Required)
This server uses OAuth 2.0 client credentials flow for secure API access. Follow these steps:
Step 1: Create OAuth Application in NinjaOne
Log into your NinjaOne Dashboard
Go to Admin/Settings β API β Client app IDs
Click + Create application
Fill in the form:
Application platform:
API Services (machine-to-machine)Name:
Claude MCP(or your preferred name)Scopes: Check
Monitoring,Management,ControlAllowed grant types: Check
Client credentials
Click Create and copy the generated credentials
Step 2: Add Credentials to Environment
Create a .env file in the project root:
cp .env.example .envEdit .env and add your credentials:
NINJA_CLIENT_ID=<your_client_id_here>
NINJA_CLIENT_SECRET=<your_client_secret_here>
NINJA_API_BASE_URL=https://your-instance.ninjarmm.comβ οΈ Security: Never commit
.envortoken.jsonto version control..gitignorecovers both. Keep real values out of.env.exampleβ it is committed.
How tokens are handled
On start the server loads
token.jsonif present, otherwise requests a token with client credentials.Before each API call it renews the token if it is within a minute of expiry, and if NinjaOne still answers
401it renews once and retries.Every new token is saved to
token.json, so restarts don't break the connection.
Alternative: browser login (Web app + refresh token)
If you can only use a Web client app, enable the Authorization code and Refresh token grants on it, then run once:
node get-oauth-token.jsOpen the printed link, sign in, and the token (with refresh token) is saved to token.json. The script reads credentials from .env or from your Claude Desktop config. If NinjaOne answers Invalid scope offline_access, the app isn't allowed refresh tokens β use the API Services app above instead.
π€ Claude Desktop Integration
Windows Setup
Edit Claude Desktop config:
Open:
C:\Users\YourUsername\AppData\Roaming\Claude\claude_desktop_config.jsonOr use:
%APPDATA%\Claude\claude_desktop_config.json
Add this to the
mcpServerssection:
{
"mcpServers": {
"ninjaone-mcp": {
"command": "node",
"args": [
"C:\\Users\\YourUsername\\ninjaone-mcp\\dist\\index.js"
],
"env": {
"NINJA_CLIENT_ID": "<your_client_id>",
"NINJA_CLIENT_SECRET": "<your_client_secret>",
"NINJA_API_BASE_URL": "https://your-instance.ninjarmm.com"
}
}
}
}macOS Setup
Edit Claude Desktop config:
Run:
nano ~/.claude/claude_desktop_config.json
Add MCP configuration (same structure as Windows above, using macOS paths):
{
"mcpServers": {
"ninjaone-mcp": {
"command": "node",
"args": [
"/Users/YourUsername/ninjaone-mcp/dist/index.js"
],
"env": {
"NINJA_CLIENT_ID": "<your_client_id>",
"NINJA_CLIENT_SECRET": "<your_client_secret>",
"NINJA_API_BASE_URL": "https://your-instance.ninjarmm.com"
}
}
}
}3. Start Using It
Close and reopen Claude Desktop
Look for the NinjaOne connector in the Connectors panel
Start using the tools:
"List all my devices" "Show me critical alerts" "Get patch status for my servers" "Create a ticket for offline devices" "Run an inventory scan on all workstations"
Verification Checklist
NinjaOne MCP appears in Claude Desktop Connectors list
All 20+ tools are visible (no "no tools available" message)
Test with:
"List my devices"Devices appear in the response
π Available Tools (20+ API Functions)
Device Management (5 tools)
Tool | Purpose |
| List all devices with pagination and filtering |
| Get detailed information about a specific device |
| Search devices using NinjaOne filter syntax |
| Get active alerts for a device |
| Get all active alerts across your fleet |
Device Actions (2 tools)
Tool | Purpose |
| Reboot a device (graceful or forced shutdown) |
| Execute a script or built-in action on a device |
Patch Management (2 tools)
Tool | Purpose |
| View OS patch status for a device |
| View software patch status for a device |
Software & Inventory (1 tool)
Tool | Purpose |
| View installed software on a device |
Ticketing (4 tools)
Tool | Purpose |
| Create a new support ticket |
| Retrieve ticket details |
| Update ticket information and status |
| Add a comment to a ticket |
Organization & Contacts (3 tools)
Tool | Purpose |
| List all organizations |
| Get organization details |
| List all contacts in your account |
Reports & Monitoring (2 tools)
Tool | Purpose |
| Generate a device health report |
| Get antivirus status across all devices |
Advanced/Generic API (2 tools)
Tool | Purpose |
| Make a GET request to any NinjaOne API endpoint |
| Make a POST request to any NinjaOne API endpoint |
π¬ Example Use Cases
Ask Claude any of these:
"List all my devices and show their status"
"Which devices haven't checked in for more than 24 hours?"
"Show me all critical and high-severity alerts"
"Get patch compliance report for all Windows servers"
"Create a ticket for all offline devices"
"Search for all devices with antivirus disabled"
"Run a compliance script on all workstations in Location XYZ"
"Show me devices running outdated versions of software"
"Get a summary of device health across the organization"
"Which devices need OS updates?"π‘ API Methods & Endpoints
All tools communicate with NinjaOne API v2.0 using the following base URL:
https://<your-instance>.ninjarmm.com/api/v2Authentication Header
All requests include:
Authorization: Bearer <access_token>
Content-Type: application/jsonTool Reference with API Methods
Tool | HTTP Method | Endpoint | Description |
| GET |
| Retrieve paginated device list |
| GET |
| Get single device details |
| GET |
| Search using filter syntax |
| GET |
| Get alerts for device |
| GET |
| Get all active alerts |
| POST |
| Initiate device reboot |
| POST |
| Execute script on device |
| GET |
| Get OS patch status |
| GET |
| Get software patch status |
| GET |
| Get installed software |
| POST |
| Create support ticket |
| GET |
| Get ticket details |
| PATCH |
| Update ticket |
| POST |
| Add ticket comment |
| GET |
| List all organizations |
| GET |
| Get org details |
| GET |
| List all contacts |
| GET |
| Get device health report |
| GET |
| Get antivirus report |
| GET |
| Custom GET request |
| POST |
| Custom POST request |
Example API Calls
List Devices (with pagination):
curl -X GET "https://your-instance.ninjarmm.com/api/v2/devices?pageNo=1&pageSize=50" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json"Get Device Details:
curl -X GET "https://your-instance.ninjarmm.com/api/v2/devices/12345" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"Search Devices with Filter:
curl -X GET "https://your-instance.ninjarmm.com/api/v2/devices?filter=status=online" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"Create a Ticket:
curl -X POST "https://your-instance.ninjarmm.com/api/v2/tickets" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Device Offline",
"description": "Device XYZ is offline",
"priority": "high"
}'Reboot a Device:
curl -X POST "https://your-instance.ninjarmm.com/api/v2/devices/12345/reboot" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"mode": "graceful"}'NinjaOne API Documentation
For complete API reference and additional endpoints:
Main API Docs: https://app.ninjarmm.com/apidocs
Beta API: https://app.ninjarmm.com/apidocs-beta/core-resources
Authorization: https://app.ninjarmm.com/apidocs-beta/authorization/overview
π οΈ Development
Build Production Code
npm run buildWatch Mode (Auto-rebuild on changes)
npm run devType Checking
npm run type-checkRun Tests
npm testProject Structure
ninjaone-mcp/
βββ src/
β βββ index.ts # MCP server entry point
β βββ api-client.ts # NinjaOne API wrapper
β βββ oauth.ts # OAuth 2.0 handling
β βββ tools.ts # Tool definitions
β βββ types.ts # TypeScript interfaces
βββ dist/ # Compiled JavaScript (auto-generated)
βββ package.json
βββ tsconfig.json
βββ README.mdπ Security Best Practices
β Do:
β Use
.envfile for credentials (already in.gitignore)β Rotate OAuth credentials regularly
β Limit API scopes to what you need
β Use strong, unique client secrets
β Monitor API usage in NinjaOne
β Don't:
β Commit
.envfile to version controlβ Share credentials or secrets
β Use credentials in code or logs
β Store secrets in comments
β Log sensitive information
π Troubleshooting
"NinjaOne MCP connector not appearing in Claude Desktop"
Verify
dist/index.jsexists:ls dist/Rebuild:
npm run buildCheck JSON syntax: Use jsonlint.com
Close and fully reopen Claude Desktop (don't just restart)
Check file paths match your installation
"Invalid or missing credentials"
Verify credentials in
.envfile (not in config file)Check for extra spaces or quotes in values
Regenerate credentials in NinjaOne if unsure
Ensure API application has correct scopes: Monitoring, Management, Control
"Cannot find module errors"
Run:
npm installDelete
node_modulesfolder and reinstall:rm -rf node_modules && npm install
"node: command not found"
Verify Node.js 20+ is installed:
node --versionOn Windows, use full path or add Node to PATH
On macOS/Linux, ensure
/usr/local/binis in PATH
Enable Debug Logging
Set environment variable and rebuild:
export DEBUG=1 # Linux/macOS
set DEBUG=1 # Windows
npm run buildπ API Documentation
For detailed NinjaOne API documentation:
π License
MIT License - See LICENSE file for details
Free to use, modify, and distribute.
π€ Contributing
Contributions welcome! Please:
Fork the repository
Create a feature branch
Test your changes
Submit a pull request
π‘ Support
Issues: Use GitHub Issues
API Help: NinjaOne Support
MCP Spec: Model Context Protocol
π Project Stats
Language: TypeScript
Runtime: Node.js 20 LTS
API Integration: NinjaOne RMM v2.0
Protocol: Model Context Protocol (MCP)
Authentication: OAuth 2.0
Tools: 20+
Available Tools
21 toolsadd_ticket_commentC
Add a comment to a ticket
Inputs: comment (required), ticket_id (required).
api_getC
Make a generic GET request to any NinjaOne API endpoint
Inputs: path (required).
api_postC
Make a generic POST request to any NinjaOne API endpoint
Inputs: data (required), path (required).
create_ticketC
Create a new support ticket
Inputs: title (required), priority, description.
get_all_alertsB
Get all active alerts across all devices
Inputs: pageNo, pageSize.
get_antivirus_statusC
Get antivirus status report
Inputs: no named parameters.
get_deviceB
Get detailed information about a specific device
Inputs: device_id (required).
get_device_alertsB
Get active alerts for a specific device
Inputs: device_id (required).
get_device_healthB
Get device health report
Inputs: no named parameters.
get_device_softwareC
Get software inventory for a device
Inputs: device_id (required).
get_organizationC
Get organization details
Inputs: org_id (required).
get_os_patchesC
Get OS patches status for a device
Inputs: device_id (required).
get_software_patchesC
Get software patches status for a device
Inputs: device_id (required).
get_ticketC
Get ticket details
Inputs: ticket_id (required).
list_contactsB
List all contacts
Inputs: no named parameters.
list_devicesC
List all devices in the NinjaOne system with optional pagination and filtering
Inputs: filter, pageNo, pageSize.
list_organizationsC
List all organizations
Inputs: no named parameters.
reboot_deviceC
Reboot a device
Inputs: device_id (required), mode.
run_scriptC
Run a script or built-in action on a device
Inputs: device_id (required), script_id (required), parameters.
search_devicesC
Search for devices using filter syntax
Inputs: filter (required).
update_ticketC
Update a ticket
Inputs: ticket_id (required), title, status, description.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 21 tools
Most specific tools target distinct resources and actions, but generic api_get/api_post overlap with nearly every read/create tool, and list_devices versus search_devices has fuzzy boundaries. Descriptions help, but an agent could reasonably misselect between generic and specific tools or between list and search.
Nearly all tools use a predictable snake_case verb_noun pattern such as list_devices, get_ticket, create_ticket, and run_script. api_get and api_post are minor deviations since they read as resource_verb rather than verb_resource, but overall the naming is consistent.
At 21 tools this is above the typical 3-15 range, but NinjaOne is a broad RMM domain covering devices, alerts, patches, software, tickets, organizations, health, antivirus, and contacts. The tools mostly earn their place, though the generic api_* tools add some redundancy.
Core areas are covered for devices, alerts, patches, software, tickets, organizations, health, antivirus, and contact listing, but there are notable lifecycle gaps such as no list_tickets, no contact get/create/update/delete, and no organization create/update. The generic api_get/api_post partially mitigate these gaps but do not cover full CRUD because they only expose GET and POST.
Maintenance
Related MCP Connectors
Connect Claude to your Platform7n workspaces: chat, links, work and decks. One-click OAuth.
Connect Claude to your Platform7n workspaces: chat, links, work and decks. One-click OAuth.
Manage your IoT device fleet directly from Claude. Create device templates with datastreams and events, provision new devices, read live sensor data, and control outputs. The Blynk connector integrates with the Blynk IoT platform, enabling direct configuration and monitoring of connected devices and infrastructure.
Read and write Sage Intacct from Claude or ChatGPT. Write tools are flagged for approval.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables MCP clients to interact with NinjaOne, providing tools for managing devices, organizations, alerts, and tickets. Uses a decision tree architecture to load domain-specific tools on demand.Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables Claude to interact with Datto RMM accounts for device, alert, site, and quick job management through natural language.Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables management of NinjaOne devices, organizations, alerts, and tickets through natural language, using a navigation-based tool selection for efficient interaction.Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to interact with the NinjaOne platform for managing devices, organizations, alerts, and tickets through a decision-tree tool-loading architecture.Apache 2.0