ServiceNow CMDB MCP Server
Enables interaction with ServiceNow CMDB tables through a Model Context Protocol server, allowing users to query any CMDB table with filtering, field selection, and pagination capabilities.
README Documentation
ServiceNow CMDB MCP Server
A Model Context Protocol (MCP) server for interacting with ServiceNow CMDB (Configuration Management Database) tables.
Features
- Tool:
get_cmdb_table_data
- Query any CMDB table with filtering, field selection, and pagination
Installation for Claude
Step 1: Setup the Server
-
Navigate to the project directory
cd "ServiceNow CMDB MCP"
-
Activate virtual environment
source venv/bin/activate # On Windows: venv\Scripts\activate
-
Configure ServiceNow credentials
cp .env.template .env
Edit
.env
file with your ServiceNow instance details:SERVICENOW_URL=https://your-instance.service-now.com SERVICENOW_USER=your-username SERVICENOW_PASS=your-password
-
Start the MCP server
python server.py
You should see:
INFO: Started server process
andINFO: Uvicorn running on http://127.0.0.1:9123
Step 2: Configure Claude
-
Open Claude settings (gear icon in bottom left)
-
Navigate to MCP section
-
Add the following configuration to your
mcpServers
section:"mcpServers": { "ServiceNowCMDB": { "command": "npx", "args": ["mcp-remote", "http://localhost:9123/mcp/"] } }
-
Save and restart Claude
Step 3: Verify Installation
Once Claude restarts, you should see:
- A new "ServiceNowCMDB" server in your MCP servers list
- Access to the
get_cmdb_table_data
tool
Prerequisites
- Python 3.11+
- Node.js and npm (for
npx
command) - ServiceNow instance with API access
- Valid ServiceNow credentials
Usage in Claude
After setup, you can use the tool in Claude:
Get all computers from CMDB:
Use get_cmdb_table_data with table_name="cmdb_ci_computer"
Get specific fields:
Use get_cmdb_table_data with table_name="cmdb_ci_computer" and fields="name,serial_number,manufacturer"
Filter by status:
Use get_cmdb_table_data with table_name="cmdb_ci_computer" and query="operational_status=1"
API Endpoints
The server runs on http://127.0.0.1:9123
by default.
Tools
get_cmdb_table_data
Query any CMDB table with optional filtering and field selection.
Parameters:
table_name
(required): Name of the CMDB tablequery
(optional): ServiceNow query string for filteringfields
(optional): Comma-separated list of fields to returnlimit
(optional): Maximum number of records (default: 100)offset
(optional): Number of records to skip (default: 0)
Usage Examples
Get all computers
await get_cmdb_table_data("cmdb_ci_computer")
Get specific fields
await get_cmdb_table_data(
"cmdb_ci_computer",
fields="name,serial_number,manufacturer"
)
Filter by status
await get_cmdb_table_data(
"cmdb_ci_computer",
query="operational_status=1"
)
Common CMDB Tables
cmdb_ci_computer
- Computer configuration itemscmdb_ci_server
- Server configuration itemscmdb_ci_network_gear
- Network equipmentcmdb_ci_storage_device
- Storage devicescmdb_ci_database
- Database configuration items
Error Handling
The server includes comprehensive error handling for:
- Missing credentials
- HTTP errors from ServiceNow
- Invalid JSON responses
- Network timeouts
License
MIT License