mcp-transport-websocket-setup

Solid

Configure WebSocket transport for bidirectional MCP communication with connection management and reconnection handling.

AI & Automation 814 stars 53 forks Updated today MIT

Install

View on GitHub

Quality Score: 95/100

Stars 20%
97
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# MCP Transport WebSocket Setup Configure WebSocket transport for bidirectional MCP communication. ## Capabilities - Configure WebSocket transport for MCP - Implement connection lifecycle management - Set up reconnection with backoff - Handle message framing - Implement heartbeat/ping-pong - Configure secure WebSocket (WSS) ## Usage Invoke this skill when you need to: - Set up bidirectional MCP communication - Implement WebSocket-based MCP transport - Configure connection management - Enable real-time bidirectional messaging ## Inputs | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | language | string | Yes | Target language | | server | boolean | No | Generate server code (default: true) | | client | boolean | No | Generate client code (default: false) | | secure | boolean | No | Use WSS (default: true) | ## Generated Patterns ### TypeScript WebSocket Server ```typescript import { WebSocketServer, WebSocket } from 'ws'; import { Server } from '@modelcontextprotocol/sdk/server/index.js'; interface Connection { ws: WebSocket; server: Server; lastPing: number; } const connections = new Map<string, Connection>(); const wss = new WebSocketServer({ port: parseInt(process.env.WS_PORT || '8080'), path: '/mcp', }); // Heartbeat interval const HEARTBEAT_INTERVAL = 30000; wss.on('connection', (ws, req) => { const connectionId = crypto.randomUUID(); console.log(`New connection: ${connectionId}`); // Create MCP s...

Details

Author
a5c-ai
Repository
a5c-ai/babysitter
Created
4 months ago
Last Updated
today
Language
JavaScript
License
MIT

Integrates with

Related Skills