Skip to main content
Glama
PhilInTheLoop

luigi-ucp-server

README.md
# Luigi's Pizzeria — UCP Server

A local MCP server implementing **Universal Commerce Protocol (UCP)** primitives,
backed by HubSpot CRM. Built as a proof-of-concept for the AgentFriend blog.

## Architecture

```
[Buyer Agent: Claude]  ←→  MCP (stdio)  ←→  [This Server]  ←→  HubSpot CRM
```

## UCP Primitive Mapping

| UCP Primitive   | MCP Tool              | Backend          |
|-----------------|-----------------------|------------------|
| `BuyerProfile`  | `get_buyer_profile`   | HubSpot Contacts |
| `ProductCatalog`| `get_product_catalog` | HubSpot Products |
| `Cart`          | `create_cart`         | in-memory        |
| `Order`         | `place_order`         | HubSpot Deals    |

## Setup

```bash
pip install -r requirements.txt
cp .env.example .env
# Add your HubSpot Private App token to .env
```

## Register as MCP server in Claude Code

Add to your `~/.claude/settings.json`:

```json
{
  "mcpServers": {
    "luigi-ucp-server": {
      "command": "python",
      "args": ["/absolute/path/to/luigi-ucp-server/server.py"],
      "env": {
        "HUBSPOT_ACCESS_TOKEN": "your-token-here"
      }
    }
  }
}
```

## HubSpot Private App Setup

1. HubSpot → Settings → Integrations → Private Apps
2. Create a Private App with these scopes:
   - `crm.objects.contacts.read`
   - `crm.objects.products.read`
   - `crm.objects.deals.write`
   - `crm.objects.line_items.write`
   - (Notes are readable via `crm.objects.contacts.read` — no separate scope needed)
3. Copy the token into `.env`