servicenow-mcp
servicenow-mcp
Ein MCP-Server zur Verwaltung von ServiceNow-Vorfällen über die Table-API. Stellt Werkzeuge zum Erstellen, Lesen, Aktualisieren, Durchsuchen, Kommentieren und Lösen von Vorfällen bereit.
Einrichtung
Abhängigkeiten installieren:
uv syncKopieren Sie
.env.examplein.envund füllen Sie Ihre Anmeldedaten aus:cp .env.example .envSERVICENOW_INSTANCE: nur der Instanzname (z. B.dev12345fürdev12345.service-now.com)SERVICENOW_USERNAME/SERVICENOW_PASSWORD: Basisauthentifizierungs-Anmeldedaten für einen Benutzer mit Zugriff auf die Tabelleincident(Lesen/Schreiben über die Table-API)
Führen Sie den Server direkt aus, um zu überprüfen, ob er startet:
uv run servicenow-mcp
Related MCP server: servicenow-api
Verwendung mit Claude Desktop / Claude Code
Es gibt zwei Möglichkeiten, eine Verbindung herzustellen, je nachdem, ob alle Benutzer des Servers sich ein ServiceNow-Dienstkonto teilen oder jede Person sich selbst authentifiziert. Siehe Authentifizierung unten für das vollständige Bild.
Option A — stdio, gemeinsames Dienstkonto
Der Client startet den Server selbst als Unterprozess; jeder Werkzeugaufruf verwendet die
SERVICENOW_USERNAME / SERVICENOW_PASSWORD, die über env übergeben werden.
{
"mcpServers": {
"servicenow": {
"command": "uv",
"args": ["--directory", "/absolute/path/to/servicenow-mcp", "run", "servicenow-mcp"],
"env": {
"SERVICENOW_INSTANCE": "your-instance",
"SERVICENOW_USERNAME": "your-username",
"SERVICENOW_PASSWORD": "your-password"
}
}
}
}Option B — HTTP, clientseitige Anmeldedaten
Starten Sie den Server einmal als langlebigen HTTP-Prozess (er benötigt nur SERVICENOW_INSTANCE,
plus SERVICENOW_USERNAME/PASSWORD als Fallback für Anfragen ohne Auth-Header):
uv run servicenow-mcp --transport streamable-http --host 127.0.0.1 --port 8003Dann verweisen Sie .mcp.json darauf und senden Sie Ihren eigenen ServiceNow-Login als HTTP-Basic-Auth-
Header – das macht die Verbindung „clientseitig": Die Anmeldedaten befinden sich in Ihrer
Client-Konfiguration, nicht auf dem Server:
{
"mcpServers": {
"servicenow": {
"type": "http",
"url": "http://127.0.0.1:8003/mcp",
"headers": {
"Authorization": "Basic <base64 of your-username:your-password>"
}
}
}
}Generieren Sie den Base64-Wert von einem Terminal aus (beachten Sie das führende Leerzeichen, das -n bei echo
vermeidet):
echo -n "your-username:your-password" | base64.mcp.json wird nicht von .gitignore abgedeckt, wie es .env ist – committen Sie keine echten Anmeldedaten
darin, wenn dieses Verzeichnis jemals ein gemeinsames/Git-Repository wird.
Werkzeuge
create_incident— einen neuen Vorfall erstellenget_incident— nach Nummer (z. B.INC0010023) oder sys_id abrufenupdate_incident— beliebige Felder aktualisierensearch_incidents— mit einer ServiceNow-codierten Abfrage (sysparm_query) suchenadd_comment— einen für den Kunden sichtbaren Kommentar oder eine interne Arbeitsnotiz hinzufügenresolve_incident— Status auf Gelöst setzen mit Abschlussnotizen/-code
Authentifizierung
Die Authentifizierung erfolgt per Basisauthentifizierung (Benutzername/Passwort). Woher diese Anmeldedaten stammen, hängt vom Transport ab:
stdio: verwendet immer die gemeinsamen
SERVICENOW_USERNAME/SERVICENOW_PASSWORDaus.env.HTTP (
sse/streamable-http): jede Anfrage kann sich als eigener ServiceNow- Benutzer authentifizieren, indem ein standardmäßiger HTTP-Basic-Auth-Header gesendet wird:Authorization: Basic base64(username:password)SERVICENOW_INSTANCEbleibt serverseitig (es ist eine Instanz für alle Clients), aber die Benutzername/Passwort sind clientseitig – daher spiegelnsearch_incidents-Ergebnisse,caller_id-Auflösung, usw. die ServiceNow-Berechtigungen dieses einzelnen Benutzers wider, anstatt eines gemeinsamen Dienstkontos. Wenn eine Anfrage keinenAuthorization-Header hat, wird auf die gemeinsamenSERVICENOW_USERNAME/SERVICENOW_PASSWORDaus.envzurückgegriffen.
Wenn Sie später OAuth 2.0 benötigen, tauschen Sie die requests.Session.auth-Einrichtung in
src/servicenow_mcp/client.py gegen einen tokenbasierten Ablauf aus – der Rest des Clients ist
authentifizierungsunabhängig.
Hinweise
Das Feld
stateder Vorfalltabelle ist numerisch (z. B.6= Gelöst,7= Geschlossen); Werte können abweichen, wenn Ihre Instanz Vorfallstatus anpasst.
Available Tools
6 toolsadd_commentA
Add a customer-visible comment or an internal work note to an incident.
Args: number_or_sys_id: Incident number or sys_id. comment: Text to add. work_note: If True, adds as an internal work note instead of a customer-visible comment.
| Name | Required | Description | Default |
|---|---|---|---|
| comment | Yes | ||
| work_note | No | ||
| number_or_sys_id | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description clearly states the tool mutates an incident by adding text, and distinguishes visibility based on the work_note flag. With no annotations provided, this description carries the full burden and does an adequate job, though it doesn't mention authentication requirements or that the tool assumes an existing incident.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is brief and structured with a docstring-style Args section, making it easy to parse. It is not overly verbose, though the Args section partially repeats schema field names without adding new info for number_or_sys_id.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the simple tool (3 params, no nested types, no enums), the description adequately covers the purpose and key behavioral differences. An output schema exists, so return value details are not needed. It does not explain prerequisites like 'incident must exist' or what happens if the incident is already resolved, but for a straightforward comment tool, this is sufficient.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description adds significant meaning beyond the schema: it explains that comment is customer-visible by default and that work_note makes it internal. Since schema coverage is 0% and there are 3 parameters, the description compensates well, though it could clarify that number_or_sys_id uniquely targets an incident.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it adds either a customer-visible comment or an internal work note to an incident, using specific verbs and resources. It distinguishes from sibling tools like create_incident or update_incident by focusing on commentary, not incident creation or field modification.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explains the core use case (adding a comment vs work_note) but does not explicitly state when not to use this tool or mention alternatives. Given the sibling tools, an agent might infer that for broader updates they should use update_incident instead, but no direct guidance is offered.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
create_incidentA
Create a new ServiceNow incident.
Args: short_description: Brief summary of the incident (required). description: Full description of the issue. urgency: "1" (High), "2" (Medium), or "3" (Low). impact: "1" (High), "2" (Medium), or "3" (Low). category: Incident category, e.g. "software", "hardware", "network". assignment_group: Name or sys_id of the assignment group. caller_id: Name or sys_id of the user reporting the incident.
| Name | Required | Description | Default |
|---|---|---|---|
| impact | No | ||
| urgency | No | ||
| category | No | ||
| caller_id | No | ||
| description | No | ||
| assignment_group | No | ||
| short_description | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It does not mention side effects (e.g., whether a record is stored immediately, if it triggers notifications, or if any validation occurs). The output schema exists but is not described, leaving the agent to infer what the tool returns.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise and well-structured, with a clear introductory sentence followed by a bullet-like list of parameters. Each line is informative and earns its place. No unnecessary words or repetition.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has 7 parameters (1 required) and a high-complexity domain (incident creation in ServiceNow), the description covers parameter semantics but lacks guidance on return values (despite having an output schema) and behavioral details (e.g., whether the incident is immediately persisted, if any side effects occur). It is adequate for basic creation but leaves gaps for a thorough agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate, and it does reasonably well. It explains 'urgency' values as '1 (High), 2 (Medium), 3 (Low)', and 'impact' similarly, and provides example categories like 'software', 'hardware', 'network'. This adds meaning beyond the bare schema titles. However, it could clarify the format for 'assignment_group' and 'caller_id' (e.g., 'sys_id preferred') for even better clarity.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Create a new ServiceNow incident', using a specific verb ('Create') and resource ('ServiceNow incident'). The parameter descriptions further clarify the fields involved, and the tool name 'create_incident' is distinct from siblings like 'get_incident' or 'update_incident', so no confusion arises.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description lists parameters and their meanings, which guides basic usage, but it does not explicitly say when to use this tool versus siblings. For example, when to create an incident versus update one via 'update_incident' is left implied. There is no 'when not to use' or alternative guidance provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_incidentA
Fetch a ServiceNow incident by its number (e.g. INC0010023) or sys_id.
| Name | Required | Description | Default |
|---|---|---|---|
| number_or_sys_id | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It correctly indicates a read-only operation ('Fetch'), but does not disclose what happens on missing identifiers, authentication needs, or response structure (though output schema partially compensates). The description adds minimal behavioral context beyond the obvious.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence with no wasted words. It front-loads the action and provides an immediate example. Every word earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (single parameter, no nested objects) and the presence of an output schema, the description is almost sufficient. It covers the core functionality and parameter semantics. The only gap is missing error behavior or success indication, but for a straightforward fetch this is acceptable.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate. It explains that the parameter accepts either an incident number (with example) or a sys_id, which adds significant meaning beyond the raw 'string' type. However, it could be more precise about sys_id format (e.g., GUID).
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Fetch'), the resource ('ServiceNow incident'), and provides a concrete example of the identifier format ('number (e.g. INC0010023) or sys_id'). This distinguishes it from sibling tools like search_incidents (which searches by other criteria) and mutation tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies use when you have the exact identifier, but provides no explicit guidance on when to use this tool versus siblings, nor when not to use it. For example, it does not mention that search_incidents should be used if the identifier is unknown.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
resolve_incidentB
Resolve an incident by setting its state to Resolved.
Args: number_or_sys_id: Incident number or sys_id. close_notes: Notes describing the resolution. close_code: Resolution code, e.g. "Solved (Permanently)", "Solved (Workaround)".
| Name | Required | Description | Default |
|---|---|---|---|
| close_code | No | Solved (Permanently) | |
| close_notes | Yes | ||
| number_or_sys_id | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description bears full responsibility for behavioral disclosure. It states that the tool sets the state to 'Resolved', which implies a write operation, but omits critical details: required permissions (e.g., can_edit_incident), side effects (e.g., notifications, closing timers), idempotency, or reversibility. The output schema exists but is not referenced.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is short (two sentences) and front-loaded with the main purpose, followed by a clear, bullet-like argument list. Every sentence contributes meaning without redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the presence of an output schema (unmentioned), three parameters, and no annotations, the description is incomplete. It lacks usage context, behavioral warnings, and does not describe the return value. An agent cannot fully assess when to invoke this tool or what to expect beyond the primary state change.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description adds meaningful information beyond the bare schema. For 'number_or_sys_id' it clarifies acceptance of either number or system ID. 'close_notes' gets a contextual explanation. 'close_code' provides concrete examples ('Solved (Permanently)', 'Solved (Workaround)'). With 0% schema coverage, this compensation is valuable, though the required/non-required distinction is left to the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly identifies the action ('Resolve'), the resource ('incident'), and the specific outcome ('by setting its state to Resolved'). This verb+resource combination distinguishes it from sibling tools like update_incident and search_incidents, as resolve is a distinct operation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives such as update_incident or add_comment. It does not mention prerequisites (e.g., incident must be open), excluded scenarios (e.g., already resolved), or compare with sibling tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_incidentsA
Search incidents using a ServiceNow encoded query.
Args: query: ServiceNow encoded query string (sysparm_query), e.g. "active=true^priority=1" or "assigned_to.nameLIKEJohn". Leave empty to list the most recent incidents. limit: Max number of records to return (default 10). offset: Number of records to skip, for pagination.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| query | No | ||
| offset | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description must carry full disclosure. It explains pagination but omits critical behavioral traits: it's a read-only operation, no side effects, no rate limits or authorization hints. The output schema exists but description doesn't confirm that results are returned.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Structured as a compact docstring with Args section. Every sentence is informative and necessary. No wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Covers the core usage of all three parameters, defaults, and pagination. Output schema is present, so return details are provided structurally. Could mention that the tool returns a list of incidents matching the query.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, yet description adds rich meaning: query is a ServiceNow encoded string with examples, limit default 10, offset for pagination. This fully compensates for the lack of schema descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Search incidents using a ServiceNow encoded query' with a specific verb and resource. It distinguishes from sibling tools like get_incident (single record) and mutation tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Describes when to use the encoded query, including examples and the behavior when query is empty. Provides pagination guidance via limit and offset. Lacks explicit contrast with siblings or exclusion scenarios.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
update_incidentA
Update fields on an existing incident.
Args: number_or_sys_id: Incident number (e.g. INC0010023) or sys_id. fields: Field name -> new value, e.g. {"state": "2", "priority": "1"}.
| Name | Required | Description | Default |
|---|---|---|---|
| fields | Yes | ||
| number_or_sys_id | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral transparency. It discloses the tool is a mutation (update) on an existing incident, which implies write side effects. However, it does not mention whether partial updates are allowed, whether all fields are updatable, what happens on failure (e.g., incident not found), or authentication/permission requirements. This is adequate but not comprehensive for a mutation tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise, consisting of a one-liner summary and a docstring-style Args block. The key info is front-loaded. However, the Args section uses a format that may be less readable in some plain-text contexts, and it could be slightly more structured with bullet points.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given that no annotations exist, the description must cover behavioral aspects. It informs about update semantics, but lacks details on return values (despite an output schema existing), error handling, rate limits, or field validation. For a tool with two parameters and a nested object, it is adequate but not fully complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description fully bears the responsibility. It explains the first parameter (number_or_sys_id) with a concrete example (INC0010023) and indicates it can also accept a sys_id. For the fields parameter, it provides a usage example format. This adds significant semantic value beyond the bare schema, which only states type and title. However, it does not document all possible field names or values, leaving some ambiguity.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool updates fields on an existing incident, specifying the resource (incident) and action (update). The sibling tools include create_incident and resolve_incident, so this description effectively distinguishes itself as a general-purpose field update tool.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implicitly indicates usage when updating existing incidents, but it does not explicitly state when not to use it or mention alternatives. For example, it does not clarify that resolving an incident should use resolve_incident instead, or that updating status to '6' (resolved) might trigger different side effects. The usage is clear for common cases but lacks explicit guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
6 tool updates
v0.1.0- First observed
add_comment - First observed
create_incident - First observed
get_incident - First observed
resolve_incident - First observed
search_incidents - First observed
update_incident
TDQS
Scored across 6 tools
Each tool has a clear, distinct purpose covering the full incident lifecycle: get, create, update, search, add comment, and resolve. There is no overlap or ambiguity between them.
Tools follow a verb_noun pattern (e.g., get_incident, create_incident). The only minor deviation is 'add_comment' which is still verb_noun but lacks the 'incident' suffix, though it is clearly contextual.
Six tools is an ideal size for an incident management MCP server. Each tool serves a necessary operation without being too many or too few, keeping the surface focused and manageable.
Core incident operations are covered: create, read, update, search, comment, and resolve. Missing an explicit delete tool, but ServiceNow incidents are typically not deleted; update can handle assignment. Minor gap but still robust.
Maintenance
Related MCP Connectors
- mttrlyOAuthcom.mttrly
AI-powered incident management and server monitoring via MCP.
- mcpOAuthcom.gibsonai
GibsonAI MCP server: manage your databases with natural language
An MCP server that provides an API to LLMs to manage their JumpCloud resources.
MCP server for generating rough-draft project plans from natural-language prompts.
Related MCP Servers
- AlicenseAqualityAmaintenanceAn 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.8935 npm16MIT
- AlicenseNot gradedqualityCmaintenanceMCP server enabling interaction with ServiceNow API for managing incidents, CMDB, change management, and other ServiceNow operations via natural language.20MIT
- FlicenseAqualityDmaintenanceA production-ready MCP server that turns any MCP-compatible AI assistant into an AI-powered ServiceNow Incident Management Assistant, exposing incidents, users, CMDB records, and knowledge articles through validated tools.12-
- AlicenseNot gradedqualityDmaintenanceMCP server to interact with ServiceNow instances, enabling ITSM, CMDB, workflow, and knowledge search operations.MIT