Arcane-Fly/disco
If you are the rightful owner of disco and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
Disco is an MCP server that integrates with ChatGPT and WebContainers, providing a development environment within the browser.
Disco - MCP Server with WebContainer Integration
MCP (Model Control Plane) server that integrates with ChatGPT through Railway deployment. The solution leverages WebContainers technology to provide a complete development environment within the browser, enabling complex coding tasks, repository interactions, and advanced tool usage directly from ChatGPT.
๐ Quick Start
Local Development
-
Clone and install dependencies:
git clone <your-repo-url> cd disco npm install
-
Set up environment:
cp .env.example .env # Edit .env with your configuration
-
Build and run:
npm run build npm start
-
Test the server:
curl http://localhost:3000/health curl http://localhost:3000/capabilities
Railway Deployment
-
Install Railway CLI:
npm install -g @railway/cli
-
Deploy to Railway:
railway login railway create mcp-server railway variables set JWT_SECRET=$(openssl rand -base64 32) railway variables set WEBCONTAINER_API_KEY=your-key railway variables set ALLOWED_ORIGINS="https://chat.openai.com" railway add redis railway up
See for detailed deployment instructions.
๐ Features
- โ Railway-compliant deployment with proper port binding and environment handling
- โ WebContainer integration with pooling and auto-cleanup
- โ JWT authentication with token refresh and validation
- โ Complete REST API for all MCP operations
- โ File system operations with security validation
- โ Terminal operations with streaming support
- โ Git integration for repository operations
- โ Real-time collaboration with multi-user editing and WebSocket sync
- โ Health monitoring with metrics and probes
- โ Background worker for maintenance tasks
๐๏ธ Architecture
The MCP server provides a bridge between ChatGPT and WebContainer instances:
ChatGPT โ Railway-hosted MCP Server โ WebContainer Instance (Browser)
Key Components
- Server (
src/server.ts
): Main Express application - Container Manager (
src/lib/containerManager.ts
): WebContainer lifecycle management - API Routes (
src/api/
): RESTful endpoints for all operations - Worker (
src/worker.ts
): Background tasks and cleanup - Middleware (
src/middleware/
): Authentication, logging, error handling
๐ง API Documentation
The server provides a comprehensive REST API for:
- Authentication: JWT-based user authentication
- Container Management: Create, list, terminate containers
- File Operations: CRUD operations on files within containers
- Terminal Operations: Execute commands with streaming support
- Git Operations: Clone, commit, push, pull repositories
- Health Checks: Monitoring and diagnostics
See for complete API documentation.
๐ก๏ธ Security Features
- JWT Authentication: Secure token-based authentication
- CORS Protection: Configurable origin restrictions
- Rate Limiting: 100 requests/minute per user
- Input Validation: All inputs validated for security
- Container Isolation: Each user gets isolated environments
- Command Filtering: Dangerous commands blocked
๐ Monitoring & Validation
Railway Configuration Validation
The project includes a comprehensive Railway Configuration Validation Agent that automatically checks:
- Railway Configuration: Validates
railpack.json
, deployment settings, and build configuration - Environment Variables: Ensures all required variables are documented and properly configured
- Authentication & Security: Validates GitHub OAuth setup, CORS configuration, and security headers
- Domain Configuration: Confirms callback URLs and allowed origins for production deployment
Running Validation Locally
# Run all validations
npm run railway:check-all
# Individual validation checks
npm run railway:validate # Railway configuration
npm run railway:validate-env # Environment variables
npm run railway:validate-auth # Authentication & CORS
# Generate comprehensive report
npm run railway:report
Automated Validation
- GitHub Actions: Validation runs automatically on pushes and pull requests
- CI/CD Integration: Deployment blocked if critical validation errors are found
- PR Comments: Validation results automatically posted to pull requests
Health Endpoints
GET /health
- Basic health checkGET /health/ready
- Readiness probeGET /health/live
- Liveness probeGET /health/metrics
- Detailed metrics
Documentation Health
- Link Validation: All documentation links automatically checked weekly
- Broken Link Reports: GitHub Actions generate reports for broken links
- Documentation Registry: Centralized link management in
docs/references/
Logging
The server provides comprehensive logging for:
- Request/response cycles
- Container operations
- Authentication events
- Error conditions
๐ Background Tasks
The worker process handles:
- Container cleanup (inactive containers)
- Pool pre-warming (faster startup)
- Memory monitoring
- Health checks
โ ๏ธ Important Notes
WebContainer Limitations
WebContainer is designed to run in browser environments. The server provides the API interface, but actual WebContainer instances run client-side. The server includes mock implementations for development and testing.
Production Deployment
For production use:
- Set strong JWT secrets
- Configure proper CORS origins
- Set up Redis for session management
- Configure monitoring and alerts
- Review security settings
๐ Environment Variables
Variable | Required | Description |
---|---|---|
JWT_SECRET | Yes | Secret for JWT token signing |
WEBCONTAINER_API_KEY | Yes | StackBlitz WebContainer API key |
ALLOWED_ORIGINS | Yes | Comma-separated allowed origins |
REDIS_URL | No | Redis connection string |
GITHUB_CLIENT_ID | No | GitHub OAuth client ID |
GITHUB_CLIENT_SECRET | No | GitHub OAuth client secret |
๐งช Testing
# Run tests
npm test
# Lint code
npm run lint
# Build project
npm run build
๐ Documentation
- - Deployment guide
- - API documentation
- - Product requirements
๐ค Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
๐ License
MIT License - see LICENSE file for details.
๐ Support
For issues and questions:
- Check the deployment guide
- Review API documentation
- Check server logs
- Test health endpoints
- Open an issue on GitHub
Built with โค๏ธ for seamless ChatGPT integration with WebContainers.