mendywoly
MCP Servermendywolypublic

mcp sse

一个使用TypeScript SDK实现的极简无状态MCP协议服务器和客户端示例。

Repository Info

0
Stars
0
Forks
0
Watchers
0
Issues
HTML
Language
-
License

About This Server

一个使用TypeScript SDK实现的极简无状态MCP协议服务器和客户端示例。

Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.

Documentation

Simple MCP Server Example

A minimal implementation of the Model Context Protocol (MCP) using the TypeScript SDK with a stateless HTTP server and client.

Overview

This example demonstrates:

  • A stateless MCP server with a simple greeting tool
  • A standard MCP client that connects and tests the server
  • Production-ready architecture with no session management complexity

Key Features

Stateless Mode - No session management required
Production Ready - Works with multiple server instances
No Sticky Sessions - Perfect for load balancers
Standard MCP Protocol - Compatible with all MCP clients

Project Structure

src/
├── server.ts    # Stateless MCP server with greeting tool
└── client.ts    # Simple MCP client for testing

Prerequisites

  • Node.js (v16 or higher)
  • npm or pnpm

Installation

npm install
npm run build

Running the Example

Start the Server

npm run start:server

The server will start on http://localhost:3003/mcp

Test with Client

In another terminal:

npm run start:client

Available Tools

greet

Generate friendly greeting messages with different styles.

Parameters:

  • name (required): The name of the person to greet
  • style (optional): greeting style - casual, formal, or enthusiastic

Examples:

  • Casual: "Hi Alice! Nice to meet you. 👋"
  • Formal: "Good day, Dr. Smith. I hope you are well."
  • Enthusiastic: "Hey Bob! 🎉 Great to see you! Hope you're having an amazing day! ✨"

Development

# Development mode with auto-reload
npm run dev:server  # Start server in dev mode
npm run dev:client  # Run client in dev mode

# Build
npm run build

# Clean
npm run clean

Architecture

This implementation uses the stateless mode of StreamableHTTPServerTransport:

const transport = new StreamableHTTPServerTransport({
  sessionIdGenerator: undefined, // Stateless mode
});

Benefits:

  • Scalable: Works with multiple server instances
  • Simple: No complex session management
  • Reliable: No sticky session requirements
  • Standard: Compatible with all MCP clients

How it Works:

  1. Each request creates a fresh transport and server instance
  2. No shared state between requests
  3. Clean isolation and automatic cleanup
  4. Perfect for containerized deployments

Based On

This implementation follows the official MCP TypeScript SDK patterns:

  • MCP TypeScript SDK
  • Stateless Server Example

License

MIT

Quick Start

1

Clone the repository

git clone https://github.com/mendywoly/mcp-sse
2

Install dependencies

cd mcp-sse
npm install
3

Follow the documentation

Check the repository's README.md file for specific installation and usage instructions.

Repository Details

Ownermendywoly
Repomcp-sse
LanguageHTML
License-
Last fetched8/10/2025

Recommended MCP Servers

💬

Discord MCP

Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.

integrationsdiscordchat
🔗

Knit MCP

Connect AI agents to 200+ SaaS applications and automate workflows.

integrationsautomationsaas
🕷️

Apify MCP Server

Deploy and interact with Apify actors for web scraping and data extraction.

apifycrawlerdata
🌐

BrowserStack MCP

BrowserStack MCP Server for automated testing across multiple browsers.

testingqabrowsers

Zapier MCP

A Zapier server that provides automation capabilities for various apps.

zapierautomation