
switchboard
io.github.cshipleygit/switchboard
Open-source MCP server for ServiceNow: permission-tiered tools for ITSM, catalog, CMDB and more.
Documentation

switchboard
An open-source Model Context Protocol server for ServiceNow. It gives AI assistants (Claude, GitHub Copilot, Cursor and other MCP clients) a focused set of 116 tools for tables, incidents, problems, changes, the service catalog, knowledge, users and groups, the CMDB, update sets, developer artifacts, Flow Designer (read only), reporting, catalog authoring and the Automated Test Framework.
- Read-only until you opt in. Every write capability sits behind a permission tier that is off by default, per instance.
- Production gets extra friction. Writes on a production instance need a second opt-in, and every write asks for confirmation.
- Per-user identity. With per-user OAuth, the assistant can never do more than the person who signed in.
- No secrets in config files. Secrets come from environment variables or the OS keychain.
- Talks only to your instances. No telemetry, no phone-home, no undocumented endpoints, no server-side script execution.
The full tool reference is in docs/tools.md.
Status: 1.0.0, the first stable release. Versions follow SemVer; changes are listed in CHANGELOG.md.
Contents
- Requirements
- Quick start (environment variables)
- Setup wizard
- Configuration file
- Authentication
- Permission tiers
- Production instances
- Profiles
- ATF setup
- Running UI tests
- HTTP transport
- CLI reference
- Troubleshooting
- Security
- Contributing
- License
Requirements
- Node.js 22 or later.
- A ServiceNow instance reachable over HTTPS (
https://<name>.service-now.com; setallowCustomDomainfor other host names). Supported: the latest two ServiceNow release families, currently Australia and Brazil. Testing so far is on Australia. - A ServiceNow account for switchboard to use. For the shared-identity modes, use a dedicated integration user (see Authentication).
Quick start (environment variables)
The fastest way to try switchboard is env mode: no config file, one instance, read only.
-
Create an integration user on your instance (see Basic auth).
-
Add switchboard to your MCP client. For example, in Claude Desktop's
claude_desktop_config.jsonor a Claude Code.mcp.json:{ "mcpServers": { "servicenow": { "command": "npx", "args": ["-y", "@cshipleygit/switchboard-mcp", "serve"], "env": { "SN_INSTANCE_URL": "https://yourinstance.service-now.com", "SN_ENVIRONMENT": "development", "SN_USERNAME": "switchboard.integration", "SN_PASSWORD": "<set this in your environment, not here>" } } } }Better: leave
SN_PASSWORDout of the client file and set it in your shell or system environment, or use--env-file <path>to load a.envfile that you keep out of version control. switchboard never loads.envon its own. -
Restart the client and ask it to run
instance_check.
Env mode variables:
| Variable | Meaning |
|---|---|
SN_INSTANCE_URL | Instance origin, e.g. https://yourinstance.service-now.com (no path) |
SN_AUTH_MODE | basic (default), oauth_password, oauth_client_credentials or oauth_user |
SN_USERNAME, SN_PASSWORD | For basic and oauth_password |
SN_CLIENT_ID, SN_CLIENT_SECRET | For the OAuth modes |
SN_ENVIRONMENT | development, test or production. Defaults to production, the safe assumption |
SWITCHBOARD_TIERS | Comma list of opt-in tiers, e.g. write,atf. Empty means read only |
SWITCHBOARD_ROLE_FILTER | off turns off the role-aware tool list |
SWITCHBOARD_READ_ONLY | Kill switch: any value other than empty, 0, false, no or off forces read only everywhere |
SWITCHBOARD_CONFIG | Path of a config file. When a config file is in use, the SN_* variables above are ignored |
The instance's alias in env mode is default.
Setup wizard
switchboard setup walks you through adding an instance and wiring up your MCP clients:
- It asks for an alias, the URL, the environment, the auth mode and where the secrets live: environment variable names, or the OS keychain (you type the secret once, masked, and it goes straight into the keychain).
- It asks which tiers to enable (all off to start; production shows a warning and asks which tiers also go in
production.allowTiers) and which profiles to use. - It runs
switchboard doctorfor the new instance (read only). - It offers to write client configs for Claude Desktop, Claude Code, Cursor and VS Code (GitHub Copilot). For each one it shows the file and the exact JSON it will merge, and asks before writing. Where a client supports project and user scope, it asks which. Existing servers in those files are kept, and the original file is backed up as
<file>.bak-<timestamp>.
VS Code has two config formats: the Copilot harness (mcpServers in the workspace-root .mcp.json or ~/.copilot/mcp-config.json) and the older Local harness (servers in .vscode/mcp.json or the profile mcp.json, deprecated by VS Code). The wizard offers both, Copilot first. Copilot accepts at most 128 tools per request, so the wizard shows how many tools your profiles register.
Client configs written by the wizard contain no secrets, only SWITCHBOARD_CONFIG. If you chose environment variables for secrets, the wizard tells you which variable names must be set. A config file with comments is refused rather than rewritten, so your comments are never lost. The wizard never runs other programs.
Configuration file
The config file is found in this order: --config <path>, then SWITCHBOARD_CONFIG, then the OS default:
| OS | Default path |
|---|---|
| Windows | %APPDATA%\switchboard\config.json |
| macOS | ~/Library/Application Support/switchboard/config.json |
| Linux | $XDG_CONFIG_HOME/switchboard/config.json or ~/.config/switchboard/config.json |
switchboard config path prints the location in use; switchboard config validate checks the file. The file is strict JSON: no comments, no trailing commas, and unknown keys are errors (the message names the JSON path).
{
"defaultInstance": "dev",
"profiles": ["developer"],
"instances": {
"dev": {
"url": "https://yourdev.service-now.com",
"environment": "development",
"auth": { "mode": "basic", "username": "env:SN_DEV_USER", "password": "env:SN_DEV_PASSWORD" },
"tiers": ["write", "atf"],
"updateSet": { "requireNonDefault": true },
"timeouts": { "readMs": 30000, "writeMs": 60000 }
},
"prod": {
"url": "https://yourprod.service-now.com",
"environment": "production",
"auth": { "mode": "oauth_user", "clientId": "env:SN_PROD_CLIENT_ID" },
"tiers": ["write"],
"production": { "allowTiers": ["write"] }
}
},
"credentialStore": "auto",
"roleFilter": "on",
"uploads": { "allowedDirs": [] },
"limits": {
"maxRecords": 1000,
"defaultLimit": 20,
"maxFieldChars": 4000,
"maxResultBytes": 262144
},
"logging": { "level": "info", "file": null }
}
Key points:
environmentis required for each instance:development,testorproduction.defaultInstanceis needed only when more than one instance is configured. Every tool takes aninstanceargument; without it, the default is used. Results always say which instance and environment they came from.- Secrets must be references:
env:<VARIABLE>orkeychain:<account>. A literal password or client secret in the file is rejected at startup (CONFIG_INLINE_SECRET).usernameandclientIdmay be literals. credentialStore: where refresh tokens andkeychain:secrets live.auto(default) uses the OS keychain when it works and falls back to acredentials.jsonfile in the config directory (mode0600on macOS and Linux; on Windows it is in your profile but not encrypted, and the doctor warns about that).keychainrequires the keychain;filenever uses it.roleFilter: see Profiles.uploads.allowedDirs: directoriesattachment_uploadmay read files from. Empty (the default) turns path uploads off. Paths are resolved, symlinks that escape are refused, and the limit is 10 MiB.cmdb.discoverySource: the data source name used for CMDB writes and IRE (defaultServiceNow).allowCustomDomain: allow instance hosts other than*.service-now.com(still HTTPS only).
Authentication
| Mode | Who ServiceNow sees | Config fields |
|---|---|---|
basic | The configured account (shared) | username, password |
oauth_password | The configured user (shared) | clientId, clientSecret, username, password |
oauth_client_credentials | The OAuth app's mapped user (shared) | clientId, clientSecret |
oauth_user | The person who signed in (per user) | clientId, clientSecret (optional), redirectPort (default 8766) |
In the shared modes, ServiceNow's ACLs apply to the shared account, not to the person using the assistant; instance_list and permissions_describe say so. Use oauth_user when each person should act as themselves.
Basic
Create a dedicated integration user rather than using a personal account:
- User Administration › Users › New. Give it a user ID such as
switchboard.integrationand a strong password. - Set Identity type to Machine and tick Internal Integration User. A user with Identity type Human can be refused by the REST API with 401 "User is not authenticated" even though the same user can sign in to the UI.
- Grant the roles the work needs (see Roles), not
adminunless you must.
OAuth password and client credentials
- System OAuth › Application Registry › New › Create an OAuth API endpoint for external clients. Note the client ID and secret.
- On the entity, add the
useraccountauth scope. Without it, ServiceNow still issues tokens but the Table API answers them with 403. - For
oauth_password, the user is the integration user from Basic. - For
oauth_client_credentials:- Set OAuth Application User on the entity to the integration user. The API acts as that user.
- Enable the client-credentials grant with the system property
glide.oauth.inbound.client.credential.grant_type.enabled=true. On many instances the property doesn't exist yet: create it (typetrue | false).
Tokens are kept in memory and refreshed shortly before they expire. oauth_password refresh tokens are stored per credentialStore.
Per-user OAuth (oauth_user)
- System OAuth › Application Registry › New › Create an OAuth API endpoint for external clients.
- Tick Public Client (switchboard uses the authorization code flow with PKCE, so no client secret is needed).
- Set the Redirect URL to
http://127.0.0.1:8766/callback(or yourredirectPort). - Add the
useraccountauth scope. Leave OAuth Application User empty. - Put the client ID in the config (
auth: { "mode": "oauth_user", "clientId": "…" }). - Each person runs
switchboard login <alias>once. It opens the browser, the person signs in and approves, and the refresh token goes into the keychain (or the credentials file).
The server itself never opens a browser. Without a sign-in, tool calls fail with AUTH_REQUIRED and tell you to run switchboard login <alias>. switchboard logout <alias> revokes the refresh token on the instance and deletes it locally; access tokens already issued expire on their own (30 minutes by default).
Roles
switchboard never widens what ServiceNow allows: tiers only take capability away. Give the identity the least it needs for the profiles you use rather than admin. Role names vary between instances and releases, so check them on yours. Some starting points:
| Work | Roles to look at |
|---|---|
| Service desk, ITSM | itil |
| Knowledge authoring | knowledge_admin |
| Catalog authoring | catalog_admin, catalog_editor or catalog_manager |
| ATF | atf_test_designer or atf_test_admin to author; sn_cicd.sys_ci_automation to run suites |
| Developer artifacts | Usually admin, since scripts, ACLs and properties are admin-level on most instances |
With the role filter on, switchboard reads the identity's roles at startup and hides tools whose required roles it lacks (see Profiles).
Permission tiers
Every tool needs a tier. read is always on; the rest are off until you list them in an instance's tiers.
| Tier | Allows |
|---|---|
read | All read tools |
write | Creating, updating and deleting ordinary records: tasks, knowledge, catalog orders, approvals, users and groups without roles, update set records, preferences |
cmdb_write | Writes to the cmdb hierarchy and cmdb_rel_ci, and IRE |
elevated | Anything that can run code or change security: scripts, ACLs, roles and role grants, groups that carry roles, scheduled jobs, UI pages and scripts, system properties, scripted REST, update set commit and back-out, catalog item definitions |
atf | Creating and editing ATF tests, steps and suites, and running suites. A step that runs script also needs elevated |
ai | Reserved; no tools use it |
Tiers are independent: elevated does not imply write.
The generic table tools (table_create, table_update, table_delete, attachment_upload, attachment_delete) work out the tier from the target table:
- Never writable: credential, certificate, OAuth secret, dictionary, update XML, audit and log tables, and their extensions.
elevated: script, ACL, role, scheduled job, property, flow, integration and application tables, their extensions, and any other table that extendssys_metadata.atfandelevated: ATF tables.cmdb_write: the CMDB hierarchy.write: everything else.
If the table's hierarchy can't be read, the table is treated as elevated. Password fields are never written and are always shown as [REDACTED] in reads.
Update sets. Metadata writes (developer artifacts, catalog definitions, ATF) refuse to run while your current update set is Default (DEFAULT_UPDATE_SET; switch it off per instance with updateSet.requireNonDefault: false). Create or pick one with update_set_create or update_set_set_current. After each metadata write, switchboard checks which update set it landed in and tells you if it went elsewhere.
Confirmation. Some calls are confirmed with the user before they run: every delete, every write on production, update set commit and back-out, role grants and revokes, property_set, and catalog builds that would remove records. If the client supports MCP elicitation, the user sees a form. Otherwise the tool returns status: "confirmation_required" with a summary and a confirmToken; the assistant shows the summary and repeats the identical call with the token (valid 5 minutes, single use, bound to the exact arguments). Treat this as a speed bump. The real control is the tier configuration, which the assistant can't change.
Production instances
On an instance with environment: "production":
- A tier other than
readworks only if it is in bothtiersandproduction.allowTiers. elevated,atfandaialso need the server started with--allow-production-elevated.- Every non-read call asks for confirmation.
- Errors and confirmation prompts say
PRODUCTION instance <alias>in capitals.
Env mode assumes production unless SN_ENVIRONMENT says otherwise. --read-only or SWITCHBOARD_READ_ONLY forces every instance to read only, whatever the config says.
Profiles
Profiles choose which tool groups are registered, so the assistant sees a short, relevant list. Set them with "profiles" in the config or --profile a,b (a union of the named profiles).
| Profile | Groups | Tools |
|---|---|---|
minimal | meta, generic read, generic write | 18 |
service_desk | meta, generic read, incident, catalog, knowledge, and the read tools of identity | 35 |
standard (default) | meta, generic read and write, incident, problem, change, catalog, knowledge, identity | 58 |
itsm | standard + reporting | 62 |
developer | meta, generic read and write, update sets, dev, flow, reporting, ATF, catalog authoring | 67 |
cmdb | meta, generic read and write, CMDB, reporting | 31 |
consultant | the read tools of every group, plus all update set and ATF tools | 83 |
admin | everything | 116 |
After the profile filter, a tool is also left out when its tier is off on every configured instance. With roleFilter: "on" (the default), a tool that needs specific roles is left out when, on every instance, the signed-in identity holds none of them. An instance whose roles can't be read never hides anything. The role filter only shortens the list: ServiceNow still decides every call. The list is fixed for the life of the server, so restart it after changing roles or signing in as someone else.
switchboard tools prints the list for your config (--all adds what was left out and why). In a session, permissions_describe explains what each instance allows and why a tool is missing.
ATF setup
ATF needs some one-time setup on the instance. atf_environment_check (and switchboard doctor) check each item read-only and tell you how to fix what's missing.
- Plugins Automated Test Framework and CI/CD REST API active.
- System property
sn_atf.runner.enabled=true(off by default). switchboard never changes it for you. - Roles for the identity:
atf_test_designeroratf_test_adminto author tests, andsn_cicd.sys_ci_automation(oradmin) to run suites. - The
atftier on the instance, pluselevatedfor steps that run script. - A non-default current update set (tests and steps are metadata).
ATF step value ACLs. ATF stores step input values in sys_variable_value, and on a stock instance the Table API can't write them. switchboard needs two extra ACLs, which an admin adds once (elevate to security_admin, then System Security › Access Control (ACL) › New, once for each operation):
| Field | Value |
|---|---|
| Type | record |
| Decision type | Allow If |
| Operation | create (first ACL), write (second ACL) |
| Name | Table Value [sys_variable_value], field -- None -- |
| Admin overrides | ticked |
| Requires role | atf_test_designer and atf_test_admin |
| Condition | Table (the document field) is sys_atf_step |
| Script | none |
Add the role rows to each ACL separately ("Insert and Stay" does not copy them). The ACLs grant only what those roles can already do in the ATF UI.
Without them, switchboard can still create tests, suites and steps that keep their default inputs, set step order, and run suites. Writing input values then fails with ATF_INPUTS_FORBIDDEN; a step the tool had just created for them is removed again, and the error says so.
ATF runs go through the CI/CD API, which runs suites only. To run a single test, put it in a suite.
Running UI tests
Suites with UI steps (forms, catalog items, the Service Portal) need a client test runner: a browser tab signed in to the instance that ServiceNow sends UI steps to. Runs started by atf_suite_run are picked up only by a scheduled runner (or a cloud runner, with runInCloud). A manual runner isn't enough: with only a manual runner online, the run is cancelled at once.
switchboard runner dev
switchboard runner dev --browser chrome
This opens <instance>/atf_test_runner.do?sysparm_scheduled_tests_only=true once. --browser chrome|edge|firefox opens a new window of that browser; --no-browser only prints the URL. On a production instance it asks first. It sends no request to ServiceNow and handles no credentials.
- Sign in as the user the UI steps should run as.
- Keep the runner window visible. Browsers slow down background tabs, and a hidden runner can take minutes to pick a run up. A visible one starts within seconds.
- For regular runs, use a spare machine or VM, and close the window when you're done.
Before starting a suite with UI steps, atf_suite_run checks for an online scheduled runner that checked in during the last 3 minutes. If there is none it starts nothing and returns ATF_RUNNER_MISSING with the runner URL. Pass skipRunnerCheck to start anyway. Poll atf_run_status no more than every 10 seconds, then read atf_run_results.
HTTP transport
stdio is the default and what most clients use. switchboard can also serve Streamable HTTP for clients that need a URL:
switchboard token create
switchboard serve --transport http --port 8765
- It binds to
127.0.0.1by default. A non-loopback address needs--allow-remoteand either TLS (--tls-cert,--tls-key) or--behind-proxy(a TLS-terminating proxy in front). Wildcard binds (0.0.0.0,::) are refused. - Every request needs
Authorization: Bearer <token>.switchboard token createprints a new token once and stores only its SHA-256 hash in the config file (http.tokenHashes), so HTTP mode needs a config file.token listshows token ids;token revoke <id>removes one. Restart the server after creating or revoking tokens. - Requests whose
Hostdoesn't match the bound address, or that carry anOriginnot listed inhttp.allowedOrigins(empty by default), are refused. There is no CORS support, so in-browser clients can't connect. - On a loopback bind,
localhost,127.0.0.1and[::1]with the same port are also accepted asHost. Add more exacthost:portvalues inhttp.allowedHosts(empty by default) for a client that reaches this machine's loopback by another name. The port is required and wildcards aren't allowed. The list only works on a loopback bind: a non-loopback bind with a non-empty list is refused at startup. The token, Origin check and limits still apply. - Limits: 1 MiB request bodies, 10 requests per second per token (burst 20). No session state.
- The bearer token is local transport authentication, not MCP OAuth.
A local container as the client (for example n8n in Docker Desktop). Keep switchboard on 127.0.0.1 and list the name the container uses:
"http": { "tokenHashes": ["sha256:…"], "allowedHosts": ["host.docker.internal:8765"] }
The container then connects to http://host.docker.internal:8765/mcp with the bearer token. In a check on Docker Desktop for Windows, the request reached the loopback-only listener over IPv4, and the machine's network addresses refused connections. Docker Desktop lets any local container reach the host's loopback this way, so the token is what keeps other containers out. Give each client its own token. examples/n8n-triage/ has config templates for this.
Docker. The image ghcr.io/cshipleygit/switchboard runs switchboard serve as a non-root user. For stdio, run it with docker run --rm -i and pass configuration through environment variables or a mounted config file. HTTP inside a container is an advanced setup: it needs --allow-remote together with --behind-proxy or TLS.
CLI reference
| Command | Does |
|---|---|
switchboard / switchboard serve | Start the server (stdio by default). --help lists the flags |
switchboard setup | The setup wizard |
switchboard login <alias> / logout <alias> | Per-user OAuth sign-in and sign-out |
switchboard doctor [alias] | Read-only diagnostics: config, secrets (presence only), sign-in, identity, roles, plugin APIs, ATF prerequisites, with fixes |
switchboard runner [alias] | Open the scheduled ATF client test runner |
switchboard tools [--profile …] [--all] [--json] | The tools that would be registered, with tiers |
switchboard token create|list|revoke | Bearer tokens for the HTTP transport |
switchboard config validate|path | Check the config file or show where it is |
Useful serve flags: --profile <list>, --config <path>, --env-file <path>, --read-only, --allow-production-elevated, --log-level error|warn|info|debug, and the HTTP flags above. Logs are JSON lines on stderr (stdout carries only MCP messages). At info, each tool call logs one audit line with no field values, queries or bodies.
Troubleshooting
Start with switchboard doctor, which checks everything below that can be checked read-only, and with the instance_check and permissions_describe tools.
| Symptom | Likely cause and fix |
|---|---|
AUTH_FAILED with Basic auth, but the user can sign in to the UI | The user's Identity type is Human. Use a dedicated user with Identity type Machine and Internal Integration User ticked. switchboard never retries a 401, so a wrong password won't lock the account out, but fix it before trying again |
AUTH_REQUIRED | oauth_user mode with no valid sign-in: run switchboard login <alias> |
OAuth token is issued, but every call returns SN_FORBIDDEN (403) | The OAuth entity lacks the useraccount auth scope |
oauth_client_credentials can't get a token | Create the property glide.oauth.inbound.client.credential.grant_type.enabled = true and set the entity's OAuth Application User |
CREDENTIALS_UNRESOLVED | An env: variable isn't set in the server's environment, or a keychain: entry is missing. The message names the config path. Fix it and restart |
A password from a .env file is cut short | In a --env-file file, an unquoted # starts a comment. Quote values that contain # |
SN_* variables seem ignored | A config file is in use (SWITCHBOARD_CONFIG or the default path); env mode applies only without one |
| A tool is missing from the client | Its group isn't in your profiles, its tier is off on every instance, or the role filter hid it. Ask for permissions_describe, or run switchboard tools --all |
TIER_DISABLED | Add the named tier to the instance's tiers |
PRODUCTION_BLOCKED | On production, the tier must also be in production.allowTiers; elevated and atf also need --allow-production-elevated |
SN_FORBIDDEN | ServiceNow's ACLs refused the identity. The hint names missing roles when known |
SN_API_UNAVAILABLE | The plugin behind that API isn't active (e.g. Change Management REST, Service Catalog REST, Knowledge REST, CI/CD). Knowledge tools fall back to the Table API |
SN_UNAVAILABLE | The instance answered with a web page instead of JSON. Developer instances hibernate: wake it in the browser |
DEFAULT_UPDATE_SET | Create or select an update set (update_set_create, update_set_set_current) before metadata writes |
UPDATE_SET_MISMATCH | The write succeeded but landed in a different update set (often an application scope's set). Move it in the UI if needed |
TIMEOUT_UNKNOWN_OUTCOME | A write timed out; it may or may not have happened. Check the record before retrying. switchboard never retries a write that may have reached ServiceNow |
RESULT_TOO_LARGE | Ask for fewer fields or a smaller limit |
PATH_FORBIDDEN | The upload path is outside uploads.allowedDirs (or path uploads are off) |
ATF_INPUTS_FORBIDDEN | Add the ATF step value ACLs |
ATF_RUNNER_MISSING, or UI tests sit pending | Start a scheduled runner with switchboard runner <alias> and keep its window visible (Running UI tests) |
REPORT_FILTER_UNSUPPORTED | The report's filter uses script values switchboard won't pass on. Query the table directly instead |
| Tools work in Claude but Copilot complains about tool count | Copilot allows 128 tools per request. Use a smaller profile |
Security
switchboard runs no shell commands from tool input, builds every ServiceNow URL from fixed templates, follows no redirects, retries a write only when ServiceNow never received or processed it (connection refused, HTTP 429), and redacts secrets from logs, results and errors. See SECURITY.md for how to report a vulnerability.
Contributing
See CONTRIBUTING.md. In short: original work only, tests for every change, and never test against an instance you don't own.
License
MIT © Chance Shipley
@cshipleygit/switchboard-mcpnpm install @cshipleygit/switchboard-mcpghcr.io/cshipleygit/switchboard:1.0.0docker pull ghcr.io/cshipleygit/switchboard:1.0.0:undefined