Skip to main content
Glama
ServiceNow PDI MCP Server

ServiceNow PDI MCP Server

by osprksc

ServiceNow PDI MCP Server

A TypeScript MCP stdio server that connects to a ServiceNow Personal Developer Instance with OAuth 2.0 and PKCE.

Setup

  1. Install Node.js 20 or newer.

  2. Copy .env.example to .env and set the PDI URL, public OAuth client ID, redirect URI, and scope.

  3. Ensure the ServiceNow OAuth application has this exact redirect URI: http://127.0.0.1:33418.

  4. Run the one-time browser authorization flow:

npm run auth

Sign in to ServiceNow and approve the useraccount scope. The command exchanges the authorization code with PKCE and saves the refresh token to .env. 5. Install dependencies and compile:

npm install
npm run build

Related MCP server: ServiceNow MCP Server

MCP tool

servicenow_test_connection calls the ServiceNow Table API for sys_properties and returns up to 10 sample records. Its optional limit argument defaults to 1.

The server requests tokens from /oauth_token.do using the saved refresh token. Public clients do not require a client secret.

CRUD tools

Generic Table API tools work with any ServiceNow table:

  • servicenow_list_records with table, optional encoded query, fields, and limit

  • servicenow_get_record with table and sysId

  • servicenow_create_record with table and a fields object

  • servicenow_update_record with table, sysId, and a fields object

  • servicenow_delete_record with table and sysId

Table names are restricted to letters, numbers, and underscores. ServiceNow ACLs still control which tables and fields the OAuth user can access.

Flow tools operate on the sys_hub_flow table and use sys_id:

  • servicenow_create_flow with a fields object

  • servicenow_get_flow with sysId

  • servicenow_update_flow with sysId and a fields object

  • servicenow_delete_flow with sysId

These operations use the ServiceNow Table API and require the OAuth user to have the corresponding table and field permissions.

Run the server directly with:

npm run dev

The VS Code MCP configuration is in .vscode/mcp.json. Open the MCP view, start servicenow-pdi, and invoke servicenow_test_connection after the environment variables are available to VS Code.

Security

Do not commit .env or place credentials in mcp.json. The .gitignore file excludes .env and build output.

References

Available Tools

10 tools
servicenow_create_flowC

Create a ServiceNow Flow record in sys_hub_flow.

Inputs: fields (required).

servicenow_create_recordC

Create a record in any ServiceNow table.

Inputs: table (required), fields (required).

servicenow_delete_flowB

Delete one ServiceNow Flow record by sys_id.

Inputs: sysId (required).

servicenow_delete_recordB

Delete one record from any ServiceNow table by sys_id.

Inputs: sysId (required), table (required).

servicenow_get_flowC

Retrieve one ServiceNow Flow record by sys_id.

Inputs: sysId (required).

servicenow_get_recordA

Retrieve one record from any ServiceNow table by sys_id.

Inputs: sysId (required), table (required), fields.

servicenow_list_recordsC

List records from any ServiceNow table using an optional encoded query and field list.

Inputs: table (required), limit, query, fields, +1 more.

servicenow_test_connectionA

Verify OAuth access to a ServiceNow PDI and return a small sample from sys_properties.

Inputs: limit.

servicenow_update_flowC

Update one ServiceNow Flow record by sys_id.

Inputs: sysId (required), fields (required).

servicenow_update_recordC

Update a record in any ServiceNow table by sys_id.

Inputs: sysId (required), table (required), fields (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 10 tools

    Disambiguation5/5

    Each tool targets a distinct resource and action: record operations are for any table, flow operations are specifically for sys_hub_flow, and test_connection is a diagnostic. The boundaries between tools are clear and unlikely to be confused.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern with a 'servicenow_' prefix, e.g., servicenow_list_records, servicenow_create_flow. This predictable structure makes the set easy to navigate.

    Tool Count5/5

    Ten tools provide comprehensive coverage for generic record operations and specialized flow operations without unnecessary bloat. The count is well-scoped for a ServiceNow integration.

    Completeness4/5

    The server offers complete CRUD for records and flows, plus connection testing, covering core lifecycle operations. However, it lacks bulk operations, attachment handling, or advanced query features that might be needed for full ServiceNow automation.

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables authenticated interaction with ServiceNow via its REST API using per-user OAuth 2.0 tokens. It provides tools for managing incidents, tasks, knowledge articles, and service catalog requests while maintaining user-specific permissions.
      4
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Connects AI assistants to a ServiceNow instance, providing tools for Table API CRUD, incident lifecycle, CMDB queries, knowledge search, and user lookup.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables MCP-capable AI agents to safely read and write ServiceNow records via the Table API, including querying, creating, updating records, running server-side scripts, and triggering CI/CD tests and scans.
      MIT