servicenow_aggregate
Compute server-side aggregates (count, avg, min, max, sum) over a table via the Stats API, with optional grouping. Avoids pulling individual rows.
Query and change a ServiceNow instance over its REST APIs — with record writes answering as a preview until you pass apply.
LABSCO SUMMARY
The read half is the reason to wire it up: any table, encoded queries, server-side aggregates, and column definitions straight out of sys_dictionary — plus the ability to ask which restricted tables the connected user can actually reach before an agent plans around them. Writes are there too, and since 2.0 they answer with a preview until a call explicitly passes apply: true.
An MCP server over a ServiceNow instance's REST APIs: Table, Aggregate, Attachment, Import Set, Batch and CMDB, plus the Service Catalog, Change Management and Knowledge plugin APIs. Since 2.0 the record-write tools return a non-mutating preview unless the call passes apply: true.
servicenow_query_table with encoded queries, field selection and pagination, and servicenow_get_record by sys_idservicenow_create_record, servicenow_update_record, servicenow_delete_recordservicenow_list_tables from sys_db_object, servicenow_describe_table from sys_dictionary with type, mandatory and reference per columnservicenow_aggregate does count, avg, min, max and sum with optional groupingservicenow_list_attachments, servicenow_download_attachment, servicenow_upload_attachment, servicenow_delete_attachmentservicenow_list_instances, servicenow_use_instance, and servicenow_set_credentials to change the connection at runtimeservicenow_test_connection reads one sys_user record and reports status and latency, servicenow_check_capabilities reports which admin-restricted sys_* tables your user can actually readSN_TOOL_PACKAGES — script intelligence, servicenow_where_used for every script and ACL touching a field, servicenow_trace_table_event for what runs on save, code checking and ATF. The default profile is core; all enables everythingA ServiceNow instance and credentials for it. SN_INSTANCE is the host — dev12345.service-now.com — and the quickest path is Basic auth with SN_USER and SN_PASSWORD. For anything long-lived, npx servicenow-mcp-ai login runs the one-time OAuth 2.1 flow with PKCE and stores a refresh token instead of the password; API key via SN_API_KEY and a pre-obtained bearer token are also supported. Node.js 20 or newer. Run it as npx -y servicenow-mcp-ai over stdio; credentials resolve from SN_ENV_FILE, then ~/.config/servicenow-mcp-ai/.env, then the project .env, with real environment variables taking precedence.
One command plus credentials — npx servicenow-mcp-ai, then supply credentials
USE CASES
Verify the credentials against one record, then preview which restricted tables the connected user can read.
Compute the counts and averages server-side with grouping instead of paging every record back.
List the tables matching a name fragment, then read the columns with their types and references.
Read the record, upload the file against it, then confirm what is now attached.
List the configured profiles, then switch the active one — tokens and cached schema are scoped per identity.
Counted once with only startup setup. Other versions, modes or optional credentials may expose a different list.
servicenow_aggregateCompute server-side aggregates (count, avg, min, max, sum) over a table via the Stats API, with optional grouping. Avoids pulling individual rows.
servicenow_check_capabilitiesPreflight which admin-restricted sys_* tables the connected user can actually read, and report which higher-level capabilities (schema reads, script intelligence, ACL audit) are achievable. Run this before relying on the scripts/flows/codecheck tools on a governed instance — on a least-privilege account those reads may be silently empty.
servicenow_create_recordCreate a new record in a table with the given field values.
servicenow_delete_attachmentDelete an attachment by its sys_id.
servicenow_delete_recordDelete a record from a table by its sys_id.
servicenow_describe_tableList a table's columns (name, label, type, mandatory, reference) from sys_dictionary.
servicenow_download_attachmentDownload an attachment's bytes, returned as base64. Large files are refused (see SN_MAX_RESULT_CHARS).
servicenow_get_attachmentRead a single attachment's metadata by its sys_id.
servicenow_get_recordRead a single record from a table by its sys_id.
servicenow_get_statusShow the configured instance, user, auth mode and access policy, and whether credentials are complete. The password is never revealed.
servicenow_list_attachmentsList attachment metadata, optionally scoped to a specific record (table + sys_id).
servicenow_list_instancesList the configured ServiceNow connection profiles (instances): name, host, user, read-only flag and whether credentials are complete. Passwords are never included.
servicenow_list_tablesList tables from sys_db_object, optionally filtered by a name or label fragment.
servicenow_query_tableRead records from any ServiceNow table through the Table API. Supports encoded queries, field selection and pagination.
servicenow_set_credentialsSave or update the ServiceNow connection credentials. Values are persisted to the env file and used for all subsequent requests. Provide any subset of fields.
servicenow_test_connectionVerify that the configured credentials actually work: reads one sys_user record and reports ok/status/latency. Auth and connectivity problems are returned structurally (ok:false), not as errors.
servicenow_update_recordUpdate fields on an existing record identified by its sys_id.
servicenow_upload_attachmentAttach a file (provided as base64) to a record identified by table + sys_id.
servicenow_use_instanceSwitch the active ServiceNow connection profile (persisted to the env file). All identity-scoped caches (OAuth tokens, schema, plugin availability) are cleared.
BEFORE YOU INSTALL
19 tools when we connected; the project documents 67. SN_TOOL_PACKAGES defaults to core (table, schema, aggregate, attachment) plus six admin tools. Set SN_TOOL_PACKAGES=all for all 67, including write tools such as create_change and send_email.
INSTALLATION
npx servicenow-mcp-ai{
"mcpServers": {
"servicenow": {
"command": "npx",
"args": [
"-y",
"servicenow-mcp-ai"
]
}
}
}/plugin marketplace add IvanBBaev/servicenow-mcp-ai
/plugin install servicenow-mcp-aicode --install-extension ivanbbaev.servicenow-mcp-ai