Remote Deployment (Ops)
Remote Deployment (Ops)
Section titled “Remote Deployment (Ops)”The HTTP transport enables remote access to Workflow MCP with optional OAuth authentication.
Hosted Service
Section titled “Hosted Service”Users should connect to:
https://api.workflow-mcp.blackmesa.live/mcpRunning Your Own (Internal)
Section titled “Running Your Own (Internal)”# Installnpm install @blackmesa/workflow-mcp-http
# RunMCP_PORT=3000 npx @blackmesa/workflow-mcp-httpEnvironment Variables
Section titled “Environment Variables”| Variable | Default | Description |
|---|---|---|
PORT | 3000 | Server port (Render/Heroku standard) |
MCP_PORT | 3000 | Server port (fallback) |
MCP_HOST | 0.0.0.0 | Bind address |
MCP_BASE_PATH | /mcp | MCP endpoint path |
MCP_WORKSPACE_DIR | cwd | Session file directory |
CORS_ORIGINS | * | Allowed origins |
MCP_OAUTH_ENABLED | false | Enable GitHub OAuth |
GITHUB_CLIENT_ID | - | OAuth client ID |
GITHUB_CLIENT_SECRET | - | OAuth secret |
Endpoints
Section titled “Endpoints”| Method | Path | Description |
|---|---|---|
POST | /mcp | Main request handler |
GET | /mcp | SSE stream for notifications |
DELETE | /mcp | Session termination |
GET | /health | Health check |
Connecting from a Client
Section titled “Connecting from a Client”import { Client } from '@modelcontextprotocol/sdk/client/index.js';import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
const transport = new StreamableHTTPClientTransport( new URL('https://your-server.com/mcp'));
const client = new Client({ name: 'my-client', version: '1.0.0' });await client.connect(transport);OAuth Authentication
Section titled “OAuth Authentication”When MCP_OAUTH_ENABLED=true, the server requires a valid GitHub access token:
const transport = new StreamableHTTPClientTransport( new URL('https://your-server.com/mcp'), { requestInit: { headers: { 'Authorization': `Bearer ${githubAccessToken}` } } });Setting Up GitHub OAuth
Section titled “Setting Up GitHub OAuth”- Create a GitHub OAuth App at https://github.com/settings/developers
- Set callback URL to your server
- Copy Client ID and Secret
- Set environment variables:
Terminal window MCP_OAUTH_ENABLED=trueGITHUB_CLIENT_ID=your_client_idGITHUB_CLIENT_SECRET=your_client_secret
Session Management
Section titled “Session Management”Sessions are stored in memory with automatic cleanup:
- Sessions expire after 1 hour of inactivity
- Cleanup runs every minute
- Session count available via
/healthendpoint
Production Considerations
Section titled “Production Considerations”Scaling
Section titled “Scaling”The HTTP server is stateful (sessions in memory). For horizontal scaling:
- Use sticky sessions/session affinity
- Or implement a shared session store (Redis)
Workspace Directory
Section titled “Workspace Directory”Set MCP_WORKSPACE_DIR to a persistent volume:
MCP_WORKSPACE_DIR=/data/workflowFor browser-based clients, configure allowed origins:
CORS_ORIGINS=https://app.example.com,https://admin.example.com