Skip to main content
Glama

MCP Host Server

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

-
security - not tested
F
license - not found
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

A multi-tenant remote server platform that enables applications to connect to Model Context Protocol servers over WebSocket connections, allowing secure access to file management, database, and API capabilities.

  1. Features
    1. Architecture
      1. Quick Start
        1. Installation
        2. Configuration
        3. Development
        4. Production Deployment
      2. API Usage
        1. Authentication
        2. Create MCP Server
        3. Get Connection URL
      3. MCP Client Configuration
        1. Claude Desktop
        2. Custom MCP Client
      4. Available MCP Server Types
        1. File Manager
        2. Database
        3. API Client
        4. Custom
      5. Security Features
        1. Deployment on DigitalOcean
          1. App Platform
          2. Example App Spec
        2. Monitoring
          1. Health Check
          2. System Status
        3. Development
          1. Project Structure
          2. Adding New MCP Server Types
          3. Testing
        4. Contributing
          1. License
            1. Support

              Related MCP Servers

              • -
                security
                F
                license
                -
                quality
                A Model Context Protocol server that integrates with Cursor IDE, providing real-time communication, modern web dashboards, and extensible tools via SSE and WebSocket connections.
                Last updated -
                1,133
                1
                Python
              • -
                security
                A
                license
                -
                quality
                A Model Context Protocol server that enables seamless execution of commands, Python code, web content fetching, and reusable task management with secure credentials handling.
                Last updated -
                2
                Python
                MIT License
                • Apple
              • A
                security
                A
                license
                A
                quality
                A Model Context Protocol server that provides tools for managing providers, clients, tenants, and access tokens through the UseGrant platform.
                Last updated -
                26
                116
                JavaScript
                MIT License
              • -
                security
                A
                license
                -
                quality
                A Model Context Protocol server that enables users to create, check status, and get details of projects on Loveable.dev, a platform for quickly creating applications.
                Last updated -
                JavaScript
                ISC License
                • Apple

              View all related MCP servers

              MCP directory API

              We provide all the information about MCP servers via our MCP API.

              curl -X GET 'https://glama.ai/api/mcp/v1/servers/motionmavericks/mcp-server'

              If you have feedback or need assistance with the MCP directory API, please join our Discord server