ServiceNow FastMCP Server

ServiceNow FastMCP Server

MCP server that enables LLMs to interact with ServiceNow instances for managing incidents, users, stories, workflows, knowledge base articles, and script includes via the FastMCP framework.

Category
访问服务器

README

ServiceNow FastMCP Server

A Model Context Protocol (MCP) server for ServiceNow, built with fastmcp.

Overview

This server allows LLMs to interact with ServiceNow instances to manage:

  • Incidents
  • Users and Groups
  • Stories
  • Workflows
  • Knowledge Base Articles
  • Script Includes

Architecture

The project follows a clean, modular architecture:

src/servicenow_mcp/
├── auth/               # Authentication handling (Basic, OAuth, API Key)
├── tools/              # MCP tool implementations
│   ├── incident_tools.py
│   ├── user_tools.py
│   ├── story_tools.py
│   ├── workflow_tools.py
│   ├── knowledge_base.py
│   └── script_include_tools.py
├── utils/              # Shared utilities
│   ├── http_client.py  # Centralized HTTP client with SSL support
│   ├── helpers.py      # Common helper functions
│   ├── config.py       # Configuration models
│   └── logging_utils.py
├── application.py      # FastMCP application setup
├── server.py           # Main server entry point
└── server_sse.py       # SSE server variant

Utility Modules

http_client.py

Centralized HTTP client providing:

  • Unified interface for all HTTP methods (GET, POST, PUT, PATCH, DELETE)
  • Automatic SSL certificate configuration for private network instances
  • Consistent timeout and error handling

helpers.py

Common helper functions to reduce code duplication:

  • build_request_data() - Build request payloads from required/optional fields
  • resolve_record_id() - Resolve ServiceNow identifiers to sys_ids
  • format_success_response() / format_error_response() - Standardized response formatting
  • format_list_response() - Pagination-aware list responses
  • extract_display_value() - Safely extract display values from ServiceNow fields
  • is_sys_id() - Check if a string is a valid ServiceNow sys_id

Installation

  1. Create a virtual environment:
    python -m venv .venv
    
  2. Activate the virtual environment. on Windows cmd
    .venv\Scripts\activate
    
    on Linux/macOS
    source .venv/bin/activate
    
  3. Install the package:
    pip install -e .
    

Configuration

Copy .env.example to .env and fill in your ServiceNow credentials.

SSL Configuration

The server supports flexible SSL verification settings to handle corporate networks, proxies, and self-signed certificates.

1. Default Secure Mode (Recommended) By default, SSL verification is enabled. If you use a custom corporate certificate, set the path:

# Uses the provided certificate for verification
SERVICENOW_SSL_CERT_PATH=C:\path\to\your\corporate-ca.crt

2. Disable SSL Verification (Testing Only) To disable SSL verification (e.g., for local testing or dev instances), you must explicitly set the variable to true.

# API requests will skip SSL verification
SERVICENOW_DISABLE_SSL_VERIFY=true

Note: If SERVICENOW_DISABLE_SSL_VERIFY is not present, or set to false, the server will default to secure verification (using SERVICENOW_SSL_CERT_PATH if provided, or system defaults).

Usage

Run the server:

Windows (cmd)

.venv\Scripts\python.exe src\servicenow_mcp\server.py

Linux/macOS

.venv/bin/python src/servicenow_mcp/server.py

Debugging with MCP Inspector

The MCP Inspector is a browser-based tool for testing and debugging your MCP server. It connects to your server and allows you to interactively call tools.

Running the Inspector

Use npx to run the inspector, pointing it at the server entry point:

# On Windows (cmd)
.venv\Scripts\activate
set PYTHONPATH=src
npx @modelcontextprotocol/inspector python src/servicenow_mcp/server.py
# On Windows (PowerShell)
. .venv\Scripts\Activate.ps1
$env:PYTHONPATH = "src"
npx @modelcontextprotocol/inspector python src/servicenow_mcp/server.py
# On Linux/macOS
source .venv/bin/activate
PYTHONPATH=src npx @modelcontextprotocol/inspector python src/servicenow_mcp/server.py

This will:

  1. Start your ServiceNow MCP server.
  2. Open a browser window with the Inspector UI.
  3. Allow you to view available tools and call them interactively.

Using the Helper Script (Windows)

For convenience, a inspector.ps1 script is provided:

.\inspector.ps1

Remote Deployment (Streamable HTTP)

The server can run as a remote MCP server over Streamable HTTP so cloud AI clients (Claude Desktop, claude.ai, Claude Code) can connect:

# Streamable HTTP on 0.0.0.0:8080 at /mcp, protected by a bearer token
MCP_AUTH_TOKEN=<random-secret> servicenow-mcp-http

Key environment variables:

Variable Default Purpose
MCP_TRANSPORT http http (Streamable HTTP) or sse (legacy)
MCP_HOST 0.0.0.0 Bind interface (keep 0.0.0.0 for Docker/EC2)
PORT 8080 Listen port
MCP_AUTH_TOKEN unset If set, clients must send Authorization: Bearer <token>. Never expose the server publicly without it.

See docs/DEPLOYMENT_EC2.md (local-only, not tracked in this repo) for a complete AWS EC2 free-tier deployment guide (Docker + Caddy with automatic HTTPS), client setup, OAuth upgrade path, and the scaling story.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选