# @onlyflows/servicenow-mcp [Health: Active]

**Category:** 🎧 Support & Service Management  
**Repository:** https://github.com/onlyflowstech/servicenow-mcp  
**GitHub Stars:** 13  
**npm Downloads (last month):** 2889  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/onlyflows-servicenow-mcp

## Description
Governed stdio ServiceNow MCP server for production: 24 tools with per-profile table and field policy, dry-run bulk changes, activity events, multi-instance profiles, CMDB traversal, ATF testing and read-only Flow Designer flow views.

## Tools
Capabilities this server exposes over MCP:

- **sn_query** — Query a policy-approved ServiceNow table. Returns records with pagination metadata (record_count, total, has_more, next_offset). Field verbosity: an explicit fields list always wins; otherwise response_format="concise" (default) uses the table's safe default field set and response_format="detailed" returns all policy-approved readable fields (same as fields="all"). Responses larger than max_response_bytes are truncated by dropping whole records from the tail, with a hint for fetching the rest.
- **sn_get** — Get exactly one record from a policy-approved ServiceNow table by a strict 32-hex sys_id or an approved table-specific human-readable identifier. Identifier resolution is exact and bounded: no match returns not_found and multiple matches return conflict. Explicit fields win; otherwise concise uses safe defaults and detailed returns all policy-approved readable fields.
- **sn_create** — Create one record on any table the configured policy grants for writes. Fields are bounded by the field policy; incident additionally requires a short_description. Journal fields (comments, work_notes) add an entry.
- **sn_update** — Update fields on exactly one record selected by canonical sys_id, on any table the configured policy grants for writes. At least one bounded approved field is required; journal fields (comments, work_notes) add an entry.
- **sn_incident_add_comment** — Append one bounded customer-visible comment to an authorized incident.
- **sn_incident_add_work_note** — Append one bounded internal work note to an authorized incident.
- **sn_delete** — Delete a ServiceNow record by sys_id. Requires the confirm flag set to true as a safety measure.
- **sn_batch** — Bulk update or delete records matching policy-authorized structured filters. Runs in dry-run mode by default — set confirm to true to execute. Raw encoded queries are prohibited. Safety cap at 10,000 records.
- **sn_aggregate** — Run aggregate queries (COUNT, AVG, MIN, MAX, SUM) on a ServiceNow table with optional grouping.
- **sn_schema** — Get the schema (field definitions) for a ServiceNow table. Returns field names, types, max lengths, mandatory flags, and reference targets.
- **sn_health** — Check ServiceNow instance health: version, cluster nodes, stuck jobs, semaphores, and key stats (active incidents, P1s, changes, problems).
- **sn_attach** — Manage attachments on ServiceNow records. List, download, or upload attachments. Bytes are exchanged inline as base64; this tool never reads or writes the host filesystem, so it behaves identically for local, containerized, and remote servers.
- **sn_relationships** — Traverse CMDB CI relationships (graph walk). Supports upstream, downstream, or both directions with configurable depth. Use for impact analysis and dependency mapping.
- **sn_syslog** — Query ServiceNow system logs (syslog table) with severity, source, and time-based filters. Results ordered newest first, with pagination metadata (record_count, total, has_more, next_offset).
- **sn_codesearch** — Search across ServiceNow code artifacts — business rules, script includes, UI scripts, client scripts, and scripted REST operations. Returns matching records with code snippets.
- **sn_discover** — Discover tables, applications, and plugins installed on the ServiceNow instance.
- **sn_flow_view** — View a Flow Designer flow or subflow (by sys_id or exact name) as a graph: trigger, steps, branches, loops and called subflows (depth 2-3), with input values under field policy. Returns a Mermaid diagram and an outline as text and the full graph as structuredContent. A name that matches more than one flow fails with a conflict; pass the sys_id instead. Reads only through the Table API; never calls Flow Designer's internal API, so it changes nothing on the instance. Flow text is untrusted instance data.
- **sn_atf_author** — Create ATF tests and suites, or add tests to a suite. Requires explicit table write grants. Rolls back confirmed inserts on failure; reports incomplete or uncertain writes. Supports a runtime-verified step catalog; script steps require atf.allowScriptSteps. Does not execute tests.
- **sn_atf_run** — Run an ATF suite using ServiceNow Cloud Runner only (no local browser or manual-runner fallback), through CI/CD with explicit atf.execute permission. Returns progress/result IDs, readable failures and cached comparison. Use sn_atf_readiness first.
- **sn_atf_results** — Get paginated ATF suite results, retrieve complete step summary/output in chunks, or inspect cached history/comparisons. History and compare need no ServiceNow network requests. Results may include untrusted failure text.
- **sn_atf_readiness** — Check ATF plugins, properties, runner availability and profile grants. Unreadable or unverified checks are reported explicitly. Optionally inspect a suite and its child suites for active tests and UI steps.
- **sn_atf** — Automated Test Framework — list tests/suites and read legacy results. Run actions return migration guidance for sn_atf_run.
- **sn_nl** — Natural language interface for ServiceNow. Translates plain English into ServiceNow API calls. Supports queries, aggregates, schema lookups, creates, updates, and batch operations. Read operations execute immediately; write operations require execute=true.
- **sn_profile** — Inspect non-secret metadata and the effective policy card (tables, tools, fields, batch limits) for an explicitly selected ServiceNow profile. Profiles are created, modified, and selected out of band by the operator; this tool never changes profile configuration or reveals credentials.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "servicenow-mcp": {
    "command": "npx",
    "args": ["-y","@onlyflows/servicenow-mcp@latest"]
  }
}
```

## Documentation

## What @onlyflows/servicenow-mcp does

@onlyflows/servicenow-mcp exposes ServiceNow operations to an AI client through MCP. Its 24 tools can read and change records on configured ServiceNow instances, subject to controls attached to each named connection profile. Profiles can target different instances and maintain separate read and write permissions.

The server also covers CMDB traversal, Automated Test Framework (ATF) testing, and read-only views of Flow Designer flows. Activity events are emitted for completed tool calls, allowing operators to observe the selected tool, profile, instance, outcome, and hashed owner and client labels without recording table, record, or field values.

## How it works

Communication uses stdio. A compatible client launches `servicenow-mcp` as a child process and exchanges MCP messages over standard input and output; there is no persistent server process to manage. Every call must include a profile name, so the request identifies its target instance explicitly.

Profiles use deny-by-default table access. Each one can define separate read and write table allowlists, while field policy controls which fields may be read or written and rejects sensitive field names. A profile with no applicable rules cannot make ServiceNow calls.

Destructive operations include additional safeguards. `sn_delete` and `sn_batch` require `confirm: true`; `sn_batch` uses structured filters, performs a dry run by default, limits a run to 10,000 records, and does not resend a batch. The confirmation flag is a model-supplied guard, not a substitute for a person's approval in the MCP client.

## Setup and configuration

Install the package globally with:

```bash
npm install -g @onlyflows/servicenow-mcp
servicenow-mcp-setup
```

The setup wizard creates local authentication material, asks for the ServiceNow instance and authentication method, verifies the credential against that instance, and writes the profile only after verification succeeds. Credentials are entered through a hidden prompt and stored encrypted in the owner-only `~/.servicenow-mcp` directory, or can use a configured reference source.

The wizard defaults reads to the `incident` table and grants no writes. You can add narrower or broader table permissions later with `servicenow-mcp-setup grant`. OAuth, API key, and basic authentication are available; basic authentication is the wizard default but is deprecated by ServiceNow.

Use `servicenow-mcp-setup doctor --profile <name>` to check the Node.js runtime, executable, configuration directory, credential resolution, and profile access. The package requires Node.js 20 or newer. Setup can register Claude Code and Codex automatically when their CLIs are available, and can generate configuration for Claude Desktop, Cursor, VS Code, and Windsurf.

## Tools and capabilities

The tool set provides:

- ServiceNow record reads and writes constrained by profile table and field policy.
- Record creation, updates, deletion, and structured batch changes through tools including `sn_create`, `sn_update`, `sn_delete`, and `sn_batch`.
- Dry-run batch execution with a 10,000-record cap and explicit confirmation for execution.
- CMDB traversal for investigating related configuration items.
- ATF testing operations.
- Read-only inspection of Flow Designer flows.
- Per-call activity events written as JSON lines to stderr.

## Limitations and notes

The policy controls govern tool calls made by the model. They do not prevent a client that grants shell or file access from running setup commands or reading local configuration files. The encryption key and encrypted profiles are stored in the same owner-only directory, so the arrangement protects against other users and stray copies rather than against the account that owns the files.

Activity-event delivery is best effort. Events are dropped when more than 256 lines are pending, and ServiceNow audit history remains the source for record-change auditing. Keep production write grants narrow and use a client or account without shell access where that distinction matters.

_Full upstream README: https://allmcps.com/mcp/onlyflows-servicenow-mcp/readme_

