diff --git a/CLAUDE.md b/CLAUDE.md index d108fb4..1640a80 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -15,6 +15,9 @@ Application de gestion de projet. Monorepo Symfony 8 (API Platform 4) + Nuxt 4. src/Entity/ # Entités Doctrine (User, Client, Project, Task, TaskStatus, TaskEffort, TaskPriority, TaskTag, TaskGroup, TimeEntry, GiteaConfiguration) src/ApiResource/ # Ressources API Platform (si découplées des entités) src/State/ # Providers et Processors API Platform (MeProvider, AppVersionProvider, ActiveTimeEntryProvider, UserPasswordHasherProcessor, TaskNumberProcessor, Gitea*Provider, Gitea*Processor) +src/Mcp/Tool/ # MCP tools organisés par domaine (Project/, Task/, TaskMeta/, TimeEntry/, Reference/) +src/Security/ # Authenticators custom (ApiTokenAuthenticator pour MCP HTTP) +src/Command/ # Commandes console (GenerateApiTokenCommand) src/Repository/ # Repositories Doctrine src/DataFixtures/ # Fixtures config/ # Config Symfony (security, api_platform, lexik_jwt, nelmio_cors, doctrine) @@ -80,8 +83,19 @@ Exemples : `feat : add login page`, `fix(auth) : prevent null token crash` - Traductions dans `frontend/i18n/locales/` (le module résout `langDir` depuis `i18n/`) - 4 espaces d'indentation +### MCP Server + +- 22 tools MCP exposant projets, tâches, métadonnées, et time tracking +- Transport STDIO (local) : `docker exec -i php-lesstime-fpm php bin/console mcp:server` +- Transport HTTP (réseau) : `POST /_mcp` avec header `Authorization: Bearer ` +- Auth HTTP : `ApiTokenAuthenticator` vérifie le champ `apiToken` de l'entité `User` +- Générer un token : `php bin/console app:generate-api-token ` +- Config : `config/packages/mcp.yaml`, firewall dans `config/packages/security.yaml` +- Attribut `#[McpTool]` doit être sur la **classe** (pas la méthode `__invoke`) pour la discovery SDK + ### Nginx +- `/_mcp` → Symfony (MCP HTTP transport) - `/api/*` → Symfony (via try_files + index.php) - `/api/login_check` → location exact match, fastcgi direct avec REQUEST_URI réécrit en `/login_check` - `/` → SPA frontend (`frontend/dist/`) @@ -97,3 +111,4 @@ Exemples : `feat : add login page`, `fix(auth) : prevent null token crash` ## Fixtures - User admin : `admin` / `admin` (ROLE_ADMIN) +- API token admin (dev) : `dev-mcp-token-for-testing-only-do-not-use-in-production`