Back to MCP directory
publicPublicdnsLocal runtime

ServiceNow

一个基于Model Context Protocol (MCP)的服务,提供与ServiceNow的接口,允许AI代理通过安全API访问和操作ServiceNow数据,支持自然语言交互。

article

README

🚀 ServiceNow MCP 服务器

一个与 ServiceNow 对接的模型上下文协议 (MCP) 服务器,允许 AI 代理通过安全的 API 访问和操作 ServiceNow 数据。使用该服务器,可通过自然语言与 ServiceNow 进行交互,让搜索记录、更新数据和管理脚本变得更加简便。

🚀 快速开始

你可以通过以下方式启动 ServiceNow MCP 服务器:

命令行运行

使用 Python 模块启动服务器:

python -m mcp_server_servicenow.cli --url "https://your-instance.service-now.com/" --username admin --password admin

配置文件

创建一个配置文件 config.json,内容如下:

{
    "instance_url": "https://your-instance.service-now.com/",
    "username": "admin",
    "password": "admin"
}

然后运行:

python -m mcp_server_servicenow.cli --config config.json

✨ 主要特性

资源

  • servicenow://incidents:列出最近的故障单
  • servicenow://incidents/{number}:通过编号获取特定故障单
  • servicenow://users:列出用户信息
  • servicenow://knowledge:列出知识库文章
  • servicenow://tables:展示可用表格
  • servicenow://tables/{table}:从指定表格获取记录
  • servicenow://schema/{table}:获取表格的模式信息

工具

基础工具

  • create_incident:创建新的故障单
  • update_incident:更新现有故障单
  • search_records:使用文本查询搜索记录
  • get_record:通过 sys_id 获取特定记录
  • perform_query:执行 ServiceNow 查询
  • add_comment:添加客户可见的评论(仅显示给客户)
  • add_work_notes:添加内部工作笔记

自然语言工具

  • natural_language_search:使用自然语言搜索记录(例如:查找所有关于邮件的故障单)
  • natural_language_update:使用自然语言更新记录(例如:将故障单 INC0010001 更新为“正在处理中”)
  • update_script:更新 ServiceNow 脚本文件(脚本包含、业务规则等)

📦 安装指南

从 PyPI 安装

pip install mcp-server-servicenow

从源码安装

git clone https://github.com/michaelbuckner/servicenow-mcp.git
cd servicenow-mcp
pip install -e .

📚 详细文档

开发

安装开发依赖

pip install -e ".[dev]"

运行测试

pytest

贡献

欢迎贡献!请随意提交 Pull Request。

  1. 叉取仓库
  2. 创建功能分支(git checkout -b feature/amazing-feature
  3. 提交更改(git commit -m 'Add some amazing feature'
  4. 推送到分支(git push origin feature/amazing-feature
  5. 提交 Pull Request

📄 许可证

本项目采用 MIT License 许可证,具体内容请参见 LICENSE 文件。 MIT License

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client