Skip to main content
Glama
Broflotsky

MCPServerL2

by Broflotsky
README.md
# 🚀 Servidor MCP Modular en TypeScript (M5L2)

Este proyecto implementa una arquitectura limpia, granular y modular para construir servidores **Model Context Protocol (MCP)** utilizando **TypeScript** y esquemas con **Zod**.

---

## đź“‚ Estructura del Proyecto

```
M5L2/
├── src/
│   ├── schemas/
│   │   ├── sumar.schema.ts      <-- Esquema Zod e inferencia de tipos para 'sumar'
│   │   └── saludar.schema.ts    <-- Esquema Zod e inferencia de tipos para 'saludar'
│   ├── tools/
│   │   ├── sumar.tool.ts        <-- Tool aislada de suma
│   │   ├── saludar.tool.ts      <-- Tool aislada de saludo
│   │   └── index.ts             <-- Registro centralizador de Tools
│   ├── server.ts                <-- Fábrica de creación y configuración del McpServer
│   └── index.ts                 <-- Punto de entrada (Bootstrapping y Transporte STDIO)
├── dist/                        <-- Código transpilado a JavaScript (generado tras 'npm run build')
├── tsconfig.json                <-- Configuración estricta de TypeScript
├── package.json                 <-- Dependencias y scripts
└── README.md
```

---

## 📦 Instalación

Instala las dependencias del proyecto ejecutando:

```bash
npm install
```

---

## 🛠️ Scripts Disponibles

- **CompilaciĂłn (TypeScript a JavaScript en `/dist`):**
  ```bash
  npm run build
  ```
- **EjecuciĂłn del Servidor:**
  - Desarrollo (TS directo): `npm run dev`
  - ProducciĂłn (cĂłdigo compilado): `npm start`
  > 💡 *Nota*: Al ejecutarse por STDIO, el servidor se queda en espera activa de mensajes JSON-RPC. Para interactuar visualmente con él, utiliza el Inspector.

- **Probar con MCP Inspector:**
  ```bash
  npm run inspector
  ```

---

## đź§Ş ÂżCĂłmo probarlo con MCP Inspector?

El Inspector levanta una interfaz web interactiva que conecta con el servidor por STDIO:

1. Compila el proyecto (si no lo has hecho):
   ```bash
   npm run build
   ```
2. Inicia el Inspector:
   ```bash
   npm run inspector
   ```
3. Abre en tu navegador la URL que muestra la terminal (ej. `http://localhost:6274/?MCP_PROXY_AUTH_TOKEN=...`) para probar interactivamente las tools `sumar` y `saludar`.

TDQS

A3.7/5.0

Scored across 2 tools

Disambiguation5/5

Both tools have completely distinct purposes—one performs arithmetic, the other generates greetings. There is no possibility of confusion between them.

Naming Consistency5/5

Both tool names are Spanish verbs in infinitive form ('sumar', 'saludar'), following a clear and consistent pattern.

Tool Count3/5

With only two tools, the set feels minimal, but it may be appropriate for a simple demo or utility server. The count is borderline thin rather than excessive.

Completeness4/5

The server covers its apparent basic scope without dead ends: one math operation and one greeting function. Additional math operations could be considered a minor gap, but the surface is functionally usable.

Maintenance

ActivityMaintained
ResponsivenessNo issues