Sandbox
@1Panel-dev/mcp-1panel

MCP server for 1Panel admin tools

This repo provides an MCP server that exposes 1Panel actions as tools an agent can call. It supports stdio for local clients and streamable HTTP with TLS and token-based auth.

167 stars26 forksGoUpdated 1mo ago
Who it's for

Builders who want their agent to manage a 1Panel instance through MCP.

What it delivers

You can ask your agent to check 1Panel status, create sites, manage certificates, and work with databases without leaving the chat.

What it does

System and dashboard tools

Returns dashboard status and system information through MCP tools like `get_dashboard_info` and `get_system_info`.

Website management

Lists existing websites and can create new ones with `list_websites` and `create_website`.

SSL certificate management

Lists certificates and creates new ones with `list_ssls` and `create_ssl`.

Database management

Lists databases and creates databases through `list_databases` and `create_database`.

Application install tools

Exposes install actions such as `install_openresty` and `install_mysql` when access level is `full`.

Transport and TLS support

Runs over stdio or streamable HTTP, and can generate a local CA and server certificate for HTTPS.

Access control

Uses `readonly`, `readwrite`, and `full` access levels so disallowed tools are not exposed to the client.

How to get it

  1. 1Clone the repository
    git clone https://github.com/1Panel-dev/mcp-1panel.git
    cd mcp-1panel
  2. 2Build the project
    make build
  3. 3Run
    go install github.com/1Panel-dev/mcp-1panel@latest
  4. 4mcp-1panel can create and persist its own local CA and HTTPS server certificate. It does…
    MCP_AUTH_TOKEN=<strong random MCP token> \
    PANEL_HOST=<your 1Panel access address> \
    PANEL_ACCESS_TOKEN=<your 1Panel access token> \
    mcp-1panel \
      -transport streamable-http \
      -addr "https://127.0.0.1:8000/mcp" \
      -tls-hosts "localhost,127.0.0.1"

README

1Panel MCP Server

1Panel MCP Server is an implementation of the Model Context Protocol (MCP) server for 1Panel.

Installation

Prerequisites

  • Go 1.25.0 or higher
  • Existing 1Panel

Build from Source

  1. Clone the repository:

    git clone https://github.com/1Panel-dev/mcp-1panel.git
    cd mcp-1panel
    
  2. Build the project:

    make build
    

    Move ./build/mcp-1panel to the system environment path.

Install using go install

go install github.com/1Panel-dev/mcp-1panel@latest

Usage

Cursor and Windsurf configuration example:

stdio mode

{
  "mcpServers": {
    "mcp-1panel": {
      "command": "mcp-1panel",
      "env": {
        "PANEL_ACCESS_TOKEN": "<your 1Panel access token>",
        "PANEL_HOST": "such as http://localhost:8080"
      }
    }
  }
}

Streamable HTTP with standalone TLS

mcp-1panel can create and persist its own local CA and HTTPS server certificate. It does not depend on 1Panel certificate management.

MCP_AUTH_TOKEN=<strong random MCP token> \
PANEL_HOST=<your 1Panel access address> \
PANEL_ACCESS_TOKEN=<your 1Panel access token> \
mcp-1panel \
  -transport streamable-http \
  -addr "https://127.0.0.1:8000/mcp" \
  -tls-hosts "localhost,127.0.0.1"

On first startup, the server writes the CA path and SHA-256 fingerprint to stderr. Configure the MCP client to trust the generated ca.crt; do not disable certificate verification. The CA is reused while the server certificate is renewed automatically.

HTTP transports require an MCP authentication token by default. Clients must send it on every request as Authorization: Bearer <token>; the private X-MCP-Token header is not accepted. This is a pre-shared token mode intended for a single-user/private deployment, not the MCP OAuth authorization flow. Put the server behind an OAuth-capable gateway when standards-based multi-user authorization is required.

Use stdio for local desktop clients when possible. Non-loopback listeners require an https:// address, -allow-remote-http, a token, explicit certificate SANs, and an appropriate Origin allowlist.

Access levels

The server defaults to readonly. Tool permissions are enforced when tools are registered, so disallowed tools are not returned by tools/list and cannot be called directly.

LevelTools
readonlyQueries, lists, and status reads
readwritereadonly plus existing website, certificate, and database creation tools
fullreadwrite plus existing application installation tools

Set the level with -access-level or MCP_ACCESS_LEVEL. Command-line configuration takes precedence.

Command Line Options

  • -token: 1Panel access token; prefer PANEL_ACCESS_TOKEN to avoid exposing secrets in process lists
  • -host: 1Panel access address; prefer PANEL_HOST for environment-based configuration
  • -transport: Transport type (stdio or streamable-http; default: stdio)
  • -addr: Base URL for HTTP transports (default: http://127.0.0.1:8000)
  • -mcp-token: Pre-shared Bearer token for HTTP transports
  • -allowed-origins: Comma-separated Origin allowlist for HTTP transports
  • -allow-insecure-http: Allow unauthenticated HTTP transports; only use for local development
  • -allow-remote-http: Allow HTTPS transports to listen on non-loopback addresses
  • -access-level: Tool access level (readonly, readwrite, or full; default: readonly)
  • -tls-dir: Directory for the local CA and HTTPS server certificate
  • -tls-hosts: Comma-separated DNS names and IP addresses for the HTTPS server certificate

Environment Variables

You can also configure the server using environment variables:

  • PANEL_HOST: 1Panel access address
  • PANEL_ACCESS_TOKEN: 1Panel access token
  • MCP_AUTH_TOKEN: Pre-shared Bearer token for streamable-http
  • MCP_ACCESS_LEVEL: Tool access level (readonly, readwrite, or full)

Available Tools

The server provides various tools for interacting with 1Panel:

ToolCategoryMinimum accessDescription
get_dashboard_infoSystemreadonlyList dashboard status
get_system_infoSystemreadonlyGet system information
list_websitesWebsitereadonlyList all websites
create_websiteWebsitereadwriteCreate a website
list_sslsCertificatereadonlyList all certificates
create_sslCertificatereadwriteCreate a certificate
list_installed_appsApplicationreadonlyList all installed applications
install_openrestyApplicationfullInstall OpenResty
install_mysqlApplicationfullInstall MySQL
list_databasesDatabasereadonlyList all databases
create_databaseDatabasereadwriteCreate a database

Files in the repo

Repository payload16 top-level entries
  • .github
  • docs
  • operations
  • utils
  • .gitignore
  • access_test.go
  • access.go
  • go.mod
  • go.sum
  • LICENSE
  • main_test.go
  • main.go
  • Makefile
  • README.md
  • tls_test.go
  • tls.go

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More connectors

High-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.

43k

Universal provider proxy for OpenAI Codex & Claude Code — use any LLM (Claude, Gemini, Grok, DeepSeek, Ollama…) with Codex CLI, App, SDK, and Claude Code

14k
okf-memory/
okf-agent-memory

Git-native persistent memory for AI coding agents. Implements Google OKF v0.2 with sub-300µs in-memory BM25 search, embedded MCP server, and progressive disclosure. Slashes token bloat by 80% with zero external databases or dependencies. Built in pure Go.

547
tirth8205/
code-review-graph

Local-first code intelligence graph for MCP and CLI. Builds a persistent map of your codebase so AI coding tools read only what matters, with benchmarked context reductions on reviews and large-repo workflows.

31k
2akouwu/
reverify

Stop your AI from making things up — it proposes, deterministic tools decide, every claim checked against ground truth with evidence. Grounded facts and context survive resets. Reverse engineering is the proving ground. MCP server + CLI.

1.1k
t8y2/dbxConnectors

20 MB lightweight cross-platform database client for 90+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 90+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP Server。

19k