fix: improve MCP page setup UX and remove automation credit quotas (#821)

* Remove MCP credit quotas and improve MCP setup page

- Always show client setup snippets with placeholder keys
- Add View Docs link to MCP page header
- Remove monthly automation credit enforcement and UI
- Update plan feature text to reflect free MCP access

Co-authored-by: Rotimi Best <rotimi-best@users.noreply.github.com>

* fix: address PR review feedback for MCP page changes

- Clear generatedSecret when revoking MCP keys
- Use Button link mode for View Docs with rel noopener noreferrer
- Update all dashboard locale files for MCP translations
- Make MCP rate-limit admission atomic with transactional reservations
- Wrap MCP route handlers with withMcpAutomationUsage helper

Co-authored-by: Rotimi Best <rotimi-best@users.noreply.github.com>

* revert: remove atomic MCP rate-limit reservations

The transactional advisory-lock reservation was unnecessary complexity
for our MCP usage model. Restore the simpler check-then-record flow.

Also only clear generatedSecret when revoking the key it belongs to.

Co-authored-by: Rotimi Best <rotimi-best@users.noreply.github.com>

* fix: address remaining MCP page bot review feedback

- Add blank lines after confirm guards in key handlers
- Skip showing rotated secret if key was revoked during rotation
- Fix vi keys_title and de rate_limits_title translations

Co-authored-by: Rotimi Best <rotimi-best@users.noreply.github.com>

* fix: prevent late key rotation from un-revoking or exposing secrets

- Rotate only when revoked_at IS NULL at update time (DB)
- Reject rotate requests for already-revoked keys (API)
- Ignore stale rotate responses in automation client state
- Guard MCP UI against showing secrets for revoked keys

Co-authored-by: Rotimi Best <rotimi-best@users.noreply.github.com>

---------
This commit is contained in:
Rotimi Best
2026-08-16 22:12:04 +01:00
committed by GitHub
co-authored by Rotimi Best
parent 1cb752d229
commit 9fb75e11d2
18 changed files with 120 additions and 94 deletions
@@ -4081,16 +4081,15 @@
},
"usage": {
"title": "Использование и ограничения",
"description": "MCP доступен в каждом плане, но использование контролируется с помощью ежемесячных кредитов на автоматизацию и ключевых лимитов.",
"credits_title": "Оставшиеся кредиты",
"credits_description": "Мутирующие действия MCP потребляют кредиты. Действия чтения бесплатны.",
"description": "MCP доступен в каждом плане. Использование контролируется лимитами ключей и лимитами запросов.",
"keys_title": "Активные ключи",
"keys_description": "Используйте один ключ MCP для каждой интеграции, чтобы можно было без проблем менять или отзывать доступ.",
"rate_limits_title": "Ограничения ставок",
"rate_limits_description": "Запросы на чтение/запись/публикацию разрешены в минуту.",
"used_label": "Использовано:"
},
"page_subtitle": "Подключайте ИИ-инструменты к ClassroomIO с помощью ключей организации, которые можно менять в любое время."
"page_subtitle": "Подключайте ИИ-инструменты к ClassroomIO с помощью ключей организации, которые можно менять в любое время.",
"view_docs": "Документация"
},
"api": {
"subtitle": "Управляйте API-ключами для интеграции с публичным API ClassroomIO.",