SuperAPI AI Directory

Ilmar7786/marzban-sdk

MCP server component in the marzban-sdk repository, used to let AI agents manage the Marzban panel through the MCP protocol. Built on marzban-sdk, it provides 21 tools and 3 prompts, covering operations such as user lifecycle, subscriptions, nodes, hosts, system statistics, and core configuration, and can be accessed through MCP-compatible clients such as Claude Desktop, Claude Code, and Cursor. Credentials are provided only through environment variables, tools are exposed according to three configuration tiers: readonly, standard, and full, and destructive operations require secondary confirmation and have a retry deduplication mechanism.

Open website

About this tool

Purpose

This package is the MCP server implementation in the marzban-sdk monorepo, with the goal of letting AI agents directly operate the Marzban panel, not just read information. Users do not need to write custom integration code; they only need to add one entry to the MCP client configuration to manage the panel through Claude Desktop, Claude Code, Cursor, or other MCP-compatible clients.

Main capabilities

  • Provides 21 tools, named in the format marzban_<area>_<action>, divided into: users (11), configuration (5), system and nodes (3), subscriptions (2).
  • Provides 3 prompts: expiring_users_audit, node_diagnostics, traffic_report, which can chain multiple tools into ready-made investigation workflows.
  • Covers the complete user lifecycle, configuration, hosts, nodes, system statistics, and subscriptions.
  • Built on marzban-sdk, reusing its authentication, retry, and reconnection behavior.

Usage

Usually no manual installation is needed; the MCP client runs it through npx. A multi-architecture container image ilmar7786/marzban-mcp is also provided. Add the panel URL and administrator login information to the client MCP configuration; clients such as Claude Desktop, Claude Code, and Cursor read the same mcpServers configuration block, only the configuration file location differs. After restarting the client, the tools are available.

Security and restriction design

  • Credentials are provided only through environment variables: the panel URL, username, and password are not accepted as tool parameters, preventing the model from redirecting the server elsewhere.
  • Configuration tiers control tool visibility: readonly exposes only lists and queries; standard (default) adds complete user CRUD, renewal, and status changes; full adds destructive tools such as deletion, traffic reset, configuration rewrite, and core restart. Tools outside the tier do not appear in tools/list.
  • Destructive calls require confirmation: the first call only describes the consequences and returns a one-time token; a second call carrying the token is required to execute; one confirmation does not authorize different targets or broader-scope calls of the same kind. MARZBAN_MCP_CONFIRM can be set to auto (default, the same tool and exactly the same parameters within 5 minutes once), always (every call), or off (only for unattended environments).
  • Retry deduplication: repeating the same destructive call within 5 minutes returns the first recorded result and does not execute again; if the request was sent but no response was received, the result is explicitly reported as unknown, and it is recommended to use read-only tools to check the status rather than retry. Restarting the server clears this memory.
  • Credentials hidden by default: proxies, subscription_url, and links are hidden by default and must be explicitly enabled to be displayed.

Applicable scenarios

Suitable for users who have deployed a Marzban panel and want to perform user management, subscription queries, node diagnostics, traffic reports, and configuration operations through MCP-compatible AI clients.

Limitations and supplementary notes

Configuration items (tier, output format, verbosity, tool allow/deny filtering, log level, link hiding, etc.) are optional; see its configuration documentation for details. The complete setup guide and tool/prompt reference are located at ilmar7786.github.io/marzban-sdk. The project uses the MIT license.