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.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

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.

上游原版 README

在 GitHub 查看同一版本原文

README.md · 48c9cabb624c · 采集于 2026-11-13 11:00:27 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

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.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

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