feat: MCP 100% Go (promotion go-rewrite → main) + submit_prediction câblé - #3
Merged
Conversation
Porte le serveur MCP de Next.js/TS vers Go dans go/ (le TS reste intact à la racine). Le serveur devient un client HTTP mince de footics-api /v1 : il vérifie le JWT Supabase localement (double-mode JWKS/HS256, même logique que footics-api internal/auth) puis relaie le Bearer vers /v1. Zéro accès DB. - SDK officiel github.com/modelcontextprotocol/go-sdk v1.6.1 (Streamable HTTP stateless + auth.RequireBearerToken + PRM RFC 9728 sur les 2 chemins well-known) - 9 outils de lecture mappés sur /v1, formes de sortie GELÉES (identiques au TS lib/tools.ts) ; inputSchema fixés explicitement - submit_prediction = stub gated OFF (POST /v1/predictions = M4, non livré) - Tests : unit (auth double-mode, mapping de forme par outil vs contrat TS) + intégration contre l'API staging (skip propre si injoignable) Gate vert : go build && go vet && gofmt -l (vide) && go test ./... Validé à la main contre l'API staging (127.0.0.1:8099). Claude-Session: https://claude.ai/code/session_01CsRaJpQmoPyXRqH7g29mwN
…on câblé
Le repo était resté sur l'implémentation Next.js alors que la PROD tourne un
binaire Go (réécriture de la nuit du cutover, jamais promue). Ce PR :
- promeut le serveur Go (go/ → racine) : cmd/mcp + internal/{auth,apiclient,tools,config},
client authentifié de l'API /v1 (JWKS/HS256, OAuth PRM, rate-limit 30/min, 10 outils) ;
- supprime toute l'implémentation Next.js (app/, db/, lib/, components/…) — plus de
connexion DB ni de service-role dans le MCP, l'API /v1 est la seule frontière ;
- CÂBLE submit_prediction (était un stub) sur footics-api POST /v1/predictions : l'API
reste le point d'écriture unique (verrou 90', quota joker, qualifié KO) et son message
FR est renvoyé verbatim ; test unitaire httptest du forward + passthrough d'erreur ;
- Dockerfile multi-stage (distroless) + deploy/compose.dokploy.yml (github-provider) +
CI Go (build/vet/fmt/test) + README/.env.example Go.
Gates verts : build, vet, gofmt, go test.
Claude-Session: https://claude.ai/code/session_01SsG4T6WHAC2RrTFJkBspf3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pourquoi
mainétait resté sur l'implémentation Next.js, mais la prod tourne un binaire Go (réécriture de la nuit du cutover 4/7, jamais promue en main — découvert en voulant passer le service Dokploy en provider github). Ce PR réconcilie le repo avec la prod et va au bout de la réécriture.Quoi
go/→ racine) :cmd/mcp+internal/{auth,apiclient,tools,config}. Client authentifié de l'API/v1(vérif JWT JWKS/HS256, OAuth PRM.well-known/oauth-protected-resource, rate-limit 30/min/user, les 10 outils). Aucune connexion DB ni service-role : l'API/v1est la seule frontière.app/,db/,lib/,components/…).submit_predictioncâblé (c'était un stub) →footics-api POST /v1/predictions. L'API garde le point d'écriture unique + toutes les règles (verrou 90', quota joker, qualifié KO) ; son message FR est renvoyé verbatim au modèle. Test unitaire httptest (forward du body/Bearer + passthrough du 409).deploy/compose.dokploy.yml(github-provider) + CI Go (build/vet/fmt/test).Après merge
Le service Dokploy
footics-mcp= banc d'essai du provider github (proposition Tom) : sourceType github → build-from-git. Déploiement du nouveau binaire dans un creux + validation OAuth d'un client MCP réel. Parité prod confirmée (même module, boot log, .well-known identiques).https://claude.ai/code/session_01SsG4T6WHAC2RrTFJkBspf3