mcp_inventory
An MCP server for managing product inventory with SQLite, enabling CRUD operations and statistical queries such as total value, out-of-stock items, and most expensive product.
README
1. Desarrollo de un Sistema Cognitivo usando MCP y Bases de Datos
Sistema de Inventario con SQLite + MCP
Este proyecto implementa un sistema de inventario básico utilizando Python, SQLite y MCP (Model Context Protocol). Permite realizar operaciones CRUD sobre productos, además de consultas estadísticas del inventario.
Características
- Crear productos
- Consultar productos por ID
- Actualizar cantidad de productos
- Eliminar productos
- Listar todos los productos
- Calcular valor total del inventario
- Consultar productos agotados
- Identificar el producto más costoso
- Obtener estadísticas generales del inventario
Tecnologías utilizadas
- Python 3.x
- SQLite3
- FastMCP (Model Context Protocol)
Estructura del proyecto
/inventario │── database.py # Creación de la base de datos │── server.py # Servidor MCP con herramientas │── productos_db.py # Lógica CRUD de productos (si aplica) │── inventory.db # Base de datos SQLite (se genera automáticamente)
⚙️ Instalación
1. Clonar el proyecto
bash: git clone <URL_DEL_REPOSITORIO> cd inventario
2. Crear entorno virtual (opcional pero recomendado)
python -m venv venv
Activar entorno:
- Windows: venv\Scripts\activate
- Linux/Mac: source venv/bin/activate
3. Instalar dependencias
pip install fastmcp
4. Inicializar base de datos
- Ejecutar el siguiente archivo: python database.py
- Esto creará automáticamente el archivo: inventory.db
5. Ejecución del servidor MCP
- Ejecutar: python server.py
El servidor quedará activo con las herramientas disponibles para consulta y manipulación del inventario.
6. Ejecución de pruebas
Puedes crear un archivo test.py para probar las funciones: python test.py
Ejemplo de uso:
- crear_producto("Laptop", "Tecnología", 10, 2500)
- consultar_producto(1)
- actualizar_producto(1, 20)
- listar_productos()
- valor_inventario()
Consideraciones
- Asegúrate de ejecutar primero database.py antes del servidor.
- No elimines el archivo inventory.db si deseas conservar los datos.
- Manejar correctamente los IDs al consultar o eliminar productos.
Autor:
Edwin Alexander Ospina Penna Proyecto desarrollado como práctica de sistemas cognitivos, bases de datos y MCP en Python.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.