MCP API Server

MCP API Server

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.

Category
Visit Server

README

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"
}

Recommended Servers

playwright-mcp

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured