by Knuckles-Team
Provides a Python wrapper for ServiceNow APIs and can operate as an MCP server, enabling programmatic interaction with ServiceNow tables, incidents, change management, CI/CD, and custom endpoints.
Enables developers to access and manipulate ServiceNow data through a clean Python interface. It also includes a standalone MCP server that can be deployed for Agentic AI integrations, exposing ServiceNow functionality over HTTP.
python -m pip install servicenow-apiimport servicenow_api
client = servicenow_api.Api(
url="https://your-instance.service-now.com",
username="YOUR_USERNAME",
password="YOUR_PASSWORD",
client_id="YOUR_CLIENT_ID", # optional for OAuth
client_secret="YOUR_CLIENT_SECRET" # optional for OAuth
)
client.get_table(table="incident") or use specialized helpers for change management, CI/CD, etc.docker pull knucklessg1/servicenow:latest
Configure compose.yml and mcp.json as shown in the README, then start the container.
parent.value.nested_value) and model_dump() for dictionary output.Q: Do I need a ServiceNow developer instance? A: Yes, a reachable ServiceNow instance with proper API permissions is required.
Q: Which authentication method should I choose? A: OAuth is recommended for production environments; basic auth works for quick tests or on‑prem setups.
Q: Can I extend the wrapper with my own endpoints?
A: Absolutely. Use client.custom_request(method, endpoint, data) to call any ServiceNow REST API not covered out‑of‑the‑box.
Q: How do I run the MCP server without Docker?
A: The package can be launched via uv run --with servicenow-api servicenow-mcp as indicated in the mcp.json configuration.
Q: What Python versions are supported? A: The library follows typical packaging practices; Python 3.8+ is recommended.
Version: 1.1.4
ServiceNow API Python Wrapper
This repository is actively maintained and will continue adding more API calls
This can run as a standalone MCP Server for Agentic AI!
Contributions are welcome!
All API Response objects are customized for the response call. You can get all return values in a parent.value.nested_value format, or you can run parent.model_dump() to get the table in dictionary format.
If your API call isn't supported, you can always run the standard custom API endpoint function to get/post/put/delete and endpoint
OAuth Authentication
#!/usr/bin/python
# coding: utf-8
import servicenow_api
username = "<SERVICENOW USERNAME>"
password = "<SERVICENOW PASSWORD>"
client_id = "<SERVICENOW CLIENT_ID>"
client_secret = "<SERVICENOW_CLIENT_SECRET>"
servicenow_url = "<SERVICENOW_URL>"
client = servicenow_api.Api(url=servicenow_url,
username=username,
password=password,
client_id=client_id,
client_secret=client_secret)
table = client.get_table(table="<TABLE NAME>")
print(f"Table: {table.model_dump()}")
Basic Authentication
#!/usr/bin/python
# coding: utf-8
import servicenow_api
username = "<SERVICENOW USERNAME>"
password = "<SERVICENOW PASSWORD>"
servicenow_url = "<SERVICENOW_URL>"
client = servicenow_api.Api(url=servicenow_url,
username=username,
password=password)
table = client.get_table(table="<TABLE NAME>")
print(f"Table: {table.model_dump()}")
Proxy and SSL Verify
#!/usr/bin/python
# coding: utf-8
import servicenow_api
username = "<SERVICENOW USERNAME>"
password = "<SERVICENOW PASSWORD>"
servicenow_url = "<SERVICENOW_URL>"
proxy = "https://proxy.net"
client = servicenow_api.Api(url=servicenow_url,
username=username,
password=password,
proxy=proxy,
verify=False)
table = client.get_table(table="<TABLE NAME>")
print(f"Table: {table.model_dump()}")
Deploy MCP Server as a Service
docker pull knucklessg1/servicenow:latest
Modify the compose.yml
services:
servicenow-mcp:
image: knucklessg1/servicenow:latest
environment:
- HOST=0.0.0.0
- PORT=8004
ports:
- 8004:8004
Configure mcp.json
Recommended: Store secrets in environment variables with lookup in JSON file.
For Testing Only: Plain text storage will also work, although not recommended.
{
"mcpServers": {
"servicenow": {
"command": "uv",
"args": [
"run",
"--with",
"servicenow-api",
"servicenow-mcp"
],
"env": {
"SERVICENOW_INSTANCE": "https://www.servicenow.com",
"SERVICENOW_USERNAME": "user",
"SERVICENOW_PASSWORD": "pass",
"SERVICENOW_CLIENT_ID": "client_id",
"SERVICENOW_CLIENT_SECRET": "client_secret",
"SERVICENOW_VERIFY": "False"
},
"timeout": 200000
}
}
}
Install Python Package
python -m pip install servicenow-api
python ./test/test_servicenow_models.py
Please log in to share your review and rating for this MCP.
Explore related MCPs that share similar capabilities and solve comparable challenges
by activepieces
A self‑hosted, open‑source platform that provides a no‑code builder for creating, versioning, and running AI‑driven automation workflows. Pieces are TypeScript‑based plugins that become MCP servers, allowing direct consumption by large language models.
by Skyvern-AI
Automates browser‑based workflows by leveraging large language models and computer‑vision techniques, turning natural‑language prompts into fully functional web interactions without writing custom scripts.
by ahujasid
Enables Claude AI to control Blender for prompt‑assisted 3D modeling, scene creation, and manipulation via a socket‑based Model Context Protocol server.
by PipedreamHQ
Connect APIs quickly with a free, hosted integration platform that enables event‑driven automations across 1,000+ services and supports custom code in Node.js, Python, Go, or Bash.
by elie222
Organizes email inbox, drafts replies in the user's tone, tracks follow‑ups, and provides analytics to achieve inbox zero quickly.
by grab
Enables Cursor AI to read and programmatically modify Figma designs through a Model Context Protocol integration.
by CursorTouch
Enables AI agents to control the Windows operating system, performing file navigation, application launching, UI interaction, QA testing, and other automation tasks through a lightweight server.
by ahujasid
Enables Claude AI to control Ableton Live in real time, allowing AI‑driven creation, editing, and playback of tracks, clips, instruments, and effects through a socket‑based server.
by leonardsellem
Provides tools and resources to enable AI assistants to manage and execute n8n workflows via natural language commands.