Caramelo MCP Server
Caramelo
Multi-channel chatbot for DulceGestion - a pastry shop management SaaS.
What it does
Answers user questions about how to use the app (RAG-powered from documentation)
Queries live business data (orders, stock, customers) via tool calling
Works on Telegram, Web Widget (embeddable), and WhatsApp (Twilio)
Exposes an MCP server for use with Claude Desktop/Code
Architecture
Channels (in/out) Brain Data
+----------------+ +----------------+ +------------------+
| Telegram |--->| |--->| RAG (docs) |
| Web Widget |--->| Bot Engine |--->| MCP Tools |
| WhatsApp |--->| |--->| Claude LLM |
+----------------+ +----------------+ +------------------+Adapter pattern - each layer has swappable implementations:
Channels: Telegram (telegraf), WebSocket (widget), WhatsApp (Twilio)
LLM: Claude (Anthropic API) or hardcoded (keyword matching for testing)
Tools: MCP registry with DulceGestion API client
Tech Stack
TypeScript, Express, telegraf, ws, @anthropic-ai/sdk, @modelcontextprotocol/sdk, Voyage AI (embeddings), vitest
Quick Start
# Install
npm install
# Configure
cp .env.example .env
# Edit .env with your keys
# Index documentation for RAG
npm run index-docs
# Run
npm run devEnvironment Variables
Variable | Description |
| Bot token from @BotFather |
| Claude API key |
| Voyage AI key (for embeddings) |
| DulceGestion API endpoint |
|
|
| HTTP server port (default: 3002) |
| Chat session timeout |
| CORS origin for widget |
Scripts
Script | Description |
| Start with hot reload |
| Start in production |
| Run tests |
| Generate RAG embeddings from docs/flows/ |
| Start MCP stdio server (for Claude Desktop/Code) |
MCP Server
Use with Claude Desktop or Claude Code:
{
"mcpServers": {
"dulcegestion": {
"command": "npx",
"args": ["tsx", "src/mcp/server.ts"],
"cwd": "/path/to/dulcechat",
"env": {
"DULCEGESTION_API_URL": "http://localhost:3001/api",
"DULCEGESTION_AUTH_TOKEN": "your-jwt-token"
}
}
}
}Embeddable Widget
Add to any page:
<script src="https://your-server/dulcechat/widget.js" data-token="USER_JWT"></script>Project Structure
src/
channels/ # Messaging adapters (Telegram, Web, WhatsApp)
llm/ # LLM adapters (Claude, hardcoded)
mcp/ # MCP tools and server
tools/ # Individual tool implementations
rag/ # RAG system (chunker, embeddings, retriever)
session/ # In-memory session store with TTL
engine.ts # Core orchestrator
index.ts # Entry point
docs/flows/ # User documentation for RAG indexing
widget/ # Embeddable chat widget (HTML + JS)Adding New Tools
Create
src/mcp/tools/your-tool.tsimplementingMcpToolRegister it in
src/index.tsAutomatically available in Caramelo, Claude Desktop, and Claude Code