motionmavericks/mcp-server
3.3
If you are the rightful owner of mcp-server 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.
The MCP Host Server is a multi-tenant remote server platform designed for hosting and managing Model Context Protocol (MCP) servers, optimized for deployment on DigitalOcean.
MCP Host Server
A multi-tenant remote MCP (Model Context Protocol) server hosting platform built for DigitalOcean deployment. This server allows multiple applications to connect to and use various MCP servers remotely over WebSocket connections.
Features
- šļø Multi-tenant Architecture: Isolated MCP servers for different tenants
- š Secure Authentication: JWT-based authentication with role-based access
- š Remote Access: WebSocket-based connections for remote MCP usage
- š Management API: RESTful API for server management
- š”ļø Security: Rate limiting, input validation, CORS protection
- š Scalable: Designed for cloud deployment on DigitalOcean
Architecture
āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāā
ā MCP Client ā ā MCP Client ā ā MCP Client ā
ā (Claude, etc.) ā ā (API App) ā ā (Custom) ā
āāāāāāāāāāā¬āāāāāāāā āāāāāāāāāāā¬āāāāāāāā āāāāāāāāāāā¬āāāāāāāā
ā ā ā
āāāāāāāāāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāāāāāāāā
ā WebSocket Connections
āāāāāāāāāāāāāā¼āāāāāāāāāāāāā
ā MCP Host Server ā
ā āāāāāāāāāāāāāāāāāāā ā
ā ā Tenant A ā ā
ā ā ā File Server ā ā
ā ā ā DB Server ā ā
ā ā ā API Server ā ā
ā āāāāāāāāāāāāāāāāāā⤠ā
ā ā Tenant B ā ā
ā ā ā Custom Server ā ā
ā ā ā File Server ā ā
ā āāāāāāāāāāāāāāāāāāā ā
āāāāāāāāāāāāāāāāāāāāāāāāāāā
Quick Start
1. Installation
# Clone the repository
git clone https://github.com/motionmavericks/mcp-server.git
cd mcp-server
# Install dependencies
npm install
# Copy environment file
cp .env.example .env
2. Configuration
Edit .env
file with your settings:
PORT=3000
JWT_SECRET=your_secret_here
ALLOWED_ORIGINS=https://yourdomain.com
ADMIN_PASSWORD=YourSecurePassword123!
3. Development
# Start in development mode
npm run dev
# Or start normally
npm start
4. Production Deployment
# Set environment to production
export NODE_ENV=production
# Start the server
npm start
API Usage
Authentication
# Login
curl -X POST http://localhost:3000/api/auth/login \
-H "Content-Type: application/json" \
-d '{"email": "admin@mcp.mvrx.com.au", "password": "SecureMCP2024!"}'
Create MCP Server
# Create a file manager server
curl -X POST http://localhost:3000/api/servers \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "My File Server",
"type": "file-manager",
"description": "File management MCP server"
}'
Get Connection URL
# Get WebSocket connection URL for MCP client
curl -X POST http://localhost:3000/api/servers/SERVER_ID/connect \
-H "Authorization: Bearer YOUR_TOKEN"
MCP Client Configuration
Claude Desktop
Add to your claude_desktop_config.json
:
{
"mcpServers": {
"remote-file-server": {
"command": "node",
"args": ["path/to/mcp-websocket-client.js"],
"env": {
"MCP_SERVER_URL": "ws://mcp.mvrx.com.au:3001/mcp-ws?tenant=TENANT_ID&server=SERVER_ID&token=CONNECTION_TOKEN"
}
}
}
}
Custom MCP Client
import { WebSocket } from 'ws';
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
const ws = new WebSocket('ws://mcp.mvrx.com.au:3001/mcp-ws?tenant=TENANT_ID&server=SERVER_ID&token=CONNECTION_TOKEN');
const client = new Client({ name: 'my-app', version: '1.0.0' }, { capabilities: {} });
await client.connect(new WebSocketClientTransport(ws));
// Use MCP tools
const tools = await client.listTools();
console.log('Available tools:', tools);
Available MCP Server Types
File Manager
read_file
: Read file contentswrite_file
: Write file contentslist_files
: List directory contents
Database
query_database
: Execute SQL queries
API Client
api_request
: Make HTTP API requests
Custom
- Define your own tools and resources
Security Features
- JWT Authentication: Secure token-based authentication
- Rate Limiting: Prevents abuse and DoS attacks
- Input Validation: Sanitizes all inputs
- CORS Protection: Configurable cross-origin policies
- Security Headers: Helmet.js security headers
- Request Logging: Comprehensive audit logging
Deployment on DigitalOcean
App Platform
- Create new app from GitHub repository
- Set environment variables in App Platform dashboard
- Configure custom domain (optional)
- Deploy!
Example App Spec
name: mcp-host-server
services:
- name: api
source_dir: /
github:
repo: motionmavericks/mcp-server
branch: main
run_command: npm start
environment_slug: node-js
instance_count: 2
instance_size_slug: apps-s-1vcpu-1gb
http_port: 3000
envs:
- key: NODE_ENV
value: production
- key: JWT_SECRET
value: YOUR_SECRET
- key: ALLOWED_ORIGINS
value: https://mcp.yourdomain.com
Monitoring
Health Check
curl http://localhost:3000/health
System Status
curl -H "Authorization: Bearer TOKEN" \
http://localhost:3000/api/status
Development
Project Structure
src/
āāā config/ # Configuration management
āāā middleware/ # Express middleware
āāā routes/ # API routes
āāā services/ # Business logic
āāā utils/ # Utilities
Adding New MCP Server Types
- Extend
MCPServerManager.registerServerTools()
- Add new tool handlers
- Update validation in API routes
- Add tests
Testing
npm test
Contributing
- Fork the repository
- Create feature branch (
git checkout -b feature/new-feature
) - Commit changes (
git commit -am 'Add new feature'
) - Push to branch (
git push origin feature/new-feature
) - Create Pull Request
License
MIT License - see LICENSE file for details.
Support
- GitHub Issues: https://github.com/motionmavericks/mcp-server/issues
- Documentation: https://github.com/motionmavericks/mcp-server/wiki
- Email: