home / mcp / railway mcp server
Day5: APIs from Remote MCP - WebSocket MCP server for Railway deployment
Configuration
View docs{
"mcpServers": {
"bizuayeu-day5-api-remote-mcp": {
"url": "https://testday5-production.up.railway.app/mcp",
"headers": {
"GOOGLE_SERVICE_ACCOUNT_KEY": "YOUR_JSON_KEY_OR_PATH"
}
}
}
}You deploy a remote MCP server to enable Claude Web to perform Google Docs operations over HTTP/WebSocket, making it accessible from web clients while using a server-side service account for authentication. This setup lets you orchestrate document tasks remotely and scale across multiple clients or accounts.
Use a remote MCP server to perform Google Docs actions from Claude Web or other MCP clients. Connect via an HTTP endpoint for MCP protocol and optionally receive real-time updates through WebSocket. Start by configuring a custom connector in Claude Web that points to your remote MCP URL, then issue MCP tool calls to manage documents (create, list, update, etc.). The server handles authentication with a service account and enforces security and rate limits.
Prerequisites: install Node.js and npm on your development machine.
# Install dependencies (example)
npm installClone the project repository and install dependencies, then start the server in production mode or development mode as needed.
git clone https://example.com/day5-api-remote-mcp.git
cd day5-api-remote-mcp
npm install
# Development run
npm run dev
# Production run (build + start)
npm run build
npm run startEnsure you configure environment variables for Google service account access before starting the server.
Configuration discusses how the server is exposed and how to connect clients. The MCP server exposes an HTTP endpoint for protocol requests and an optional WebSocket endpoint for real-time updates. The remote API relies on a service account to authorize Google Docs operations.
Security considerations include managing API keys and service account credentials securely, applying rate limiting, configuring CORS, and validating all inputs with proper schemas.
Deployment options include Vercel for serverless deployment, Railway for full-stack hosting, or Docker for containerized deployment. Choose the option that best fits your scaling and operational needs.
Troubleshooting hints: check health endpoints, verify IAM scopes for the service account (docs and drive), inspect logs for MCP endpoint requests, and confirm the Claude Web Custom Connector is correctly configured with your remote MCP URL.
The MCP server provides HTTP endpoints and optional WebSocket channels to support both batch and real-time operations.
# MCP HTTP endpoint
POST /mcp
# WebSocket endpoint (optional)
WS /wsUse environment variables to protect secrets and rotate keys regularly. Apply per-client access controls and rate limits to guard against abuse. Validate all inputs with strong schemas to prevent invalid or harmful requests.
Fetches the current time from the system or environment to timestamp actions.
Echoes a message back to the caller, useful for basic testing of the MCP channel.
Performs simple arithmetic calculations requested by clients.
Creates a new Google Docs document with a given title on the remote Google Drive.
Writes content to a specified Google Docs document.
Lists documents that match certain criteria and supports iterating over results.
Records learning or action logs into a centralized repository for EpisodicRAG.