0a1576aaa5
USER_ALIASES test->mcptest. Eigene Backends pro Dienst: - Radicale-User mcptest + /mcptest/calendar-test + contacts-test - oCIS-User mcptest (Graph-API), Joplin lokales Profil :41186 - statische Test-Maildir tests/testdata/maildir (mcp-test-mail/-empty) test_all.py auf mcptest-Backends umgestellt (Account-/Kalender-/Kontaktnamen). config.json (gitignored) mit mcptest in allen Maps. Doku: tests/MCPTEST.md. 54 Tests gruen. Stefans calendar-test/contacts-test + Joplin-Test-Reste entfernt.
62 lines
3.1 KiB
Markdown
62 lines
3.1 KiB
Markdown
# mcptest — isoliertes Test-/Dev-Backend
|
|
|
|
Die MCP-Test-Suite (`test_all.py`, taeglich via `mcp-tests.timer`) laeuft **NICHT mehr
|
|
auf Stefans echten Daten**, sondern auf einem dedizierten `mcptest`-User mit eigenen
|
|
Backends. Dieselbe Umgebung dient als isolierte **Dev-Sandbox** fuer die MCP-Server.
|
|
|
|
## Routing
|
|
|
|
`common.py`: `USER_ALIASES = {"test": "mcptest"}`. Der Test-OAuth-Client `client_id=test`
|
|
(Secret in `config.json` -> `test.token`) wird also auf den User `mcptest` gemappt.
|
|
Alle Server lesen pro User aus `config.json`.
|
|
|
|
## Backends pro Dienst
|
|
|
|
- **Calendar/Contacts (Radicale):** User `mcptest` (htpasswd `/opt/radicale/config/htpasswd`,
|
|
bcrypt). Collections `/mcptest/calendar-test/` (VEVENT+VTODO) und `/mcptest/contacts-test/`
|
|
(VADDRESSBOOK, Test-Kontakt "Max Mustermann"). `calendar_paths/addressbook_paths[mcptest]=["/mcptest/"]`.
|
|
- **Files (oCIS):** kompletter User `mcptest` (angelegt via Graph-API `POST /graph/v1.0/users`
|
|
als admin). `ocis_users[mcptest]`. Tests legen `/.mcp-tests` selbst an + raeumen auf.
|
|
- **Notes (Joplin):** lokales joplin-cli-Profil `/mnt/ssd/joplin-mcp/profiles/mcptest`
|
|
(`sync.target=0`, kein Server-Sync), Data API auf **:41186** via `joplin-cli-mcptest.service`.
|
|
Notizbuecher `Inbox` + `MCP Test` mit Beispielnotizen. `joplin_data_api[mcptest]`.
|
|
- **Mail:** statische Test-**Maildir** `/opt/mcp-servers/tests/testdata/maildir/` mit Konten
|
|
`mcp-test-mail` (INBOX: "Willkommen" + "Rechnung"+PDF-Anhang, Sent) und `mcp-test-empty`.
|
|
`mail_roots[mcptest]` zeigt dahin. (Der Mail-MCP liest Maildirs, kein Live-IMAP.)
|
|
|
|
## Credentials
|
|
|
|
- Klartext-Backup: `/root/.mcptest-creds` (chmod 600).
|
|
- Aktiv genutzt: `config.json` (gitignored) — radicale/ocis Passwoerter, joplin Token.
|
|
- oCIS-Admin (fuer User-Anlage): `/mnt/ssd/ocis/auth.txt`.
|
|
|
|
## Tests laufen lassen
|
|
|
|
```bash
|
|
/opt/mcp-servers/venv/bin/python -m pytest /opt/mcp-servers/tests/test_all.py -q
|
|
# oder der taegliche Runner:
|
|
sudo /opt/mcp-servers/tests/run_tests.sh
|
|
```
|
|
|
|
## Als Dev-Sandbox nutzen
|
|
|
|
- Direkt gegen die Backends: Radicale `http://127.0.0.1:5232/mcptest/` (User mcptest),
|
|
Joplin Data API `http://127.0.0.1:41186` (Token aus config.json), Maildir s.o.
|
|
- Ueber die MCP-Server: mit dem `test`-OAuth-Client verbinden -> trifft automatisch mcptest.
|
|
- Testdaten zuruecksetzen: Collections/Notebooks neu seeden (siehe Provisioning unten).
|
|
|
|
## Provisioning (Recreate)
|
|
|
|
1. Radicale: `htpasswd -bB /opt/radicale/config/htpasswd mcptest <pw>`; dann MKCALENDAR
|
|
`/mcptest/calendar-test/` + extended-MKCOL `/mcptest/contacts-test/`.
|
|
2. oCIS: `POST /graph/v1.0/users` als admin (onPremisesSamAccountName=mcptest, passwordProfile).
|
|
3. Joplin: Profil anlegen (`joplin --profile DIR config api.token ...; sync.target 0`),
|
|
`api.port=41186` in settings.json, `joplin-cli-mcptest.service` (Kopie von -stefan),
|
|
Notebooks/Notizen via Data API seeden.
|
|
4. Mail: `tests/testdata/maildir/` (im Repo) — Maildir-Konten mit cur/-Nachrichten.
|
|
5. `config.json`: mcptest in radicale_users, ocis_users, joplin_data_api, mail_roots,
|
|
calendar_paths, addressbook_paths.
|
|
6. `common.py`: `USER_ALIASES = {"test": "mcptest"}`.
|
|
|
|
Verwandt: `/opt/mcp-servers/CLAUDE.md`.
|