mcp-server-servicenow
Copilot instructions24 starsChanged 9 months agoMITView on GitHub
Python MCP server built with FastMCP 4.0. Exposes 19 tools + 5 resources for ServiceNow via the Model Context Protocol (speaks both the stateless 2026-07-28 revision and the legacy handshake).
- Installs packages
In this repository4 other files it gives its agents.
- exploring-tablesSkill
- reviewing-update-setsSkill
- servicenow-cmdbSkill
- triaging-incidentsSkill
The file
Files
ServiceNow MCP Server — AI Coding Instructions
Python MCP server built with FastMCP 4.0. Exposes 19 tools + 5 resources for ServiceNow via the Model Context Protocol (speaks both the stateless 2026-07-28 revision and the legacy handshake).
Source Code
src/servicenow_mcp/tools/— Tool modules with@mcp.tool()decorators (table, CMDB, system, update sets)src/servicenow_mcp/auth/— Auth manager (basic, OAuth, API key) + OAuth proxy + token verifiersrc/servicenow_mcp/utils/— Pydantic config models, HTTP helpersrc/servicenow_mcp/server.py— FastMCP singleton,make_sn_request()helpersrc/servicenow_mcp/cli.py— CLI entry point with argparse
Critical Patterns
- Tools use
@mcp.tool()decorator — Importmcpfromservicenow_mcp.server. UseAnnotated[type, Field(description="...")]for parameters. - All API calls go through
make_sn_request()— Handles per-user OAuth tokens (proxy mode) vs global auth. Never callrequests.get()directly. - Config uses Pydantic BaseModel —
ServerConfig,AuthConfiginutils/config.py. CLI args and env vars resolved incli.py. - Auth manager handles token lifecycle —
auth_manager.get_headers()returns ready-to-use headers. OAuth tokens auto-refresh on 401. - Responses use
parse_json_response()— Fromutils/http.py. Handles HTML login pages (hibernating instance) gracefully.
Build & Test
pip install -e ".[dev]"
python -m pytest tests/ -v --ignore=tests/integration
ruff check src/ tests/
ruff format --check src/ tests/Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

