MCP Ops Toolkit
A self-hosted MCP operations gateway for Linux control hosts, enabling safe filesystem and Git operations, authenticated HTTP transport, and optional SSH/SFTP and infrastructure adapters.
README
MCP Ops Toolkit
中文说明 | English
A self-hosted Model Context Protocol (MCP) operations gateway for Linux control hosts. It provides a compact tool surface for safe filesystem and Git operations, authenticated HTTP transport, ChatGPT attachment upload, native file reading, SSH/SFTP adapters, and optional infrastructure integrations.
Security warning: this project can expose highly privileged operations. The unrestricted root-shell path is disabled by default. Audit the code, keep the service on loopback behind an authenticated reverse proxy or tunnel, use a dedicated Unix account, and allowlist every privileged bridge.
Highlights
- Compact FastMCP facade designed to keep tool discovery manageable.
- Constant-time Bearer or
X-API-Keyauthentication for Streamable HTTP. - Atomic binary attachment upload with size limits, SHA-256 verification, overwrite protection, and backup support.
- Native MCP text, image, and blob responses for local files.
- Structured filesystem, Git, Python, Node, and npm operations through a root-owned bridge.
- Persistent SSH sessions, argv-based remote execution, terminal I/O, and SFTP-style transfer through an external allowlisted bridge.
- Optional Azure, Cloudflare, control-plane, and encrypted secret-broker adapters.
- Optional full root shell with bounded runtime, bounded output files, output paging, and explicit opt-in.
Repository layout
compact_app.py: the compact public MCP tool surface.http_server.py: authenticated Streamable HTTP entrypoint.mcp_main.py: stdio entrypoint.safe_ops.py/safe_ops_bridge.py: structured local operations.file_content.py: native MCP file responses.server.py: control-plane and optional root-shell implementation.azure_tools.py,cloudflare_tools.py,ssh_tools.py,secret_tools.py: optional bridge adapters.deploy/systemd/: generic systemd and sudoers examples.
Quick start
git clone https://github.com/gaojiefengxswhuhit/mcp-ops-toolkit.git
cd mcp-ops-toolkit
python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
export MCP_OPS_ACCESS_TOKEN="$(python3 -c 'import secrets; print(secrets.token_urlsafe(48))')"
python http_server.py
The default listener is 127.0.0.1:8792; /healthz is unauthenticated and all MCP routes require the access token. For stdio transport, run python mcp_main.py.
Privileged bridges
The MCP process should run as an unprivileged account. Privileged operations call narrowly named, root-owned executables under /usr/local/sbin/. The repository includes the safe-operations bridge and the optional root-shell bridge. Azure, Cloudflare, SSH, and secret-broker adapters define JSON or argv contracts, but their deployment-specific credential and host-resolution implementations are intentionally not included.
Expected bridge paths can be changed in source or wrapped with stable symlinks:
/usr/local/sbin/mcp-ops-toolkit-safe-ops
/usr/local/sbin/mcp-ops-toolkit-root-shell
/usr/local/sbin/mcp-ops-toolkit-azure-cli
/usr/local/sbin/mcp-ops-toolkit-cloudflare
/usr/local/sbin/mcp-ops-toolkit-ssh-bridge
/usr/local/sbin/mcp-ops-toolkit-secret-broker
Security defaults
- The HTTP server binds to loopback by default.
- DNS-rebinding protection is enabled.
- Allowed hosts and origins are configured through environment variables.
- Full root shell is disabled unless
MCP_OPS_ENABLE_FULL_SHELL=1. - File reads use allowlisted roots and deny common key and secret locations.
- Uploaded files are copied atomically and verified after the copy.
- Real tokens, host aliases, private domains, account identifiers, and credentials must stay outside Git.
See SECURITY.md before production use.
Tests
python -m compileall -q .
python test_server_contract.py server.py
python test_compact_contract.py .
License
MIT
Recommended Servers
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.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.