Skip to main content

MCP server connecting Claude to ServiceNow CMDB via natural language

Project description

ServiceNow CMDB MCP Server

A Python MCP server that connects AI assistants (Claude Code, Claude Desktop) to a ServiceNow CMDB instance via natural language. Enables querying, dependency analysis, health auditing, CI lifecycle management, and configurable inspection — all through the Model Context Protocol.

What makes this different

  • Deep CMDB focus with relationship traversal, health auditing, and dependency mapping
  • Dynamic schema powered by the Data Model Navigator plugin (no hardcoded class hierarchies)
  • Full configurable inspection (business rules, flows, client scripts, ACLs) with credential redaction
  • Discovery, IRE rules, and import set visibility
  • Two-phase write confirmation for safe CI mutations
  • Tool annotations for smart auto-approval in Claude Code

Requirements

  • Python 3.11+
  • uv package manager
  • ServiceNow instance (Xanadu+) with an OAuth 2.0 application and service account

Setup

  1. Clone the repository and install dependencies:
uv sync
  1. Copy .env.example to .env and fill in your ServiceNow credentials:
cp .env.example .env
SN_INSTANCE_URL=https://your-instance.service-now.com
SN_CLIENT_ID=your-oauth-client-id
SN_CLIENT_SECRET=your-oauth-client-secret
SN_USERNAME=your-service-account
SN_PASSWORD=your-password
  1. Run the server:
uv run servicenow-cmdb-mcp

Claude Code integration

Add to your Claude Code MCP config:

{
  "mcpServers": {
    "servicenow-cmdb": {
      "command": "uv",
      "args": ["run", "servicenow-cmdb-mcp"],
      "cwd": "/path/to/mcp-cmdb"
    }
  }
}

Tools (34 total)

Domain Tools Description
Queries search_cis, query_cis_raw, get_ci_details, count_cis, suggest_table, list_ci_classes, describe_ci_class Search, inspect, and explore CMDB classes
Relationships get_ci_relationships, find_related_cis, list_relationship_types, get_dependency_tree, get_impact_summary Traverse CI relationships and dependencies
Health find_orphan_cis, find_duplicate_cis, find_stale_cis, cmdb_health_summary Audit CMDB data quality
Mutations preview_ci_create, confirm_ci_create, preview_ci_update, confirm_ci_update Safe two-phase CI writes
Configurables get_business_rules, get_flows, get_client_scripts, get_acls, analyze_configurables Inspect automation and security config
Discovery list_discovery_schedules, get_discovery_status, get_discovery_errors Monitor discovery operations
IRE get_identification_rules, get_reconciliation_rules, explain_duplicate Inspect identification and reconciliation
Imports list_data_sources, get_import_set_runs, get_transform_errors Monitor data imports and transforms
Schema refresh_metadata_cache Manage cached metadata

Development

# Run unit tests
uv run pytest tests/ -v

# Run smoke tests (requires live ServiceNow instance)
uv run python smoke_tests/smoke_test.py

# Type check
uv run mypy src/

# Lint
uv run ruff check src/

Architecture

See ARCHITECTURE.md for the full design document covering authentication, security, tool patterns, and API usage.

Tech stack

  • FastMCP (mcp[cli]) — MCP server framework with decorator-based tool registration
  • httpx — Async HTTP client for ServiceNow REST APIs
  • pydantic / pydantic-settings — Configuration and validation
  • OAuth 2.0 — Password grant against ServiceNow /oauth_token.do
  • STDIO transport — Local deployment for Claude Code / Claude Desktop

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

servicenow_cmdb_mcp-0.1.2.tar.gz (124.3 kB view details)

Uploaded Source

Built Distribution

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

servicenow_cmdb_mcp-0.1.2-py3-none-any.whl (54.2 kB view details)

Uploaded Python 3

File details

Details for the file servicenow_cmdb_mcp-0.1.2.tar.gz.

File metadata

  • Download URL: servicenow_cmdb_mcp-0.1.2.tar.gz
  • Upload date:
  • Size: 124.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for servicenow_cmdb_mcp-0.1.2.tar.gz
Algorithm Hash digest
SHA256 bc3c4a15e694584521ec95df3462ead5fdb626502dfb91595b1d2aade63e40ac
MD5 c4b0d45a8a3433ba54bbf0870a1399d9
BLAKE2b-256 63ec33bbb08a5f52cfad7a6ee9f289c5a6b2b63f704107c2febc4c644069dde5

See more details on using hashes here.

File details

Details for the file servicenow_cmdb_mcp-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: servicenow_cmdb_mcp-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 54.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for servicenow_cmdb_mcp-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 caf8ef7a8a8589fcb713dae6affae0a43e38fac0a19387f3103fdcbb9d3c12a6
MD5 8bb1f1b0b4458238e0c9fbbbdb2dab03
BLAKE2b-256 0bbc53d726980fee4da8d7d349aa59474fb17af8e5fc5f05ba0ea107b6db6f10

See more details on using hashes here.

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