Example
Streamable HTTP Server with Verbose Logging
claude mcp add --transport stdio danny-avila-example-mcp-server node server.js \ --env PORT="Server port (default: 3001)" \ --env DEBUG="Enable debug logging (default: true)"
How to use
This MCP server implements a Streamable HTTP transport with JSON-RPC and Server-Sent Events (SSE). Clients create a session and then invoke tools within that session, allowing progress notifications for long-running tasks. Available tools include hello_world (simple greeting), get_server_info (returns server metadata), long_running_test (configurable duration with progress updates), and slow_test (a longer, progress-enabled operation). Use the POST /mcp endpoint to send JSON-RPC requests to call tools, and GET /mcp for SSE streams to receive updates within an active session. Sessions persist across requests, and transports are reused within a session for efficiency. Your client should handle session IDs and terminate them with DELETE /mcp when you’re done.
How to install
Prerequisites:
- Node.js (v14+ recommended) and npm
- Basic familiarity with npm scripts used by the project
- Clone the repository
- git clone https://github.com/danny-avila-example-mcp-server.git
- cd danny-avila-example-mcp-server
- Install dependencies
- npm ci
- Configure environment (optional)
- PORT: port to run the server on (default 3001)
- DEBUG: true to enable debug logging (default true)
- Start the server
- npm run start
- Development mode (auto-reload)
- npm run dev
- Run tests (optional)
- npm run test:http
Note: The server exposes endpoints at /mcp for JSON-RPC and SSE, and /health for health checks.
Additional notes
Tips and notes:
- Ensure PORT is not in use by another process. The default is 3001.
- Sessions are created on initialization requests and must be terminated with DELETE /mcp when done.
- Long-running tools (long_running_test, slow_test) emit progress notifications via the notifications/progress event structure. Make sure your client subscription handles SSE if you’re using streaming.
- If you encounter JSON-RPC errors, check that the tool name is correct and arguments match what the server expects (duration, steps, messages, etc.).
- SSE streaming requires a persistent connection; use GET /mcp to subscribe to the event stream within an active session.
Related MCP Servers
iterm
A Model Context Protocol server that executes commands in the current iTerm session - useful for REPL and CLI assistance
mcp
Octopus Deploy Official MCP Server
furi
CLI & API for MCP management
editor
MCP Server for Phaser Editor
DoorDash
MCP server from JordanDalton/DoorDash-MCP-Server
mcp
MCP сервер для автоматического создания и развертывания приложений в Timeweb Cloud