Minimal Model Context Protocol server example in TypeScript

Minimal Model Context Protocol server example in TypeScript

mcp-node-server•bymateusdata

A small TypeScript MCP server demonstrating JSON-RPC request handling, example tools, and Server-Sent Events for real-time communication.

License: MIT License•Runtime: Awaiting documentation review•Category: developer tools

WHAT IT DOES

  • •Handles JSON-RPC requests as part of its MCP server implementation.
  • •Provides example tools named add-number and greet.
  • •Supports Server-Sent Events for real-time communication over its MCP server.
  • •Includes simple client and server code for testing and learning.

BEST FOR

  • •Learning how a minimal MCP server is structured and works.
  • •Experimenting with calling MCP tools such as add-number and greet directly from a terminal.

ABOUT MCP-NODE-SERVER

Minimal Model Context Protocol server example in TypeScript is cataloged as an MCP server attributed to mateusdata. A small TypeScript MCP server demonstrating JSON-RPC request handling, example tools, and Server-Sent Events for real-time communication. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT License. Check the source repository's current license and terms before using, modifying or distributing this software.

Capability inspector

Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.

Tools (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Resources (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Prompts (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for Minimal Model Context Protocol server example in TypeScript are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

What example tools does the server expose?

It includes example tools named add-number and greet.

Does the server support real-time communication?

Yes, it supports Server-Sent Events for real-time communication.

Upstream README

View this exact version on GitHub

README.md · 48c9cabb624c · Fetched 2026-11-13 11:00:27 UTC

Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.

Showing the last retrieved documentation snapshot; check the source for current changes.

MCP MateusData Server

A TypeScript server implementing a simple Model Context Protocol (MCP) — a true "Hello World" example to help you understand how an MCP server works. This project includes basic features such as:

  • Handling JSON-RPC requests
  • Example tools like add-number and greet
  • Support for Server-Sent Events (SSE) for real-time communication
  • Simple client and server code for easy testing and learning

Prerequisites

  • Node.js (v20 or higher)
  • npm (comes with Node.js)
  • Cursor IDE (recommended)

Installation

  1. Clone the repository:
git clone git@github.com:mateusdata/mcp-mateusdata-server.git
cd mcp-mateusdata-server
  1. Install dependencies:
npm install

Running the Project

Development mode:

npm run dev

For build and production run:

npm run build
npm start

Adding the MCP Server in Cursor

In the Cursor configuration file, add:

{
  "mcpServers": {    
  "mateusdata-mcp-server": {
   "command": "node",      
   "args": ["path/to/mcp-mateusdata-server/build/index.js"]
  }
  }
}

Project Structure

mcp-mateusdata-server/
├── build/         # Compiled JavaScript files
├── src/           # Source code
    └── server.ts  # Simple MCP server example
│   └── client.js  # Simple MCP client example
├── node_modules/  # Project dependencies
├── package.json   # Project configuration and dependencies
└── tsconfig.json  # TypeScript configuration

About

This repository demonstrates a minimal implementation of the Model Context Protocol (MCP). The src/client.js file provides an example of how a client can interact with the server, useful for testing and initial learning.

Usage Examples

You can interact with the MCP server directly from your terminal using Bash, Zsh, or Fish. For example, to list available tools:

To call the tool "add-number" with values a = 3 and b = 5:

echo '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"add-number","arguments":{"a":3,"b":5}}}' | node build/index.js

To call the "greet" tool with the parameter nome = "Mateus":

echo '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"greet","arguments":{"name":"Mateus"}}}' | node build/index.js

Using SSE (Server-Sent Events) with the MCP Server

You can interact with the MCP server using SSE for real-time communication. Start the server:

node build/index.js sse

You should see:

MCP Server running with SSE on http://localhost:8765/sse

Connecting to the SSE endpoint

In a new terminal, connect using curl:

curl http://localhost:8765/sse

Example output:

event: endpoint
data: /messages?sessionId=d9bfe7df-937c-475e-8d80-904a99f9ef4d

Sending a message to the server

Copy the sessionId from the previous output and use it to send a request:

curl -X POST http://localhost:8765/messages \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"greet","arguments":{"name":"Mateus"}}}'

The server will respond via the SSE connection with the result of your request.

This project is licensed under the MIT License.

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for Minimal Model Context Protocol server example in TypeScript from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/mcp-node-server)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

Downloads and pulls

Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.

No reviewed package or image identity; download statistics are not listed yet.

Related developer tools MCP Servers

Alternative and complementary servers in the same category

View all in developer tools →
Postbye
postbye-mcp•postbye-team

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools
Singapore Proxy MCP
singapore-proxy-mcp•Xavierfok

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

0
Developer Tools

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools