
SN MCP Server
io.github.ImJaineel由 GitHub 账号 ImJaineel 发布v2.2.22更新于 Oct 24, 2026
Multi-instance read-only MCP server for ServiceNow
概览
只读的 MCP 服务器,让助手查询和检查多个 ServiceNow 实例(生产、开发、测试、PDI),并检索 ServiceNow 文档。
- 可以做什么
- 列出已配置的实例,并测试指定实例或默认实例的连通性
- 查询、聚合和检查表结构,按 sys_id、记录编号、任务表或 CMDB 类获取记录
- 从身份相关表读取用户、用户组及组成员关系
- 搜索并获取脚本类构件、更新集、传统工作流以及 Flow Designer/Workflow Studio 构件
- 获取附件的元数据或文件内容
- 按发布分支搜索和阅读 ServiceNowDocs 文档,安装 now-sdk 后可解释 SDK 概念
- 适用场景
- 适合从事 ServiceNow 开发或运维、希望助手在多个环境间探查实例数据、表结构、脚本、工作流和更新集而无需切换工具的场景。也便于在同一会话中查阅官方 ServiceNow 文档。
- 运行要求
- 以 stdio 方式在本地运行(npx 或克隆仓库),需要 Node.js。需要 sn-instance.json 配置文件(路径由 SN_INSTANCE_CONFIG 或 --config 指定),其中包含各实例凭据:基本认证的用户名/密码,或 OAuth 2.0 的客户端凭据、密码、授权码、JWT 断言等授权方式。需要能访问相应 ServiceNow 实例的网络。可选:GITHUB_TOKEN 用于文档分支查询和 GitHub 搜索,SN_LOG_DIR、SN_MCP_VERBOSE,以及全局安装的 now-sdk 以启用 SDK 解释工具。
安装
在 SourceWeft 中
- 打开 控制台中的 SN MCP Server,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
📘 SN-MCP-Server
A read-only Model Context Protocol (MCP) server for ServiceNow — built for developers, AI workflows, and tools that need deep visibility into ServiceNow across multiple instances (Prod, Dev, Test, PDI).
[NPM Package] [Node.js] [License]
✨ Features
- 🔗 Multi-instance — Prod, Dev, Test, PDI in one server
- 🔍 Powerful querying — Table, Aggregate, Code Search APIs
- 🧠 Intelligent record resolution — INC, CHG, RITM, sys_id
- 🔄 Flow Designer + Legacy Workflows
- 🧩 Schema inspection & discovery
- 👥 Identity & access data
- 🔑 Multiple Auth Methods — Basic Auth and OAuth 2.0 (Client Credentials, Password, Auth Code, JWT)
- 🧰 ServiceNow SDK support — optional
sn_sdk_explaintool is registered whennow-sdkis installed globally (npm install -g now-sdk) - Read-only by design — safe on production instances
- 📄 Per-run log files — one file per server start, stored in OS temp folder
- 🔬 Verbose tool logging — per-call called/received debug lines (instance, args, result summary) when
SN_MCP_VERBOSE=true - 📚 ServiceNow Docs search —
sn_read_docssearches the ServiceNowDocs repo, returnsfile_path/raw_urlfor direct reads, and can resolve the selected branch when a non-default version is requested
🚀 Quick Start
Option A — npx (no install needed)
Option B — Local clone
⚙️ Configuration
1. Create sn-instance.json
📄 Full example: sn-instance.example.json
Common fields
Basic Auth (auth: "basic")
OAuth 2.0 (auth: "oauth2")
Default selection is resolved in this order:
- explicit top-level
"default"alias in the config object - an entry with
"default": true - the first entry in the list
2. Environment variables (optional)
All optional — set them in your shell, in the MCP client "env" block, or in a .env file at the project root. Values from the shell take precedence over .env.
Note: If you are running the server from a local clone, a root-level
.envfile is loaded automatically at startup.
CLI flags are also supported as an alternative to environment variables:
--config <path>→ setsSN_INSTANCE_CONFIG--verbose→ setsSN_MCP_VERBOSE=true--github-token <token>→ setsGITHUB_TOKEN
🔌 MCP Client Setup
For Anyone, Everyone
VS Code: Press
Ctrl+Shift+P, select Add MCP
Claude Desktop: Edit
~/Library/Application Support/Claude/claude_desktop_config.json(macOS) or%APPDATA%\Claude\claude_desktop_config.json(Windows)
Gemini Code Assist: Create or edit
~/.gemini/mcp.json
Amazon Q: Create or edit
~/.aws/amazonq/mcp.json
Using npx (recommended):
Using local clone:
⚠️ Always use absolute paths in MCP client configs.
▶️ Running locally
🪵 Logs
Each server run creates a new timestamped log file:
Stored in the OS temp directory:
Override with SN_LOG_DIR env var. Log files are cleaned up automatically by the OS on reboot.
The startup banner always prints the exact log file path:
🧰 Available Tools
The server exposes 16 tools at runtime when the current environment supports them:
- 14 instance tools — require a configured
sn-instance.json - 2 knowledge tools — instance-independent tools for docs and SDK guidance
14 instance tools
2 knowledge tools
Runtime visibility rules
- Instance tools (14) are hidden when the server starts in config-less mode (no
sn-instance.jsonprovided). In that mode, only the 2 knowledge tools remain visible. sn_read_docsis always registered, because it does not depend on ServiceNow instance credentials.sn_sdk_explainis added only after a successful probe ofnow-sdk; if the package is not installed or cannot be executed, the tool is omitted entirely. Install it globally with:npm install -g now-sdk- Every instance tool accepts an optional
instanceparameter. If omitted, the server uses the configured default instance.
💡 Usage Examples
Target a specific instance
Query incidents
Search ServiceNow Docs
Use mode": "get_file" with the returned file_path or raw_url to read the matching doc.
Get record by number
Search legacy workflows
Aggregate
📁 Project Structure
⚠️ Troubleshooting
Invalid credentials
- Verify username/password in
sn-instance.json - Ensure the account has REST API access enabled in ServiceNow
Instance unreachable
- Check the
instancevalue format — subdomain or full URL - Verify VPN / network connectivity
sn-instance.json validation error
- The server prints a specific error message pointing to the exact field/entry
- See the example: sn-instance.example.json
MCP client not detecting server
- Always use absolute paths in MCP client config
- Restart the MCP client after config changes
🔐 Security Notes
sn-instance.jsonis in.gitignore— never commit it- Use a dedicated read-only service account per instance
- PDI instances can use
admincredentials safely since they're isolated - Do not store credentials in environment variables in shared environments
🤝 Contributing
PRs welcome! Please open an issue first for larger changes.
🐛 Report a bug
If you hit a bug, please open a GitHub issue here:
Include the following in your report so it can be fixed quickly:
- what you expected to happen
- what actually happened
- the command or MCP client configuration you used
- the relevant log output or error text
- any redacted snippets from
sn-instance.jsonor.env
📄 License
See LICENSE for details.
来源:README.md,提交 e621164
工具
0版本历史
1- v2.2.22最新Sep 16, 2026
评分
已满足适用检查项的 40%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
请在仓库或注册中心条目中声明许可证。
