servicenow-mcp-ai: an open-source MCP server that lets AI assistants work with your instance safely
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
44m ago
AI coding assistants like Claude Code, GitHub Copilot in VS Code and Cursor are getting good at writing code. Most of them still know nothing about your instance: what a table looks like, which business rules fire on save, where a field is used. I built servicenow-mcp-ai to fill that gap. It is an open-source Model Context Protocol (MCP) server that gives any MCP-capable assistant controlled access to a ServiceNow instance over the standard REST APIs.
It is a personal project, free and GPL-3.0 licensed. It needs no plugin or scoped app on the instance, so it works against a free PDI as well as your dev instance.
What it can do
The server exposes 100 tools in 28 packages. You load only the packages you need, and the default set is small and focused on discovery.
- Data: Table, Aggregate, Attachment, Import Set and Batch APIs, plus table and dictionary metadata.
- Process APIs: CMDB (including IRE identify and reconcile), Service Catalog, Change Management and Knowledge.
- Script intelligence: search the instance's own code across business rules, script includes, client scripts, UI policies and actions, ACLs, portal widgets, transform scripts and more.
- Flow tracing and code checks: see what a table operation actually runs, read Flow Designer flows and run history, and lint scripts against a local rule set.
- Ops and history: system log and scheduler reads, data-health checks, record history from sys_audit and journal fields, and update-set summaries.
- Documentation: Mermaid ER diagrams and record-lifecycle flowcharts generated from your schema and business rules.
Three questions it answers in one call
"Where is this field actually used?" servicenow_where_used finds every script, business rule, client script, UI policy, UI action and ACL that touches a field or table. It also lists structural references such as reference fields, form and list layouts, catalog variables, flow inputs and reports. It can draw the result as a Mermaid graph.
"What runs when I save this record?" servicenow_trace_table_event lists the automation chain in execution order (display, before, after and async business rules, then flows, workflows and notifications), each with its condition. It runs nothing on the instance.
"What drifted between dev and prod?" servicenow-mcp-ai drift dev prod compares two configured instances: tables, columns, scripts (with a unified diff) and plugins, plus properties, ACLs, flows and more on request. It exits non-zero on drift, so a pipeline can block a risky deploy.
All three are read-only.
Writes are safe by default
Letting an AI write to an instance needs guard rails, so they are on by default:
- Plan, then apply. Every write tool first returns a preview of what it would change. Nothing happens until the assistant calls it again with apply: true, which it should do only after you agree.
- Plan tokens for destructive actions. Deletes, writing batches, emails, catalog orders and similar actions also need a single-use token from the preview, so the assistant cannot skip the preview.
- A local write journal. Every applied write is recorded, and one create, update or delete can be reverted, with a check for edits made after it.
- Policy controls. Table allow and deny lists, read-only packages, a global read-only mode and protected system tables. A profile marked as production always asks for confirmation.
- Credentials stay local. They live in a local env file or secret files, never in the client config, and are never echoed back. Basic and OAuth 2.0 are supported, and you can configure several instance profiles.
Getting started
You need Node.js 22.12 or later.
Claude Code:
claude mcp add servicenow -- npx -y servicenow-mcp-ai
VS Code: install the ServiceNow MCP extension from the Marketplace, or add the server in .vscode/mcp.json:
{
"servers": {
"servicenow": { "command": "npx", "args": ["-y", "servicenow-mcp-ai"] }
}
}Cursor, Claude Desktop, Windsurf and Cline use the same npx -y servicenow-mcp-ai command.
Then put your instance URL and credentials in ~/.config/servicenow-mcp-ai/.env (or run npx servicenow-mcp-ai login for OAuth), and ask your assistant something like "Describe the incident table and show me what runs when an incident is updated."
Links
- npm: https://www.npmjs.com/package/servicenow-mcp-ai
- GitHub: https://github.com/IvanBBaev/servicenow-mcp-ai
- Documentation: https://ivanbbaev.github.io/servicenow-mcp-ai/
- VS Code extension: https://marketplace.visualstudio.com/items?itemName=ivanbbaev.servicenow-mcp-ai
Feedback, issues and pull requests are welcome on GitHub. I would especially like to hear which workflows you would want an assistant to handle on your instance, and where the tools fall short.
