Skip to main content
Glama
README.md
# mcp-itsm-demo

[![tests](https://github.com/iamshinji/mcp-itsm-demo/actions/workflows/tests.yml/badge.svg)](https://github.com/iamshinji/mcp-itsm-demo/actions/workflows/tests.yml)

[Français](#français) · [English](#english)

## Français

Un serveur MCP (Model Context Protocol) d'exemple, **en lecture seule**, branché sur une base de tickets ITSM **entièrement fictive**. Il illustre l'article [À quoi sert un serveur MCP quand on fait de l'ITSM](https://gael.palie.fr/articles/serveur-mcp-itsm/) : un assistant IA consulte les tickets lui-même au lieu qu'on lui colle des copier-coller.

### Ce qu'il expose

| Outil | Usage |
|---|---|
| `search_tickets` | Retrouver les tickets passés qui ressemblent à celui en cours (mots-clés, filtres par application, priorité, statut). |
| `incident_timeline` | Reconstituer la chronologie d'un incident à partir de son journal : détection, pont de crise, communications, contournement, résolution. |
| `recent_changes` | Lister les changements appliqués dans les dernières heures, pour voir ce qui a bougé juste avant un incident. |

La base contient une quinzaine de tickets inventés, dont un incident majeur complet (`INC0001001`) et le changement qui l'a déclenché. Les données sont figées au **20 novembre 2026 à 18 h** (`as_of`), pour que les résultats ne dépendent pas de la date du jour.

### Les garde-fous de l'article, appliqués

- **Lecture seule.** Aucun outil n'écrit. Chacun est annoté `readOnlyHint: true`, `destructiveHint: false`, `openWorldHint: false`.
- **Peu d'outils, bien décrits.** Trois outils, chacun avec une description et des paramètres documentés : c'est ce que le modèle lit pour choisir.
- **Le texte d'un ticket est une donnée, pas un ordre.** Le ticket `INC0001007` contient une fausse consigne adressée à l'assistant. Le serveur la renvoie telle quelle, comme une donnée, et n'a de toute façon aucun moyen d'agir.
- **Chaque appel est tracé.** Une ligne JSON par appel sur stderr (horodatage, outil, arguments, nombre de résultats). stdout est réservé au protocole.
- **Aucune donnée réelle.** Applications, équipes et événements sont inventés ; les personnes sont désignées par leur rôle.

### Lancer

Prérequis : Python 3.10 ou plus récent.

```bash
git clone https://github.com/iamshinji/mcp-itsm-demo
cd mcp-itsm-demo
python -m venv .venv
source .venv/bin/activate        # Windows : .venv\Scripts\activate
pip install -e ".[dev]"
pytest                           # les tests passent par un vrai client MCP
```

Le serveur se lance avec la commande `itsm-demo` (transport stdio). On ne l'utilise pas seul : on le déclare à un client MCP.

### Le brancher sur un assistant

Remplacez `/chemin/vers` par le chemin absolu du dépôt cloné (sous Windows : `.venv\Scripts\itsm-demo.exe`).

- **Claude Code** : `claude mcp add itsm-demo -- /chemin/vers/mcp-itsm-demo/.venv/bin/itsm-demo`
- **Claude Desktop** : dans `claude_desktop_config.json`
  ```json
  { "mcpServers": { "itsm-demo": { "command": "/chemin/vers/mcp-itsm-demo/.venv/bin/itsm-demo" } } }
  ```
- **MCP Inspector**, pour tester sans assistant : `npx @modelcontextprotocol/inspector /chemin/vers/mcp-itsm-demo/.venv/bin/itsm-demo`

Questions à essayer :

- « Quels incidents passés ressemblent à des timeouts sur les paiements ? »
- « Reconstitue la chronologie de l'incident INC0001001 et résume-la pour le métier. »
- « Quels changements ont été appliqués dans les 48 heures avant cet incident ? »

### Aller plus loin

- L'article : [À quoi sert un serveur MCP quand on fait de l'ITSM](https://gael.palie.fr/articles/serveur-mcp-itsm/)
- Brancher un assistant sur vos propres outils : [Intégration IA et automatisation](https://gael.palie.fr/services/integration-ia-automatisation/)

Construit avec le [SDK Python officiel du Model Context Protocol](https://github.com/modelcontextprotocol/python-sdk) (version 2). Licence [MIT](LICENSE).

---

## English

A sample **read-only** MCP (Model Context Protocol) server over an **entirely fictional** ITSM ticket base. It illustrates the article [What an MCP server is good for when you work in ITSM](https://gael.palie.fr/en/articles/mcp-server-itsm/): the AI assistant looks up tickets itself instead of being fed copy-pasted text.

### What it exposes

| Tool | Use |
|---|---|
| `search_tickets` | Find past tickets that look like the current one (keywords, filters on application, priority, status). |
| `incident_timeline` | Rebuild an incident's timeline from its journal: detection, crisis bridge, communications, workaround, resolution. |
| `recent_changes` | List the changes implemented in the last hours, to see what moved just before an incident. |

The base holds about fifteen invented tickets, including a complete major incident (`INC0001001`) and the change that triggered it. The data is frozen at **20 November 2026, 18:00** (`as_of`), so results do not depend on today's date.

### The article's guardrails, applied

- **Read-only.** No tool writes. Each one is annotated `readOnlyHint: true`, `destructiveHint: false`, `openWorldHint: false`.
- **Few tools, well described.** Three tools, each with a description and documented parameters: that is what the model reads to choose.
- **Ticket text is data, not an order.** Ticket `INC0001007` contains a fake instruction aimed at the assistant. The server returns it as is, as data, and has no way to act on it anyway.
- **Every call is traced.** One JSON line per call on stderr (timestamp, tool, arguments, result count). stdout is reserved for the protocol.
- **No real data.** Applications, teams and events are invented; people are referred to by their role.

### Run it

Requires Python 3.10 or later.

```bash
git clone https://github.com/iamshinji/mcp-itsm-demo
cd mcp-itsm-demo
python -m venv .venv
source .venv/bin/activate        # Windows: .venv\Scripts\activate
pip install -e ".[dev]"
pytest                           # the tests go through a real MCP client
```

The server starts with the `itsm-demo` command (stdio transport). You do not run it on its own: you register it with an MCP client.

### Connect it to an assistant

Replace `/path/to` with the absolute path of the cloned repository (on Windows: `.venv\Scripts\itsm-demo.exe`).

- **Claude Code**: `claude mcp add itsm-demo -- /path/to/mcp-itsm-demo/.venv/bin/itsm-demo`
- **Claude Desktop**: in `claude_desktop_config.json`
  ```json
  { "mcpServers": { "itsm-demo": { "command": "/path/to/mcp-itsm-demo/.venv/bin/itsm-demo" } } }
  ```
- **MCP Inspector**, to test without an assistant: `npx @modelcontextprotocol/inspector /path/to/mcp-itsm-demo/.venv/bin/itsm-demo`

Questions to try:

- "Which past incidents look like payment timeouts?"
- "Rebuild the timeline of incident INC0001001 and summarise it for the business."
- "Which changes were implemented in the 48 hours before that incident?"

### Going further

- The article: [What an MCP server is good for when you work in ITSM](https://gael.palie.fr/en/articles/mcp-server-itsm/)
- Connecting an assistant to your own tools: [Integration and automation](https://gael.palie.fr/en/services/ai-integration-automation/)

Built with the [official Model Context Protocol Python SDK](https://github.com/modelcontextprotocol/python-sdk) (version 2). [MIT](LICENSE) licence.