Advanced Architecture2026-07-202 min read

Remote MCP Server – Run MCP Anywhere

Comprehensive guide to deploying MCP servers remotely using SSE, Streamable HTTP, and cloud platforms like AWS, Azure, and GCP.

Deployment guidesCloud provider examples

Remote MCP servers run as HTTP services accessible from any client, enabling centralized management and multi-user access.

Transport Options

  • SSE (Server-Sent Events): Traditional remote transport with bidirectional communication
  • Streamable HTTP: Modern, stateless transport that works well with cloud load balancers

SSE Transport Example

SSEServerTransport is now marked deprecated in the official SDK in favor of Streamable HTTP, but it's still in wide use and worth knowing. Unlike the local StdioServerTransport, it's tied to one specific HTTP response per client connection — you create a new transport inside the request handler that opens the SSE stream, not once at server startup.

import express from "express";
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { SSEServerTransport } from "@modelcontextprotocol/sdk/server/sse.js";

const server = new Server(
  { name: "remote-mcp-server", version: "1.0.0" },
  { capabilities: { tools: {} } }
);

const app = express();
const transports = new Map();

app.get("/mcp/sse", async (req, res) => {
  const transport = new SSEServerTransport("/mcp/messages", res);
  transports.set(transport.sessionId, transport);
  res.on("close", () => transports.delete(transport.sessionId));
  await server.connect(transport);
});

app.post("/mcp/messages", express.json(), async (req, res) => {
  const sessionId = req.query.sessionId as string;
  const transport = transports.get(sessionId);
  if (!transport) {
    res.status(400).send("No transport found for sessionId");
    return;
  }
  await transport.handlePostMessage(req, res, req.body);
});

app.listen(3000);

The GET endpoint opens the long-lived SSE stream and hands the transport a session ID; every subsequent client-to-server message arrives as a separate POST carrying that same sessionId, routed to the matching transport via handlePostMessage.

Cloud Deployment

Deploy to AWS ECS, Azure App Service, or GCP Cloud Run with proper TLS and authentication.

Production Checklist

  • Use TLS 1.3 with valid certificates
  • Implement proper authentication (OAuth or API keys)
  • Configure health check endpoints
  • Set up monitoring and logging

Join the Discussion

Discussion (0)

Y

No comments yet. Be the first to share your thoughts!