NinjaOne MCP
A local MCP server that enables searching, reading, creating, updating, and commenting on NinjaOne tickets through natural language.
README
NinjaOne MCP
A local Model Context Protocol server for NinjaOne ticketing. It lets any MCP client (Claude Desktop, Claude Code, and others) search, read, create, update, and comment on NinjaOne tickets.
Runs locally over stdio using your own NinjaOne OAuth credentials. No third-party service sits in the middle.
Tools
| Tool | Description |
|---|---|
search_tickets |
List tickets from a board (paginated) |
get_ticket |
Get a single ticket by ID |
create_ticket |
Create a ticket |
update_ticket |
Update a ticket (status, priority, severity, assignee, subject) |
add_comment |
Add a public response or private note to a ticket |
list_statuses |
List ticket statuses with IDs |
list_organizations |
List organizations (clients) |
list_technicians |
List technicians with their numeric IDs |
list_boards |
Return the default board ID |
get_auth_url / exchange_code |
Manual OAuth flow to obtain a user refresh token |
Prerequisites
- Node.js 18+
- A NinjaOne API OAuth client (NinjaOne > Administration > Apps > API):
- Client ID and Client Secret
- Scopes:
monitoring(reads) andmanagement(ticket writes) - For user-context writes (comments authored as you), enable the Authorization Code grant and the
offline_accessscope, and register a redirect URI (http://localhost:3846/for the built-in flow, orhttps://localhostif you useget-refresh-token.js).
Install
git clone https://github.com/cyberkoder/ninjaone-mcp.git
cd ninjaone-mcp
npm install
Configuration
All configuration is via environment variables (see .env.example):
| Variable | Required | Notes |
|---|---|---|
NINJA_BASE_URL |
yes | Your region's host, e.g. https://app.ninjarmm.com (US), https://eu.ninjarmm.com (EU) |
NINJA_CLIENT_ID |
yes | OAuth client ID |
NINJA_CLIENT_SECRET |
yes | OAuth client secret |
NINJA_SCOPE |
no | Defaults to monitoring management control |
NINJA_REFRESH_TOKEN |
for writes | User-context refresh token (preferred). See below. |
NINJA_SESSION_KEY |
alt | NinjaOne web session cookie value (expires with the browser session) |
NINJA_DEFAULT_CLIENT_ID |
no | Default org ID for create_ticket |
NINJA_LOCAL_AUTH_PORT |
no | Port for the one-time interactive login (default 3846) |
Reads (search_tickets, get_ticket, list tools) work with just the client ID/secret via client_credentials. Writes require user context (a refresh token or session key). If neither is set, the first write opens a browser once to authenticate you and captures a refresh token for the session.
Getting a refresh token
NINJA_CLIENT_ID=... NINJA_CLIENT_SECRET=... node get-refresh-token.js
Follow the prompts, then set the printed value as NINJA_REFRESH_TOKEN.
MCP client setup
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"ninjaone": {
"command": "node",
"args": ["/absolute/path/to/ninjaone-mcp/index.js"],
"env": {
"NINJA_BASE_URL": "https://app.ninjarmm.com",
"NINJA_CLIENT_ID": "your-client-id",
"NINJA_CLIENT_SECRET": "your-client-secret",
"NINJA_REFRESH_TOKEN": "your-refresh-token"
}
}
}
}
Claude Code
claude mcp add ninjaone -- node /absolute/path/to/ninjaone-mcp/index.js
Then set the NINJA_* environment variables for the server (via the config file's env block or your shell).
Known limitations
These reflect how NinjaOne's ticketing API actually behaves, so you know what to expect:
- Reads vs. writes need different auth.
client_credentials(client ID + secret) is read-only. Creating, updating, or commenting on tickets requires user context - a refresh token, a session key, or the one-time browser login. With reads-only auth, write tools return an auth error. - Authorization Code grant must be enabled. Older NinjaOne OAuth clients only expose the "Refresh Token" grant and return
unauthorized_clientfor the authorization-code flow. Enable Authorization Code (and theoffline_accessscope) on the API client, or the interactive/get-refresh-token.jsflows won't work. - Comments must be
multipart/form-data. The/commentendpoint rejectsapplication/jsonwith HTTP 415. This server already posts the correct form encoding - noted so forks don't regress it. - Refresh tokens rotate. NinjaOne may issue a new refresh token on use. The server logs the rotated value to stderr, but it only persists for the process lifetime - copy it back into
NINJA_REFRESH_TOKENto keep it across restarts. - Session keys are short-lived.
NINJA_SESSION_KEYis a browser-session cookie and expires when that session ends. Prefer a refresh token for anything long-running. update_ticketis read-modify-write. It fetches the ticket first to supply the requiredversionandrequesterUid, so concurrent edits can hit optimistic-locking conflicts. Some status transitions (e.g. directly to a closed state) are restricted by NinjaOne's workflow.- Interactive login is local-only. The automatic browser flow needs a localhost redirect and a desktop browser; it won't work in headless/CI environments (use a pre-obtained
NINJA_REFRESH_TOKENthere). - No "list boards" API. NinjaOne doesn't expose one; board
1is the default. Uselist_organizationsandlist_techniciansto discover IDs. - No built-in rate-limit handling or retries, and the toolset is intentionally scoped to core ticketing (no attachments, custom fields, time entries, or asset/monitoring endpoints yet). PRs welcome.
This is an independent open-source project and is not affiliated with or endorsed by NinjaOne.
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。