Skip to main content

A Model Context Protocol (MCP) server implementation for ServiceNow

Project description

ServiceNow MCP Server

English | 한국어

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.

Python Version PyPI version

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 false if 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:

  1. Tools such as create_, update_, delete_, execute_, add_, commit_, and publish_ require confirmation.
  2. You must pass confirm='approve'.
  3. 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_matches starts with widget-only scanning, linked expansion off, and small default limits.
  • download_portal_sources does 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mfa_servicenow_mcp-1.2.4.tar.gz (221.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mfa_servicenow_mcp-1.2.4-py3-none-any.whl (131.6 kB view details)

Uploaded Python 3

File details

Details for the file mfa_servicenow_mcp-1.2.4.tar.gz.

File metadata

  • Download URL: mfa_servicenow_mcp-1.2.4.tar.gz
  • Upload date:
  • Size: 221.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mfa_servicenow_mcp-1.2.4.tar.gz
Algorithm Hash digest
SHA256 23942cfa6c6348710de4bb7df1708261183c5d654802019f8f77b0baa8611298
MD5 441123b114ceae0f335a26de4979d489
BLAKE2b-256 26aa8efaf206706b465332e78f7888991e83cd7e40eddf527f66613fe67d3c8b

See more details on using hashes here.

Provenance

The following attestation bundles were made for mfa_servicenow_mcp-1.2.4.tar.gz:

Publisher: ci.yml on jshsakura/mfa-servicenow-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mfa_servicenow_mcp-1.2.4-py3-none-any.whl.

File metadata

File hashes

Hashes for mfa_servicenow_mcp-1.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 90634e5eac63cdf4aed71e490321f915ab820ddefdec5889db5fd8bfb5947a38
MD5 b1c1fb1d0655fd7d33fee310de756a7f
BLAKE2b-256 e75f7cedfcbc9812c0d40c5f5cfafd4e2c04572b553a3715441079c0b7aacd57

See more details on using hashes here.

Provenance

The following attestation bundles were made for mfa_servicenow_mcp-1.2.4-py3-none-any.whl:

Publisher: ci.yml on jshsakura/mfa-servicenow-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page