cart mcp
Build and Publish / BuildAndDeployArm64 (push) Failing after 6s
Build and Publish / BuildAndDeployAmd64 (push) Has been cancelled

This commit is contained in:
2026-06-24 18:45:26 +02:00
parent 94b1f9c4ec
commit 87ba9c41b9
+10
View File
@@ -14,6 +14,7 @@ import (
"git.k6n.net/mats/go-cart-actor/pkg/actor"
"git.k6n.net/mats/go-cart-actor/pkg/cart"
cartmcp "git.k6n.net/mats/go-cart-actor/pkg/cart/mcp"
"git.k6n.net/mats/go-cart-actor/pkg/promotions"
promotionmcp "git.k6n.net/mats/go-cart-actor/pkg/promotions/mcp"
"git.k6n.net/mats/go-cart-actor/internal/ucp"
@@ -242,6 +243,8 @@ func main() {
log.Fatalf("Error creating cart pool: %v\n", err)
}
cartMCP := cartmcp.New(pool)
// Publish each applied mutation to the "cart"/"mutation" RabbitMQ topic so the
// backoffice /commerce live feed (and other consumers) see cart activity.
// Best-effort: if AMQP is unreachable the cart still serves; the feed stays empty.
@@ -299,6 +302,13 @@ func main() {
mux.Handle("/mcp", promotionMCP.Handler())
mux.Handle("/mcp/", promotionMCP.Handler())
// Cart MCP edge: inspect and mutate carts — get_cart, get_cart_items,
// update_item_quantity, remove_cart_item, clear_cart, apply_voucher, etc.
// Exposes 11 tools on the same grain pool, mounted at /cart-mcp so it does
// not conflict with the Promotions MCP at /mcp.
mux.Handle("/cart-mcp", cartMCP.Handler())
mux.Handle("/cart-mcp/", cartMCP.Handler())
// UCP REST adapter — Universal Commerce Protocol
cartUCP := ucp.CartHandler(pool)
if signer := loadUCPCartSigner(); signer != nil {