SC

sonisoft-cnanda/now-sdk-ext-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

16 stars 8 forks 质量 87 趋势 35MIT

MCP server for ServiceNow — enables AI assistants (Claude, etc.) to execute scripts, query data, run ATF tests, and more via the Model Context Protocol

概览

An MCP (Model Context Protocol) server that enables AI assistants to interact directly with ServiceNow instances — executing background scripts, querying data, running ATF tests, tailing logs, and more. Built on @modelcontextprotocol/sdk and @sonisoft/now-sdk-ext-core. Use table behavior discovery to inspect automation, field requirements, and related artifact details. Available in MCP , using core . - >= 26 - configured via now-sdk auth --add Configure your MCP client to launch npx --yes @sonisoft/now-sdk-ext-mcp: The readonly package includes schema and behavior discovery. Omit MCP_TOOL_PACKAGE for all tools, or select a tool package for your workflow. This server uses the same credential store as the ServiceNow CLI. If you haven't already, configure your instance credentials: This stores credentials locally.

README

以下为原文 README 节选,完整内容请查看原文。

now-sdk-ext-mcp

An MCP (Model Context Protocol) server that enables AI assistants to interact directly with ServiceNow instances — executing background scripts, querying data, running ATF tests, tailing logs, and more.

Built on @modelcontextprotocol/sdk and @sonisoft/now-sdk-ext-core.

Use table behavior discovery to inspect automation, field requirements, and related artifact details. Available in MCP 4.8.0, using core 6.4.1.

Quick Start

Prerequisites

  • Node.js >= 26
  • ServiceNow CLI credentials configured via now-sdk auth --add

Use the Published Package

Configure your MCP client to launch npx --yes @sonisoft/now-sdk-ext-mcp:

{
  "mcpServers": {
    "servicenow": {
      "command": "npx",
      "args": ["--yes", "@sonisoft/now-sdk-ext-mcp"],
      "env": {
        "SN_AUTH_ALIAS": "dev",
        "MCP_TOOL_PACKAGE": "readonly"
      }
    }
  }
}

The readonly package includes schema and behavior discovery. Omit MCP_TOOL_PACKAGE for all tools, or select a tool package for your workflow.

Build from Source

git clone https://github.com/sonisoft-cnanda/now-sdk-ext-mcp.git
cd now-sdk-ext-mcp
npm install
npm run build

Configure Credentials

This server uses the same credential store as the ServiceNow CLI. If you haven’t already, configure your instance credentials:

npm install -g @servicenow/sdk
now-sdk auth --add https://dev12345.service-now.com --alias dev --type oauth

This stores credentials locally. For clients that cannot unlock the OS keyring, import credentials into @sonisoft/sn-credstore and set SN_CRED_STORE_ENABLE=1 in the server environment; see credential storage.

Breaking Change in v2.0.0 (ServiceNow SDK 4.3.0)

v2.0.0 upgrades the underlying ServiceNow SDK from 4.2.x to 4.3.0, which changed how credential aliases are stored (replacing the previous keytar-based credential store with a new implementation).

If you are upgrading from v1.x:

  • Credential aliases created with ServiceNow SDK 4.2.x cannot be read by SDK 4.3.x
  • You must re-create all instance aliases after upgrading
# 1. Update the global CLI
npm install -g @servicenow/[email protected]

# 2. Re-add each instance alias
now-sdk auth --add https://dev12345.service-now.com --alias dev --type oauth

# 3. Verify your aliases work
now-sdk auth --list

Run the Server

node dist/index.js

The server communicates over stdio (standard input/output) using the MCP JSON-RPC protocol. It is not meant to be run interactively — it’s designed to be launched by an MCP client (Claude Desktop, VS Code, Cursor, etc.).

Connecting to an MCP Client

Claude Desktop

在 GitHub 查看完整 README

安装

npx --yes @sonisoft/now-sdk-ext-mcp
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "servicenow": { "command": "npx", "args": ["--yes", "@sonisoft/now-sdk-ext-mcp"], "env": { "SN_AUTH_ALIAS": "dev", "MCP_TOOL_PACKAGE": "readonly" } } } }