Skip to main content
Glama
cherwell-mcp

cherwell-mcp

by mkyrpychnyk

cherwell-mcp

A Model Context Protocol server (stdio) for the Cherwell CSM REST API. It lets MCP clients (Claude Code, Claude Desktop, etc.) create, read, update, delete and search Cherwell business objects — Incidents, Problems, Changes, or any custom object.

Requirements

  • Node.js ≥ 20

  • A Cherwell REST API client key (created in CSM Administrator → Security → Edit REST API client settings)

  • A Cherwell user account the server will act as

Related MCP server: Azure DevOps MCP Server

Configuration

All configuration is provided via environment variables — no config files, no CLI flags:

Variable

Required

Description

CHERWELL_BASE_URL

yes

CSM host root, e.g. https://csm.example.com

CHERWELL_CLIENT_ID

yes

REST API client key

CHERWELL_USERNAME

yes

Cherwell user login

CHERWELL_PASSWORD

yes

Cherwell user password

CHERWELL_AUTH_MODE

no

internal (default), windows, ldap, or saml

CHERWELL_TIMEOUT_MS

no

Per-request timeout in milliseconds, default 30000

The server exits with a descriptive error at startup if a required variable is missing.

Usage

Claude Code

claude mcp add cherwell \
  --env CHERWELL_BASE_URL=https://csm.example.com \
  --env CHERWELL_CLIENT_ID=<client-key> \
  --env CHERWELL_USERNAME=<user> \
  --env CHERWELL_PASSWORD=<password> \
  -- npx -y cherwell-mcp

Claude Desktop / generic MCP client

{
  "mcpServers": {
    "cherwell": {
      "command": "npx",
      "args": ["-y", "cherwell-mcp"],
      "env": {
        "CHERWELL_BASE_URL": "https://csm.example.com",
        "CHERWELL_CLIENT_ID": "<client-key>",
        "CHERWELL_USERNAME": "<user>",
        "CHERWELL_PASSWORD": "<password>"
      }
    }
  }
}

Tools

Tool

Purpose

list_business_object_summaries

Discover business objects and their IDs (Major, Supporting, Lookup, Groups, All)

get_business_object_template

Field schema of an object (names, IDs, required flags)

get_business_object

Read one record by record ID or public ID

create_business_object

Create a record from a {fieldName: value} map

update_business_object

Update selected fields of an existing record

delete_business_object

Permanently delete a record

search_business_objects

Filtered search with paging and field selection

Everywhere a business object is expected, tools accept either its name (Incident) or its 32-character busObId. Fields are addressed by name or display name; the server resolves them to Cherwell field IDs internally.

Response size

Cherwell wraps every field in seven keys of metadata, so one raw Incident is ~110 KB — far more than an LLM context can afford. The read tools therefore return a compact form by default: a flat {fieldName: value} map alongside the record identifiers. Measured against a live instance:

Call

Compact

Raw (raw: true)

get_business_object (one incident, ~400 fields)

13.8 KB

111 KB

get_business_object with fields: ["IncidentID","Status","ShortDescription"]

260 B

—

list_business_object_summaries (141 objects)

20 KB

61 KB

get_business_object_template (Incident)

35 KB

93 KB

Pass fields on get_business_object / search_business_objects to request only what you need, and raw: true when you genuinely need Cherwell's original payload (field IDs, HTML, dirty flags).

Example workflow

  1. list_business_object_summaries → find Incident

  2. get_business_object_template (requiredOnly: true) → see mandatory fields

  3. create_business_object with {"Description": "...", "Priority": "3", ...}

  4. search_business_objects with [{"fieldName": "Status", "operator": "eq", "value": "New"}]

  5. update_business_object / delete_business_object by the returned busObRecId

How it works

  • Authenticates with the OAuth password grant against POST /CherwellAPI/token (auth_mode configurable). The token is cached and refreshed 10 minutes before expiry; a 401 triggers one automatic re-login + retry.

  • Cherwell's in-band errors (HTTP 200 with hasError: true) are surfaced as tool errors.

  • Templates are cached per business object, so repeated saves/searches don't re-fetch schemas.

See ARCHITECTURE.md for the full design.

Development

npm install
npm run build     # compile to dist/
npm start         # run the compiled server (needs CHERWELL_* env vars)

Security notes

  • Credentials live only in environment variables and are never included in tool output or logs.

  • The account's Cherwell permissions bound what the tools can do — use a least-privilege account.

  • delete_business_object is irreversible; grant it deliberately.

License

MIT

Available Tools

7 tools
create_business_objectA

Create a new business object record. Pass field values as a map of field name (or display name) to value. Use get_business_object_template with requiredOnly=true to see which fields are mandatory. Returns the new record's busObRecId and public ID.

Inputs: fields (required), businessObject (required).

delete_business_objectA

Permanently delete a business object record by its record ID (busObRecId). This cannot be undone.

Inputs: recId (required), businessObject (required).

get_business_objectA

Read a single business object record with all its field values, addressed by record ID (busObRecId) or public ID (e.g. incident number). Provide exactly one of recId / publicId.

Inputs: businessObject (required), recId, publicId.

get_business_object_templateA

Get the field schema (template) of a business object: field IDs, names, display names and required flags. Use this to learn which fields exist before creating, updating or searching records.

Inputs: businessObject (required), requiredOnly.

list_business_object_summariesA

List Cherwell business objects (names and busObIds). Use this to discover which objects exist and to find the busObId or exact name needed by the other tools.

Inputs: type.

search_business_objectsA

Search business object records with field filters. Filters on the SAME field are OR-ed together; filters on DIFFERENT fields are AND-ed (Cherwell semantics). Supports paging and an optional list of fields to return (defaults to all fields).

Inputs: filters (required), businessObject (required), fields, pageSize, +1 more.

update_business_objectB

Update fields of an existing business object record, addressed by record ID (busObRecId) or public ID. Only the provided fields are changed. Provide exactly one of recId / publicId.

Inputs: fields (required), businessObject (required), recId, publicId.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 7 tools

    Disambiguation5/5

    Each tool targets a clearly distinct action: listing object types, reading one record, creating, deleting, getting schema, updating, and searching. The descriptions explicitly clarify boundaries, such as get_business_object_template for schema versus get_business_object for record data. No two tools appear interchangeable.

    Naming Consistency5/5

    All tool names use snake_case and a consistent verb_noun pattern: list_, get_, create_, delete_, update_, search_. The minor extra suffixes (summaries, template) still follow the same predictable style.

    Tool Count5/5

    Seven tools is well-scoped for a Cherwell business-object CRUD surface. Each tool covers a necessary operation without redundancy or bloat.

    Completeness5/5

    The set provides full lifecycle coverage for business object records: discovery, schema inspection, create, read, update, delete, and search. No obvious operational gap exists for the stated domain.

    Maintenance

    ActivitySlowing
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      Not graded
      maintenance
      Enables MCP clients to interact with Microsoft Dynamics 365 Business Central entities, providing tools to get schemas, list, create, update, and delete records.
      6
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables MCP clients to access and manage Microsoft Dynamics 365 Business Central entities, such as creating sales orders, via a modern async MCP server.
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables MCP clients to manage Snipe-IT assets with full CRUD, checkout/checkin, audit, restore, and lookup operations across all supported resource types.
      11
      AGPL 3.0