Sponsored by Deepsite.site

MCP Host Server

Created By
motionmavericks7 months ago
Multi-tenant remote MCP server hosting platform for DigitalOcean
Content

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 contents
  • write_file: Write file contents
  • list_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

  1. Create new app from GitHub repository
  2. Set environment variables in App Platform dashboard
  3. Configure custom domain (optional)
  4. 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

  1. Extend MCPServerManager.registerServerTools()
  2. Add new tool handlers
  3. Update validation in API routes
  4. Add tests

Testing

npm test

Contributing

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/new-feature)
  3. Commit changes (git commit -am 'Add new feature')
  4. Push to branch (git push origin feature/new-feature)
  5. Create Pull Request

License

MIT License - see LICENSE file for details.

Support

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
ChatWiseThe second fastest AI chatbotโ„ข
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Baidu Map็™พๅบฆๅœฐๅ›พๆ ธๅฟƒAPI็Žฐๅทฒๅ…จ้ขๅ…ผๅฎนMCPๅ่ฎฎ๏ผŒๆ˜ฏๅ›ฝๅ†…้ฆ–ๅฎถๅ…ผๅฎนMCPๅ่ฎฎ็š„ๅœฐๅ›พๆœๅŠกๅ•†ใ€‚
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
WindsurfThe new purpose-built IDE to harness magic
DeepChatYour AI Partner on Desktop
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Serper MCP ServerA Serper MCP Server
Amap Maps้ซ˜ๅพทๅœฐๅ›พๅฎ˜ๆ–น MCP Server
Howtocook McpๅŸบไบŽAnduin2017 / HowToCook ๏ผˆ็จ‹ๅบๅ‘˜ๅœจๅฎถๅš้ฅญๆŒ‡ๅ—๏ผ‰็š„mcp server๏ผŒๅธฎไฝ ๆŽจ่่œ่ฐฑใ€่ง„ๅˆ’่†ณ้ฃŸ๏ผŒ่งฃๅ†ณโ€œไปŠๅคฉๅƒไป€ไนˆโ€œ็š„ไธ–็บช้šพ้ข˜๏ผ› Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Tavily Mcp
Playwright McpPlaywright MCP server
CursorThe AI Code Editor
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.