servicenow-mcp
servicenow-mcp
一个通过 Table API 管理 ServiceNow 事件的 MCP 服务器。提供了创建、读取、更新、搜索、评论和解决事件的工具。
设置
安装依赖:
uv sync将
.env.example复制为.env并填写您的凭据:cp .env.example .envSERVICENOW_INSTANCE:仅实例名称(例如dev12345对应于dev12345.service-now.com)SERVICENOW_USERNAME/SERVICENOW_PASSWORD:拥有对incident表(通过 Table API 进行读写访问权限)的用户的 basic auth 凭据
直接运行服务器以快速检查其是否能正常启动:
uv run servicenow-mcp
Related MCP server: servicenow-api
与 Claude Desktop / Claude Code 一起使用
有两种连接方式,具体取决于您是希望所有使用该服务器的用户共享一个 ServiceNow 服务账户,还是每个人都使用自己的身份进行身份验证。完整说明请参见下面的身份验证。
选项 A — stdio,共享服务账户
客户端将服务器本身作为子进程启动;每次工具调用都使用通过 env 传入的 SERVICENOW_USERNAME / SERVICENOW_PASSWORD。
{
"mcpServers": {
"servicenow": {
"command": "uv",
"args": ["--directory", "/absolute/path/to/servicenow-mcp", "run", "servicenow-mcp"],
"env": {
"SERVICENOW_INSTANCE": "your-instance",
"SERVICENOW_USERNAME": "your-username",
"SERVICENOW_PASSWORD": "your-password"
}
}
}
}选项 B — HTTP,每个客户端凭据
将服务器启动一次作为长时间运行的 HTTP 进程(它只需要 SERVICENOW_INSTANCE,加上 SERVICENOW_USERNAME/PASSWORD 作为没有认证头请求的回退):
uv run servicenow-mcp --transport streamable-http --host 127.0.0.1 --port 8003然后将 .mcp.json 指向它,并发送您自己的 ServiceNow 登录信息作为 HTTP Basic Auth 头——这使连接成为“客户端级别”:凭据存在于您的客户端配置中,而不是服务器中:
{
"mcpServers": {
"servicenow": {
"type": "http",
"url": "http://127.0.0.1:8003/mcp",
"headers": {
"Authorization": "Basic <base64 of your-username:your-password>"
}
}
}
}在终端中生成 base64 值(注意前导空格,这是 echo 的 -n 选项避免的):
echo -n "your-username:your-password" | base64.mcp.json 不像 .env 那样受 .gitignore 覆盖——如果此目录将来成为共享/git 仓库,不要将真实凭据提交到其中。
工具
create_incident— 创建新事件get_incident— 按编号(例如INC0010023)或 sys_id 获取update_incident— 更新任意字段search_incidents— 使用 ServiceNow 编码查询(sysparm_query)进行搜索add_comment— 添加客户可见评论或内部工作备注resolve_incident— 将状态设置为已解决,并附带关闭备注/代码
身份验证
身份验证是 basic auth(用户名/密码)。这些凭据的来源取决于传输方式:
stdio:始终使用来自
.env的共享SERVICENOW_USERNAME/SERVICENOW_PASSWORD。HTTP(
sse/streamable-http):每个请求可以通过发送标准 HTTP Basic Auth 头使用其自己的 ServiceNow 用户进行身份验证:Authorization: Basic base64(username:password)SERVICENOW_INSTANCE保留在服务器端(对所有客户端来说是一个实例),但用户名/密码是每个客户端的——因此search_incidents结果、caller_id解析等会反映该个别用户的 ServiceNow 权限,而不是一个共享服务账户。如果请求没有Authorization头,它将回退到来自.env的共享SERVICENOW_USERNAME/SERVICENOW_PASSWORD。
如果您以后需要 OAuth 2.0,请将 src/servicenow_mcp/client.py 中的 requests.Session.auth 设置替换为基于令牌的流程——客户端的其余部分与认证无关。
备注
事件表的
state字段是数字(例如6= 已解决,7= 已关闭);如果您的实例自定义了事件状态,值可能不同。
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 Servers
- AlicenseAqualityAmaintenanceAn MCP server that enables AI assistants to interact with ServiceNow instances, allowing script execution, data querying, ATF tests, and log tailing through natural language commands.8736413MIT
- Alicense-qualityBmaintenanceMCP server enabling interaction with ServiceNow API for managing incidents, CMDB, change management, and other ServiceNow operations via natural language.19MIT
- FlicenseAqualityCmaintenanceA production-ready MCP server that turns any MCP-compatible AI assistant into an AI-powered ServiceNow Incident Management Assistant, exposing incidents, users, CMDB records, and knowledge articles through validated tools.12
- Alicense-qualityDmaintenanceMCP server to interact with ServiceNow instances, enabling ITSM, CMDB, workflow, and knowledge search operations.MIT
Related MCP Connectors
GibsonAI MCP server: manage your databases with natural language
MCP server for generating rough-draft project plans from natural-language prompts.
Markdown-first MCP server for Notion API with 8 composite tools and 39 actions.
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/siddhardhan/servicenow-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server