Skip to main content
Glama

example-mcp-server-streamable-http

by yigitkonur
package.jsonโ€ข4.01 kB
{ "name": "calculator-learning-demo-streamable-http", "version": "1.0.0", "description": "Streamable HTTP (stateful) reference implementation for MCP learning edition", "type": "module", "main": "dist/index.js", "scripts": { "dev": "PORT=1453 tsx watch src/server.ts", "clean": "rimraf dist build .tsbuildinfo", "typecheck": "tsc --noEmit", "lint": "eslint .", "lint:fix": "eslint . --fix", "lint:ci": "eslint . --max-warnings=0", "format": "prettier --write .", "format:check": "prettier --check .", "build": "tsc -p tsconfig.json", "check:quick": "npm run typecheck && npm run lint:ci && npm run format:check", "check:deep": "npm run typecheck && npm run lint:fix && npm run lint:ci && npm run format && npm run format:check", "pipeline": "npm run clean && npm run typecheck && npm run lint:fix && npm run lint:ci && npm run format && npm run format:check && npm run build", "smoke:stdio": "node -e \"const {spawn}=require('child_process');try{const p=spawn('node',['dist/server.js'],{stdio:['ignore','pipe','pipe']});let exited=false;const timer=setTimeout(()=>{if(!exited){p.kill('SIGINT');}},900);p.on('exit',c=>{exited=true;clearTimeout(timer);if(c&&c!==0){process.exit(c);}console.log('smoke:stdio exit',c||0);});}catch(e){console.error(e);process.exit(1);} \"", "smoke:http": "node -e \"const http=require('http');const {spawn}=require('child_process');const ports=[1453,1923,3333];const s=spawn('node',['dist/server.js'],{stdio:'inherit'});let i=0,tries=0,ok=false;function hit(){if(i>=ports.length){if(!ok){s.kill('SIGINT');process.exit(1);}return;}const port=ports[i];tries++;http.get({host:'127.0.0.1',port,path:'/'},res=>{ok=true;console.log('HTTP status',res.statusCode,'on',port);s.kill('SIGINT');if(res.statusCode>=400)process.exit(1);}).on('error',()=>{if(tries<5){setTimeout(hit,300);}else{tries=0;i++;setTimeout(hit,200);} });}setTimeout(hit,600);\"", "smoke:auto": "node -e \"const http=require('http');const {spawn}=require('child_process');const ports=[1453,1923,3333];const s=spawn('node',['dist/server.js'],{stdio:'inherit'});let i=0,tries=0,ok=false;function hit(){if(i>=ports.length){if(!ok){console.log('No HTTP detected; assuming STDIO-style process.');setTimeout(()=>{s.kill('SIGINT');process.exit(0);},800);return;}return;}const port=ports[i];tries++;http.get({host:'127.0.0.1',port,path:'/'},res=>{ok=true;console.log('HTTP status',res.statusCode,'on',port);s.kill('SIGINT');if(res.statusCode>=400)process.exit(1);}).on('error',()=>{if(tries<5){setTimeout(hit,300);}else{tries=0;i++;setTimeout(hit,200);} });}setTimeout(hit,600);\"", "all": "npm run pipeline && npm run smoke:auto", "start": "node dist/server.js", "start:production": "NODE_ENV=production node dist/server.js", "check": "npm run typecheck && npm run lint:ci && npm run format:check", "ci": "npm run all", "test:health": "curl -s http://localhost:1453/health | jq", "prepare": "husky" }, "lint-staged": { "*.{ts,tsx,js,json,md,css,scss}": [ "prettier --write", "eslint --fix" ] }, "keywords": [ "mcp", "calculator", "streamable-http", "sse", "typescript" ], "author": "", "license": "MIT", "dependencies": { "@modelcontextprotocol/sdk": "^1.0.0", "cors": "^2.8.5", "express": "^4.21.2", "express-rate-limit": "^7.5.0", "ioredis": "^5.4.2", "prom-client": "^15.1.3", "zod": "^3.24.1" }, "devDependencies": { "@eslint/js": "^9.32.0", "@types/cors": "^2.8.17", "@types/express": "^5.0.0", "@types/ioredis": "^4.28.10", "@types/node": "^22.10.6", "@typescript-eslint/eslint-plugin": "^8.20.0", "@typescript-eslint/parser": "^8.20.0", "eslint": "^9.17.0", "eslint-config-prettier": "^10.1.8", "husky": "^9.1.7", "lint-staged": "^16.1.3", "prettier": "^3.6.2", "rimraf": "^6.0.1", "tsx": "^4.19.2", "typescript": "^5.7.3" }, "engines": { "node": ">=20.0.0" } }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yigitkonur/example-mcp-server-streamable-http'

If you have feedback or need assistance with the MCP directory API, please join our Discord server