Magg: A meta-MCP server that acts as a universal hub, allowing LLMs to autonomously discover, install, and orchestrate multiple MCP servers - essentially giving AI assistants the power to extend their own capabilities on-demand.
A Model Context Protocol server that manages, aggregates, and proxies other MCP servers, enabling LLMs to dynamically extend their own capabilities.
Magg is a meta-MCP server that acts as a central hub for managing multiple MCP servers. It provides tools that allow LLMs to:
Think of Magg as a "package manager for LLM tools" - it lets AI assistants install and manage their own capabilities at runtime.
.magg/config.json
.magg_status
and magg_check
tools for server health checks.uv
(recommended) - Install from astral.sh/uvThe easiest way to install Magg is as a tool using uv
:
# Install Magg as a tool
uv tool install magg
# Run with stdio transport (for Claude Desktop, Cline, etc.)
magg serve
# Run with HTTP transport (for system-wide access)
magg serve --http
You can also run Magg directly from GitHub without installing:
# Run with stdio transport
uvx --from git+https://github.com/sitbon/magg.git magg
# Run with HTTP transport
uvx --from git+https://github.com/sitbon/magg.git magg serve --http
For development, clone the repository and install in editable mode:
# Clone the repository
git clone https://github.com/sitbon/magg.git
cd magg
# Install in development mode with dev dependencies
uv sync --dev
# Or with poetry
poetry install --with dev
# Run the CLI
magg --help
Magg is available as pre-built Docker images from GitHub Container Registry:
# Run production image (WARNING log level)
docker run -p 8000:8000 ghcr.io/sitbon/magg:latest
# Run with authentication (mount or set private key)
docker run -p 8000:8000 \
-v ~/.ssh/magg:/home/magg/.ssh/magg:ro \
ghcr.io/sitbon/magg:latest
# Or with environment variable
docker run -p 8000:8000 \
-e MAGG_PRIVATE_KEY="$(cat ~/.ssh/magg/magg.key)" \
ghcr.io/sitbon/magg:latest
# Run beta image (INFO log level)
docker run -p 8000:8000 ghcr.io/sitbon/magg:beta
# Run with custom config directory
docker run -p 8000:8000 \
-v /path/to/config:/home/magg/.magg \
ghcr.io/sitbon/magg:latest
Magg uses a multi-stage Docker build with three target stages:
pro
(Production): Minimal image with WARNING log level, suitable for production deploymentspre
(Pre-production): Same as production but with INFO log level for staging/testing (available but not published)dev
(Development): Includes development dependencies and DEBUG logging for troubleshootingImages are automatically published to GitHub Container Registry with the following tags:
1.2.3
, 1.2
, dev
, 1.2-dev
, 1.2-dev-py3.12
, etc.beta
, beta-dev
beta-dev-py3.12
, beta-dev-py3.13
, etc.For easier management, use Docker Compose:
# Clone the repository
git clone https://github.com/sitbon/magg.git
cd magg
# Run production version
docker compose up magg
# Run staging version (on port 8001)
docker compose up magg-beta
# Run development version (on port 8008)
# This uses ./.magg/config.json for configuration
docker compose up magg-dev
# Build and run with custom registry
REGISTRY=my.registry.com docker compose build
REGISTRY=my.registry.com docker compose push
See compose.yaml
and .env.example
for configuration options.
Magg can run in three modes:
Stdio Mode (default) - For integration with Claude Desktop, Cline, Cursor, etc.:
magg serve
HTTP Mode - For system-wide access or web integrations:
magg serve --http --port 8000
Hybrid Mode - Both stdio and HTTP simultaneously:
magg serve --hybrid
magg serve --hybrid --port 8080 # Custom port
This is particularly useful when you want to use Magg through an MCP client while also allowing HTTP access. For example:
With Claude Code:
# Configure Claude Code to use Magg in hybrid mode
claude mcp add magg -- magg serve --hybrid --port 42000
With mbro:
# mbro hosts Magg and connects via stdio
mbro connect magg "magg serve --hybrid --port 8080"
# Other mbro instances can connect via HTTP
mbro connect magg http://localhost:8080
Once Magg is running, it exposes the following tools to LLMs:
magg_list_servers
- List all configured MCP serversmagg_add_server
- Add a new MCP servermagg_remove_server
- Remove a servermagg_enable_server
/ magg_disable_server
- Toggle server availabilitymagg_search_servers
- Search for MCP servers onlinemagg_list_tools
- List all available tools from all serversmagg_smart_configure
- Intelligently configure a server from a URLmagg_analyze_servers
- Analyze configured servers and suggest improvementsmagg_status
- Get server and tool statisticsmagg_check
- Health check servers with repair actions (report/remount/unmount/disable)magg_reload_config
- Reload configuration from disk and apply changesmagg_load_kit
- Load a kit and its servers into the configurationmagg_unload_kit
- Unload a kit and optionally its servers from the configurationmagg_list_kits
- List all available kits with their statusmagg_kit_info
- Get detailed information about a specific kitMagg includes the mbro
(MCP Browser) CLI tool for interactive exploration. A unique feature is the ability to connect to Magg in stdio mode for quick inspection:
# Connect mbro to a Magg instance via stdio (no HTTP server needed)
mbro connect local-magg magg serve
# Now inspect your Magg setup from the MCP client perspective
mbro:local-magg> call magg_status
mbro:local-magg> call magg_list_servers
MBro also supports:
.mbro
files with commands for automationkey=value
syntax instead of JSONSee the MBro Documentation for details.
Magg supports optional bearer token authentication to secure access:
Initialize authentication (creates RSA keypair):
magg auth init
Generate a JWT token for clients:
# Generate token (displays on screen)
magg auth token
# Export as environment variable
export MAGG_JWT=$(magg auth token -q)
Connect with authentication:
MaggClient
(auto-loads from MAGG_JWT):
from magg.client import MaggClient
async def main():
async with MaggClient("http://localhost:8000/mcp") as client:
tools = await client.list_tools()
from fastmcp import Client
from fastmcp.client import BearerAuth
jwt_token = "your-jwt-token-here"
async with Client("http://localhost:8000/mcp", auth=BearerAuth(jwt_token)) as client:
tools = await client.list_tools()
~/.ssh/magg/
by defaultMAGG_PRIVATE_KEY
environment variablekey_path
in .magg/auth.json
magg auth init
- Initialize authentication (generates RSA keypair)magg auth status
- Check authentication configurationmagg auth token
- Generate JWT tokenmagg auth public-key
- Display public key (for verification)magg auth private-key
- Display private key (for backup)See examples/authentication.py for more usage patterns.
Magg stores its configuration in .magg/config.json
in your current working directory. This allows for project-specific tool configurations.
Magg supports automatic configuration reloading without requiring a restart:
config.json
and reloads automatically (uses watchdog when available)kill -HUP <pid>
to trigger immediate reload (Unix-like systems)magg_reload_config
tool from any MCP clientConfiguration reload is enabled by default. You can control it with:
MAGG_AUTO_RELOAD=false
- Disable automatic reloadingMAGG_RELOAD_POLL_INTERVAL=5.0
- Set polling interval in seconds (when watchdog unavailable)See Configuration Reload Documentation for detailed information.
Magg supports several environment variables for configuration:
MAGG_CONFIG_PATH
- Path to config file (default: .magg/config.json
)MAGG_LOG_LEVEL
- Logging level: DEBUG, INFO, WARNING, ERROR, CRITICAL (default: INFO)MAGG_STDERR_SHOW=1
- Show stderr output from subprocess MCP servers (default: suppressed)MAGG_AUTO_RELOAD
- Enable/disable config auto-reload (default: true)MAGG_RELOAD_POLL_INTERVAL
- Config polling interval in seconds (default: 1.0)MAGG_READ_ONLY=true
- Run in read-only modeMAGG_SELF_PREFIX
- Prefix for Magg tools (default: "magg"). Tools will be named as {prefix}{sep}{tool}
(e.g., magg_list_servers
)MAGG_PREFIX_SEP
- Separator between prefix and tool name (default: "_")Example configuration:
{
"servers": {
"calculator": {
"name": "calculator",
"source": "https://github.com/executeautomation/calculator-mcp",
"command": "npx @executeautomation/calculator-mcp",
"prefix": "calc",
"enabled": true
}
}
}
Servers can be added in several ways:
Using the LLM (recommended):
"Add the Playwright MCP server"
"Search for and add a calculator tool"
Manual configuration via magg_add_server
:
name: playwright
url: https://github.com/microsoft/playwright-mcp
command: npx @playwright/mcp@latest
prefix: pw
Direct config editing: Edit .magg/config.json
directly
The MaggClient
now supports real-time notifications from backend MCP servers:
from magg import MaggClient, MaggMessageHandler
# Using callbacks
handler = MaggMessageHandler(
on_tool_list_changed=lambda n: print("Tools changed!"),
on_progress=lambda n: print(f"Progress: {n.params.progress}")
)
async with MaggClient("http://localhost:8000/mcp", message_handler=handler) as client:
# Client will receive notifications while connected
tools = await client.list_tools()
See Messaging Documentation for advanced usage including custom message handlers.
Magg supports organizing related MCP servers into "kits" - bundles that can be loaded and unloaded as a group:
# List available kits
magg kit list
# Load a kit (adds all its servers)
magg kit load web-tools
# Unload a kit (removes servers only in that kit)
magg kit unload web-tools
# Get information about a kit
magg kit info web-tools
You can also manage kits programmatically through Magg's tools when connected via an MCP client:
magg_list_kits
- List all available kitsmagg_load_kit
- Load a kit and its serversmagg_unload_kit
- Unload a kitmagg_kit_info
- Get detailed kit informationKits are JSON files stored in ~/.magg/kit.d/
or .magg/kit.d/
that define a collection of related servers. See Kit Documentation for details on creating and managing kits.
Automate common workflows with MBro scripts:
# Create a setup script
cat > setup.mbro <<EOF
# Connect to Magg and check status
connect magg magg serve
call magg_status
call magg_list_servers
# Add a new server if needed
call magg_add_server name=calculator source="npx -y @modelcontextprotocol/server-calculator"
EOF
# Run the script
mbro -x setup.mbro
For more documentation, see docs/.
Magg appears in multiple locations. Please feel free to submit a PR to add more appearances below in alphabetical order.