Skip to content

Commit fc9597f

Browse files
committed
Refactor to use official MCP SDK with StreamableHTTP transport
1 parent cfaaa5d commit fc9597f

File tree

5 files changed

+904
-1991
lines changed

5 files changed

+904
-1991
lines changed

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ A professional Model Context Protocol (MCP) server that bridges AI assistants wi
44

55
## Features
66

7-
- 🔌 **MCP Protocol** - Server-Sent Events (SSE) endpoint for AI agent connectivity
7+
- 🔌 **MCP Protocol** - Official SDK Streamable HTTP transport for AI agent connectivity
88
- 🔐 **Simple Authentication** - Login tool for end-users, no auth required for agents
99
- 🚀 **Production Ready** - Built with NestJS and TypeScript
1010
- 📊 **IoT Device Management** - Full access to devices, locations, groups, and definitions
@@ -14,18 +14,18 @@ A professional Model Context Protocol (MCP) server that bridges AI assistants wi
1414
```
1515
┌─────────────────────────────────┐
1616
│ AI Agent (Claude, ChatGPT) │
17-
Connects via SSE
17+
Streamable HTTP + SSE
1818
└───────────┬─────────────────────┘
1919
│ No Authentication
2020
┌───────────▼─────────────────────┐
21-
│ MCP Server (SSE Endpoint) │
22-
GET /api/mcp/sse
21+
│ MCP Server (Official SDK) │
22+
│ /api/mcp (all methods)
2323
└───────────┬─────────────────────┘
2424
2525
│ 1. Agent connects (no auth)
2626
│ 2. Agent calls 'login' tool
2727
│ 3. Server returns token
28-
│ 4. Token stored in connection
28+
│ 4. Token stored in session
2929
│ 5. Subsequent tools use token
3030
3131
┌───────────▼─────────────────────┐
@@ -97,12 +97,15 @@ Server will be available at `http://localhost:3001`
9797

9898
### Connection
9999

100-
**Endpoint:** `GET /api/mcp/sse`
100+
**Endpoint:** `/api/mcp` (supports GET for SSE, POST for messages, DELETE for session termination)
101101

102102
**No Authentication Required** - Agents can connect freely.
103103

104+
**Uses Official MCP SDK** - Implements the MCP Streamable HTTP protocol specification
105+
104106
```bash
105-
curl -N http://localhost:3001/api/mcp/sse
107+
# Test SSE connection (will receive session ID in response headers)
108+
curl -N http://localhost:3001/api/mcp
106109
```
107110

108111
### Available Tools

0 commit comments

Comments
 (0)