SN

servicenowcoach/now-sdk-ext-mcp

开发工具

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

0 stars 7 forks 质量 64 趋势 0

ServiceNow SDK Extension MCP Server

概览

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. This server uses the same credential store as the ServiceNow CLI (snc). If you haven't already, configure your instance credentials: This stores credentials locally so the MCP server can authenticate without prompting. The server communicates over (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.). Add to ~/Library/Application Support/Claude/claude_desktop_config.json: To set a default instance (so you don't have to specify it every time): Add to your .vscode/mcp.json or Cursor MCP settings:

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.

Quick Start

Prerequisites

  • Node.js >= 18
  • ServiceNow CLI credentials configured via snc configure

Install and Build

git clone 
cd now-sdk-ext-mcp
npm install
npm run build

Configure Credentials

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

now-sdk auth --add 

This stores credentials locally so the MCP server can authenticate without prompting.

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

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "servicenow": {
      "command": "node",
      "args": ["/absolute/path/to/now-sdk-ext-mcp/dist/index.js"]
    }
  }
}

To set a default instance (so you don’t have to specify it every time):

{
  "mcpServers": {
    "servicenow": {
      "command": "node",
      "args": ["/absolute/path/to/now-sdk-ext-mcp/dist/index.js"],
      "env": {
        "SN_AUTH_ALIAS": "dev224436"
      }
    }
  }
}

VS Code / Cursor

Add to your .vscode/mcp.json or Cursor MCP settings:

{
  "servers": {
    "servicenow": {
      "command": "node",
      "args": ["/absolute/path/to/now-sdk-ext-mcp/dist/index.js"],
      "env": {
        "SN_AUTH_ALIAS": "dev224436"
      }
    }
  }
}

Claude Code

Add to your .claude/settings.json or project-level .mcp.json:

{
  "mcpServers": {
    "servicenow": {
      "command": "node",
      "args": ["/absolute/path/to/now-sdk-ext-mcp/dist/index.js"],
      "env": {
        "SN_AUTH_ALIAS": "dev224436"
      }
    }
  }
}

Opencode

Add to your .config/opencode/opencode.json or project-level opencode.jsonc

{
  "mcp": {
    "servicenow": {
      "type": "local",
      "command": ["node", "/absolute/path/to/now-sdk-ext-mcp/dist/index.js"],
      "enabled": true,
      "environment": {
        "SN_AUTH_ALIAS": "dev224436"
      }
    }
  }
}

How It Works

Once connected, you can talk to your AI assistant naturally:

“Find all CMDB CI records in the computer class on my dev224436 instance”

“Run a script on dev224436 that counts all active incidents by priority”

“Query the sys_user table for users with the admin role on prod”

在 GitHub 查看完整 README

安装

npx @modelcontextprotocol/inspector node dist/index.js
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "servicenow": { "command": "node", "args": ["/absolute/path/to/now-sdk-ext-mcp/dist/index.js"] } } }