Skip to main content
Glama

Retail Enterprise MCP Portfolio

A complete enterprise portfolio that connects AI clients to retail customer, inventory, sales, order, and support capabilities through the Model Context Protocol (MCP). It combines strategic assessment, a working server, and production security/deployment artifacts in one repository.

Portfolio coverage

  1. MCP architecture assessment and design: architecture, MCP evaluation, risk assessment, ROI, and executive summary.

  2. Production MCP server: resources, tools, prompt, PostgreSQL adapter, Redis cache, connection pool, validation, transactions, idempotency, tests, and API documentation.

  3. Enterprise framework: security, Prometheus/Grafana, Docker, Kubernetes, TLS gateway, CI/CD, deployment, and disaster recovery.

  4. Multi-agent extension proposal: dialogue synthesis, safeguards, conflict resolution, and human intervention.

Related MCP server: Createve.AI Nexus

Architecture

flowchart LR
  U[Enterprise User] --> H[AI Host / MCP Client]
  H -->|Streamable HTTP + TLS| G[Gateway / WAF]
  G --> M[Stateless MCP Replicas]
  M --> A[Authentication + RBAC]
  A --> R[Resource Manager]
  A --> T[Tool Manager]
  R --> C[(Redis Cache)]
  R --> P[Connection Pool]
  T --> P
  P --> D[(PostgreSQL)]
  D -. adapters .-> E[CRM / ERP / Inventory / Support]
  M --> O[Metrics / Audit / Alerts]

The editable diagram is docs/architecture.mmd.

MCP contract

Resources

URI template

Permission

Description

retail://customers/{customer_id}

customer:read

Customer profile with role-based PII filtering

retail://inventory/{sku}

inventory:read

Quantity, reorder threshold, and price

retail://sales/{sale_id}

sales:read

Confirmed retail sale

Tools

Tool

Permission

Safety property

process_order

order:write

Transaction, row lock, idempotency key, stock validation

update_inventory

inventory:write

Bounds validation, non-negative invariant, cache invalidation

create_support_ticket

ticket:write

Length/control-character validation and audit event

The investigate_customer_issue prompt provides workflow guidance but grants no permission.

Quick start

Prerequisites: asdf, uv, and optionally Docker. The repository pins Python in .tool-versions, following the workspace standard.

asdf install
asdf current python
cp .env.example .env
uv sync --python "$(asdf which python)" --extra dev
uv run pytest
uv run retail-mcp --transport http

In another terminal, run the non-destructive protocol smoke test, or let it manage a temporary local server with --start-server:

uv run python scripts/smoke_test.py
uv run python scripts/smoke_test.py --start-server

Connect an MCP client to http://localhost:8000/mcp and send one of these headers:

X-API-Key: dev-admin-key

or:

Authorization: Bearer dev-admin-key

Bundled keys work only in development. Production mode rejects them. For STDIO:

RETAIL_MCP_STDIO_API_KEY=dev-admin-key uv run retail-mcp --transport stdio

Full stack

docker compose up --build -d
docker compose ps
curl http://localhost:8000/health/ready

Services:

  • MCP server: localhost:8000/mcp

  • Prometheus: localhost:9090

  • Grafana: localhost:3000

  • PostgreSQL and Redis: private Compose network only

See deployment.md for production Compose, Kubernetes, TLS, secrets, SLOs, scaling, and rollback.

Configuration

All settings use the RETAIL_MCP_ prefix.

Variable

Purpose

Production requirement

ENVIRONMENT

development, test, or production

production

DATA_BACKEND

memory or postgres

postgres

DATABASE_URL

PostgreSQL DSN

Secret

REDIS_URL

Shared cache URL

Secret/private endpoint

API_KEYS

JSON key/subject/role records

Secret; no dev-* keys

STDIO_API_KEY

Credential for local STDIO process

Environment secret

RATE_LIMIT_PER_MINUTE

Per-principal application limit

Tune from load test

REQUEST_TIMEOUT_SECONDS

Dependency operation timeout

Below gateway timeout

Example API_KEYS value:

[
  {"key": "a-long-random-secret", "subject": "support-agent", "role": "customer_service"}
]

API keys are the scenario's required authentication mechanism. Enterprise evolution should replace them with OAuth 2.1 and audience-bound tokens while retaining the same Principal and RBAC boundary.

Quality and validation

uv run ruff check .
uv run ruff format --check .
uv run pytest
docker compose config
docker build -t retail-mcp:local .

The CI pipeline performs linting, tests with coverage, package build, dependency review, and container build. Before production, add organization-specific SAST, secret scanning, image vulnerability scanning, signing, provenance, and deployment approval.

Repository map

src/retail_mcp/       MCP server and enterprise application layers
tests/                Unit, authorization, resilience, and API tests
migrations/           PostgreSQL schema and seed data
monitoring/           Prometheus alerts and provisioned Grafana dashboard
deploy/               TLS gateway and Kubernetes deployment/HPA
docs/                 Architecture, business, security, operations, and DR
.github/workflows/    CI pipeline

Important limitations

  • The API-key manager is intentionally replaceable; use the corporate IdP for user-delegated production access.

  • The sample is single-tenant. Tenant identity must be enforced in principals, queries, row policies, and cache keys before multi-tenant use.

  • The PostgreSQL projection represents integration with systems of record; real CRM/ERP adapters and synchronization are organization-specific.

  • Performance and ROI figures are hypotheses until validated with production-like load tests and business measurements.

Available Tools

3 tools
create_support_ticketB

Create a customer support ticket. Requires ticket:write.

ParametersJSON Schema
NameRequiredDescriptionDefault
subjectYes
priorityNonormal
customer_idYes
descriptionYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

B3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden for behavioral disclosure. It only notes the auth requirement ('requires ticket:write') but does not mention side effects, rate limits, or other behavioral traits beyond the obvious creation action.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise, consisting of a single sentence. While it is not verbose, it is barely adequate and could benefit from additional context without becoming unwieldy. It is front-loaded with the core action but lacks structure.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (4 parameters, no nested objects, presence of output schema) and the absence of annotations, the description is incomplete. It fails to explain the result of creating a ticket, how parameters interact, or any required order of operations, leaving an agent with insufficient context to use the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, meaning the description offers no explanation of the parameters. The input schema provides names and types but lacks descriptions, and the tool description adds no additional semantic meaning to help an agent correctly populate the subject, priority, customer_id, or description fields.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states 'Create a customer support ticket,' which is a specific verb+resource. It clearly distinguishes the tool from siblings like process_order and update_inventory, which serve different purposes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description mentions the required permission 'ticket:write,' providing context for when to use this tool. However, it lacks explicit guidance on when not to use it or alternatives, missing an opportunity to clarify when other tools might be more appropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

process_orderB

Create an order atomically and decrement inventory. Requires order:write.

ParametersJSON Schema
NameRequiredDescriptionDefault
skuYes
quantityYes
customer_idYes
idempotency_keyYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

B3.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden. It discloses the atomic write operation, inventory decrement side effect, and required permission (order:write). It does not detail failure behavior or idempotency, but for a mutation tool, this is substantive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence plus a permission note, with no extraneous words. It is front-loaded with the main purpose and concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is non-trivial with four required parameters, atomic inventory decrement, and an output schema (not shown). The description omits details on idempotency key usage, return value, and exact inventory behavior. More context is needed for a complete understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0% and the description does not mention any of the four required parameters (customer_id, sku, quantity, idempotency_key). The description fails to add any meaning beyond the schema, which is insufficient for a tool with no parameter descriptions in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the tool creates an order atomically and decrements inventory, with a specific verb and resource. It distinguishes itself from siblings like create_support_ticket (different resource) and update_inventory (different action).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description mentions a required permission (order:write) but provides no guidance on when to use this tool versus alternatives, such as when to use update_inventory separately or create_support_ticket. There is no context about exclusions or prerequisites beyond the permission.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

update_inventoryA

Adjust inventory with validation and audit logging. Requires inventory:write.

ParametersJSON Schema
NameRequiredDescriptionDefault
skuYes
reasonYes
quantity_deltaYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description adds 'validation and audit logging' as behavioral traits. However, it does not specify what validation occurs, the nature of audit logging, or whether the operation is destructive or reversible. More detail is needed for a tool without annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two short sentences, front-loaded with the core action. Every phrase adds value: the action, key features (validation, audit logging), and permission requirement. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Although an output schema exists (not shown), the description does not explain the return value or what the agent can expect. It lacks detail on how 'adjust' works (e.g., whether quantity_delta is additive or absolute), the role of 'reason', and potential side effects. Given the critical nature of inventory operations, this is insufficient.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It fails to explain any of the three parameters (sku, quantity_delta, reason). It does not clarify that quantity_delta is a positive/negative integer or that reason is a required free-text field, leaving the agent to infer from names alone.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states 'Adjust inventory' with specific verb and resource, and adds validation, audit logging, and permission requirements. It clearly distinguishes from sibling tools like create_support_ticket and process_order.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description mentions the required permission 'inventory:write', providing a precondition. It implies usage for inventory adjustments, but lacks explicit when-to-use or when-not-to-use guidance or alternatives beyond the permission context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 3 tool updatesv1.0.0
    • First observedcreate_support_ticket
    • First observedprocess_order
    • First observedupdate_inventory

TDQS

B3.4/5.0

Scored across 3 tools

Disambiguation5/5

Each tool targets a distinct domain action: support ticket creation, order processing, and inventory updating. No two tools overlap in purpose, ensuring clear differentiation for an agent.

Naming Consistency5/5

All tools follow a consistent verb_noun pattern (create_support_ticket, process_order, update_inventory), making the naming predictable and easy to navigate.

Tool Count3/5

With only 3 tools, the server feels sparse for a retail domain, which typically involves many more operations (e.g., product listings, customer management). However, the tools are focused and non-redundant.

Completeness3/5

The tools cover core retail actions (support, order processing, inventory) but miss obvious CRUD operations like reading or searching orders/inventory, creating products, or listing customers, leaving notable gaps.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    B
    quality
    D
    maintenance
    Implements the Model Context Protocol (MCP) to provide AI models with a standardized interface for connecting to external data sources and tools like file systems, databases, or APIs.
    1
    153
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    A Model Context Protocol server that provides AI models with structured access to external data and services, acting as a bridge between AI assistants and applications, databases, and APIs in a standardized, secure way.
    2
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    Allows Large Language Models to interact with Kroger's grocery services, enabling product search, store lookup, and cart management through the Model Context Protocol.
    3
    MIT