MCP Server Control

MCP Server Control

A production-grade MCP server that lets AI cloud services control and manage your Linux server securely via HTTP/SSE.

Category
Visit Server

README

MCP Server Control šŸ–„ļø

A production-grade MCP (Model Context Protocol) server that lets AI cloud services (Claude, ChatGPT, Gemini, Cursor, etc.) control and manage your Linux server securely via HTTP/SSE.

✨ Features

  • 20 MCP Tools — run commands, manage files, control services, manage users & SSH keys
  • 10 Security Layers — API key + JWT tokens + IP whitelist + rate limiting + audit logs + command blacklist + path sandboxing + HTTPS + Helmet + CORS
  • Role-Based Access — admin gets full control; user is sandboxed to their home directory
  • Per-User API Keys — issue scoped keys for different users/services
  • Audit Logging — every tool call logged with user, IP, duration, result (daily rotating JSON)
  • systemd Ready — auto-start on boot

šŸš€ Quick Start

# 1. Clone
git clone https://github.com/MarketingLimited/mcp-server-control.git
cd mcp-server-control

# 2. Install dependencies
npm install

# 3. Setup (generates secrets, .env, optional TLS cert)
node setup.js

# 4. Start
npm start

# 5. Or run as system service
cp mcp-server.service /etc/systemd/system/
systemctl enable --now mcp-server

šŸ”— Connect Your AI Client

Claude Desktop

{
  "mcpServers": {
    "server-control": {
      "type": "sse",
      "url": "http://YOUR_SERVER_IP:4444/mcp",
      "headers": { "X-API-Key": "YOUR_ADMIN_KEY" }
    }
  }
}

Cursor / VS Code

{
  "mcpServers": {
    "server-control": {
      "url": "http://YOUR_SERVER_IP:4444/mcp",
      "type": "sse",
      "headers": { "X-API-Key": "YOUR_ADMIN_KEY" }
    }
  }
}

šŸ› ļø Available Tools

Category Tools
System run_command, get_system_info, get_processes, kill_process
Files read_file, write_file, delete_file, list_directory, move_file, copy_file, get_file_info, search_files
Services manage_service, get_service_status, list_services, get_journal_logs, manage_firewall
Users list_users, get_user_info, create_user, delete_user, set_user_password, modify_user, manage_ssh_keys

šŸ” Security Architecture

AI Client → HTTPS → IP Whitelist → API Key/JWT → Rate Limit → Scope Check → Sandbox → Tool
Layer Details
HTTPS/TLS TLS 1.2+ with strong cipher suites
IP Whitelist Per-key or global CIDR restrictions
API Key 64-byte cryptographically random hex keys
JWT Tokens IP-bound, 8h expiry, issued per-session
Rate Limiting 60 req/min global, 10/15min auth
Command Guard Blacklist of destructive patterns
Path Sandbox Users restricted to /home/{username}
Audit Logs Structured JSON, 30-day retention

šŸ“ Project Structure

ā”œā”€ā”€ server.js              # Main MCP server (Express + SSE)
ā”œā”€ā”€ security.js            # All auth & security middleware
ā”œā”€ā”€ audit.js               # Structured audit logging
ā”œā”€ā”€ keygen.js              # API key generator
ā”œā”€ā”€ setup.js               # First-time setup wizard
ā”œā”€ā”€ mcp-server.service     # systemd unit file
ā”œā”€ā”€ .env.example           # Config template
└── tools/
    ā”œā”€ā”€ system.js          # Shell commands, processes, system info
    ā”œā”€ā”€ files.js           # File system CRUD
    ā”œā”€ā”€ services.js        # systemd & firewall management
    └── users.js           # User & SSH key management

āš™ļø Configuration

Copy .env.example to .env and configure:

PORT=4444
USE_HTTPS=true
JWT_SECRET=<64-byte random hex>
ADMIN_API_KEY=<generated with keygen.js>
ALLOWED_IPS=203.0.113.10,192.168.1.0/24   # optional
RATE_LIMIT_MAX_REQUESTS=60
AUDIT_LOG_KEEP_DAYS=30

šŸ”‘ Generate API Keys

# Generate admin key
node keygen.js admin admin

# Generate scoped user key
node keygen.js alice user run_command,read_file,write_file

šŸ“Š Monitor

# Live audit log
tail -f logs/audit-$(date +%Y-%m-%d).log | jq

# View active sessions
curl http://localhost:4444/admin/sessions -H "X-API-Key: YOUR_KEY"

# Health check
curl http://localhost:4444/health

Requirements

  • Node.js 18+
  • Linux (systemd-based)
  • openssl (for HTTPS)
  • Root or sudo for full admin tools

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured