Skip to main content
Glama
README.md
# mcp-evento

Serveur MCP pour **Evento**, le service de sondages et de planification d'événements
de RENATER (<https://evento.renater.fr>), construit sur le logiciel libre **Moment**
(AGPLv3, <https://sourcesup.renater.fr/projects/moment>, dépôt
`https://git.renater.fr/anonscm/git/moment/moment.git`).

Evento n'a pas d'API publique documentée, mais son interface web repose sur une API
REST (`/rest.php`) décrite dans `doc/api/openapi.yml` du dépôt Moment et utilisée par
les outils ci-dessous : sondages, questions, réponses, résultats, calendriers.

## Installation

```bash
uv sync
uv run playwright install chromium   # navigateur utilisé par ouvrir_connexion
```

Déclaration dans un client MCP (`~/.omp/agent/mcp.json`, Claude Desktop…) :

```json
{
  "mcpServers": {
    "evento": {
      "command": "/chemin/vers/mcp-evento/.venv/bin/python",
      "args": ["-m", "mcp_evento"]
    }
  }
}
```

Variante sans venv : `"command": "uv", "args": ["run", "--directory", "/chemin/vers/mcp-evento", "mcp-evento"]`.

## Session

L'authentification Evento passe par la fédération Shibboleth (aucun mot de passe
applicatif) : elle ne peut pas être automatisée. Deux chemins, sans copie de cookie :

1. **Connexion assistée par navigateur** (recommandé, à lancer à la demande) :
   `ouvrir_connexion` ouvre un Chromium piloté sur la page Shibboleth, attend que la
   session soit valide côté API, puis la conserve dans
   `~/.local/share/mcp-evento/session.json` (0600). Les appels suivants la réutilisent,
   y compris depuis un autre processus ; aucune tentative de connexion n'est faite en
   arrière-plan, pour ne pas solliciter le fournisseur d'identité à répétition.
2. **Import depuis Firefox/Epiphany** : `importer_session` relit `cookies.sqlite`.

Evento s'appuie sur la session Shibboleth (`_shibsession_…`) : un cookie `PHPSESSID`
seul ne suffit pas, et la session expire côté fournisseur d'identité — il faut alors
relancer `ouvrir_connexion`.
3. **Cookie explicite** : `EVENTO_COOKIE="PHPSESSID=…; _shibsession_…=…"` (les deux
   cookies). `EVENTO_SECURITY_TOKEN` est optionnel : le jeton CSRF (`X-Security-Token`)
   est lu dans le HTML de `/home` et renouvelé sur erreur.

Variables : `EVENTO_COOKIE`, `EVENTO_BASE_URL` (défaut `https://evento.renater.fr`),
`EVENTO_SECURITY_TOKEN`, `EVENTO_BROWSER_PROFILE` (profil Chromium), `EVENTO_BROWSER_CMD`
(ouverture de lien simple). Voir `.env.example`.

## Outils

| Outil | Rôle |
| --- | --- |
| `qui_suis_je` | Session et compte connecté (diagnostic) |
| `ouvrir_connexion` | Connexion Shibboleth dans un Chromium piloté, session capturée et vérifiée |
| `importer_session` | Repli : import des cookies depuis Firefox/Epiphany |
| `lister_sondages` | Mes sondages, invités, répondus, à traiter |
| `obtenir_sondage` | Fiche d'un sondage : questions, propositions, réglages, lien |
| `creer_sondage` | Création (dates ou choix de texte, brouillon possible) |
| `modifier_sondage` | Mise à jour (titre, description, lieu, réglages, questions) |
| `clore_sondage`, `rouvrir_sondage` | Clôture (prévient les participants par courriel) et réouverture |
| `dupliquer_sondage`, `supprimer_sondage` | Copie en brouillon, suppression |
| `repondre_sondage`, `modifier_reponse` | Réponse (oui / non / peut-être) et modification |
| `resultats_sondage` | Digest prêt pour un courriel, CSV Evento ou JSON brut |
| `lister_participants` | Participants, avec courriels et noms si demandé |
| `reponses_participant`, `reponses_question` | Réponses détaillées |
| `lister_calendriers`, `ajouter_calendrier`, `supprimer_calendrier` | Flux ICS importés |
| `conflits_sondage` | Conflits bruts (JSON) entre propositions et calendriers |
| `creneaux_compatibles` | Créneaux du sondage libres dans les calendriers visés |
| `creneaux_incompatibles` | Créneaux en conflit, avec les événements à l'appui |
| `ouvrir_sondage` | Ouvre le lien public d'un sondage dans le navigateur |

Aucun outil n'envoie d'invitation : la liste des invités n'est ni lue ni modifiée.

## Attribution

Le code a été écrit avec l'aide d'un assistant LLM (DeepSeek V4.1 Flash servi par
vLLM), relu et vérifié contre l'API réelle par l'auteur. Les contributions
assistées doivent être signalées (voir `CONTRIBUTING.md`).

## Développement

```bash
pre-commit install            # ruff (lint + format) et gitleaks à chaque commit
uv run ruff check --fix .
uv run ruff format .
uv run pytest
```

## Licence

MIT (voir `LICENSE.md`). Ce serveur est un client de l'API d'Evento ; le logiciel
Evento/Moment est publié sous AGPLv3 par RENATER, indépendamment de ce dépôt.

TDQS

B3/5.0

Scored across 24 tools

Disambiguation4/5

Most tools target distinct resources and actions (lister/obtenir/creer/modifier/clore/supprimer_sondage, response and calendar tools are clearly separated). The main confusion is the trio conflits_sondage, creneaux_incompatibles and creneaux_compatibles, which all compute survey-vs-calendar overlap and differ only in output framing; obtenir_sondage vs ouvrir_sondage is also a subtle distinction (data vs browser window).

Naming Consistency4/5

Names are consistently snake_case French with a predictable verb_noun pattern for the action tools (lister_, obtenir_, creer_, modifier_, supprimer_, ajouter_, repondre_). A handful of noun-first names (resultats_sondage, reponses_participant, reponses_question, conflits_sondage, creneaux_compatibles) break the verb-first convention but remain readable and unambiguous.

Tool Count3/5

24 tools is heavy for the apparent scope; the survey CRUD, response, participant and calendar groups each earn their place, but the three conflict/compatibility tools overlap enough that one or two could be folded in, and clore/rouvrir could arguably be state changes on modifier_sondage.

Completeness3/5

Survey lifecycle (create, read, list, update, close, reopen, duplicate, delete) and response reading are well covered, with calendars and conflict detection adding real value. However, invitation/participant management is missing (creer_sondage explicitly sends no invitations, and there is no tool to invite or add participants), and there is no way to delete or retract a submitted response.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues