Skip to main content
Glama
mukhtar-zargar

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/pytest

Maintenance

ActivityMaintained
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

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

Related MCP Connectors

Related MCP Servers

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/mukhtar-zargar/servicenow-mcp'

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