Skip to content

Commit 6a3332b

Browse files
author
Lasim
committed
feat(gateway): implement MCP endpoint and enhance logging for session management
1 parent 6f2196a commit 6a3332b

File tree

10 files changed

+695
-81
lines changed

10 files changed

+695
-81
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ Our roadmap is designed to build the essential infrastructure for using MCP secu
107107
- **[Done]** Implemented secure authentication and configuration synchronization between the Gateway and the cloud.
108108
- **[Done]** Built the on-demand `stdio` process spawning and management logic.
109109
- **[Done]** Added support for multi-user teams with role-based access control.
110+
- **[Done]** Implemented dual transport architecture supporting both SSE and Streamable HTTP transports for maximum client compatibility.
110111

111112
### Phase 3: Enterprise Governance (Current Focus)
112113

services/gateway/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The local secure gateway that connects developers to their team's MCP servers th
44

55
## 🔍 Features
66

7-
- **Dual Transport Architecture**: Supports SSE transport for VS Code compatibility with session-based messaging
7+
- **Dual Transport Architecture**: Supports both legacy SSE transport and modern Streamable HTTP transport for maximum MCP client compatibility
88
- **Individual Tool Exposure**: Exposes individual MCP tools with namespacing (e.g., `brightdata-search_engine`) for direct use
99
- **Automatic Tool Discovery**: Discovers and caches tools from all MCP servers when switching teams
1010
- **Fast Gateway Startup**: Instant startup using cached tools without waiting for server discovery
@@ -110,8 +110,9 @@ After logging in, the gateway automatically downloads and synchronizes your team
110110

111111
**Gateway Endpoints:**
112112

113-
- 📡 **SSE Connection**: `http://localhost:9095/sse` (for establishing connections)
114-
- 📨 **Messages**: `http://localhost:9095/message` (for JSON-RPC with session context)
113+
- 📡 **SSE Connection**: `http://localhost:9095/sse` (for establishing legacy SSE connections)
114+
- 📨 **Messages**: `http://localhost:9095/message` (for JSON-RPC with session context)
115+
- 🚀 **MCP Endpoint**: `http://localhost:9095/mcp` (for modern Streamable HTTP transport)
115116
- 📊 **Health Check**: `http://localhost:9095/health` (for monitoring)
116117
- 📋 **Status**: `http://localhost:9095/status` (for detailed information)
117118

@@ -293,6 +294,7 @@ deploystack start --foreground
293294
🚀 DeployStack Gateway listening at:
294295
📡 SSE endpoint: http://localhost:9095/sse
295296
📨 Messages: http://localhost:9095/message
297+
🚀 MCP endpoint: http://localhost:9095/mcp
296298
📊 Health check: http://localhost:9095/health
297299
🤖 Ready to serve 2 MCP servers for team: kaka
298300
```

services/gateway/src/commands/restart.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export function registerRestartCommand(program: Command) {
3535
console.log(chalk.gray(` PID: ${result.pid}`));
3636
console.log(chalk.gray(` SSE endpoint: ${result.endpoints?.sse}`));
3737
console.log(chalk.gray(` Messages: ${result.endpoints?.messages}`));
38+
console.log(chalk.gray(` MCP endpoint: ${result.endpoints?.mcp}`));
3839
console.log(chalk.gray(' Use "deploystack status" to check status'));
3940
console.log(chalk.gray(' Use "deploystack stop" to stop the server'));
4041

services/gateway/src/commands/start.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export function registerStartCommand(program: Command) {
4040
console.log(chalk.gray(` PID: ${result.pid}`));
4141
console.log(chalk.gray(` SSE endpoint: ${result.endpoints?.sse}`));
4242
console.log(chalk.gray(` Messages: ${result.endpoints?.messages}`));
43+
console.log(chalk.gray(` MCP endpoint: ${result.endpoints?.mcp}`));
4344
console.log(chalk.gray(' Use "deploystack status" to check status'));
4445
console.log(chalk.gray(' Use "deploystack stop" to stop the server'));
4546

services/gateway/src/commands/status.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ async function getGatewayStatus() {
4444
pid: null as number | null,
4545
uptime: null as number | null,
4646
endpointSSE: null as string | null,
47-
endpointMessages: null as string | null
47+
endpointMessages: null as string | null,
48+
endpointMcp: null as string | null
4849
},
4950
// eslint-disable-next-line @typescript-eslint/no-explicit-any
5051
server: null as any,
@@ -86,10 +87,12 @@ async function getGatewayStatus() {
8687
const host = 'localhost'; // Default host
8788
status.gateway.endpointSSE = `http://${host}:${port}/sse`;
8889
status.gateway.endpointMessages = `http://${host}:${port}/message`;
90+
status.gateway.endpointMcp = `http://${host}:${port}/mcp`;
8991
} catch {
9092
// Server might be starting up or not responding
9193
status.gateway.endpointSSE = 'http://localhost:9095/sse (not responding)';
9294
status.gateway.endpointMessages = 'http://localhost:9095/message (not responding)';
95+
status.gateway.endpointMcp = 'http://localhost:9095/mcp (not responding)';
9396
}
9497
}
9598
}
@@ -144,8 +147,9 @@ async function displayStatus(status: any, verbose: boolean, _compare: boolean =
144147
['Status', status.gateway.running ? chalk.green('Running') : chalk.red('Stopped')],
145148
['PID', status.gateway.pid || chalk.gray('N/A')],
146149
['Uptime', status.gateway.uptime ? formatUptime(status.gateway.uptime) : chalk.gray('N/A')],
147-
['Endpoint SSE', status.gateway.endpointSSE || chalk.gray('N/A')],
148-
['Endpoint Messages', status.gateway.endpointMessages || chalk.gray('N/A')]
150+
['SSE Endpoint', status.gateway.endpointSSE || chalk.gray('N/A')],
151+
['Messages', status.gateway.endpointMessages || chalk.gray('N/A')],
152+
['MCP Endpoint', status.gateway.endpointMcp || chalk.gray('N/A')]
149153
);
150154

151155
console.log(gatewayTable.toString());

0 commit comments

Comments
 (0)