ServiceNow MCP Demo — Incident Assistant
ServiceNow MCP Demo — Incident Assistant
一个端到端的 Model Context Protocol 演示,将 Claude 连接到 ServiceNow Incident Management。项目旨在展示 MCP 核心概念(servers、clients、tools、resources、stdio transport、agent loops)如何应用于真实的 ITSM 工作流。
架构
┌─────────────────────────────┐ ┌───────────────────────────────┐ ┌────────────────┐
│ Web Client (Streamlit) │ MCP │ MCP Server (FastMCP) │ REST │ ServiceNow │
│ - MCP host + client │◄──────►│ - create_incident │◄──────►│ Table API │
│ - Claude agent loop │ stdio │ - get_incident │ │ (or mock mode)│
│ - Incident cards in UI │JSON-RPC│ - list_recent_incidents │ │ │
│ │ │ - update_incident_state │ │ │
│ │ │ - resolve_incident │ │ │
│ │ │ - search_knowledge_articles │ │ │
│ │ │ - resource: priority │ │ │
│ │ │ matrix reference │ │ │
└─────────────────────────────┘ └───────────────────────────────┘ └────────────────┘“我的笔记本电脑无法启动,帮我开一张工单”的处理流程:
Web 客户端将你的消息连同它在启动时从 MCP 服务器发现到的工具 schema(
tools/list)一起发送给 Claude。Claude 决定调用
create_incident,并传入推断出的 urgency/impact/category。客户端通过 MCP(
tools/call)转发该调用;服务器调用 ServiceNow Table API(或内存 mock)。结果返回后,Claude 确认事件编号;UI 渲染出事件卡片。
Related MCP server: ServiceNow MCP Server (SSE)
快速开始
# 1. Create a virtual environment
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
# 2. Install dependencies
pip install -r requirements.txt
# 3. Configure
cp .env.example .env # then edit: add your ANTHROPIC_API_KEY
# leave SERVICENOW_MODE=mock for a no-setup demo
# 4. Run the web client (it launches the MCP server automatically)
streamlit run client/app.py打开 http://localhost:8501,然后试试:
“我的笔记本电脑无法启动,一小时后我还有客户演示——帮我开一张工单。”
“显示最近 5 条事件。”
“将 INC0010001 移至 In Progress,并附上一条 work note,说明技术人员已在上门途中。”
“有没有关于笔记本电脑无法开机的 KB 文章?”
“修好了——解决 INC0010001,标记为 solved permanently,已更换充电器。”
ServiceNow 实时模式
在 https://developer.servicenow.com 申请一个免费的 Personal Developer Instance(PDI)(约需 ~2 分钟)。
在
.env中设置SERVICENOW_MODE=live,并填写SERVICENOW_INSTANCE、SERVICENOW_USER、SERVICENOW_PASSWORD。重启应用。创建的事件会出现在你的 PDI 的 Incident > All 中——非常适合在演示期间在真实的 ServiceNow UI 里展示工单。
PDI 闲置一段时间后会休眠。请在面试前 ~15 分钟唤醒你的实例,并把
mock模式留作后备方案。
search_knowledge_articles会直接查询 PDI 的kb_knowledge表——在实时模式下演示之前,请先在那里预置 2–3 篇已发布的 KB 文章,标题要与你的演示场景相匹配(例如“笔记本电脑无法开机”),否则实时搜索会返回空结果。mock 模式自带 3 篇预置文章,开箱即用。
单独测试服务器(无 UI)
MCP Inspector 是证明服务器能独立工作的最快方式:
npx @modelcontextprotocol/inspector python server/servicenow_server.py你也可以将服务器添加到 Claude Desktop(claude_desktop_config.json):
{
"mcpServers": {
"servicenow": {
"command": "python",
"args": ["/absolute/path/to/server/servicenow_server.py"]
}
}
}项目结构
servicenow-mcp-demo/
├── server/servicenow_server.py # FastMCP server: 6 tools + 1 resource, mock/live backends
├── client/app.py # Streamlit web app: MCP client + Claude agent loop
├── requirements.txt
├── .env.example
├── PROJECT_PLAN.md # Phase-by-phase build plan and status
└── DEMO_SCRIPT.md # 5-minute recorded-demo script演示的 MCP 概念
Server:使用 FastMCP 构建,工具带有类型化参数,schema 由 docstring 驱动
Resource(
servicenow://reference/priority-matrix)——只读上下文,与 tools 不同stdio transport——客户端启动服务器子进程,并通过 JSON-RPC 通信
Capability discovery——客户端从不硬编码工具,而是调用
tools/listAgent loop——与 Claude 进行多轮工具调用,直到得到最终文本回答
Separation of concerns——同一个服务器无需任何修改,即可用于这个 Web 客户端、Claude Desktop 或 MCP Inspector
This server cannot be installed
Maintenance
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
Build and manage AI-native customer support agents from Claude or any MCP client.
Connect Claude AI to UluP Spaces via MCP — create projects, nodes, and tasks with OAuth 2.0.
A Model Context Protocol (MCP) application for automated GitHub PR analysis and issue management.…
Enable secure connectivity between Sentry issues and debugging data, and LLM clients, using a Model Context Protocol (MCP) server.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables AI assistants and development tools to interact with ServiceNow instances, providing comprehensive API coverage for incident management, change management, CMDB, and other ServiceNow modules.3MIT
- FlicenseNot gradedqualityDmaintenanceA browser-accessible Model Context Protocol server that enables AI assistants to manage ServiceNow incidents using Server-Sent Events. It provides comprehensive tools for creating, listing, retrieving, and updating incidents through a type-safe RESTful interface.
- AlicenseBqualityAmaintenanceConnect Claude AI to ServiceNow with 19 tools and 5 resources for incidents, CMDB, update sets, and more, accessible from any MCP client over stdio or Streamable HTTP.1916MIT
- FlicenseNot gradedqualityBmaintenanceA local gateway that exposes ServiceNow REST APIs as MCP tools, enabling natural language interaction with ServiceNow incidents, changes, CMDB, and scripts via Claude and other MCP clients.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/darrylsarkisian-debug/servicenow-mcp-demo'
If you have feedback or need assistance with the MCP directory API, please join our Discord server