ServiceNow MCP サーバー
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: SupaUI MCP Server
インストール
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.cliCline での構成
この 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"認証方法
サーバーは複数の認証方法をサポートしています:
基本認証:ユーザー名とパスワード
トークン認証: OAuthトークン
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貢献
貢献を歓迎します!お気軽にプルリクエストを送信してください。
リポジトリをフォークする
機能ブランチを作成します(
git checkout -b feature/amazing-feature)変更をコミットします (
git commit -m 'Add some amazing feature')ブランチにプッシュする (
git push origin feature/amazing-feature)プルリクエストを開く
ライセンス
このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細についてはLICENSEファイルを参照してください。