Skip to main content
Glama
michaelbuckner

ServiceNow MCP Server

ServiceNow MCP 服务器

许可证:MIT

一个与 ServiceNow 交互的模型上下文协议 (MCP) 服务器,允许 AI 代理通过安全的 API 访问和操作 ServiceNow 数据。该服务器支持与 ServiceNow 进行自然语言交互,从而更轻松地搜索、更新记录和管理脚本。

特征

资源

  • 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 :使用自然语言搜索记录(例如,“查找有关 SAP 的所有事件”)

  • natural_language_update :使用自然语言更新记录(例如,“更新事件 INC0010001,并说明我正在处理此事”)

  • update_script :更新 ServiceNow 脚本文件(脚本包含、业务规则等)

Related MCP server: AI MCP ServiceNow

安装

来自 PyPI

pip install mcp-server-servicenow

来自源

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

用法

命令行

使用 Python 模块运行服务器:

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

或者使用环境变量:

export SERVICENOW_INSTANCE_URL="https://your-instance.service-now.com/"
export SERVICENOW_USERNAME="your-username"
export SERVICENOW_PASSWORD="your-password"
python -m mcp_server_servicenow.cli

Cline 中的配置

要将此 MCP 服务器与 Cline 一起使用,请将以下内容添加到您的 MCP 设置文件中:

{
  "mcpServers": {
    "servicenow": {
      "command": "/path/to/your/python/executable",
      "args": [
        "-m",
        "mcp_server_servicenow.cli",
        "--url", "https://your-instance.service-now.com/",
        "--username", "your-username",
        "--password", "your-password"
      ],
      "disabled": false,
      "autoApprove": []
    }
  }
}

**注意:**确保使用安装了mcp-server-servicenow包的 Python 可执行文件的完整路径。

自然语言示例

搜索记录

您可以使用自然语言查询来搜索记录:

find all incidents about email
search for incidents related to network issues
show me all incidents with high priority

更新记录

您可以使用自然语言命令更新记录:

Update incident INC0010001 saying I'm working on it
Set incident INC0010002 to in progress
Close incident INC0010003 with resolution: fixed the issue

管理脚本

您可以从本地文件更新 ServiceNow 脚本:

Update the ServiceNow script include "HelloWorld" with the contents of hello_world.js
Upload utils.js to ServiceNow as a script include named "UtilityFunctions"
Update @form_validation.js, it's a client script called "FormValidation"

身份验证方法

服务器支持多种认证方式:

  1. 基本身份验证:用户名和密码

  2. 令牌认证:OAuth 令牌

  3. OAuth 身份验证:客户端 ID、客户端密钥、用户名和密码

发展

先决条件

  • Python 3.8+

  • 具有 API 访问权限的 ServiceNow 实例

设置开发环境

# Clone the repository
git clone https://github.com/michaelbuckner/servicenow-mcp.git
cd servicenow-mcp

# Create a virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install development dependencies
pip install -e ".[dev]"

运行测试

pytest

贡献

欢迎贡献代码!欢迎提交 Pull 请求。

  1. 分叉存储库

  2. 创建你的功能分支( git checkout -b feature/amazing-feature

  3. 提交您的更改( git commit -m 'Add some amazing feature'

  4. 推送到分支( git push origin feature/amazing-feature

  5. 打开拉取请求

执照

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。

Related MCP Connectors

  • A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…

  • The Mercado Pago MCP Server implements the Model Context Protocol to provide AI agents and LLMs with access to Mercado Pago's APIs and tools within compatible development environments. It acts as an intermediary that translates Mercado Pago resources into executable functions (tools) that AI applications can invoke to perform actions and automate flows. The server simplifies integration, enables using documentation to implement or improve code, and optimizes operations through natural language interactions without manual implementations.

  • The HubSpot MCP Server acts as a bridge that enables AI assistants and Large Language Models to securely interact with HubSpot CRM data through natural conversation, without requiring users to understand complex API structures. It provides read-only access to standard CRM objects (contacts, companies, deals, tickets, products, invoices, and more) and their associations, secured via OAuth 2.0, allowing AI agents to perform tasks like summarizing deals, fetching company updates, and looking up record changes.

  • The Remote MCP server acts as a standardized bridge between LLM applications (like Claude, ChatGPT, and Cursor) and external services, enabling AI agents to access external tools and resources. Its primary capability is providing a centralized search tool to discover other MCP servers and their respective tools. Unlike local implementations, it runs remotely with OAuth authentication and permission controls for security.

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    A 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.
    3
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    An 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.
    89
    79 npm
    16
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A ServiceNow integration server for the Model Context Protocol that enables automated incident management, knowledge base article creation, and other ServiceNow operations through a standardized protocol.
    3
    MIT