Skip to main content
Glama

MCP API Server

by mcgiverdev

MCP API Server

Servidor MCP (Model Context Protocol) con arquitectura modular que permite conectarse a APIs externas.

Estructura del Proyecto

src/ ├── config/ # Configuración │ ├── api.ts # Configuración de API │ └── env.ts # Variables de entorno ├── services/ # Servicios de negocio │ ├── httpClient.ts # Cliente HTTP base │ ├── userService.ts # Servicio de usuarios │ ├── weatherService.ts # Servicio de clima │ └── companyService.ts # Servicio de empresas ├── tools/ # Herramientas MCP │ ├── weatherTool.ts # Herramienta de clima │ ├── userCreateTool.ts # Crear usuarios │ ├── userListTool.ts # Listar usuarios │ ├── companyCreateTool.ts # Crear empresas │ └── companyListTool.ts # Listar empresas ├── types/ # Tipos TypeScript │ ├── api.ts # Tipos base de API │ └── company.ts # Tipos de empresas └── main.ts # Punto de entrada

Características

  • ✅ Arquitectura modular y escalable
  • ✅ Cliente HTTP reutilizable
  • ✅ Validación con Zod
  • ✅ Tipos TypeScript completos
  • ✅ Manejo de errores robusto
  • ✅ Configuración por variables de entorno

Herramientas Disponibles

Clima

  • obtener-clima: Obtiene información del clima

Usuarios

  • crear-usuario: Crea un nuevo usuario
  • listar-usuarios: Lista todos los usuarios

Empresas (API Externa)

  • crear-empresa: Crea una nueva empresa vía API
    • Tamaños permitidos: small, medium, large
  • listar-empresas: Lista empresas desde la API

Scripts Disponibles

# Construir el proyecto npm run build # Ejecutar en modo desarrollo npm run dev # Ejecutar el servidor npm start # Abrir inspector MCP npm run inspector

Variables de Entorno

API_BASE_URL=https://api.ejemplo.com # URL base de la API API_TIMEOUT=30000 # Timeout en milisegundos NODE_ENV=development # Entorno de ejecución

Uso con Inspector MCP

  1. Ejecutar el inspector: npm run inspector
  2. El servidor se iniciará en modo debug
  3. Se abrirá automáticamente el navegador con la interfaz

Agregar Nuevos Servicios

Para agregar un nuevo servicio (ej: productos):

  1. Crear tipos en src/types/product.ts
  2. Crear servicio en src/services/productService.ts
  3. Crear herramientas en src/tools/productCreateTool.ts, etc.
  4. Registrar herramientas en src/main.ts
  5. Actualizar configuración si es necesario

Estructura de API Externa

El servidor está configurado para trabajar con APIs que sigan este formato:

GET Response

{ "data": [...], "links": { "first": "string", "last": "string", "prev": "string", "next": "string" }, "meta": { "current_page": 0, "from": 0, "last_page": 0, "per_page": 0, "to": 0, "total": 0 } }

POST Request

{ "field1": "value1", "field2": "value2" }
Install Server
-
security - not tested
F
license - not found
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

A modular MCP server that connects to external APIs, providing tools for weather data, user management, and company operations. Features a scalable architecture with TypeScript support, HTTP client abstraction, and robust error handling.

  1. Estructura del Proyecto
    1. Características
      1. Herramientas Disponibles
        1. Clima
        2. Usuarios
        3. Empresas (API Externa)
      2. Scripts Disponibles
        1. Variables de Entorno
          1. Uso con Inspector MCP
            1. Agregar Nuevos Servicios
              1. Estructura de API Externa
                1. GET Response
                2. POST Request

              Related MCP Servers

              • -
                security
                F
                license
                -
                quality
                An MCP server implementation that allows users to fetch and display weather information for specified cities, including temperature, humidity, wind speed, and weather descriptions.
                Last updated -
                1
                Python
                • Linux
                • Apple
              • -
                security
                A
                license
                -
                quality
                An MCP server that connects to OpenWeatherMap's API to provide current weather data and multi-day forecasts for locations worldwide in different measurement units.
                Last updated -
                3
                TypeScript
                MIT License
              • -
                security
                F
                license
                -
                quality
                An MCP server that provides weather information like forecasts and alerts for US locations using the National Weather Service API.
                Last updated -
                2
                JavaScript
              • A
                security
                A
                license
                A
                quality
                A TypeScript-based MCP server that provides simulated weather data including current conditions, forecasts, alerts, and location search functionality through both MCP protocol and HTTP API endpoints.
                Last updated -
                5
                9
                1
                JavaScript
                MIT License

              View all related MCP servers

              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/mcgiverdev/mcp-api-v1'

              If you have feedback or need assistance with the MCP directory API, please join our Discord server