yigitkonur

example-mcp-stateless

Community yigitkonur
Updated

stateless MCP server — fresh instance per request, infinite horizontal scaling

example-mcp-stateless

learning-first MCP boilerplate for HTTP stateless servers using TypeScript SDK v2 pre-release.

part of a series: stdio · stateless (you are here) · stateful · sse

what it does

  • runs a stateless MCP server where every request gets a fresh McpServer instance -- no sessions, no state, no coordination
  • registers example tools (calculate, describe_stateless_limits), resources (boilerplate://limitations, boilerplate://topic/{topic}), and a prompt (design-next-tool)
  • includes a scaffold CLI to bootstrap new projects and generate tool/resource/prompt stubs
  • vendors SDK v2 pre-release tarballs for reproducible builds
  • ships with Docker support, CI workflow, and a smoke test

quick start

git clone https://github.com/yigitkonur/example-mcp-stateless.git
cd example-mcp-stateless
npm install
npm run dev

the server starts at http://127.0.0.1:1071/mcp. verify with:

curl http://127.0.0.1:1071/health

Docker alternative:

docker-compose up -d

scaffold cli

build the CLI first, then scaffold a new project:

npm run build
npm run cli -- init my-mcp-server --install

generate stubs inside an existing project:

npm run create -- generate tool my_tool
npm run create -- generate resource my_resource
npm run create -- generate prompt my_prompt

full reference: docs/03-scaffold-cli.md

documentation

document description
docs/01-getting-started.md install, run, configure, verify
docs/02-architecture.md module layout, stateless pattern, endpoint contract
docs/03-scaffold-cli.md init and generate command reference
docs/04-sdk-v2-notes.md v2 packages, vendoring, migration from v1
docs/05-validation.md CI breakdown, smoke test, mcp-cli verification

sdk v2 context

this repo tracks MCP TypeScript SDK v2 in pre-release form. it uses the split package model (@modelcontextprotocol/server, @modelcontextprotocol/node, @modelcontextprotocol/express) and the registerTool/registerResource/registerPrompt APIs with Zod v4 schemas. tarballs are vendored in vendor/mcp-sdk-v2/ for reproducibility.

license

MIT

MCP Server · Populars

MCP Server · New

    klever-io

    Klever MCP Server

    MCP server for Klever blockchain smart contract development

    Community klever-io
    luohy15

    y-agent

    A Simple Agent App

    Community luohy15
    PrefectHQ

    FastMCP 🚀

    🚀 The fast, Pythonic way to build MCP servers and clients.

    Community PrefectHQ
    meal-inc

    bonnard-cli

    Ultra-fast to deploy agentic-first mcp-ready semantic layer. Let your data be like water.

    Community meal-inc
    DevsHero

    🥷 ShadowCrawl MCP — v2.3.0

    🥷 The FREE, Sovereign alternative to Firecrawl & Tavily. Pure Rust Stealth Scraper + Built-in God-Tier Meta-Search for AI Agents. Bypass Cloudflare & DataDome via HITL. Zero-bloat, ultra-clean LLM data. 99.99% Success Rate. 🦀

    Community DevsHero