
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 分
請在儲存庫或註冊中心條目中宣告授權條款。
