cart mcp
This commit is contained in:
@@ -14,6 +14,7 @@ import (
|
|||||||
|
|
||||||
"git.k6n.net/mats/go-cart-actor/pkg/actor"
|
"git.k6n.net/mats/go-cart-actor/pkg/actor"
|
||||||
"git.k6n.net/mats/go-cart-actor/pkg/cart"
|
"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"
|
"git.k6n.net/mats/go-cart-actor/pkg/promotions"
|
||||||
promotionmcp "git.k6n.net/mats/go-cart-actor/pkg/promotions/mcp"
|
promotionmcp "git.k6n.net/mats/go-cart-actor/pkg/promotions/mcp"
|
||||||
"git.k6n.net/mats/go-cart-actor/internal/ucp"
|
"git.k6n.net/mats/go-cart-actor/internal/ucp"
|
||||||
@@ -242,6 +243,8 @@ func main() {
|
|||||||
log.Fatalf("Error creating cart pool: %v\n", err)
|
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
|
// Publish each applied mutation to the "cart"/"mutation" RabbitMQ topic so the
|
||||||
// backoffice /commerce live feed (and other consumers) see cart activity.
|
// backoffice /commerce live feed (and other consumers) see cart activity.
|
||||||
// Best-effort: if AMQP is unreachable the cart still serves; the feed stays empty.
|
// 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())
|
||||||
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
|
// UCP REST adapter — Universal Commerce Protocol
|
||||||
cartUCP := ucp.CartHandler(pool)
|
cartUCP := ucp.CartHandler(pool)
|
||||||
if signer := loadUCPCartSigner(); signer != nil {
|
if signer := loadUCPCartSigner(); signer != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user