Skip to main content
Glama
MCP RifaExpress Backend

MCP RifaExpress Backend

by piedraprog

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 PostgreSQL

  • rifaexpress_inspect_table - Ver schema de una tabla

  • rifaexpress_list_tables - Listar todas las tablas

Entidades

  • rifaexpress_get_companies - Obtener companies con filtros

  • rifaexpress_get_users - Obtener users con filtros

  • rifaexpress_get_plans - Obtener plans

  • rifaexpress_get_subscriptions - Obtener subscriptions (cuando exista la tabla)

Utilidades

  • rifaexpress_health_check - Verificar conexión a BD y API

Available Tools

8 tools
rifaexpress_get_companiesB

Obtiene companies (empresas) con filtros opcionales de subscriptionStatus.

Inputs: subscriptionStatus, limit.

rifaexpress_get_plansC

Obtiene plans de suscripción.

Inputs: isActive.

rifaexpress_get_subscriptionsC

Obtiene subscriptions (si la tabla existe). Esta entidad se creará en Fase 1 del SaaS Core.

Inputs: companyId, status, limit.

rifaexpress_get_usersC

Obtiene users con filtros opcionales de companyId y role.

Inputs: companyId, role, limit.

rifaexpress_health_checkA

Verifica la conexión con la base de datos PostgreSQL. Útil para diagnosticar problemas de configuración.

Inputs: no named parameters.

rifaexpress_inspect_tableB

Inspecciona el schema de una tabla específica (columnas, tipos, nullability, etc.).

Inputs: tableName (required).

rifaexpress_list_tablesC

Lista todas las tablas en el schema especificado.

Inputs: schema.

rifaexpress_query_dbA

Ejecuta una query SELECT en la base de datos PostgreSQL de RifaExpress. Solo queries SELECT están permitidas por seguridad.

Inputs: sql (required), limit.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 8 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose with no overlap: get_companies, get_plans, get_subscriptions, get_users retrieve specific entities, health_check tests connectivity, inspect_table examines schema, list_tables enumerates tables, and query_db executes custom queries. The descriptions reinforce these distinct roles, making misselection unlikely.

    Naming Consistency5/5

    All tools follow a consistent 'rifaexpress_verb_noun' pattern using snake_case, with verbs like 'get', 'health_check', 'inspect', 'list', and 'query'. This predictability aids agent understanding and tool selection without confusion from mixed conventions.

    Tool Count5/5

    With 8 tools, this server is well-scoped for a backend database interaction server. It covers essential operations like data retrieval, schema inspection, and health checks without being overly sparse or bloated, making each tool earn its place in the set.

    Completeness4/5

    The toolset provides strong read-only coverage for database interaction, including entity retrieval, schema exploration, and connectivity checks. However, it lacks write operations (e.g., create, update, delete), which could be a gap for full CRUD workflows, though this might be intentional for security as noted in query_db's description.

    Related MCP Connectors