Skip to main content
Glama
MCPServerL2

MCPServerL2

by Broflotsky

🚀 Modular MCP Server in TypeScript (M5L2)

This project implements a clean, granular, and modular architecture for building Model Context Protocol (MCP) servers using TypeScript and schemas with Zod.


đź“‚ Project Structure

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

Related MCP server: MCP Server TypeScript Template

📦 Installation

Install the project dependencies by running:

npm install

🛠️ Available Scripts

  • Compilation (TypeScript to JavaScript in /dist):

    npm run build
  • Running the Server:

    • Development (direct TS): npm run dev

    • Production (compiled code): npm start

    đź’ˇ Note: When running over STDIO, the server stays actively waiting for JSON-RPC messages. To interact with it visually, use the Inspector.

  • Testing with MCP Inspector:

    npm run inspector

đź§Ş How to test it with MCP Inspector?

The Inspector launches an interactive web interface that connects to the server over STDIO:

  1. Compile the project (if you haven't already):

    npm run build
  2. Start the Inspector:

    npm run inspector
  3. Open in your browser the URL shown in the terminal (e.g. http://localhost:6274/?MCP_PROXY_AUTH_TOKEN=...) to interactively test the sumar and saludar tools.

Available Tools

2 tools
saludarB

Genera un saludo personalizado

Inputs: nombre (required), idioma.

sumarA

Suma dos nĂşmeros y devuelve el resultado

Inputs: a (required), b (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    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.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      A demonstration MCP server built in TypeScript that shows how to implement stdio-based communication for integration with MCP clients. Serves as a template for building custom MCP servers with strong typing and maintainability.
      ISC
    • A
      license
      Not graded
      quality
      D
      maintenance
      A lightweight TypeScript-based MCP server that demonstrates how to build custom MCP tools by implementing a simple addition calculator. Serves as a starting point for building MCP-compatible tools.
      1,527 npm
      MIT
    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables building and running an MCP server with automatically discovered tools, prompts, and resources over HTTP or STDIO, using TypeScript and Zod schemas.
      -