A Model Context Protocol (MCP) server implementation for ServiceNow
Project description
ServiceNow MCP Server
ServiceNow MCP server with browser-based authentication for MFA/SSO environments. Designed for direct use from MCP clients such as Claude Desktop, Claude Code, OpenCode, Gemini Code Assist, and similar local MCP hosts.
Quick Start
Most users do not need to clone this repository. If you have uv, you can register the server directly in your MCP client.
1. Register in Your MCP Client
Claude Desktop
Add this to claude_desktop_config.json:
{
"mcpServers": {
"servicenow": {
"command": "uvx",
"args": [
"mfa-servicenow-mcp",
"--instance-url", "https://your-instance.service-now.com",
"--auth-type", "browser",
"--browser-headless", "false"
]
}
}
}
OpenCode / Gemini / Vertex AI
{
"mcp": {
"servicenow": {
"type": "local",
"command": [
"uvx", "mfa-servicenow-mcp",
"--instance-url", "https://your-instance.service-now.com",
"--auth-type", "browser",
"--browser-headless", "false"
],
"enabled": true
}
}
}
2. Run Directly From a Terminal
uvx mfa-servicenow-mcp --instance-url "https://your-instance.service-now.com" --auth-type "browser"
- The first run may install browser dependencies automatically.
- Browser auth may open a login window.
- Use
--browser-headless falseif you want an interactive MFA/SSO flow.
3. Install as a Local Command
uv tool install mfa-servicenow-mcp
servicenow-mcp --instance-url "https://your-instance.service-now.com" --auth-type "browser"
4. Update to Latest Version
macOS / Linux
# uvx (always runs the latest from PyPI — no manual update needed)
uvx mfa-servicenow-mcp --version
# uv tool
uv tool upgrade mfa-servicenow-mcp
# pip
pip install --upgrade mfa-servicenow-mcp
Windows
# uv tool
uv tool upgrade mfa-servicenow-mcp
# pip
pip install --upgrade mfa-servicenow-mcp
5. Browser Auth Setup
Browser authentication uses Playwright to drive your local browser for MFA/SSO login. Playwright is an optional dependency — install it separately:
# 1. Install Playwright
pip install playwright
# or
uv pip install playwright
# 2. Install the browser binary (uses your local Chromium)
playwright install chromium
With uvx:
uvx --with playwright mfa-servicenow-mcp \
--instance-url "https://your-instance.service-now.com" \
--auth-type "browser"
Or install as a bundle:
pip install "mfa-servicenow-mcp[browser]"
playwright install chromium
Playwright is only needed for browser auth. Basic, OAuth, and API Key auth work without it.
Windows users can also use WINDOWS_INSTALL.md.
Features
- Browser authentication for MFA/SSO environments (Okta, Entra ID, SAML, MFA)
- Safe write confirmation with
confirm='approve' - Payload safety limits, per-field truncation, and total response budget (200K chars)
- Transient network error retry with backoff
- Tool packages for standard users, service desk, portal developers, and platform developers
- Developer productivity tools: activity tracking, uncommitted changes, dependency mapping, daily summary
- Full coverage of core ServiceNow artifact tables (see below)
Supported ServiceNow Tables
| 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 | - | - |
Authentication
Choose the auth mode based on your ServiceNow environment.
Browser Auth
Use this for Okta, Entra ID, SAML, MFA, or any interactive SSO flow.
uvx mfa-servicenow-mcp \
--instance-url "https://your-instance.service-now.com" \
--auth-type "browser" \
--browser-headless "false"
Optional browser-related flags:
--browser-username--browser-password--browser-user-data-dir--browser-timeout--browser-probe-path
Environment variables:
SERVICENOW_INSTANCE_URL=https://your-instance.service-now.com
SERVICENOW_AUTH_TYPE=browser
SERVICENOW_BROWSER_HEADLESS=false
Basic Auth
Use this for PDIs or instances without MFA.
uvx mfa-servicenow-mcp \
--instance-url "https://your-instance.service-now.com" \
--auth-type "basic" \
--username "your_id" \
--password "your_password"
OAuth
Current CLI support expects OAuth password grant inputs.
uvx mfa-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.
API Key
uvx mfa-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
Tool Packages
Set MCP_TOOL_PACKAGE to choose a smaller tool set. Default: standard
| Package | Intended Use | Highlights |
|---|---|---|
standard |
General users | Incidents, catalog, knowledge, core queries |
portal_developer |
Portal developers | Portal code, script includes, source search (all 9 artifact types), developer activity tracking, dependency mapping, daily summary, safe logs, workflow read, update set commit/publish |
platform_developer |
Platform developers | Everything in portal_developer + delete script include, full workflow CRUD, UI policy |
service_desk |
Operations | Incident handling, comments, user lookup, article lookup |
full |
Admin / unrestricted | Broad access across all implemented tool domains |
Developer Productivity Tools
These tools are available in portal_developer, platform_developer, and full packages:
| Tool | Description |
|---|---|
get_developer_changes |
List recent changes by a developer across all artifact tables. Supports count_only for cost preview. |
get_uncommitted_changes |
Find items in uncommitted (in-progress) update sets, grouped by update set. |
get_provider_dependency_map |
Map Widget → Angular Provider → Script Include dependency chains. |
get_developer_daily_summary |
Generate a daily work report in Jira markdown, plain text, or structured JSON. |
Safety Policy
All mutating tools are protected by explicit confirmation.
Rules:
- Tools such as
create_,update_,delete_,execute_,add_,commit_, andpublish_require confirmation. - You must pass
confirm='approve'. - Without that parameter, the server rejects the request before execution.
This policy applies regardless of the selected tool package.
Portal investigation tools are also conservative by default.
search_portal_regex_matchesstarts with widget-only scanning, linked expansion off, and small default limits.download_portal_sourcesdoes not pull linked Script Includes or Angular Providers unless explicitly requested.- Large portal scans are capped server-side and return warnings when the request is broader than the safe default.
- The intended workflow is: target one widget or a small widget list first, then opt in to broader expansion only when needed.
Example targeted portal search:
{
"regex": "btnClickLoadData|myQuery",
"widget_ids": ["jobWFMngt2Wd"],
"max_widgets": 1,
"max_matches": 20
}
Example broader search with explicit opt-in:
{
"regex": "btnClickLoadData|myQuery",
"widget_ids": ["jobWFMngt2Wd", "jobWFMngtLegacyWd"],
"include_linked_script_includes": true,
"include_linked_angular_providers": true,
"max_widgets": 2,
"max_matches": 50
}
Developer Setup
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 chromium
Windows-specific setup: WINDOWS_INSTALL.md
Documentation
Related Projects and Acknowledgements
- This repository includes tools that were consolidated and refactored from earlier internal / legacy ServiceNow MCP implementations. You can still see that lineage in modules such as core_plus.py and tool_utils.py.
- Some developer productivity workflows, especially server-side source lookup, were designed with ideas inspired by SN Utils. This project does not bundle or redistribute SN Utils code. It implements MCP-oriented server tools separately.
- This project is focused on MCP server use cases rather than browser-extension UX. If you want in-browser productivity features directly inside ServiceNow, SN Utils remains a strong companion tool.
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mfa_servicenow_mcp-1.2.5.tar.gz.
File metadata
- Download URL: mfa_servicenow_mcp-1.2.5.tar.gz
- Upload date:
- Size: 223.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ad679ecd39c5bd01c5ae09cb0c6e676bcfc3f86a20bc2e26451ca081fdcae74
|
|
| MD5 |
db4c13dff67130d35716cd1df6ce158f
|
|
| BLAKE2b-256 |
92d62be82e0640cf8c8f0616850ff73a73ee74219fc48a7a2b0a2455998781c5
|
Provenance
The following attestation bundles were made for mfa_servicenow_mcp-1.2.5.tar.gz:
Publisher:
ci.yml on jshsakura/mfa-servicenow-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mfa_servicenow_mcp-1.2.5.tar.gz -
Subject digest:
5ad679ecd39c5bd01c5ae09cb0c6e676bcfc3f86a20bc2e26451ca081fdcae74 - Sigstore transparency entry: 1202518144
- Sigstore integration time:
-
Permalink:
jshsakura/mfa-servicenow-mcp@0579e4cc11a25f4c9e65244d84c5a614c193c02f -
Branch / Tag:
refs/tags/v1.2.5 - Owner: https://github.com/jshsakura
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@0579e4cc11a25f4c9e65244d84c5a614c193c02f -
Trigger Event:
push
-
Statement type:
File details
Details for the file mfa_servicenow_mcp-1.2.5-py3-none-any.whl.
File metadata
- Download URL: mfa_servicenow_mcp-1.2.5-py3-none-any.whl
- Upload date:
- Size: 133.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
639e76a34ec08e5e8414755396c7f9c3cef9a14b96daab1b08a420322c1a5253
|
|
| MD5 |
5933a4758b23e3365cb273a8f908a065
|
|
| BLAKE2b-256 |
b6aa9b677c83137a27a6e9c48318f90196a6a7488ed3ba46c9347dfeecc617bc
|
Provenance
The following attestation bundles were made for mfa_servicenow_mcp-1.2.5-py3-none-any.whl:
Publisher:
ci.yml on jshsakura/mfa-servicenow-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mfa_servicenow_mcp-1.2.5-py3-none-any.whl -
Subject digest:
639e76a34ec08e5e8414755396c7f9c3cef9a14b96daab1b08a420322c1a5253 - Sigstore transparency entry: 1202518219
- Sigstore integration time:
-
Permalink:
jshsakura/mfa-servicenow-mcp@0579e4cc11a25f4c9e65244d84c5a614c193c02f -
Branch / Tag:
refs/tags/v1.2.5 - Owner: https://github.com/jshsakura
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@0579e4cc11a25f4c9e65244d84c5a614c193c02f -
Trigger Event:
push
-
Statement type: