ServiceNow MCP Server
ServiceNow MCP Server
一个自托管的 Model Context Protocol 服务器,将 ServiceNow 实例暴露给 MCP 客户端,例如 Microsoft Copilot Studio(以及任何其他 MCP 客户端,如 Claude)。它完全在 标准 ServiceNow 许可 上运行,通过调用平台的 REST API(Table / Aggregate / CMDB)实现,并使用 每用户 OAuth 2.0 令牌透传,因此每次调用都以已登录用户的身份运行,并强制执行其自己的 ACL。
为什么存在
目标实例使用标准 ServiceNow 许可,因此 ServiceNow 原生的 MCP Server Console(仅限 Now Assist / AI Native SKU)不可用。此服务器是一个可移植、可重用的集成层——一个 MCP 服务器,可用于各种客户端和 AI 前端——而不是特定于 Copilot Studio 的连接器。
Related MCP server: servicenow-mcp-server
认证工作原理(令牌透传)
User ⇄ Copilot Studio --(per-user OAuth: ServiceNow access token as Bearer)--> this server
│ forwards the same Bearer token
▼
ServiceNow REST APIs (ACLs enforced as that user)服务器不存储任何用户凭据。它读取传入的 Authorization: Bearer <token> 标头,并将其原样转发给 ServiceNow。参见 auth.py。
工具
第一层 — 直接检索(只读):
get_incident, list_incidents, get_change_request, list_change_requests,
get_service_request, list_service_requests, get_configuration_item,
find_configuration_items, search_knowledge, get_knowledge_article, lookup_user,
lookup_group。
第二层 — 确定性逻辑:
correlate_changes_to_incident, get_incident_trends, get_ci_impact,
find_similar_incidents, get_incident_context。
根本原因分析和最终的相似事件排名有意留给代理的推理,由 get_incident_context / find_similar_incidents 提供支持。
本地运行
python -m venv .venv
.venv/Scripts/pip install -e ".[dev]" # Windows; use .venv/bin on macOS/Linux
cp .env.example .env # set SERVICENOW_INSTANCE_URL
SERVICENOW_INSTANCE_URL=https://devXXXXX.service-now.com .venv/Scripts/servicenow-mcp服务器监听 http://HOST:PORT/mcp(Streamable HTTP),并带有 /health 探针。
使用 MCP Inspector 检查
npx @modelcontextprotocol/inspector将其指向 http://localhost:8000/mcp,选择 Streamable HTTP,并提供 ServiceNow OAuth 访问令牌作为 Bearer 令牌来使用这些工具。这是最接近 Swagger UI 的 MCP 等价物:它列出每个工具及其架构,并允许您以交互方式调用每个工具。
列出所有工具(无需服务器或 ServiceNow 连接)
.venv/Scripts/python scripts/list_tools.py # human-readable catalog
.venv/Scripts/python scripts/list_tools.py --json # machine-readable (like an OpenAPI dump)部署
容器镜像 + Azure Container Apps。有关 ServiceNow OAuth 应用注册、Copilot Studio 接线和基础设施,请参阅 docs/DEPLOYMENT.md。
如需完整的逐步演练——包括通过开发隧道暴露本地服务器、从头创建代理以及双用户 ACL 测试——请参阅 docs/COPILOT_STUDIO_SETUP.md。
测试
.venv/Scripts/pytestTool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Governed MCP gateway: one endpoint for your tools, with credential custody and audit log.
One OAuth connector for your team's remote MCP servers, with Tool Packs, guardrails and logs.
One MCP endpoint for your company's tools, with per-person sign-in, policy and audit.
Find, document and execute authenticated API calls across 1000+ apps via one MCP server
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables authenticated interaction with ServiceNow via its REST API using per-user OAuth 2.0 tokens. It provides tools for managing incidents, tasks, knowledge articles, and service catalog requests while maintaining user-specific permissions.4-
- AlicenseAqualityDmaintenanceEnables natural language interaction with ServiceNow instances for managing incidents, changes, CMDB, service catalog, users, groups, and knowledge base via MCP.4151 npm1MIT
- AlicenseNot gradedqualityDmaintenanceMCP server to interact with ServiceNow instances, enabling ITSM, CMDB, workflow, and knowledge search operations.MIT
- AlicenseNot gradedqualityCmaintenanceEnables MCP clients to interact with ServiceNow instances for IT service management, CMDB, ITOM, and other domains via a governed skill catalog and runtime that enforces ACLs, business rules, and data policies.1Apache 2.0