Lab 2 Session Summary — Customer Support Agentic App with MCP (Python)

Session Context

What We Added in Lab 2

1) Separate local MCP server (SupportOps)

We added a new standalone MCP project:
- support-ops-mcp-python/main.py
- Streamable HTTP endpoint: http://127.0.0.1:5058/mcp
- Stateless HTTP transport for simple request/response workshop flow.

2) MCP tools (minimum requirements met)

Implemented two required tool categories:
- Data-access tool: lookup_customer(customer_email)
- Reads customer/account context from mock-data-lab2/mock_customers.json.
- Business-action tool: create_support_action(customer_email, action_type, reason, details)
- Records real support actions into support-ops-mcp-python/data/support_actions.json.

3) Host integration (Lab 1 app extended)

In support-agent-python host app:
- Added MCP client in app/mcp_client.py using streamable HTTP client/session.
- Updated app/processor.py to:
- detect customer email from input
- call MCP lookup before policy decision
- include account context in reasoning + policy prompt
- call MCP action tool for real outcomes (refund/escalation/general)

Architecture (Simple)

Files Added / Updated

New

Updated

Real Validation Results

MCP server/tool validation

End-to-end host scenarios

Scenario A — Refund flow with lookup + approval

Input used sam.r@example.com and duplicate-charge complaint.

Observed:
- Host reasoning included MCP lookup result (customer found + plan/status).
- Clarification asked once.
- Human approval requested.
- Action recorded via MCP as refund_request.
- Final action shown by host: RefundTicketCreated.

Scenario B — Escalation flow with lookup + action recording

Input used tomas.l@example.com and explicit manager/escalation demand.

Observed:
- Host reasoning included MCP lookup result.
- Escalation path selected.
- Action recorded via MCP as escalation.
- Final action shown by host: EscalatedToHuman.

Persistence proof

support-ops-mcp-python/data/support_actions.json contains recorded actions from:
- tool smoke test
- refund scenario
- escalation scenario

Real Session Evidence (from @Local (2) and @Local (3))

Example 1 — Full refund flow with MCP data + action

From your real terminal run:
- Input was from sam.r@example.com with double-charge refund request.
- App asked one clarification question.
- You provided dates (April 3 and April 4) and approved action.

Observed in reasoning/output:
- MCP lookup: found customer Sam (plan=Basic, status=active)
- MCP action: recorded refund_request as act-1776243341825
- Final action: RefundTicketCreated

Example 2 — JSON persistence confirms real business action

From your cat support_actions.json output:
- A new record exists with:
- action_id: act-1776243341825
- customer_email: sam.r@example.com
- action_type: refund_request
- policy-linked details (intent, policy_action, escalate, etc.)

Why this matters:
- This proves Lab 2 is no longer text-only: the host triggered a real MCP tool call and persisted a concrete support action.

How To Run (Lab 2)

Terminal 1 — start MCP server

cd /Users/llatin/Geek-Academy-Spec-Driven-workshop/support-ops-mcp-python
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python main.py

Terminal 2 — run host app

cd /Users/llatin/Geek-Academy-Spec-Driven-workshop/support-agent-python
source .venv/bin/activate
python main.py

Optional MCP Inspector Check

npx -y @modelcontextprotocol/inspector

Then connect to:
- http://127.0.0.1:5058/mcp

Outcome vs Lab 2 Expectations

Next Step