Asistente Comercial MCP
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Asistente Comercial MCPShow me the top 5 best selling products"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
๐ Asistente Comercial MCP
Sistema de agente de IA para anรกlisis comercial de un e-commerce de productos alimenticios.
๐ รndice
Related MCP server: Shop Analytics MCP Server
๐ Problema que Resuelve
El asistente ayuda a equipos comerciales y de atenciรณn al cliente a obtener informaciรณn rรกpida y verificable sobre:
Clientes: Bรบsqueda, perfil de consumo, identificaciรณn de alto valor
Productos: Productos mรกs vendidos, anรกlisis por categorรญa
Ventas: Anรกlisis por regiรณn, mรฉtodos de pago
Anรกlisis: Clasificaciรณn de clientes (VIP, Premium, Regular)
Usuario principal: Equipo comercial y de atenciรณn al cliente de un e-commerce.
Necesidad: Obtener informaciรณn rรกpida y verificable sobre clientes, ventas, productos y regiones sin necesidad de consultar directamente bases de datos.
Lo que cubre:
โ Bรบsqueda de clientes por nombre, apellido o regiรณn
โ Perfil de consumo de clientes
โ Productos mรกs vendidos
โ Anรกlisis de ventas por categorรญa y regiรณn
โ Preferencias de mรฉtodos de pago
โ Clasificaciรณn de clientes (VIP, Premium, Regular)
Lo que NO cubre:
โ Modificaciรณn de datos (solo lectura)
โ Procesamiento de pagos
โ Gestiรณn de inventario en tiempo real
๐๏ธ Arquitectura del Sistema
Diagrama de Componentes
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ USUARIO โ
โโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ INTERFAZ WEB (Streamlit) โ
โ app_streamlit.py โ
โ โข Chat interactivo โ
โ โข Visualizaciรณn de evidencia โ
โ โข Gestiรณn de session_id โ
โโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ AGENTE LANGCHAIN + GROQ โ
โ agent_core.py โ
โ โข Interpretaciรณn de intenciรณn โ
โ โข Selecciรณn de herramientas โ
โ โข Memoria de corto plazo (InMemorySaver) โ
โโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ CLIENTE MCP (langchain-mcp-adapters) โ
โ โข Descubrimiento de herramientas โ
โ โข Invocaciรณn de tools โ
โโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ SERVIDOR MCP (FastMCP) โ
โ mcp_server.py โ
โ โข Exposiciรณn de 8 herramientas personalizadas โ
โ โข Validaciรณn de entradas โ
โ โข Respuestas estructuradas โ
โโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ BASE DE DATOS (SQLite) โ
โ data/mcp_laboratorio.db โ
โ โข clientes โข ventas โข productos โ
โ โข categorias โข metodos_pago โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโArquitectura
graph TD
A[Usuario] --> B[Streamlit UI]
B --> C[Agente LangChain + Groq]
C --> D{ยฟNecesita tool?}
D -->|Sรญ| E[Cliente MCP]
D -->|No| F[Respuesta directa]
E --> G[Servidor MCP FastMCP]
G --> H[SQLite Database]
H --> I[Resultado estructurado]
I --> C
F --> J[Respuesta final]
C --> J
J --> B
B --> A
style A fill:#B30909,stroke:#fff,stroke-width:2px
style B fill:#00f,stroke:#fff,stroke-width:2px
style C fill:#056c5c,stroke:#fff,stroke-width:2px
style G fill:#f2f,stroke:#fff,stroke-width:2px
style H fill:#1D7799,stroke:#fff,stroke-width:2pxFlujo de Ejecuciรณn
Usuario escribe una pregunta en Streamlit
Streamlit envรญa la pregunta al agente con session_id
Agente LangChain + Groq interpreta la intenciรณn
Decisiรณn:
Si necesita datos โ Invoca tool MCP
Si no โ Responde directamente
MCP Server ejecuta la tool contra SQLite
Resultado vuelve al agente
Agente sintetiza respuesta con evidencia
Streamlit muestra respuesta, tools usadas y traza
Memoria guarda contexto para siguiente interacciรณn
Componentes y Responsabilidades
Capa | Tecnologรญa | Archivo | Responsabilidad |
Interfaz | Streamlit | app_streamlit.py | Recibir preguntas, mostrar respuesta y evidencia |
Orquestaciรณn | LangChain + Groq | agent_core.py | Interpretar intenciรณn, elegir tools, gestionar memoria |
MCP | FastMCP | mcp_server.py | Exponer tools personalizadas con contratos claros |
Datos | SQLite | data/ | Entregar informaciรณn y ejecutar operaciones controladas |
Memoria | InMemorySaver | agent_core.py | Mantener contexto de la conversaciรณn por session_id |
๐ ๏ธ Tecnologรญas Utilizadas
Tecnologรญa | Versiรณn | Propรณsito |
Python | 3.12.9+ | Lenguaje base |
Streamlit | 1.28+ | Interfaz web |
LangChain | 0.3+ | Orquestaciรณn del agente |
Groq | - | Modelo de lenguaje (llama-3.3-70b-versatile) |
FastMCP | 0.3+ | Servidor MCP |
SQLite | 3.x | Base de datos local |
Pandas | 2.0+ | Procesamiento de datos |
Pytest | 8.0+ | Pruebas unitarias |
Pytest-Asyncio | 0.23+ | Pruebas asรญncronas |
๐ง Herramientas MCP
Tool | Propรณsito | Entrada | Salida | Riesgo |
| Buscar clientes | texto_busqueda, limite | Lista de clientes | Bajo |
| Perfil de consumo | cliente_id | Mรฉtricas de consumo | Bajo |
| Clientes con alto gasto | gasto_minimo, limite | Top clientes | Bajo |
| Productos mรกs vendidos | limite, ordenar_por | Ranking de productos | Bajo |
| Ventas por categorรญa | categoria (opcional) | Mรฉtricas por categorรญa | Bajo |
| Ventas por regiรณn | region (opcional) | Mรฉtricas por regiรณn | Bajo |
| Preferencias de pago | region (opcional) | Mรฉtricas de pago | Bajo |
| Clasificar cliente | gasto_total, total_ordenes | Nivel y recomendaciรณn | Bajo |
๐ง Memoria
Tipo: Corto plazo (InMemorySaver)
Session ID: Identificador รบnico por conversaciรณn
Ventana: รltimos 6-10 mensajes
Limitaciรณn: La memoria se pierde al reiniciar el servidor
๐ Secretos y Configuraciรณn
Variables de Entorno Requeridas
Variable | Descripciรณn | Dรณnde obtenerla |
| API Key de Groq | |
| Modelo a usar |
|
| URL del MCP Server | Local: |
Configuraciรณn Local (.env)
Copia el archivo de ejemplo:
cp .env.example .envEdita
.envcon tus valores:
GROQ_API_KEY=gsk_tu_api_key_aqui
GROQ_MODEL=llama-3.3-70b-versatile
MCP_SERVER_URL=http://127.0.0.1:8000/mcpConfiguraciรณn para Streamlit Cloud (Secrets)
En la interfaz de Streamlit Cloud, agrega estos secretos:
GROQ_API_KEY = "gsk_tu_api_key_aqui"
GROQ_MODEL = "llama-3.1-8b-instant"
MCP_SERVER_URL = "https://tu-mcp-server.onrender.com/mcp"๐ Instalaciรณn Local
Clonar el repositorio
git clone https://github.com/systemyuri/agente-mcp-groq.git
cd agente-mcp-groqCrear y activar entorno virtual
python -m venv .venv
#source .venv/bin/activate # Linux/Mac
.venv\Scripts\activate # WindowsInstalar dependencias
pip install -r requirements.txtConfigurar variables de entorno
cp .env.example .env
# Edita .env con tu GROQ_API_KEYPreparar datos
# Coloca tus archivos CSV en la carpeta data/
python load_data.pyEjecutar el MCP Server (Terminal 1)
python mcp_server.pySalida esperada:
๐ Iniciando MCP Server...
Base de datos: data/mcp_laboratorio.db
โ
Con validaciรณn de tipos para parรกmetros
๐ Tools disponibles:
- buscar_clientes
- perfil_consumo_cliente
- clientes_alto_valor
- top_productos_vendidos
- analisis_categoria
- ventas_por_region
- preferencia_metodo_pago
- calcular_nivel_cliente
๐ Servidor HTTP escuchando en http://127.0.0.1:8000
Endpoint MCP: http://127.0.0.1:8000/mcpEjecutar Streamlit (Terminal 2)
streamlit run app_streamlit.py๐งช Pruebas
El proyecto incluye pruebas unitarias para todas las herramientas MCP y el agente completo.
๐ Cobertura de Pruebas
Componente | Pruebas | Estado |
Tools MCP | 9 pruebas | โ Todas pasan |
Agente LangChain | 5 pruebas | โ Todas pasan |
Conexiรณn MCP | 1 prueba | โ Todas pasan |
Total | 15 pruebas | โ 100% pasan |
๐ง Pruebas de Herramientas MCP
Prueba | Descripciรณn | Estado |
| Bรบsqueda por regiรณn, nombre y validaciรณn de tipos | โ |
| Perfil de cliente existente e inexistente | โ |
| Filtrado por gasto mรญnimo y lรญmite | โ |
| Orden por cantidad e ingresos | โ |
| Todas las categorรญas y especรญfica | โ |
| Todas las regiones y especรญfica | โ |
| Todos los mรฉtodos y por regiรณn | โ |
| Clasificaciรณn VIP, Premium, Regular | โ |
| Conexiรณn al MCP Server | โ |
๐ง Pruebas del Agente
Prueba | Descripciรณn | Estado |
| Verifica que el prompt estรก definido | โ |
| Creaciรณn del agente LangChain | โ |
| Consulta simple sin tools | โ |
| Consulta que usa herramientas MCP | โ |
| Memoria entre turnos de conversaciรณn | โ |
| Manejo de errores y casos extremos | โ |
๐ Ejecutar Pruebas
1. Instalar dependencias de pruebas
pip install pytest pytest-cov pytest-asyncio2. Asegurar que el MCP Server estรก corriendo
# En una terminal separada
python mcp_server.py3. Ejecutar todas las pruebas
python -m pytest tests/ -v --asyncio-mode=auto4. Ejecutar pruebas con cobertura
python -m pytest tests/ -v --cov=. --cov-report=html --asyncio-mode=auto
# Abrir htmlcov/index.html en el navegador5. Ejecutar pruebas especรญficas
# Solo herramientas MCP
python -m pytest tests/test_tools.py -v
# Solo agente
python -m pytest tests/test_agent.py -v --asyncio-mode=auto
# Solo conexiรณn
python -m pytest tests/test_connection.py -v --asyncio-mode=auto๐ Resultado Esperado
============================================= test session starts =============================================
collected 15 items
tests/test_agent.py::test_system_prompt PASSED [ 6%]
tests/test_agent.py::test_agent_creation PASSED [ 13%]
tests/test_agent.py::test_simple_query PASSED [ 20%]
tests/test_agent.py::test_tool_query PASSED [ 26%]
tests/test_agent.py::test_memory PASSED [ 33%]
tests/test_agent.py::test_error_handling PASSED [ 40%]
tests/test_connection.py::test_mcp PASSED [ 46%]
tests/test_tools.py::test_buscar_clientes PASSED [ 53%]
tests/test_tools.py::test_perfil_consumo_cliente PASSED [ 60%]
tests/test_tools.py::test_clientes_alto_valor PASSED [ 66%]
tests/test_tools.py::test_top_productos_vendidos PASSED [ 73%]
tests/test_tools.py::test_analisis_categoria PASSED [ 80%]
tests/test_tools.py::test_ventas_por_region PASSED [ 86%]
tests/test_tools.py::test_preferencia_metodo_pago PASSED [ 93%]
tests/test_tools.py::test_calcular_nivel_cliente PASSED [100%]
=========================================== 15 passed in 3.42s ===========================================๐ Soluciรณn de Problemas en Pruebas
Error | Soluciรณn |
| Activar entorno virtual: |
| Instalar: |
| Ejecutar |
| Verificar URL en |
๐ Despliegue
En Streamlit Community Cloud
Sube el cรณdigo a GitHub
git add .
git commit -m "feat: Asistente Comercial MCP con Groq"
git push origin mainVe a share.streamlit.io
Conecta tu repositorio
Selecciona GitHub
Elige el repositorio y rama
mainArchivo principal:
app_streamlit.py
Configura los Secretos
En la secciรณn "Secrets", agrega:GROQ_API_KEY = "gsk_tu_api_key_aqui" GROQ_MODEL = "llama-3.1-8b-instant" MCP_SERVER_URL = "https://tu-mcp-server.onrender.com/mcp"Despliega
Haz clic en "Deploy"
Espera ~5 minutos
ยกObtendrรกs tu URL pรบblica!
MCP Server Remoto
Opciรณn 1: Render.com (Recomendado)
Crea render.yaml:
services:
- type: web
name: mcp-server
env: python
buildCommand: pip install -r requirements.txt
startCommand: python mcp_server.py
envVars:
- key: GROQ_API_KEY
sync: falseOpciรณn 2: ngrok (Para pruebas rรกpidas)
# Terminal 1
python mcp_server.py
# Terminal 2 (nueva terminal)
ngrok http 8000
# Copia la URL https://xxxx.ngrok.io
# Actualiza MCP_SERVER_URL con esta URL + /mcp๐ Estructura del Proyecto
agente_mcp_groq/
โโโ app_streamlit.py # Interfaz web
โโโ agent_core.py # Lรณgica del agente (Groq, MCP, memoria)
โโโ mcp_server.py # Servidor MCP con 8 herramientas
โโโ load_data.py # Script para cargar datos
โโโ check_db.py # Verificaciรณn de base de datos
โโโ test_connection.py # Prueba de conexiรณn MCP
โโโ requirements.txt # Dependencias
โโโ README.md # Documentaciรณn
โโโ .gitignore # Archivos a ignorar
โโโ .env.example # Ejemplo de variables de entorno
โโโ data/ # Datos
โ โโโ clientes.csv
โ โโโ ventas.csv
โ โโโ productos.csv
โ โโโ categorias.csv
โ โโโ metodos_pago.csv
โโโ tests/ # Pruebas unitarias
โ โโโ __init__.py
โ โโโ test_tools.py # 8 pruebas de herramientas MCP
โ โโโ test_agent.py # 5 pruebas del agente
โ โโโ test_connection.py # 1 prueba de conexiรณn
โโโ .streamlit/
โโโ secrets.toml.example # Ejemplo de secretos๐ Enlaces
Producciรณn y Repositorio
App en Producciรณn: https://systemyuri-agente-mcp-groq.streamlit.app/
MCP Server (Render): https://agente-mcp-groq-g2ei.onrender.com/mcp
Repositorio GitHub: https://github.com/systemyuri/agente-mcp-groq
Documentaciรณn Oficial
Model Context Protocol: https://modelcontextprotocol.io
LangChain Documentation: https://docs.langchain.com
Streamlit Docs: https://docs.streamlit.io
Groq Console: https://console.groq.com
FastMCP: https://github.com/jlowin/fastmcp
๐ฅ Equipo
Desarrollador: David Yurivilca
Curso: Estrategias de Integracion
Fecha de Entrega: 19/07/2026
๐ Licencia
MIT - Libre para uso educativo.
๐ Agradecimientos
Groq por el modelo de lenguaje de alto rendimiento
LangChain por la orquestaciรณn del agente
FastMCP por el servidor de herramientas
Streamlit por la interfaz web
Guรญa del Curso por la estructura y requisitos
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
An AI agent that runs your online business: products, orders, customers, email, and sites.
Ask questions across Shopify, Klaviyo, GA4 and 20+ e-commerce sources in plain English.
Commerce intelligence for AI agents. Diagnose drop-offs, fix checkouts, optimize pricing.
Ask data questions in natural language. Get SQL, insights, and charts from your databases.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceEnables AI assistants like Claude to query, analyze, and summarize local SQLite e-commerce databases using natural language through 11 tools, schema resources, and pre-built analytical prompts.
- FlicenseAqualityCmaintenanceEnables AI agents to answer analytical questions about an online store's SQLite database through specialized read-only tools, without any risk of modifying the underlying data.8
- FlicenseAqualityCmaintenanceEnables AI agents to safely inspect and query an SQLite e-commerce database with tools for listing tables, describing schemas, and running read-only SQL queries while blocking destructive operations.4
- FlicenseAqualityBmaintenanceGives AI agents read-only analytical access to an e-commerce SQLite database (customers, orders, order_items, products) via SQL queries, table listing, and schema inspection.3
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/systemyuri/agente-mcp-groq'
If you have feedback or need assistance with the MCP directory API, please join our Discord server