🌐 English | 🇰🇷 한국어 | 🚀 GitHub Pages
MFA-first ServiceNow MCP server. Authenticates via real browser (Playwright) so Okta, Entra ID, SAML, and any MFA/SSO login just works. Also supports API Key for headless/Docker environments.
# One command — MFA/SSO browser login, works on macOS/Linux/Windows
uvx --with playwright --from mfa-servicenow-mcp servicenow-mcp \
--instance-url "https://your-instance.service-now.com" \
--auth-type "browser" \
--browser-headless "false"One line. Any AI coding assistant. Everything configured automatically.
Paste this into Claude Code, Cursor, Codex, OpenCode, Windsurf, VS Code Copilot, or Gemini CLI:
Install and configure mfa-servicenow-mcp by following the instructions here:
curl -s https://raw.githubusercontent.com/jshsakura/mfa-servicenow-mcp/main/docs/llm-setup.mdYour AI will:
No manual config editing. No format differences to worry about. Works on macOS, Linux, and Windows.
After setup, restart your AI client (or reload MCP servers) to load the new configuration. A browser window will open on the first tool call for MFA login.
For manual setup, see Prerequisites and Quick Start below.
confirm='approve'| Artifact Type | Table Name | Source Search | Developer Tracking | Safety (Heavy Table) |
|---|---|---|---|---|
| Script Include | sys_script_include | O | O | O |
| Business Rule | sys_script | O | O | O |
| Client Script | sys_client_script | O | O | O |
| UI Action | sys_ui_action | O | O | O |
| UI Script | sys_ui_script | O | O | O |
| UI Page | sys_ui_page | O | O | O |
| Scripted REST API | sys_ws_operation | O | O | O |
| Fix Script | sys_script_fix | O | O | O |
| Service Portal Widget | sp_widget | O | O | O |
| Angular Provider | sp_angular_provider | - | O | - |
| Update XML | sys_update_xml | O | - | - |
Install uv — it handles Python, packages, and execution in one tool.
curl -LsSf https://astral.sh/uv/install.sh | shpowershell -c "irm https://astral.sh/uv/install.ps1 | iex"Restart your terminal after installation. That's it — no Python install, no pip, no venv needed.
Chromium for MFA/SSO browser login is installed automatically on first use.
Windows users: see Windows Installation Guide for details.
No clone needed. One command — works on macOS, Linux, and Windows:
uvx --with playwright --from mfa-servicenow-mcp servicenow-mcp \
--instance-url "https://your-instance.service-now.com" \
--auth-type "browser" \
--browser-headless "false"A browser window opens on the first tool call for Okta/Entra ID/SAML/MFA login. Chromium is auto-installed if missing. Session persists after login — no need to re-authenticate every time.
Each project can connect to a different ServiceNow instance. Set the config in your project directory so each project has its own instance URL and credentials.
| Client | Config File | Format |
|---|---|---|
| Claude Desktop | claude_desktop_config.json | JSON (mcpServers) |
| Claude Code | .mcp.json or claude mcp add | JSON / CLI |
| OpenCode | opencode.json | JSON (mcp, uses environment) |
| OpenAI Codex | .codex/agents.toml | TOML |
| AntiGravity | mcp_config.json | JSON (mcpServers) |
| Gemini / Vertex AI | project config | JSON (mcp) |
| Docker | — | Environment variables |
Copy-paste configs for each client: Client Setup Guide
SERVICENOW_USERNAME/SERVICENOW_PASSWORDare optional — they prefill the MFA login form. On Windows, set these as system environment variables.
Choose the auth mode based on your ServiceNow environment.
The Quick Start command uses browser auth. Optional flags:
| Flag | Env Variable | Default | Description |
|---|---|---|---|
--browser-username | SERVICENOW_USERNAME | — | Prefill login form username |
--browser-password | SERVICENOW_PASSWORD | — | Prefill login form password |
--browser-headless | SERVICENOW_BROWSER_HEADLESS | false | Run browser without GUI |
--browser-timeout | SERVICENOW_BROWSER_TIMEOUT | 120 | Login timeout in seconds |
--browser-session-ttl | SERVICENOW_BROWSER_SESSION_TTL | 30 | Session TTL in minutes |
--browser-user-data-dir | SERVICENOW_BROWSER_USER_DATA_DIR | — | Persistent browser profile path |
--browser-probe-path | SERVICENOW_BROWSER_PROBE_PATH | /api/now/table/sys_user?sysparm_limit=1&sysparm_fields=sys_id | Session validation endpoint |
--browser-login-url | SERVICENOW_BROWSER_LOGIN_URL | — | Custom login page URL |
Use this for PDIs or instances without MFA.
uvx --from mfa-servicenow-mcp servicenow-mcp \
--instance-url "https://your-instance.service-now.com" \
--auth-type "basic" \
--username "your_id" \
--password "your_password"Current CLI support expects OAuth password grant inputs.
uvx --from mfa-servicenow-mcp servicenow-mcp \
--instance-url "https://your-instance.service-now.com" \
--auth-type "oauth" \
--client-id "your_client_id" \
--client-secret "your_client_secret" \
--username "your_id" \
--password "your_password"If --token-url is omitted, the server defaults to https://<instance>/oauth_token.do.
uvx --from mfa-servicenow-mcp servicenow-mcp \
--instance-url "https://your-instance.service-now.com" \
--auth-type "api_key" \
--api-key "your_api_key"Default header: X-ServiceNow-API-Key (customizable with --api-key-header).
Set MCP_TOOL_PACKAGE to choose a specific tool set. Default: standard
All packages except none include the full set of read-only tools (55 tools). Higher packages add write capabilities for their domain.
| Package | Tools | Description |
|---|---|---|
standard | 45 | (Default) Read-only safe mode. All query/analysis tools across every domain. |
service_desk | 49 | standard + incident create/update/resolve/comment |
portal_developer | 61 | standard + portal/widget updates, script include writes, changeset commit/publish |
platform_developer | 69 | standard + workflow CRUD, UI policy, incident/change management writes |
full | 89 | All write operations across every domain |
If a tool is not available in your current package, the server tells you which package includes it.
For the complete tool list by category, see Tool Inventory.
| Flag | Env Variable | Default | Description |
|---|---|---|---|
--instance-url | SERVICENOW_INSTANCE_URL | required | ServiceNow instance URL |
--auth-type | SERVICENOW_AUTH_TYPE | basic | Auth mode: basic, oauth, api_key, browser |
--tool-package | MCP_TOOL_PACKAGE | standard | Tool package to load |
--timeout | SERVICENOW_TIMEOUT | 30 | HTTP request timeout (seconds) |
--debug | SERVICENOW_DEBUG | false | Enable debug logging |
| Flag | Env Variable |
|---|---|
--username | SERVICENOW_USERNAME |
--password | SERVICENOW_PASSWORD |
| Flag | Env Variable |
|---|---|
--client-id | SERVICENOW_CLIENT_ID |
--client-secret | SERVICENOW_CLIENT_SECRET |
--token-url | SERVICENOW_TOKEN_URL |
--username | SERVICENOW_USERNAME |
--password | SERVICENOW_PASSWORD |
| Flag | Env Variable | Default |
|---|---|---|
--api-key | SERVICENOW_API_KEY | — |
--api-key-header | SERVICENOW_API_KEY_HEADER | X-ServiceNow-API-Key |
| Flag | Env Variable |
|---|---|
--script-execution-api-resource-path | SCRIPT_EXECUTION_API_RESOURCE_PATH |
uvx automatically uses the latest cached version. In most cases, updates happen without any action.
To force the latest PyPI release immediately:
uvx --refresh --from mfa-servicenow-mcp servicenow-mcp --versionpip install --upgrade mfa-servicenow-mcpIf you need a specific version (e.g., for stability):
# uvx with pinned version
uvx --from "mfa-servicenow-mcp==1.5.0" servicenow-mcp --version
# uv tool with pinned version
uv tool install "mfa-servicenow-mcp==1.5.0"
# pip with pinned version
pip install "mfa-servicenow-mcp==1.5.0"pyproject.toml (version = "x.y.z")main, CI auto-creates a git tag v{version} if it doesn't existamd64 and arm64All mutating tools are protected by explicit confirmation.
Rules:
create_, update_, delete_, remove_, add_, move_, activate_, deactivate_, commit_, publish_, submit_, approve_, reject_, resolve_, reorder_, and execute_ require confirmation.confirm='approve'.This policy applies regardless of the selected tool package.
Portal investigation tools are conservative by default:
search_portal_regex_matches starts with widget-only scanning, linked expansion off, and small default limits.trace_portal_route_targets is the preferred follow-up for compact Widget -> Provider -> route target evidence.download_portal_sources does not pull linked Script Includes or Angular Providers unless explicitly requested.Pattern matching modes:
| Mode | Behavior |
|---|---|
auto (default) | Plain strings treated literally, regex-looking patterns remain regex |
literal | Always escape the pattern first; safest for route/token strings |
regex | Use only when you intentionally need regex operators |
The server includes several layers of performance optimization to minimize latency and token usage.
json_fast (orjson when available, stdlib fallback). 2-4x faster than stdlib json for both loads and dumps.serialize_tool_output detects already-compact JSON strings and skips re-serialization.OrderedDict.popitem(). 256 max entries, 30-second TTL, thread-safe.model_json_schema() output is cached per model type, avoiding repeated schema generation.MCP_TOOL_PACKAGE are imported at startup. Unused modules are skipped entirely.requests.Session with 20-connection pool, TCP keep-alive, TLS session resumption, and gzip/deflate compression.sn_query_all fetches the first page sequentially for total count, then retrieves remaining pages concurrently via ThreadPoolExecutor (up to 4 workers).sn_batch combines multiple REST sub-requests into a single /api/now/batch POST, with automatic chunking at the 150-request limit.confirm='approve') is injected via lightweight dict copy instead of copy.deepcopy, reducing list_tools overhead.sysparm_no_count=true to skip server-side total count computation.sp_widget, sys_script, etc.) have automatic field clamping and limit restrictions to prevent context window overflow.Tools are raw API calls. Skills are what make your LLM actually useful — verified pipelines with safety gates, rollback, and context-aware sub-agent delegation. MCP server + skills is the complete setup for LLM-driven ServiceNow automation.
20 skills today, more coming with every release.
| Tools Only | Tools + Skills | |
|---|---|---|
| Safety | LLM decides | Gates enforced (snapshot → preview → apply) |
| Tokens | Source dumps in context | Delegate to sub-agent, summary only |
| Accuracy | LLM guesses tool order | Verified pipeline |
| Rollback | Might forget | Snapshot mandatory |
# Claude Code
uvx --from mfa-servicenow-mcp servicenow-mcp-skills claude
# OpenAI Codex
uvx --from mfa-servicenow-mcp servicenow-mcp-skills codex
# OpenCode
uvx --from mfa-servicenow-mcp servicenow-mcp-skills opencode
# Gemini CLI
uvx --from mfa-servicenow-mcp servicenow-mcp-skills geminiThe installer downloads 20 skill files from this repository's skills/ directory and places them in a project-local LLM directory. No authentication or configuration needed.
| Client | Install Path | Auto-Discovery |
|---|---|---|
| Claude Code | .claude/commands/servicenow/ | /servicenow slash commands appear on next startup |
| OpenAI Codex | .codex/skills/servicenow/ | Skills loaded on next agent session |
| OpenCode | .opencode/skills/servicenow/ | Skills loaded on next session |
| Gemini CLI | .gemini/skills/servicenow/ | Skills activated on next session |
How it works: Each skill is a standalone Markdown file with YAML frontmatter (metadata) and pipeline instructions. The LLM client reads these files from the install path and exposes them as callable commands or skill triggers.
Update: Re-run the same install command — it replaces all existing skill files (clean install, no merge).
Remove: Delete the install directory (e.g., rm -rf .claude/commands/servicenow/).
| Category | Skills | Purpose |
|---|---|---|
analyze/ | 6 | Widget analysis, portal diagnosis, provider audit, dependency mapping, code detection, ESC audit |
fix/ | 3 | Widget patching (staged gates), debugging, code review |
manage/ | 5 | Page layout, script includes, source export, changeset workflow, local sync |
deploy/ | 2 | Change request lifecycle, incident triage |
explore/ | 4 | Health check, schema discovery, route tracing, ESC catalog flow |
Each skill includes metadata that helps LLMs optimize execution:
context_cost: low|medium|high # → high = delegate to sub-agent
safety_level: none|confirm|staged # → staged = mandatory snapshot/preview/apply
delegatable: true|false # → can run in sub-agent to save context
triggers: ["위젯 분석", "analyze widget"] # → LLM trigger matchingFor the full skill reference, see skills/SKILL.md.
API Key auth only (MFA browser auth requires GUI, not available in containers).
docker run -it --rm \
-e SERVICENOW_INSTANCE_URL=https://your-instance.service-now.com \
-e SERVICENOW_AUTH_TYPE=api_key \
-e SERVICENOW_API_KEY=your-api-key \
ghcr.io/jshsakura/mfa-servicenow-mcp:latestSee Client Setup Guide for SSE mode and local build options.
If you want to modify the source locally:
git clone https://github.com/jshsakura/mfa-servicenow-mcp.git
cd mfa-servicenow-mcp
uv venv
uv pip install -e ".[browser,dev]"
uv run playwright install chromiumuv run pytestuv run black src/ tests/
uv run isort src/ tests/
uv run ruff check src/ tests/
uv run mypy src/uv buildWindows: see Windows Installation Guide
Apache License 2.0
jshsakura/mfa-servicenow-mcp
March 3, 2026
April 13, 2026
Python