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: 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 Servers
- Flicense-qualityDmaintenanceEnables AI agents to explore and query a mock e-commerce store's data including customers, products, inventory, and orders through conversational interactions backed by PostgreSQL.
- Flicense-qualityDmaintenanceProvides AI-powered tools for querying customer and order analytics, enabling order counting, customer listing by country, and spend calculation.
- Flicense-qualityCmaintenanceEnables AI to query a business database for customers, orders, and revenue using natural language through safe, well-defined tools.
- Flicense-qualityCmaintenanceEnables querying ecommerce data (customers, products, orders, reviews) using natural language via Cortex Analyst and Cortex Search, with SQL execution capability, all exposed as MCP tools.
Related MCP Connectors
Manage your NanoCart store from any AI agent: products, orders, coupons, subscribers, reports.
Manage your Savanto store from your AI: catalog, content, prompts, and analytics, by chat.
Web search, page extraction and structured commerce, social and business data for AI agents
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