跳过安装。2 分钟内即可运行。
在 cloud.anythingmcp.com 开始免费试用,一键添加 ServiceNow,然后将你的 AI 客户端(Claude、ChatGPT、Copilot 或 Cursor)指向生成的 MCP 端点。无需 Docker,无需 git clone,无需任何工程经验。
摘要
让你的 AI 直接在 ServiceNow ITSM 中工作:查找、创建、更新、解决和关闭事件,处理变更请求和问题,跟进服务目录请求并订购目录项,搜索知识库,查找用户、组和 CMDB 配置项,并查询任意表。
试试这样问
ServiceNow 的示例提示
点击任意提示即可复制,然后粘贴到 Claude、ChatGPT、Cursor、Gemini、Copilot 或 OpenClaw 中,在该连接器上运行。
Claude 是 AI,可能会出错。请核对回答。
💡 无需安装? 直接使用 cloud.anythingmcp.com。 登录、点击 Connectors → ServiceNow、粘贴凭证、生成 MCP API key,即可完成。无 Docker、无
git clone、无本地服务器。
ServiceNow + Gemini
让你的 AI 直接在 ServiceNow ITSM 中工作:查找、创建、更新、解决和关闭事件,处理变更请求和问题,跟进服务目录请求并订购目录项,搜索知识库,查找用户、组和 CMDB 配置项,并查询任意表。
前提条件
完整的设置说明已内置在连接器中 (在 store 中选择连接器时可见)。所需环境变量:
SERVICENOW_INSTANCE, SERVICENOW_USERNAME, SERVICENOW_PASSWORD
步骤 1 — 获取凭证
ServiceNow 管理员只需设置一次,大约 10 分钟。想先试用的话,可以使用 https://developer.servicenow.com 提供的免费个人开发者实例。
- 创建一个集成用户:User Administration → Users → New。为其设置用户 ID 和强密码,勾选 Web service access only(该用户无法登录界面),并保持 Password needs reset 不勾选,否则第一次调用会失败。
- 为该用户分配工作所需的角色:
itil可读写事件、问题、变更请求、请求、请求项和目录任务,并可读取 CMDB。snc_platform_rest_api_access,仅当你的实例将 REST 访问限制为该角色时才需要(REST API 访问策略)。- 知识文章的可读范围取决于知识库的用户条件;只有撰写文章才需要
knowledge角色。 - 如需只读连接器,在
itil之外再添加snc_read_only:这样实例会拒绝所有写入。不要使用admin。
- 将
SERVICENOW_INSTANCE设置为实例名称本身(https://dev123456.service-now.com对应dev123456),将SERVICENOW_USERNAME和SERVICENOW_PASSWORD设置为集成用户的凭据。安装连接器:它使用 Basic 认证登录,安装检查会列出一条事件。
ACL 依然生效:用户能查看和修改的内容取决于实例的 ACL。无权读取的记录不会报错,而是直接不出现在列表中,因此列表意外为空时,通常是 ACL 的原因,或者在启用域分离时,是用户所属域的原因。
用 OAuth 代替密码:在实例上打开 System OAuth → Application Registry → New → Create an OAuth API endpoint for external clients,将重定向 URL 设置为 https://cloud.anythingmcp.com/api/mcp-oauth/callback(自托管:<your AnythingMCP URL>/api/mcp-oauth/callback)并保存。在 AnythingMCP 中打开连接器,将 Authentication 切换为 OAuth 2.0,填写客户端 ID 和密钥、授权 URL https://<instance>.service-now.com/oauth_auth.do 和令牌 URL https://<instance>.service-now.com/oauth_token.do,保存后点击 Authorize with Provider。登录的人将成为所有使用该连接器的人的 ServiceNow 用户,并具有该用户的角色。刷新令牌默认有效期为 100 天,过期后需重新授权。启用多因素登录的账户需要使用 OAuth,因为 Basic 认证无法应答第二个因素。
覆盖范围:事件(创建、更新、添加工作备注或客户评论、解决、关闭)、变更请求、问题、服务目录请求和请求项(含其订购表单的答案)、订购目录项、知识库搜索、用户、组及其成员、CMDB 配置项及其关系、附件,以及用户有权读取的任何其他表,并可按任意字段分组计数。
先确认:每个执行写入的工具都会注明这一点,AI 会向你展示将要更改的内容,并等待你确认。客户评论通常会通过电子邮件发送给报告人。写入操作会像在界面中修改一样,以集成用户的名义触发你的业务规则、工作流、SLA 和通知。servicenow_delete_record 安装时默认关闭。
筛选:列表类工具接受 ServiceNow 编码查询,例如 active=true^priority=1^assignment_group.name=Service Desk。最简单的获取方式是在界面中操作:筛选一个列表,右键点击筛选路径(breadcrumb),然后选择 Copy query。列表默认返回 20 条记录,每次调用最多 1,000 条。
常见错误:401 表示用户名或密码错误、用户被锁定或未激活,或 OAuth 授权已过期。403 Failed API level ACL Validation 或 Insufficient rights:用户缺少相应角色或 ACL,或者 REST 访问策略阻止了调用。404 No Record found:该表中不存在此记录,或者记录被 ACL 隐藏。已进入休眠的个人开发者实例会返回一个唤醒页面:在 developer.servicenow.com 上打开它一次即可。
自定义域名:使用自有主机名提供服务的实例,需要在连接器设置中将基础 URL 改为 https://<host>/api。
步骤 2 — 安装 adapter
curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d
步骤 3 — 在 Gemini 中添加连接器
你的服务器 URL: 在 AnythingMCP 中打开 MCP Servers → 此连接器所在的服务器,复制它的 URL(
https://cloud.anythingmcp.com/mcp/…)。本指南中出现YOUR_SERVER_ID的地方都用它替换。
Gemini CLI 从 ~/.gemini/settings.json(Windows 上为 %USERPROFILE%\.gemini\settings.json)读取 MCP 服务器。添加:
{
"mcpServers": {
"anythingmcp": {
"httpUrl": "https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID",
"headers": { "X-API-Key": "YOUR_MCP_API_KEY" }
}
}
}
- 在 AnythingMCP 的 MCP Servers → 你的服务器 → API keys 中创建 MCP API 密钥,并用它替换
YOUR_MCP_API_KEY。 - 保存文件并重启
gemini。 - 在 Gemini CLI 中运行
/mcp(或在终端运行gemini mcp list),anythingmcp应显示为已连接。 - 开始输入提示,Gemini CLI 现在可以调用
ServiceNow的工具。
可用工具
| Tool | What it does |
|---|---|
servicenow_list_incidents | List incidents from the incident table, newest first by default |
servicenow_get_incident | Read one incident by its number (INC0010023) with all its fields, including sys_id, which the update tools need |
servicenow_create_incident | Open a new incident. short_description is required; impact and urgency (1 High, 2 Medium, 3 Low) set the priority |
servicenow_update_incident | Change fields of an incident by sys_id (from servicenow_get_incident): reassign, change state, impact or urgency, put on hold (state 3… |
servicenow_add_note | Add a work note (internal, fulfillers only) or an additional comment (visible to the caller or requester, and usually e-mailed to them) to… |
servicenow_resolve_incident | Resolve an incident: sets state 6 (Resolved) with the resolution code (close_code) and resolution notes (close_notes), which ServiceNow… |
servicenow_close_incident | Close an incident: sets state 7 (Closed) with the resolution code (close_code) and resolution notes (close_notes), which ServiceNow… |
servicenow_list_change_requests | List change requests from the change_request table, newest first by default |
servicenow_get_change_request | Read one change request by its number (CHG0030001) with all its fields, including sys_id, which the update tools need |
servicenow_create_change_request | Create a change request (type normal or emergency) in state New |
servicenow_update_change_request | Change fields of a change request by sys_id: plans, planned window, assignment, risk, or the state (-5 New, -4 Assess, -3 Authorize, -2… |
servicenow_list_problems | List problems from the problem table, newest first by default |
servicenow_get_problem | Read one problem by its number (PRB0040001) with all its fields, including sys_id, which the update tools need |
servicenow_create_problem | Open a problem record for the root cause behind one or more incidents |
servicenow_update_problem | Change fields of a problem by sys_id: assignment, root cause (cause_notes), fix (fix_notes), workaround, known_error, or the state (101… |
servicenow_list_requests | List service catalog requests (REQ numbers) from the sc_request table, newest first by default |
servicenow_list_requested_items | List requested items (RITM numbers, one per ordered catalog item) from the sc_req_item table, newest first by default |
servicenow_get_requested_item | Read one requested item by its number (RITM0010001) with all its fields, including sys_id, which the update tools need |
servicenow_get_requested_item_variables | Read the variables (the questions of the catalog form and the requester's answers) of one requested item by its sys_id |
servicenow_search_catalog_items | Search the service catalog for items the integration user may order ("laptop", "VPN access", "new hire") |
servicenow_get_catalog_item | Read one catalog item by sys_id with its order form: variables (name, label, type, mandatory, choices), price and description |
servicenow_order_catalog_item | Order a catalog item right away (Order Now): creates a request (REQ) with a requested item (RITM) and starts its approvals and fulfilment… |
servicenow_search_knowledge | Search knowledge articles by keywords with ServiceNow's text index (the same search as the knowledge portal, on title and body) |
servicenow_get_knowledge_article | Read one knowledge article by its number (KB0010001): title, body (text, HTML), knowledge base, category, author, state and validity |
servicenow_find_users | Find active users by part of their name, e-mail or user ID |
servicenow_find_groups | Find active groups (assignment groups, approval groups) by part of their name |
servicenow_list_group_members | List the members of a group by the group's sys_id (from servicenow_find_groups): user sys_id, name, user ID and e-mail |
servicenow_find_configuration_items | Find configuration items (servers, applications, network gear, services) in the CMDB by part of their name, IP address, FQDN or serial… |
servicenow_get_configuration_item | Read one configuration item with the CMDB Instance API: all its attributes plus its outbound and inbound relationships (Runs on, Depends… |
servicenow_query_table | Query any table the integration user may read with the Table API: sysparm_query (encoded query), sysparm_fields, sysparm_limit… |
servicenow_get_record | Read one record of any table by sys_id, with all fields or the ones given |
servicenow_count_records | Count records with the Aggregate API instead of fetching them, optionally grouped by a field: open incidents per assignment group, changes… |
servicenow_list_choices | List the allowed values of a choice field on this instance (sys_choice): state, close_code, category, subcategory, hold_reason, impact… |
servicenow_update_record | Change fields of any record by table and sys_id with a PATCH (only the fields given change), e.g. close a catalog task (sc_task state 3) or… |
servicenow_delete_record | Delete a record of any table by sys_id |
servicenow_list_attachments | List the files attached to a record (any table): file_name, content_type, size_bytes, sys_id, created on and by, and download_link |
示例提示
- “显示分配给 Service Desk 组的所有未关闭的优先级 1 事件,按从旧到新排列。”
- “为慕尼黑办公室的 VPN 故障创建一个事件,影响为高,紧急度为中,并分配给 Network Operations。”
- “现在每个分配组各有多少未关闭的事件?”
- “在知识库中搜索如何重置 MFA 设备,并总结步骤。”
FAQ
Gemini CLI 从哪里读取 MCP 服务器? 用户级配置位于 ~/.gemini/settings.json,项目级配置位于项目内的 .gemini/settings.json。gemini mcp list 会列出每个服务器及其连接状态。
下一步
这份指南对你有帮助吗?