mcp
This commit is contained in:
@@ -16,7 +16,6 @@ import (
|
||||
"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"
|
||||
"git.k6n.net/mats/go-cart-actor/pkg/proxy"
|
||||
"git.k6n.net/mats/go-cart-actor/pkg/voucher"
|
||||
@@ -142,7 +141,6 @@ func main() {
|
||||
log.Printf("loaded %d promotions", len(promotionStore.List()))
|
||||
|
||||
promotionService := promotions.NewPromotionService(nil)
|
||||
promotionMCP := promotionmcp.New(promotionStore, promotionService)
|
||||
|
||||
//inventoryPubSub := actor.NewPubSub[inventory.InventoryChange]()
|
||||
|
||||
@@ -296,14 +294,6 @@ func main() {
|
||||
|
||||
syncedServer.Serve(mux)
|
||||
|
||||
// Promotion MCP edge: list/get/upsert/status/delete promotions and preview
|
||||
// discounts. Mutations persist to data/promotions.json and are picked up by
|
||||
// the cart's totals processor on the next mutation (it reads a fresh snapshot).
|
||||
// Mounted at /promotions-mcp to avoid conflicting with the backoffice CMS MCP
|
||||
// at /mcp (which is routed by the edge).
|
||||
mux.Handle("/promotions-mcp", promotionMCP.Handler())
|
||||
mux.Handle("/promotions-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
|
||||
|
||||
@@ -24,6 +24,7 @@ import (
|
||||
"git.k6n.net/mats/go-cart-actor/pkg/flow"
|
||||
"git.k6n.net/mats/go-cart-actor/pkg/idempotency"
|
||||
"git.k6n.net/mats/go-cart-actor/pkg/order"
|
||||
ordermcp "git.k6n.net/mats/go-cart-actor/pkg/order/mcp"
|
||||
"git.k6n.net/mats/go-cart-actor/pkg/outbox"
|
||||
messages "git.k6n.net/mats/go-cart-actor/proto/order"
|
||||
|
||||
@@ -169,6 +170,13 @@ func main() {
|
||||
// for why the exact-match pattern is omitted).
|
||||
mux.Handle("/ucp/v1/orders/", http.StripPrefix("/ucp/v1/orders", orderUCP))
|
||||
|
||||
// Order MCP streamable-HTTP server (inspect + mutate orders via tools).
|
||||
// Mounted at /order-mcp to avoid conflicting with the backoffice CMS MCP at
|
||||
// /mcp (which is routed by the edge).
|
||||
orderMCP := ordermcp.New(applier)
|
||||
mux.Handle("/order-mcp", orderMCP.Handler())
|
||||
mux.Handle("/order-mcp/", orderMCP.Handler())
|
||||
|
||||
// Saga / flow admin (backoffice editor).
|
||||
mux.HandleFunc("GET /sagas/capabilities", s.handleCapabilities)
|
||||
mux.HandleFunc("GET /sagas/flows", s.handleListFlows)
|
||||
|
||||
Reference in New Issue
Block a user