Skip to main content
Glama
mcp-first-server

mcp-first-server

by Esaban17

mcp-first-server

Primer servidor MCP (Model Context Protocol) en TypeScript, siguiendo la actividad First Server del MCP Workshop.

Expone dos capacidades sobre transporte stdio:

Tipo

Nombre

Descripción

Tool

add

Suma dos números (a, b) y devuelve el resultado como texto

Resource

greeting://{name}

Devuelve Hello, {name}!

Requisitos

  • Node.js 18+ (probado con v25)

  • npm

Related MCP server: Python MCP Server

Instalación

npm install
npm run build

Probarlo con el Inspector

npm run inspector

Abre la interfaz web del MCP Inspector, donde puedes listar y ejecutar la tool add y leer el resource greeting://{name}.

Probarlo desde la terminal

Sin inspector, hablando JSON-RPC directo por stdio:

printf '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"t","version":"0"}}}\n{"jsonrpc":"2.0","method":"notifications/initialized"}\n{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"add","arguments":{"a":2,"b":3}}}\n{"jsonrpc":"2.0","id":3,"method":"resources/read","params":{"uri":"greeting://Mundo"}}\n' | node build/index.js

Salida esperada (entre otras líneas):

{"result":{"content":[{"type":"text","text":"5"}]},"jsonrpc":"2.0","id":2}
{"result":{"contents":[{"uri":"greeting://Mundo","text":"Hello, Mundo!"}]},"jsonrpc":"2.0","id":3}

Conectarlo a un cliente MCP

Ejemplo de configuración (Claude Desktop, VS Code, etc.):

{
  "mcpServers": {
    "demo": {
      "command": "node",
      "args": ["/ruta/absoluta/a/mcp-first-server/build/index.js"]
    }
  }
}

Estructura

src/index.ts     código del servidor
tsconfig.json    compila src/ -> build/
build/           salida compilada (no versionada)

Available Tools

1 tool
addD

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

    D1.6/5.0

    Scored across 1 tool

    Disambiguation5/5

    With only one tool, there is no risk of confusing it with another tool. The tool is uniquely identifiable even without a description.

    Naming Consistency5/5

    A single tool named 'add' introduces no naming conflicts or mixed conventions. Consistency is trivially maintained.

    Tool Count1/5

    A server exposing exactly one tool with no description is an extreme mismatch—there is no meaningful tool surface to serve a coherent purpose.

    Completeness1/5

    The tool 'add' without a description or supporting tools provides no discernible domain coverage. The surface is severely incomplete and effectively useless for real tasks.

    Maintenance

    ActivityStale
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Demonstrates core MCP server functionality with basic arithmetic operations (addition and subtraction) and personalized greeting generation. Serves as an educational template implementing example tools and dynamic resources for MCP server development with Python.
      -
    • F
      license
      Not graded
      quality
      C
      maintenance
      Exposes basic arithmetic and greeting tools, a queue status resource, and a queue analysis prompt, demonstrating MCP server-client interaction over stdio.
      -
    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables arithmetic addition, personalized greetings, version lookup, and text summarization through MCP tools, a resource, and a prompt.
      -
    • A
      license
      B
      quality
      C
      maintenance
      Enables arithmetic operations, mock weather lookups, and in-memory note management with tools, a resource, and a summarization prompt over stdio.
      4
      118 npm
      MIT