README.md
MCP Server para interactuar con el backend de RifaExpress (PostgreSQL + API REST).
MCP RifaExpress Backend
MCP Server para interactuar con el backend de RifaExpress (PostgreSQL + API REST).
Variables de Entorno
Crea un archivo .env en la raíz del proyecto:
# PostgreSQL Connection
DB_HOST=localhost
DB_PORT=5432
DB_NAME=rifaexpress
DB_USER=postgres
DB_PASSWORD=tu_password
# API REST (opcional)
API_URL=http://localhost:3000/api
API_TOKEN=tu_jwt_token
Instalación
npm install
npm run build
Uso
npm start
Tools Disponibles
Base de Datos
rifaexpress_query_db- Ejecutar queries SELECT en PostgreSQLrifaexpress_inspect_table- Ver schema de una tablarifaexpress_list_tables- Listar todas las tablas
Entidades
rifaexpress_get_companies- Obtener companies con filtrosrifaexpress_get_users- Obtener users con filtrosrifaexpress_get_plans- Obtener plansrifaexpress_get_subscriptions- Obtener subscriptions (cuando exista la tabla)
Utilidades
rifaexpress_health_check- Verificar conexión a BD y API
Tools (8)
rifaexpress_query_dbEjecutar queries SELECT en PostgreSQLrifaexpress_inspect_tableVer schema de una tablarifaexpress_list_tablesListar todas las tablasrifaexpress_get_companiesObtener companies con filtrosrifaexpress_get_usersObtener users con filtrosrifaexpress_get_plansObtener plansrifaexpress_get_subscriptionsObtener subscriptions (cuando exista la tabla)rifaexpress_health_checkVerificar conexión a BD y APIEnvironment Variables
DB_HOSTrequiredPostgreSQL Connection hostDB_PORTrequiredPostgreSQL Connection portDB_NAMErequiredPostgreSQL database nameDB_USERrequiredPostgreSQL userDB_PASSWORDrequiredPostgreSQL passwordAPI_URLAPI REST URL (optional)API_TOKENAPI JWT token (optional)Configuration
claude_desktop_config.json
{"mcpServers":{"rifaexpress":{"command":"npm","args":["start"]}}}Try it
→List all tables in the RifaExpress database using rifaexpress_list_tables.
→Get all companies using rifaexpress_get_companies.
→Inspect the schema of the users table with rifaexpress_inspect_table.
→Execute this query: SELECT * FROM plans using rifaexpress_query_db.
→Perform a health check with rifaexpress_health_check.