Skip to main content
Glama
vinayulli

ServiceNow CMDB MCP Server

by vinayulli

ServiceNow CMDB MCP Server

A read-only Python project for:

  1. Listing and searching ServiceNow configuration items.

  2. Searching by manufacturer, model name, model number, serial number, network identity, and CI class.

  3. Reading direct CI relationships from cmdb_rel_ci.

  4. Traversing the relationship graph to a controlled depth.

  5. Exposing the functions as MCP tools with FastMCP.

1. Create and activate a virtual environment

Windows PowerShell:

python -m venv .venv
.\.venv\Scripts\Activate.ps1

macOS/Linux:

python -m venv .venv
source .venv/bin/activate

Related MCP server: servicenow-api

2. Install packages

pip install -r requirements.txt

3. Configure the PDI

Copy .env.example to .env and enter your PDI URL and credentials.

Windows:

Copy-Item .env.example .env

macOS/Linux:

cp .env.example .env

Do not commit .env.

4. Test the ServiceNow REST APIs

Connectivity:

python test_api.py health

List ten CIs:

python test_api.py list --limit 10

Search by manufacturer:

python test_api.py search --manufacturer Cisco

Search by model name:

python test_api.py search --model-name Catalyst

Combine manufacturer and model:

python test_api.py search --manufacturer Cisco --model-name Catalyst

Read direct relationships:

python test_api.py relationships YOUR_32_CHARACTER_SYS_ID

Build a two-level graph:

python test_api.py tree YOUR_32_CHARACTER_SYS_ID --depth 2

5. Run the MCP server using stdio

Keep this in .env:

MCP_TRANSPORT=stdio

Run:

python mcp_server.py

For an MCP desktop/client configuration, use the absolute Python and script paths and pass the ServiceNow credentials through the environment.

6. Run over Streamable HTTP

Set:

MCP_TRANSPORT=http
MCP_HOST=127.0.0.1
MCP_PORT=9000

Start the server:

python mcp_server.py

The endpoint is:

http://127.0.0.1:9000/mcp

In another terminal:

python test_mcp_client.py

You can also use MCP Inspector:

npx -y @modelcontextprotocol/inspector

Then connect it to:

http://127.0.0.1:9000/mcp

Notes

  • The server performs read-only GET operations.

  • Search field names and operators are allowlisted.

  • User-provided encoded ServiceNow queries are not accepted.

  • CMDB graphs can contain cycles, so the dependency result contains nodes and edges rather than forcing the data into a nested tree.

  • An empty result usually means the PDI has no sample CIs or relationships.

F
license - not found
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/vinayulli/ServiceNow-MCP-Server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server