AI Chat, MCP Server build with Agentic Workflow Protocol for demo at Checkatrade .com
The MCP-in-Chat project represents a complete, production-ready demonstration of how Model Context Protocol (MCP) servers can transform e-commerce chatbot interactions. This comprehensive example showcases a boiler maintenance and sales system that connects external AI chatbots (Claude, ChatGPT, Cursor) to real business logic through a secure, scalable architecture. Built using the Agentic Workflow Protocol (AWP) methodology, this project demonstrates how to create sophisticated MCP servers that bridge the gap between conversational AI and enterprise systems.
The Agentic Workflow Protocol (AWP) is an agentic development methodology created by Michael Wybraniec and maintained by the overvibing.com community. This systematic approach ensures consistent, high-quality development outcomes by providing structured workflows that prevent context drift callet overvibing and enable rapid, reliable project delivery while scaling development with AI.
Demo Video
Implementation Results
- Timeline: 4 hours (including unplanned tasks)
- Scope: 100% of planned features implemented
- Quality: 100% test success rate
- Documentation: Complete and comprehensive
- Ready for Demo: Fully functional and tested
Development Phases
- Project Setup & Security Architecture (45 minutes)
- Initialize Node.js project with TypeScript
- Set up layered architecture (MCP → API → Services → Database)
- Create mock JSON data files with access controls
- Define TypeScript interfaces and security types
- Core MCP Tools Development (90 minutes)
- Implement boiler information tool with API validation
- Implement maintenance scheduling tool with access controls
- Implement inventory tool with rate limiting
- Implement purchase tool with transaction validation
- Implement email tool with content filtering
- Testing & Demo Preparation (45 minutes)
- Test MCP Server with local tools
- Create demo instructions for chatbot integration
- Prepare sample conversation flows
- Create README with setup and usage instructions
- External Chatbot Integration (60 minutes)
- Test MCP Server with Claude (if available)
- Test MCP Server with ChatGPT (if available)
- Document integration process and results
- Create demo presentation materials
Project Overview
Boiler Maintenance MCP Server
The MCP-in-Chat project is a successfully completed demonstration that showcases how MCP servers can integrate with external chatbots to provide real business value. The system handles boiler maintenance services, customer information, inventory management, and purchase processing through a conversational interface.
Key Features
- 4 MCP Tools: Boiler information, maintenance scheduling, purchase processing, and email confirmation
- 4 API Endpoints: RESTful backend with authentication and validation
- 8 Mock Services: Complete business logic simulation with realistic data
- External Integration: Ready for Claude, ChatGPT, and Cursor IDE testing
- 100% Test Coverage: Comprehensive test suite with 100% success rate
- Production-Ready: Security middleware, rate limiting, and error handling
Architecture Overview
---
header: MCP-in-Chat System Architecture
legend:
- color: "#3B82F6"
text: "External Systems"
- color: "#8B5CF6"
text: "MCP Protocol Layer"
- color: "#10B981"
text: "API & Security Layer"
- color: "#F59E0B"
text: "Business Services"
- color: "#EF4444"
text: "Data Layer"
---
graph TD
subgraph "External Chatbots"
A[Claude AI]
B[ChatGPT]
C[Cursor IDE]
end
subgraph "MCP Server Layer"
D[MCP Server]
E[Boiler Info Tool]
F[Maintenance Tool]
G[Purchase Tool]
H[Email Tool]
end
subgraph "Backend API Layer"
I[Express API Server]
J[Authentication]
K[Validation]
L[Rate Limiting]
end
subgraph "Business Services"
M[Customer Service]
N[Boiler Service]
O[Payment Service]
P[Email Service]
end
subgraph "Mock Data Layer"
Q[Customers JSON]
R[Boilers JSON]
S[Inventory JSON]
T[Orders JSON]
end
A --> D
B --> D
C --> D
D --> E
D --> F
D --> G
D --> H
E --> I
F --> I
G --> I
H --> I
I --> J
J --> K
K --> L
L --> M
L --> N
L --> O
L --> P
M --> Q
N --> R
O --> S
P --> T
classDef external fill:#3B82F6,stroke:#1E40AF,stroke-width:2px,color:#fff
classDef mcp fill:#8B5CF6,stroke:#7C3AED,stroke-width:2px,color:#fff
classDef api fill:#10B981,stroke:#059669,stroke-width:2px,color:#fff
classDef service fill:#F59E0B,stroke:#D97706,stroke-width:2px,color:#fff
classDef data fill:#EF4444,stroke:#DC2626,stroke-width:2px,color:#fff
class A,B,C external
class D,E,F,G,H mcp
class I,J,K,L api
class M,N,O,P service
class Q,R,S,T data
The MCP server exposes four specialized tools that enable chatbots to interact with the boiler maintenance system. Each tool is designed with specific business logic and security controls.
Boiler Information Tool
// MCP Tool: Get customer boiler details and warranty information
const boilerInfoTool = {
name: "boiler-info",
description: "Get customer boiler information and warranty details",
inputSchema: {
type: "object",
properties: {
customer_id: { type: "string" }
},
required: ["customer_id"]
}
}
Use Case: When a customer asks "What's the warranty status of my boiler?", the chatbot can retrieve detailed information about their specific boiler model, installation date, warranty coverage, and maintenance history.
Maintenance Scheduling Tool
// MCP Tool: Schedule maintenance services with weather consideration
const maintenanceTool = {
name: "maintenance",
description: "Schedule maintenance services",
inputSchema: {
type: "object",
properties: {
customer_id: { type: "string" },
service_type: { type: "string", enum: ["routine", "emergency"] },
preferred_date: { type: "string" }
},
required: ["customer_id", "service_type"]
}
}
Use Case: Customers can request maintenance scheduling, and the system automatically considers weather conditions, technician availability, and customer preferences to book optimal appointments.
Purchase Processing Tool
// MCP Tool: Process boiler purchase orders
const purchaseTool = {
name: "purchase",
description: "Process boiler purchase orders",
inputSchema: {
type: "object",
properties: {
customer_id: { type: "string" },
boiler_model: { type: "string" },
installation_date: { type: "string" }
},
required: ["customer_id", "boiler_model"]
}
}
Use Case: When customers want to upgrade their boiler, the chatbot can show available models, compare specifications, process payments, and schedule installation.
Email Confirmation Tool
// MCP Tool: Send confirmation emails
const emailTool = {
name: "email",
description: "Send confirmation emails",
inputSchema: {
type: "object",
properties: {
customer_id: { type: "string" },
email_type: { type: "string", enum: ["maintenance", "purchase", "reminder"] }
},
required: ["customer_id", "email_type"]
}
}
Use Case: After any service booking or purchase, the system automatically sends appropriate confirmation emails with relevant details and next steps.
The MCP-in-Chat project includes comprehensive demo scenarios that showcase real-world usage patterns and demonstrate the system's capabilities.
Scenario 1: Boiler Information Query
Customer: "What's the warranty status of my boiler?"
Chatbot Response:
I'll check your boiler information right away.
Based on your records, you have a Worcester Bosch 8000 Style installed on March 15, 2023.
Your warranty is valid until March 15, 2028 (5-year manufacturer warranty).
Key details:
- Model: Worcester Bosch 8000 Style 30kW
- Installation Date: March 15, 2023
- Warranty Status: Active (3 years remaining)
- Last Service: January 12, 2024
- Next Service Due: January 12, 2025
Would you like me to schedule your annual service or check if there are any warranty claims?
Scenario 2: Maintenance Scheduling
Customer: "I need to schedule maintenance for my boiler"
Chatbot Response:
I'll help you schedule maintenance for your boiler. Let me check your current schedule and available slots.
Based on your location and preferences, I found these available appointments:
Next Week:
- Tuesday, January 21: 9:00 AM - 11:00 AM
- Thursday, January 23: 2:00 PM - 4:00 PM
Weather forecast shows clear conditions for both days. Your preferred technician, John Smith (Gas Safe registered), is available on Tuesday.
I recommend Tuesday at 9:00 AM. The service will include:
- Full system inspection
- Safety checks
- Efficiency testing
- Filter cleaning
Cost: £120 (includes parts and labor)
Shall I book this appointment for you?
Scenario 3: Boiler Upgrade Purchase
Customer: "I want to upgrade my boiler to a more efficient model"
Chatbot Response:
Great choice! Let me show you the most efficient models available and help you upgrade.
Available High-Efficiency Boilers:
1. **Worcester Bosch 8000 Style** (A-Rated)
- Efficiency: 94%
- Price: £2,800
- 10-year warranty
- Smart thermostat included
2. **Vaillant ecoTEC plus** (A-Rated)
- Efficiency: 92%
- Price: £2,600
- 7-year warranty
- Compact design
3. **Ideal Logic+** (A-Rated)
- Efficiency: 90%
- Price: £2,200
- 10-year warranty
- Quiet Mark certified
Based on your current system, I recommend the Worcester Bosch 8000 Style for maximum efficiency and reliability.
Would you like me to:
1. Show detailed specifications
2. Check installation availability
3. Process the purchase
4. Compare with your current boiler
The MCP-in-Chat project implements a sophisticated layered architecture that ensures security, scalability, and maintainability.
Security Architecture
---
header: MCP Security Flow and Authentication
---
sequenceDiagram
participant Chatbot as External Chatbot
participant MCP as MCP Server
participant API as Backend API
participant Auth as Authentication
participant Service as Business Service
participant DB as Mock Database
rect rgb(59, 130, 246)
note right of Chatbot: External Systems
Chatbot->>+MCP: Request with customer_id
end
rect rgb(139, 92, 246)
note right of MCP: MCP Protocol Layer
MCP->>+API: API call with validation
end
rect rgb(16, 185, 129)
note right of API: Security & API Layer
API->>+Auth: Verify authentication
Auth-->>-API: Authentication result
end
rect rgb(245, 158, 11)
note right of Service: Business Logic Layer
API->>+Service: Process business logic
Service->>+DB: Query with access controls
end
rect rgb(239, 68, 68)
note right of DB: Data Storage Layer
DB-->>-Service: Return filtered data
end
rect rgb(245, 158, 11)
note right of Service: Business Logic Layer
Service-->>-API: Processed response
end
rect rgb(16, 185, 129)
note right of API: Security & API Layer
API-->>-MCP: API response
end
rect rgb(139, 92, 246)
note right of MCP: MCP Protocol Layer
MCP-->>-Chatbot: Formatted result
end
Note over Chatbot,DB: Secure communication flow with<br/>authentication at each layer
Mock Services Implementation
The project includes 8 comprehensive mock services that simulate real business operations:
- Customer Service: Manages customer profiles and preferences
- Boiler Service: Handles boiler information and warranty data
- Payment Service: Processes transactions and payment validation
- Email Service: Manages communication and notifications
- Weather Service: Provides weather data for scheduling
- Warranty Service: Handles warranty information and claims
- AI Prediction Service: Simulates maintenance predictions
- Technician Service: Manages technician availability and scheduling
Data Layer Structure
{
"customers": {
"CUST001": {
"name": "John Smith",
"email": "john.smith@email.com",
"address": "123 Main St, London",
"phone": "+44 20 1234 5678",
"preferences": {
"contact_method": "email",
"appointment_time": "morning",
"technician_preference": "John Smith"
}
}
},
"boilers": {
"BOIL001": {
"customer_id": "CUST001",
"model": "Worcester Bosch 8000 Style",
"installation_date": "2023-03-15",
"warranty_expiry": "2028-03-15",
"last_service": "2024-01-12",
"next_service_due": "2025-01-12"
}
}
}
Data Structure Overview: The system uses JSON files to simulate a real database, with structured data for customers, boilers, maintenance schedules, and orders. Each record includes comprehensive information needed for the chatbot interactions.
The MCP-in-Chat project includes a comprehensive testing suite that ensures reliability and functionality across all components.
Test Coverage
- MCP Tools: All 4 tools tested with various input scenarios
- API Endpoints: Complete REST API testing with authentication
- Error Handling: Validation of error responses and edge cases
- Integration: End-to-end workflow testing
- Performance: Response time and load testing
Test Results Summary
📊 TEST SUMMARY
============================================================
Total Tests: 5
Passed: 5 ✅
Failed: 0 ❌
Success Rate: 100.0%
📋 DETAILED RESULTS
------------------------------------------------------------
1. boiler-info: ✅ PASS
2. maintenance-get: ✅ PASS
3. maintenance-schedule: ✅ PASS
4. purchase: ✅ PASS
5. email: ✅ PASS
🎉 All tests passed! MCP tools are working correctly.
Quick Test Commands
# Run all MCP tool tests
npm test
# Test specific components
npm run test:api # Backend API tests
npm run test:mcp # Cursor MCP integration
npm run test:protocol # MCP protocol validation
npm run test:compiled # Compiled version test
npm run test:connection # Connection test
npm run test:quick # Quick health check
The MCP-in-Chat project is designed to be easily accessible for developers who want to understand and implement MCP servers for their own use cases.
Prerequisites
- Node.js 18+ and npm
- TypeScript knowledge
- Basic understanding of MCP protocol
- Access to external chatbots (Claude, ChatGPT, Cursor)
Installation
# Clone the repository
git clone https://github.com/michaelwybraniec/mcp-in-chat.git
cd mcp-in-chat
# Install dependencies
npm install
# Build the project
npm run build
# Start the API server
npm run start:api
# Start the MCP server (in another terminal)
npm run start:mcp
Integration with External Chatbots
The MCP server is designed to work with any MCP-compatible chatbot:
- Claude Desktop: Add the MCP server to Claude's configuration
- ChatGPT: Use the MCP server as a custom tool
- Cursor IDE: Integrate directly with the development environment
Customization
The project is designed to be easily customizable for different business domains:
- Replace Mock Services: Connect to real APIs and databases
- Add New Tools: Extend the MCP server with additional functionality
- Modify Business Logic: Adapt the services for your specific use case
- Enhance Security: Add additional authentication and authorization layers
The MCP-in-Chat project provides valuable insights into building production-ready MCP servers and integrating them with external chatbots.
Key Success Factors
- Layered Architecture: Clear separation between MCP tools, API layer, and business logic
- Comprehensive Testing: 100% test coverage ensures reliability
- Security First: Authentication, validation, and rate limiting from the start
- Documentation: Complete documentation for easy onboarding
- Mock Services: Realistic data simulation for development and testing
Common Challenges and Solutions
- External Integration Complexity
- Challenge: Testing with external chatbots can be difficult
- Solution: Comprehensive local testing suite with realistic scenarios
- Security Implementation
- Challenge: Ensuring secure communication between components
- Solution: Layered security with authentication at each level
- Data Management
- Challenge: Maintaining consistent state across services
- Solution: Centralized data layer with access controls
- Error Handling
- Challenge: Graceful error handling in conversational interfaces
- Solution: Structured error responses with actionable guidance
Performance Considerations
- Response Time: MCP tools should respond within 2-3 seconds
- Rate Limiting: Implement appropriate rate limits to prevent abuse
- Caching: Cache frequently accessed data to improve performance
- Monitoring: Implement comprehensive logging and monitoring
The MCP-in-Chat project serves as a foundation for more sophisticated MCP server implementations and provides a roadmap for future development.
Possibilities
- Real Service Integration
- Replace mock services with real APIs
- Integrate with payment gateways
- Connect to customer databases
- Implement real email services
- Advanced Features
- Multi-language support
- Voice integration
- Mobile app integration
- Advanced analytics and reporting
- Scalability Improvements
- Microservices architecture
- Load balancing
- Database optimization
- Caching strategies
- Security Enhancements
- OAuth 2.0 integration
- Role-based access control
- Audit logging
- Compliance features
Industry Applications
The MCP-in-Chat architecture can be adapted for various industries:
- Healthcare: Patient appointment scheduling and medical record access
- Finance: Account management and transaction processing
- Education: Course registration and student services
- Real Estate: Property search and booking management
- Travel: Flight booking and itinerary management
The MCP-in-Chat project demonstrates the power and potential of Model Context Protocol servers in creating sophisticated, conversational AI systems. By providing a complete, production-ready example, it serves as both a learning resource and a foundation for real-world implementations.
Key Takeaways
- MCP Servers Enable Real Business Value: The project shows how MCP servers can bridge the gap between conversational AI and enterprise systems
- Systematic Development Works: The AWP methodology ensured consistent, high-quality development
- Security is Paramount: Layered security architecture is essential for production systems
- Testing is Critical: Comprehensive testing ensures reliability and functionality
- Documentation Matters: Complete documentation enables easy adoption and customization
Next Steps
The MCP-in-Chat project represents a significant step forward in making MCP servers accessible and practical for real-world applications. By providing a complete, working example, it lowers the barrier to entry for developers who want to integrate conversational AI with their business systems.
Resources:
From Idea to API in 2 Days: Building Bankly with Agentic Workflows
Discover how Bankly, a banking backend system, was built in just two days using Apollo GraphQL, Prisma, and Agentic Workflow - a protocol for sustainable AI-assisted development.
Domain-Driven Design in Full-Stack Frameworks
Explore the intersection of modern software architecture with Domain-Driven Design (DDD) and powerful front-end frameworks like Vue, Nuxt, and React, supported by cloud-based backends or Node.js.
From Idea to API in 2 Days: Building Bankly with Agentic Workflows
Discover how Bankly, a banking backend system, was built in just two days using Apollo GraphQL, Prisma, and Agentic Workflow - a protocol for sustainable AI-assisted development.
Domain-Driven Design in Full-Stack Frameworks
Explore the intersection of modern software architecture with Domain-Driven Design (DDD) and powerful front-end frameworks like Vue, Nuxt, and React, supported by cloud-based backends or Node.js.