Skip to main content
Glama
siddhardhan

servicenow-mcp

by siddhardhan

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

  1. Abhängigkeiten installieren:

    uv sync
  2. Kopieren Sie .env.example in .env und füllen Sie Ihre Anmeldedaten aus:

    cp .env.example .env
    • SERVICENOW_INSTANCE: nur der Instanzname (z. B. dev12345 für dev12345.service-now.com)

    • SERVICENOW_USERNAME / SERVICENOW_PASSWORD: Basisauthentifizierungs-Anmeldedaten für einen Benutzer mit Zugriff auf die Tabelle incident (Lesen/Schreiben über die Table-API)

  3. 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 8003

Dann 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 erstellen

  • get_incident — nach Nummer (z. B. INC0010023) oder sys_id abrufen

  • update_incident — beliebige Felder aktualisieren

  • search_incidents — mit einer ServiceNow-codierten Abfrage (sysparm_query) suchen

  • add_comment — einen für den Kunden sichtbaren Kommentar oder eine interne Arbeitsnotiz hinzufügen

  • resolve_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_PASSWORD aus .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_INSTANCE bleibt serverseitig (es ist eine Instanz für alle Clients), aber die Benutzername/Passwort sind clientseitig – daher spiegeln search_incidents-Ergebnisse, caller_id-Auflösung, usw. die ServiceNow-Berechtigungen dieses einzelnen Benutzers wider, anstatt eines gemeinsamen Dienstkontos. Wenn eine Anfrage keinen Authorization-Header hat, wird auf die gemeinsamen SERVICENOW_USERNAME / SERVICENOW_PASSWORD aus .env zurü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 state der Vorfalltabelle ist numerisch (z. B. 6 = Gelöst, 7 = Geschlossen); Werte können abweichen, wenn Ihre Instanz Vorfallstatus anpasst.

Available Tools

6 tools
add_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.

ParametersJSON Schema
NameRequiredDescriptionDefault
commentYes
work_noteNo
number_or_sys_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.3/5.0
Behavior4/5

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.

Conciseness4/5

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.

Completeness4/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
impactNo
urgencyNo
categoryNo
caller_idNo
descriptionNo
assignment_groupNo
short_descriptionYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.7/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness3/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
number_or_sys_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.8/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines2/5

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)".

ParametersJSON Schema
NameRequiredDescriptionDefault
close_codeNoSolved (Permanently)
close_notesYes
number_or_sys_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

B3.4/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness2/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines2/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
queryNo
offsetNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.1/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters5/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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"}.

ParametersJSON Schema
NameRequiredDescriptionDefault
fieldsYes
number_or_sys_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.5/5.0
Behavior3/5

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.

Conciseness4/5

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.

Completeness3/5

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.

Parameters4/5

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.

Purpose4/5

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.

Usage Guidelines3/5

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.

  1. 6 tool updatesv0.1.0
    • First observedadd_comment
    • First observedcreate_incident
    • First observedget_incident
    • First observedresolve_incident
    • First observedsearch_incidents
    • First observedupdate_incident

TDQS

A3.9/5.0

Scored across 6 tools

Disambiguation5/5

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.

Naming Consistency4/5

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.

Tool Count5/5

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.

Completeness4/5

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

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers