Script Runner
БесплатноНе проверенEnables MCP clients to remotely execute server-side JavaScript in ServiceNow via a single tool, allowing full CRUD and API access with audit logging and securit
Описание
Enables MCP clients to remotely execute server-side JavaScript in ServiceNow via a single tool, allowing full CRUD and API access with audit logging and security controls.
README
MCP Script Runner is a ServiceNow application that exposes a Model Context
Protocol (MCP) server inside a ServiceNow instance. It gives trusted AI clients
such as Build Agent a single tool, run_script, that can execute server-side
JavaScript in global scope as the authenticated ServiceNow user.
Download the update set ZIP and import the XML inside it: MCP_Script_Runner_1.0.12.xml.zip
This is remote code execution by design. Install it only on instances where you understand and accept that risk, and grant access only to trusted users.
What It Does
MCP Script Runner lets Build Agent and other MCP clients:
- Run ServiceNow server-side JavaScript through MCP.
- Query and modify records through GlideRecord.
- Call ServiceNow server APIs available to the authenticated user.
- Return script output directly to the MCP client.
- Audit every script execution and returned result.
The app also includes an admin page, MCP Script Runner Admin, that checks the configuration status and shows the latest script executions.
Prerequisites
- ServiceNow instance on Australia Patch 2 Hotfix 1 or newer.
- Build Agent installed.
- Workflow Data Fabric / Connect Hub installed.
- Admin access for installation and setup.
- A trusted setup user who can be granted the required roles shown in the admin page.
Installation
- In ServiceNow, go to System Update Sets > Retrieved Update Sets.
- Download MCP_Script_Runner_1.0.12.xml.zip, unzip it, and import the XML update set inside.
- Preview the update set.
- Resolve any preview issues if your instance reports them.
- Commit the update set.
- Navigate to MCP Script Runner > MCP Script Runner Admin.
- Open Configuration status and follow the instructions shown in each step.
The admin page guides you through OAuth client creation, role assignment, Connect Hub MCP connector setup, AI Control Tower approval, inbound OAuth scope validation, and Build Agent MCP server enablement.
Security Notes
- The
run_scripttool executes server-side JavaScript. - Scripts run as the authenticated ServiceNow user.
- Access is gated by ServiceNow authentication, OAuth/WDF setup, AI Control
Tower approval, and the
mcp_script_runnerrole. - Every script execution is written to the
u_mcp_script_executionaudit table. - Do not grant access broadly.
MCP Script Runner: Capability Bypass Analysis
A comparison of originally listed limitations vs. what can actually be achieved by executing server-side JavaScript via MCP_Script_Runner.
Infrastructure & Administration
| Limitation | Bypassable? | How via MCP_Script_Runner |
|---|---|---|
| Activate/deactivate plugins | Yes | new GlidePluginManager().activate('com.snc.plugin_id') or GlidePluginManagerWorker |
| Clone or upgrade instances | No | These are HI-level infrastructure operations outside the instance runtime |
| Modify system properties | Yes | gs.setProperty('property.name', 'value') |
| Manage MID Servers | Partial | Can query/modify MID records and issue ECC queue commands, but can't control the actual MID host process |
External Connectivity
| Limitation | Bypassable? | How via MCP_Script_Runner |
|---|---|---|
| Make outbound HTTP/REST calls | Yes | new sn_ws.RESTMessageV2() - full control over method, headers, body, auth |
| Access the internet | Yes | Same as above - can fetch any URL the instance network/ACL allows |
| Send emails directly | Yes | GlideEmailOutbound for direct send, or gs.eventQueue() to trigger a notification |
File & Binary Operations
| Limitation | Bypassable? | How via MCP_Script_Runner |
|---|---|---|
| Create or edit binary files | Partial | GlideSysAttachment.write() can attach base64-encoded content to records, but can't generate complex images/PDFs from scratch without a library |
| Upload/download attachments | Yes | GlideSysAttachment - write(), getContent(), getContentBase64(), copy(), deleteAttachment() |
| Manage instance file storage | Yes | Query/delete/copy via GlideSysAttachment and GlideRecord on sys_attachment |
Version Control & DevOps
| Limitation | Bypassable? | How via MCP_Script_Runner |
|---|---|---|
| Git operations | No | Git lives outside the instance - no server-side API for it |
| CI/CD pipelines | Partial | Can trigger external CI/CD via outbound REST calls to Jenkins/GitHub Actions/etc., or use ServiceNow's CICD spoke APIs |
| Export/import Update Sets | Yes | GlideRecord on sys_update_set to create/commit; GlideUpdateSet2 API; can pull remote update sets via sys_remote_update_set |
Instance Operations
| Limitation | Bypassable? | How via MCP_Script_Runner |
|---|---|---|
| Impersonate users | Yes | new GlideImpersonate().impersonate('user_sys_id') for query context |
| Modify OOB/system tables | Yes | Background scripts run in global scope as admin - full GlideRecord CRUD on any table |
| Run client-side JavaScript | No | Server-side only - no browser DOM or client-side context available |
| Real-time log monitoring | Partial | Can poll with repeated queries, but can't maintain a persistent stream/tail |
| Cancel running jobs/threads | Yes | Update sys_trigger records (state=4), delete scheduled jobs, or use GlideRunScriptJob.cancel() |
Scope & Access Limitations
| Limitation | Bypassable? | How via MCP_Script_Runner |
|---|---|---|
| Access scope-protected tables | Yes | GlideRecord in global scope - already demonstrated with syslog |
| Create metadata not supported by Fluent | Yes | Insert directly into metadata tables (sys_script, sys_ui_page, sys_security_acl, etc.) via GlideRecord |
| Work across multiple instances | Partial | Can call another instance's REST/Table API via RESTMessageV2 (requires credentials), but can't execute scripts there |
UI & Visual
| Limitation | Bypassable? | How via MCP_Script_Runner |
|---|---|---|
| Take visual screenshots | No | No rendering engine server-side - pixels require a browser |
| Edit or preview UI in real-time | No | Server-side can't interact with a live browser session |
| Create custom themes | Yes | Insert/update records in sp_theme, sys_ui_theme, CSS includes, etc. via GlideRecord |
Summary Scorecard
| Category | Total | Full | Partial | Cannot |
|---|---|---|---|---|
| Infrastructure & Admin | 4 | 2 | 1 | 1 |
| External Connectivity | 3 | 3 | 0 | 0 |
| File & Binary | 3 | 2 | 1 | 0 |
| Version Control & DevOps | 3 | 1 | 1 | 1 |
| Instance Operations | 5 | 3 | 1 | 1 |
| Scope & Access | 3 | 2 | 1 | 0 |
| UI & Visual | 3 | 1 | 0 | 2 |
| TOTAL | 24 | 14 | 5 | 5 |
Hard Limitations
These 5 remain regardless of MCP_Script_Runner:
- Clone or upgrade instances - HI-level infrastructure operation.
- Git operations - External tooling, not accessible from instance runtime.
- Run client-side JavaScript - Requires a browser; server-side only.
- Take visual screenshots - No rendering engine available server-side.
- Edit or preview UI in real-time - No live browser interaction from server.
Установка Script Runner
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/Now-Italy-Demo/MCP-Script-RunnerFAQ
Script Runner MCP бесплатный?
Да, Script Runner MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Script Runner?
Нет, Script Runner работает без API-ключей и переменных окружения.
Script Runner — hosted или self-hosted?
Доступен hosted-вариант: Unyly запускает сервер в облаке, локальная установка не обязательна.
Как установить Script Runner в Claude Desktop, Claude Code или Cursor?
Открой Script Runner на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
GitHub
PRs, issues, code search, CI status
автор: GitHubFilesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Template MCP Server
A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
автор: mcpdotdirectCompare Script Runner with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории development
