mcp-typescript-sdk
by emqx·★ 97·Score 47
A TypeScript SDK for implementing MCP over MQTT with full type safety, supporting both browser and Node.js environments.
Overview
This is a comprehensive TypeScript SDK for implementing the Model Context Protocol (MCP) over MQTT. It provides a clean, object-oriented API with proper TypeScript classes for creating both MCP servers and clients. The SDK supports automatic environment detection between browser (WebSocket) and Node.js (TCP) environments, ensuring seamless cross-platform functionality. It includes full type safety with Zod schema validation, automatic server discovery, and follows the MCP specification v2024-11-05.
Try asking AI
After installing, here are 5 things you can ask your AI assistant:
When to choose this
Choose this SDK when building MCP applications that need to communicate between browser and Node.js environments, especially when you already use MQTT infrastructure or need reliable message queuing.
When NOT to choose this
Avoid this if you need direct HTTP/WebSocket MCP transport without MQTT dependency, or if your environment doesn't support MQTT brokers.
Tools this server exposes
2 tools extracted from the READMEgreet({ name: string, language?: 'en' | 'es' | 'fr' }) => Promise<{ content: Array<{ type: 'text', text: string }> }>Greet someone with a personalized message
calculate({ expression: string }) => Promise<{ content: Array<{ type: 'text', text: string }>, isError?: boolean }>Perform mathematical calculations
Comparable tools
Installation
Installation
npm install @emqx-ai/mcp-mqtt-sdkClaude Desktop Integration
Add to your Claude Desktop configuration:
{
"mcpServers": {
"mqtt-mcp": {
"command": "npx",
"args": ["@emqx-ai/mcp-mqtt-sdk"],
"env": {
"MQTT_HOST": "mqtt://localhost:1883"
}
}
}
}FAQ
- What MQTT brokers are supported?
- The SDK supports any standard MQTT broker including EMQX, Mosquitto, HiveMQ, and others. You can connect via mqtt:// for TCP or ws://wss:// for WebSocket connections.
- Does this work in browser environments?
- Yes, the SDK automatically detects browser environments and uses WebSocket connections instead of TCP. It works seamlessly in both Node.js and browser contexts.
On Hacker News
Recent discussion from the developer community.
- Story by Kiplingbt · 2025-09-15
Compare mcp-typescript-sdk with
Last updated · Auto-generated from public README + GitHub signals.