snow-mcp-gateway

snow-mcp-gateway

A local gateway that exposes ServiceNow REST APIs as MCP tools, enabling natural language interaction with ServiceNow incidents, changes, CMDB, and scripts via Claude and other MCP clients.

Category
访问服务器

README

snow-mcp-gateway

Built by @AIbyTusharM — subscribe for more such tools, learning and walkthroughs.

A local gateway that turns ServiceNow REST APIs into MCP (Model Context Protocol) tools, so they can be used by Claude Desktop, Claude Code, or any MCP-compatible client.

You point the gateway at a ServiceNow instance, declare tools in a web UI (each tool wraps a Table API or Scripted REST endpoint), and the gateway exposes them as MCP servers over Streamable HTTP. Each MCP server runs on its own port and can be hot-edited without restarting clients.

Architecture

Claude Desktop ──stdio──▶ mcp-remote ──HTTP──▶ snow-mcp-gateway ──REST──▶ ServiceNow
Claude Code  ──────────────HTTP────────────▶       │
                                                   ├─ Management UI (port 3001)
                                                   ├─ incident-mcp        (port 7801)
                                                   ├─ change-ops          (port 7820)
                                                   ├─ cmdb-server         (port 7850)
                                                   ├─ business-rule-mcp   (port 8110)
                                                   ├─ script-include-mcp  (port 8120)
                                                   └─ client-script-mcp   (port 8140)
  • Management process serves the web UI on MANAGEMENT_PORT (default 3001) and a REST API at /api.
  • Each MCP server is its own Express app on its own port, mounting POST/GET/DELETE /mcp via the official MCP TypeScript SDK's StreamableHTTPServerTransport.
  • Tools are persisted to data/store.json (checked in — see Bundled MCP servers) and read live on every tools/list and tools/call, so adding or editing a tool takes effect immediately without restarting clients.

Quick start

# 1. Install dependencies
npm install

# 2. Create your local env file
cp .env.example .env
# then edit .env with your ServiceNow instance + credentials

# 3. Run the gateway
npm run dev          # tsx watch — hot reload on file changes
# or
npm run build && npm start

Open the management UI at http://localhost:3001. The repo ships with six MCP servers pre-configured (see Bundled MCP servers) — they auto-start on launch. From the UI you can:

  1. Click Connect Instance and paste your ServiceNow URL, username, and password. The gateway tests the connection before saving.
  2. Browse the pre-bundled servers in the sidebar — click any tool to edit, or click Add Tool to extend a server.
  3. Click Create MCP Server to spin up a new one on a fresh port.
  4. Click Config snippet on any server to get the JSON to paste into Claude Desktop / Claude Code.

Bundled MCP servers

These ship in data/store.json and start automatically. Tool definitions are live-editable from the UI.

Server Port Target table Tools
incident-mcp 7801 incident get_incident, list_incidents, create_incident, update_incident
change-ops 7820 change_request get_change, create_change, update_change
cmdb-server 7850 cmdb_ci get_cmdb_ci
business-rule-mcp 8110 sys_script create_business_rule, list_business_rules, get_business_rule, update_business_rule
script-include-mcp 8120 sys_script_include create_script_include, list_script_includes, get_script_include, update_script_include
client-script-mcp 8140 sys_script_client create_client_script, list_client_scripts, get_client_script, update_client_script

Convention across CRUD tools:

  • create_* — POST to the table collection URL; required fields go in the body.
  • list_* — GET; takes sysparm_query, sysparm_limit, sysparm_fields. No script parameter — pass sysparm_fields='sys_id,name,description' for a lean list view.
  • get_* — GET to /{table}/{sys_id}; returns the full record including script body.
  • update_* — PATCH to /{table}/{sys_id}; pass only the fields you want to change.

ServiceNow's boolean fields (active, action_insert, etc.) are declared as string so they're sent as "true"/"false" — the Table API rejects raw JSON booleans for these columns.

Wiring into Claude Desktop

The gateway speaks Streamable HTTP. Claude Desktop speaks stdio. Bridge them with mcp-remote.

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):

{
  "mcpServers": {
    "incident-mcp":       { "command": "npx", "args": ["mcp-remote", "http://localhost:7801/mcp"] },
    "change-ops":         { "command": "npx", "args": ["mcp-remote", "http://localhost:7820/mcp"] },
    "cmdb-server":        { "command": "npx", "args": ["mcp-remote", "http://localhost:7850/mcp"] },
    "business-rule-mcp":  { "command": "npx", "args": ["mcp-remote", "http://localhost:8110/mcp"] },
    "script-include-mcp": { "command": "npx", "args": ["mcp-remote", "http://localhost:8120/mcp"] },
    "client-script-mcp":  { "command": "npx", "args": ["mcp-remote", "http://localhost:8140/mcp"] }
  }
}

Restart Claude Desktop — the tools appear as native MCP tools.

The Config snippet button in the UI generates the per-server JSON for you with the correct port.

Wiring into Claude Code

Claude Code speaks Streamable HTTP natively — no mcp-remote wrapper needed.

CLI (one server at a time):

claude mcp add --transport http incident-mcp       http://localhost:7801/mcp
claude mcp add --transport http change-ops         http://localhost:7820/mcp
claude mcp add --transport http cmdb-server        http://localhost:7850/mcp
claude mcp add --transport http business-rule-mcp  http://localhost:8110/mcp
claude mcp add --transport http script-include-mcp http://localhost:8120/mcp
claude mcp add --transport http client-script-mcp  http://localhost:8140/mcp

Add --scope user to make them available across all projects.

Or drop a .mcp.json in your project root:

{
  "mcpServers": {
    "incident-mcp":       { "type": "http", "url": "http://localhost:7801/mcp" },
    "change-ops":         { "type": "http", "url": "http://localhost:7820/mcp" },
    "cmdb-server":        { "type": "http", "url": "http://localhost:7850/mcp" },
    "business-rule-mcp":  { "type": "http", "url": "http://localhost:8110/mcp" },
    "script-include-mcp": { "type": "http", "url": "http://localhost:8120/mcp" },
    "client-script-mcp":  { "type": "http", "url": "http://localhost:8140/mcp" }
  }
}

Run claude mcp list to verify, or /mcp inside an interactive session for live status.

Environment variables

Variable Required Description
MANAGEMENT_PORT no (default 3001) Port for the management UI / REST API
SN_INSTANCE_URL yes e.g. https://devXXXXXX.service-now.com
SN_USERNAME yes ServiceNow user the gateway calls as
SN_PASSWORD yes Password for that user

Credentials can also be set/updated live via the UI; the running process picks them up immediately.

Project layout

src/
  index.ts          # bootstraps management API + auto-starts saved MCP servers
  routes.ts         # REST API for instance/servers/tools (under /api)
  mcp-manager.ts    # tracks running MCPInstance per server
  mcp-instance.ts   # Express + StreamableHTTPServerTransport per MCP server
  servicenow.ts     # REST client + tool dispatcher (Table API / Scripted REST)
  storage.ts        # JSON file persistence
  types.ts          # shared types
public/
  index.html        # single-file management UI
data/
  store.json        # persisted server + tool definitions (checked in)

Scripts

Script Purpose
npm run dev Run with tsx watch (auto-reload)
npm run build TypeScript compile to dist/
npm start Run the compiled output

Notes

  • Each MCP session gets its own SDK Server instance, because the SDK's Protocol class allows only one transport attachment per Server. Handlers read live from storage, so tool edits propagate to all sessions immediately.
  • data/store.json is checked in so the bundled server + tool catalog ships with the repo. Your .env (with the password) is gitignored.
  • Authentication to ServiceNow is HTTP Basic auth using the credentials you configure. Use a least-privilege service account, not a personal admin login, for any non-toy use.

Stay in the loop

If this was useful, follow AI by Tushar M on YouTube — subscribe for more such tools, learning and walkthroughs.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选