Skip to content

Remote Deployment (HTTP/SSE)

Remote mode runs ByteMCP as an HTTP server with Server-Sent Events (SSE) for MCP communication.

AI Assistant ←→ HTTP/SSE ←→ ByteMCP Server ←→ Database
└── https://mcp.example.com/sse
DB_HOST=your_db_host
DB_DATABASE=bytefederal
DB_USER=your_user
DB_PASSWORD=your_password
MCP_MODE=remote
PORT=3000
Terminal window
npm run start:remote
# Or with environment variable
MCP_MODE=remote npm start
Terminal window
curl http://localhost:3000/health

Response:

{
"status": "ok",
"version": "1.0.0",
"mode": "remote"
}
EndpointMethodDescription
/healthGETHealth check
/sseGETSSE connection endpoint
/ssePOSTJSON-RPC tool calls
/mcpPOSTAlternative JSON-RPC endpoint
/.well-known/mcp-serverGETMCP discovery
/api/docsGETOpenAPI documentation

MCP clients connect via SSE for real-time communication:

const eventSource = new EventSource('https://mcp.example.com/sse');
eventSource.onmessage = (event) => {
const data = JSON.parse(event.data);
console.log('Received:', data);
};

The server allows requests from:

  • https://bytefederal.com
  • http://localhost:3000
  • http://localhost:4321
  • *.anthropic.com
  • *.claude.ai

To add additional origins, modify remoteServer.ts.

Default limits:

  • General: 10 requests/second
  • SSE: 5 connections/second

Configured in nginx or application level.

For production process management:

Terminal window
# Start with PM2
pm2 start ecosystem.config.js
# Or manually
MCP_MODE=remote PORT=3000 pm2 start dist/index.js --name bytemcp
# Save configuration
pm2 save
pm2 startup
module.exports = {
apps: [{
name: 'bytemcp',
script: 'dist/index.js',
env: {
MCP_MODE: 'remote',
PORT: 3000
},
error_file: './logs/err.log',
out_file: './logs/out.log'
}]
};

For production, always use HTTPS. Options:

Use nginx with Let’s Encrypt:

Terminal window
sudo ./scripts/setup-nginx.sh

Configure SSL certificates in the application:

SSL_CERT=/path/to/cert.pem
SSL_KEY=/path/to/key.pem
Terminal window
curl https://mcp.example.com/health
Terminal window
curl -X POST https://mcp.example.com/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "find_nearest_bitcoin_atm",
"arguments": {
"location": "Miami, FL",
"limit": 5
}
}
}'