Repository files navigation

🧲 Magg - The MCP Aggregator

Python VersionPyPI VersionGitHub ReleaseDeepWikiDownloads

TestsDocker

A Model Context Protocol server that manages, aggregates, and proxies other MCP servers, enabling LLMs to dynamically extend their own capabilities.

What is Magg?

Magg is a meta-MCP server that acts as a central hub for managing multiple MCP servers. It provides tools that allow LLMs to:

  • Search for new MCP servers and discover setup instructions
  • Add and configure MCP servers dynamically
  • Enable/disable servers on demand
  • Aggregate tools from multiple servers under unified prefixes
  • Persist configurations across sessions

Think of Magg as a "package manager for LLM tools" - it lets AI assistants install and manage their own capabilities at runtime.

Features

  • Self-Service Tool Management: LLMs can search for and add new MCP servers without human intervention.
  • Dynamic Configuration Reloading: Automatically detects and applies config changes without restarting.
  • Automatic Tool Proxying: Tools from added servers are automatically exposed with configurable prefixes.
  • ProxyMCP Tool: A built-in tool that proxies the MCP protocol to itself, for clients that don't support notifications or dynamic tool updates (which is most of them currently).
  • Smart Configuration: Uses MCP sampling to intelligently configure servers from just a URL.
  • Persistent Configuration: Maintains server configurations in .magg/config.json.
  • Multiple Transport Support: Works with stdio, HTTP, and in-memory transports.
  • Bearer Token Authentication: Optional RSA-based JWT authentication for secure HTTP access.
  • Docker Support: Pre-built images for production, staging, and development workflows.
  • Health Monitoring: Built-in magg_status and magg_check tools for server health checks.
  • Real-time Messaging: Full support for MCP notifications and messages - receive tool/resource updates and progress notifications from backend servers.
  • Python 3.12+ Support: Fully compatible with Python 3.12 and 3.13.
  • Kit Management: Bundle related MCP servers into kits for easy loading/unloading as a group.
  • MBro CLI: Included MCP Browser for interactive exploration and management of MCP servers, with script support for automation.

Installation

Prerequisites

  • Python 3.12 or higher (3.13+ recommended)
  • uv (recommended) - Install from astral.sh/uv

Quick Install (Recommended)

The 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

Alternative: Run Directly from GitHub

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

Local Development

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

Docker

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

Docker Image Strategy

Magg uses a multi-stage Docker build with three target stages:

  • pro (Production): Minimal image with WARNING log level, suitable for production deployments
  • pre (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 troubleshooting

Images are automatically published to GitHub Container Registry with the following tags:

  • Version tags (from main branch): 1.2.3, 1.2, dev, 1.2-dev, 1.2-dev-py3.12, etc.
  • Branch tags (from beta branch): beta, beta-dev
  • Python-specific dev tags: beta-dev-py3.12, beta-dev-py3.13, etc.

Pull requests build and test images but do not publish them unless a maintainer adds the push-image label, which publishes ephemeral pr-NN / pr-NN-dev tags (same-repo PRs only). Ephemeral pr-* tags and untagged manifests are cleaned up weekly; version tags are kept forever, so pinned deployments are never affected.

Docker Compose

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.

Usage

Running Magg

Magg can run in three modes:

  1. Stdio Mode (default) - For integration with Claude Desktop, Cline, Cursor, etc.:

    magg serve
  2. HTTP Mode - For system-wide access or web integrations:

    magg serve --http --port 8000
  3. 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

Available Tools

Once Magg is running, it exposes the following tools to LLMs:

  • magg_list_servers - List all configured MCP servers
  • magg_add_server - Add a new MCP server
  • magg_remove_server - Remove a server
  • magg_enable_server / magg_disable_server - Toggle server availability
  • magg_search_servers - Search for MCP servers online
  • magg_list_tools - List all available tools from all servers
  • magg_smart_configure - Intelligently configure a server from a URL
  • magg_analyze_servers - Analyze configured servers and suggest improvements
  • magg_status - Get server and tool statistics
  • magg_check - Health check servers with repair actions (report/remount/unmount/disable)
  • magg_reload_config - Reload configuration from disk and apply changes
  • magg_load_kit - Load a kit and its servers into the configuration
  • magg_unload_kit - Unload a kit and optionally its servers from the configuration
  • magg_list_kits - List all available kits with their status
  • magg_kit_info - Get detailed information about a specific kit

Quick Inspection with MBro

Magg 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:

  • Scripts: Create .mbro files with commands for automation
  • Shell-style arguments: Use key=value syntax instead of JSON
  • Tab completion: Rich parameter hints after connecting

See the MBro Documentation for details.

Authentication

Magg supports optional bearer token authentication to secure access:

Quick Start

  1. Initialize authentication (creates RSA keypair):

    magg auth init
  2. Generate a JWT token for clients:

    # Generate token (displays on screen)
    magg auth token
    # Export as environment variableexport MAGG_JWT=$(magg auth token -q)
  3. Connect with authentication:

    • Using MaggClient (auto-loads from MAGG_JWT):
      frommagg.clientimportMaggClientasyncdefmain():
      asyncwithMaggClient("http://localhost:8000/mcp") asclient:
      tools=awaitclient.list_tools()
    • Using FastMCP with explicit token:
      fromfastmcpimportClientfromfastmcp.clientimportBearerAuthjwt_token="your-jwt-token-here"asyncwithClient("http://localhost:8000/mcp", auth=BearerAuth(jwt_token)) asclient:
      tools=awaitclient.list_tools()

Key Management

  • Keys are stored in ~/.ssh/magg/ by default
  • Private key can be set via MAGG_PRIVATE_KEY environment variable
  • To disable auth, remove keys or set non-existent key_path in .magg/auth.json

Authentication Commands

  • magg auth init - Initialize authentication (generates RSA keypair)
  • magg auth status - Check authentication configuration
  • magg auth token - Generate JWT token
  • magg 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.

Configuration

Magg stores its configuration in .magg/config.json in your current working directory. This allows for project-specific tool configurations.

Dynamic Configuration Reloading

Magg supports automatic configuration reloading without requiring a restart:

  • Automatic file watching: Detects changes to config.json and reloads automatically (uses watchdog when available)
  • SIGHUP signal: Send kill -HUP <pid> to trigger immediate reload (Unix-like systems)
  • MCP tool: Use magg_reload_config tool from any MCP client
  • Smart transitions: Only affected servers are restarted during reload

Configuration reload is enabled by default. You can control it with:

  • MAGG_AUTO_RELOAD=false - Disable automatic reloading
  • MAGG_RELOAD_POLL_INTERVAL=5.0 - Set polling interval in seconds (when watchdog unavailable)

See Configuration Reload Documentation for detailed information.

Environment Variables

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 mode
  • MAGG_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
}
}
}

Adding Servers

Servers can be added in several ways:

  1. Using the LLM (recommended):

    "Add the Playwright MCP server"
    "Search for and add a calculator tool"
    
  2. Manual configuration via magg_add_server:

    name: playwright
    url: https://github.com/microsoft/playwright-mcp
    command: npx @playwright/mcp@latest
    prefix: pw
    
  3. The magg server CLI (see below)

  4. Direct config editing: Edit .magg/config.json directly

Managing Servers from the CLI

Server and kit configuration can be managed entirely from the command line — no MCP client or running server required. The CLI edits .magg/config.json directly, and a running Magg instance picks up the changes automatically via config reload. (Tools that require a live server, like magg_search_servers, magg_check, and magg_smart_configure, remain available through any MCP client such as mbro.)

# List servers (human-readable, or JSON on stdout for scripting)
magg server list
magg server list --json
# Add a server
magg server add playwright https://github.com/microsoft/playwright-mcp \
--command "npx @playwright/mcp@latest" --prefix pw
# Add a server without enabling it, with transport options
magg server add web https://example.com/web --uri http://localhost:9000/mcp \
--transport '{"keep_alive": false}' --disable
# Update an existing server (pass '' to clear an optional field)
magg server update playwright --prefix play --notes "Browser automation"
magg server update playwright --command "npx @playwright/mcp@next"
magg server update playwright --notes ""# Enable / disable / inspect / remove
magg server enable playwright
magg server disable playwright
magg server info playwright --json
magg server remove playwright

Real-time Notifications with MaggClient

The MaggClient now supports real-time notifications from backend MCP servers:

frommaggimportMaggClient, MaggMessageHandler# Using callbackshandler=MaggMessageHandler(
on_tool_list_changed=lambdan: print("Tools changed!"),
on_progress=lambdan: print(f"Progress: {n.params.progress}")
)
asyncwithMaggClient("http://localhost:8000/mcp", message_handler=handler) asclient:
# Client will receive notifications while connectedtools=awaitclient.list_tools()

See Messaging Documentation for advanced usage including custom message handlers.

Kit Management

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
# Export the current configuration (or a loaded kit) as a kit file
magg kit export --name my-kit --output my-kit.json

When unloading a kit, servers that belong only to that kit are removed, while servers shared with other kits are kept.

You can also manage kits programmatically through Magg's tools when connected via an MCP client:

  • magg_list_kits - List all available kits
  • magg_load_kit - Load a kit and its servers
  • magg_unload_kit - Unload a kit
  • magg_kit_info - Get detailed kit information

Kits 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.

MBro Scripts

Automate common workflows with MBro scripts:

# Create a setup script
cat > setup.mbro <<EOF# Connect to Magg and check statusconnect magg magg servecall magg_statuscall magg_list_servers# Add a new server if neededcall magg_add_server name=calculator source="npx -y @modelcontextprotocol/server-calculator"EOF# Run the script
mbro -x setup.mbro

MCP 2026-07-28 (Stateless Spec)

The MCP 2026-07-28 spec moves the protocol to a stateless request/response core. Magg's take: something still has to own long-lived stdio subprocesses, backend connections, and tool-list caching — and that's exactly the layer an aggregator provides. See Magg and the Stateless MCP Spec for the impact analysis and migration plan, including how Magg bridges pre-2026 (stateful) backends to stateless-era clients and how hierarchical Magg deployments fit in.

Documentation

For more documentation, see docs/.

Appearances

Magg appears in multiple locations. Please feel free to submit a PR to add more appearances below in alphabetical order.

Listing, Index, and other MCP Sites

Magg ships a server.json manifest for the official MCP Registry (as io.github.sitbon/magg), and magg_search_servers queries the registry as a first-class discovery source alongside Glama, GitHub, and npm. See MCP Registry Documentation for publishing instructions.

mcp-name: io.github.sitbon/magg

Awesome GitHub MCP Lists

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Repository files navigation

🧲 Magg - The MCP Aggregator

Python VersionPyPI VersionGitHub ReleaseDeepWikiDownloads

TestsDocker

A Model Context Protocol server that manages, aggregates, and proxies other MCP servers, enabling LLMs to dynamically extend their own capabilities.

What is Magg?

Magg is a meta-MCP server that acts as a central hub for managing multiple MCP servers. It provides tools that allow LLMs to:

  • Search for new MCP servers and discover setup instructions
  • Add and configure MCP servers dynamically
  • Enable/disable servers on demand
  • Aggregate tools from multiple servers under unified prefixes
  • Persist configurations across sessions

Think of Magg as a "package manager for LLM tools" - it lets AI assistants install and manage their own capabilities at runtime.

Features

  • Self-Service Tool Management: LLMs can search for and add new MCP servers without human intervention.
  • Dynamic Configuration Reloading: Automatically detects and applies config changes without restarting.
  • Automatic Tool Proxying: Tools from added servers are automatically exposed with configurable prefixes.
  • ProxyMCP Tool: A built-in tool that proxies the MCP protocol to itself, for clients that don't support notifications or dynamic tool updates (which is most of them currently).
  • Smart Configuration: Uses MCP sampling to intelligently configure servers from just a URL.
  • Persistent Configuration: Maintains server configurations in .magg/config.json.
  • Multiple Transport Support: Works with stdio, HTTP, and in-memory transports.
  • Bearer Token Authentication: Optional RSA-based JWT authentication for secure HTTP access.
  • Docker Support: Pre-built images for production, staging, and development workflows.
  • Health Monitoring: Built-in magg_status and magg_check tools for server health checks.
  • Real-time Messaging: Full support for MCP notifications and messages - receive tool/resource updates and progress notifications from backend servers.
  • Python 3.12+ Support: Fully compatible with Python 3.12 and 3.13.
  • Kit Management: Bundle related MCP servers into kits for easy loading/unloading as a group.
  • MBro CLI: Included MCP Browser for interactive exploration and management of MCP servers, with script support for automation.

Installation

Prerequisites

  • Python 3.12 or higher (3.13+ recommended)
  • uv (recommended) - Install from astral.sh/uv

Quick Install (Recommended)

The 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

Alternative: Run Directly from GitHub

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

Local Development

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

Docker

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

Docker Image Strategy

Magg uses a multi-stage Docker build with three target stages:

  • pro (Production): Minimal image with WARNING log level, suitable for production deployments
  • pre (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 troubleshooting

Images are automatically published to GitHub Container Registry with the following tags:

  • Version tags (from main branch): 1.2.3, 1.2, dev, 1.2-dev, 1.2-dev-py3.12, etc.
  • Branch tags (from beta branch): beta, beta-dev
  • Python-specific dev tags: beta-dev-py3.12, beta-dev-py3.13, etc.

Pull requests build and test images but do not publish them unless a maintainer adds the push-image label, which publishes ephemeral pr-NN / pr-NN-dev tags (same-repo PRs only). Ephemeral pr-* tags and untagged manifests are cleaned up weekly; version tags are kept forever, so pinned deployments are never affected.

Docker Compose

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.

Usage

Running Magg

Magg can run in three modes:

  1. Stdio Mode (default) - For integration with Claude Desktop, Cline, Cursor, etc.:

    magg serve
  2. HTTP Mode - For system-wide access or web integrations:

    magg serve --http --port 8000
  3. 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

Available Tools

Once Magg is running, it exposes the following tools to LLMs:

  • magg_list_servers - List all configured MCP servers
  • magg_add_server - Add a new MCP server
  • magg_remove_server - Remove a server
  • magg_enable_server / magg_disable_server - Toggle server availability
  • magg_search_servers - Search for MCP servers online
  • magg_list_tools - List all available tools from all servers
  • magg_smart_configure - Intelligently configure a server from a URL
  • magg_analyze_servers - Analyze configured servers and suggest improvements
  • magg_status - Get server and tool statistics
  • magg_check - Health check servers with repair actions (report/remount/unmount/disable)
  • magg_reload_config - Reload configuration from disk and apply changes
  • magg_load_kit - Load a kit and its servers into the configuration
  • magg_unload_kit - Unload a kit and optionally its servers from the configuration
  • magg_list_kits - List all available kits with their status
  • magg_kit_info - Get detailed information about a specific kit

Quick Inspection with MBro

Magg 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:

  • Scripts: Create .mbro files with commands for automation
  • Shell-style arguments: Use key=value syntax instead of JSON
  • Tab completion: Rich parameter hints after connecting

See the MBro Documentation for details.

Authentication

Magg supports optional bearer token authentication to secure access:

Quick Start

  1. Initialize authentication (creates RSA keypair):

    magg auth init
  2. Generate a JWT token for clients:

    # Generate token (displays on screen)
    magg auth token
    # Export as environment variableexport MAGG_JWT=$(magg auth token -q)
  3. Connect with authentication:

    • Using MaggClient (auto-loads from MAGG_JWT):
      frommagg.clientimportMaggClientasyncdefmain():
      asyncwithMaggClient("http://localhost:8000/mcp") asclient:
      tools=awaitclient.list_tools()
    • Using FastMCP with explicit token:
      fromfastmcpimportClientfromfastmcp.clientimportBearerAuthjwt_token="your-jwt-token-here"asyncwithClient("http://localhost:8000/mcp", auth=BearerAuth(jwt_token)) asclient:
      tools=awaitclient.list_tools()

Key Management

  • Keys are stored in ~/.ssh/magg/ by default
  • Private key can be set via MAGG_PRIVATE_KEY environment variable
  • To disable auth, remove keys or set non-existent key_path in .magg/auth.json

Authentication Commands

  • magg auth init - Initialize authentication (generates RSA keypair)
  • magg auth status - Check authentication configuration
  • magg auth token - Generate JWT token
  • magg 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.

Configuration

Magg stores its configuration in .magg/config.json in your current working directory. This allows for project-specific tool configurations.

Dynamic Configuration Reloading

Magg supports automatic configuration reloading without requiring a restart:

  • Automatic file watching: Detects changes to config.json and reloads automatically (uses watchdog when available)
  • SIGHUP signal: Send kill -HUP <pid> to trigger immediate reload (Unix-like systems)
  • MCP tool: Use magg_reload_config tool from any MCP client
  • Smart transitions: Only affected servers are restarted during reload

Configuration reload is enabled by default. You can control it with:

  • MAGG_AUTO_RELOAD=false - Disable automatic reloading
  • MAGG_RELOAD_POLL_INTERVAL=5.0 - Set polling interval in seconds (when watchdog unavailable)

See Configuration Reload Documentation for detailed information.

Environment Variables

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 mode
  • MAGG_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
}
}
}

Adding Servers

Servers can be added in several ways:

  1. Using the LLM (recommended):

    "Add the Playwright MCP server"
    "Search for and add a calculator tool"
    
  2. Manual configuration via magg_add_server:

    name: playwright
    url: https://github.com/microsoft/playwright-mcp
    command: npx @playwright/mcp@latest
    prefix: pw
    
  3. The magg server CLI (see below)

  4. Direct config editing: Edit .magg/config.json directly

Managing Servers from the CLI

Server and kit configuration can be managed entirely from the command line — no MCP client or running server required. The CLI edits .magg/config.json directly, and a running Magg instance picks up the changes automatically via config reload. (Tools that require a live server, like magg_search_servers, magg_check, and magg_smart_configure, remain available through any MCP client such as mbro.)

# List servers (human-readable, or JSON on stdout for scripting)
magg server list
magg server list --json
# Add a server
magg server add playwright https://github.com/microsoft/playwright-mcp \
--command "npx @playwright/mcp@latest" --prefix pw
# Add a server without enabling it, with transport options
magg server add web https://example.com/web --uri http://localhost:9000/mcp \
--transport '{"keep_alive": false}' --disable
# Update an existing server (pass '' to clear an optional field)
magg server update playwright --prefix play --notes "Browser automation"
magg server update playwright --command "npx @playwright/mcp@next"
magg server update playwright --notes ""# Enable / disable / inspect / remove
magg server enable playwright
magg server disable playwright
magg server info playwright --json
magg server remove playwright

Real-time Notifications with MaggClient

The MaggClient now supports real-time notifications from backend MCP servers:

frommaggimportMaggClient, MaggMessageHandler# Using callbackshandler=MaggMessageHandler(
on_tool_list_changed=lambdan: print("Tools changed!"),
on_progress=lambdan: print(f"Progress: {n.params.progress}")
)
asyncwithMaggClient("http://localhost:8000/mcp", message_handler=handler) asclient:
# Client will receive notifications while connectedtools=awaitclient.list_tools()

See Messaging Documentation for advanced usage including custom message handlers.

Kit Management

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
# Export the current configuration (or a loaded kit) as a kit file
magg kit export --name my-kit --output my-kit.json

When unloading a kit, servers that belong only to that kit are removed, while servers shared with other kits are kept.

You can also manage kits programmatically through Magg's tools when connected via an MCP client:

  • magg_list_kits - List all available kits
  • magg_load_kit - Load a kit and its servers
  • magg_unload_kit - Unload a kit
  • magg_kit_info - Get detailed kit information

Kits 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.

MBro Scripts

Automate common workflows with MBro scripts:

# Create a setup script
cat > setup.mbro <<EOF# Connect to Magg and check statusconnect magg magg servecall magg_statuscall magg_list_servers# Add a new server if neededcall magg_add_server name=calculator source="npx -y @modelcontextprotocol/server-calculator"EOF# Run the script
mbro -x setup.mbro

MCP 2026-07-28 (Stateless Spec)

The MCP 2026-07-28 spec moves the protocol to a stateless request/response core. Magg's take: something still has to own long-lived stdio subprocesses, backend connections, and tool-list caching — and that's exactly the layer an aggregator provides. See Magg and the Stateless MCP Spec for the impact analysis and migration plan, including how Magg bridges pre-2026 (stateful) backends to stateless-era clients and how hierarchical Magg deployments fit in.

Documentation

For more documentation, see docs/.

Appearances

Magg appears in multiple locations. Please feel free to submit a PR to add more appearances below in alphabetical order.

Listing, Index, and other MCP Sites

Magg ships a server.json manifest for the official MCP Registry (as io.github.sitbon/magg), and magg_search_servers queries the registry as a first-class discovery source alongside Glama, GitHub, and npm. See MCP Registry Documentation for publishing instructions.

mcp-name: io.github.sitbon/magg

Awesome GitHub MCP Lists

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

🧲 Magg - The MCP Aggregator

Python VersionPyPI VersionGitHub ReleaseDeepWikiDownloads

TestsDocker

A Model Context Protocol server that manages, aggregates, and proxies other MCP servers, enabling LLMs to dynamically extend their own capabilities.

What is Magg?

Magg is a meta-MCP server that acts as a central hub for managing multiple MCP servers. It provides tools that allow LLMs to:

  • Search for new MCP servers and discover setup instructions
  • Add and configure MCP servers dynamically
  • Enable/disable servers on demand
  • Aggregate tools from multiple servers under unified prefixes
  • Persist configurations across sessions

Think of Magg as a "package manager for LLM tools" - it lets AI assistants install and manage their own capabilities at runtime.

Features

  • Self-Service Tool Management: LLMs can search for and add new MCP servers without human intervention.
  • Dynamic Configuration Reloading: Automatically detects and applies config changes without restarting.
  • Automatic Tool Proxying: Tools from added servers are automatically exposed with configurable prefixes.
  • ProxyMCP Tool: A built-in tool that proxies the MCP protocol to itself, for clients that don't support notifications or dynamic tool updates (which is most of them currently).
  • Smart Configuration: Uses MCP sampling to intelligently configure servers from just a URL.
  • Persistent Configuration: Maintains server configurations in .magg/config.json.
  • Multiple Transport Support: Works with stdio, HTTP, and in-memory transports.
  • Bearer Token Authentication: Optional RSA-based JWT authentication for secure HTTP access.
  • Docker Support: Pre-built images for production, staging, and development workflows.
  • Health Monitoring: Built-in magg_status and magg_check tools for server health checks.
  • Real-time Messaging: Full support for MCP notifications and messages - receive tool/resource updates and progress notifications from backend servers.
  • Python 3.12+ Support: Fully compatible with Python 3.12 and 3.13.
  • Kit Management: Bundle related MCP servers into kits for easy loading/unloading as a group.
  • MBro CLI: Included MCP Browser for interactive exploration and management of MCP servers, with script support for automation.

Installation

Prerequisites

  • Python 3.12 or higher (3.13+ recommended)
  • uv (recommended) - Install from astral.sh/uv

Quick Install (Recommended)

The 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

Alternative: Run Directly from GitHub

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

Local Development

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

Docker

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

Docker Image Strategy

Magg uses a multi-stage Docker build with three target stages:

  • pro (Production): Minimal image with WARNING log level, suitable for production deployments
  • pre (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 troubleshooting

Images are automatically published to GitHub Container Registry with the following tags:

  • Version tags (from main branch): 1.2.3, 1.2, dev, 1.2-dev, 1.2-dev-py3.12, etc.
  • Branch tags (from beta branch): beta, beta-dev
  • Python-specific dev tags: beta-dev-py3.12, beta-dev-py3.13, etc.

Pull requests build and test images but do not publish them unless a maintainer adds the push-image label, which publishes ephemeral pr-NN / pr-NN-dev tags (same-repo PRs only). Ephemeral pr-* tags and untagged manifests are cleaned up weekly; version tags are kept forever, so pinned deployments are never affected.

Docker Compose

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.

Usage

Running Magg

Magg can run in three modes:

  1. Stdio Mode (default) - For integration with Claude Desktop, Cline, Cursor, etc.:

    magg serve
  2. HTTP Mode - For system-wide access or web integrations:

    magg serve --http --port 8000
  3. 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

Available Tools

Once Magg is running, it exposes the following tools to LLMs:

  • magg_list_servers - List all configured MCP servers
  • magg_add_server - Add a new MCP server
  • magg_remove_server - Remove a server
  • magg_enable_server / magg_disable_server - Toggle server availability
  • magg_search_servers - Search for MCP servers online
  • magg_list_tools - List all available tools from all servers
  • magg_smart_configure - Intelligently configure a server from a URL
  • magg_analyze_servers - Analyze configured servers and suggest improvements
  • magg_status - Get server and tool statistics
  • magg_check - Health check servers with repair actions (report/remount/unmount/disable)
  • magg_reload_config - Reload configuration from disk and apply changes
  • magg_load_kit - Load a kit and its servers into the configuration
  • magg_unload_kit - Unload a kit and optionally its servers from the configuration
  • magg_list_kits - List all available kits with their status
  • magg_kit_info - Get detailed information about a specific kit

Quick Inspection with MBro

Magg 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:

  • Scripts: Create .mbro files with commands for automation
  • Shell-style arguments: Use key=value syntax instead of JSON
  • Tab completion: Rich parameter hints after connecting

See the MBro Documentation for details.

Authentication

Magg supports optional bearer token authentication to secure access:

Quick Start

  1. Initialize authentication (creates RSA keypair):

    magg auth init
  2. Generate a JWT token for clients:

    # Generate token (displays on screen)
    magg auth token
    # Export as environment variableexport MAGG_JWT=$(magg auth token -q)
  3. Connect with authentication:

    • Using MaggClient (auto-loads from MAGG_JWT):
      frommagg.clientimportMaggClientasyncdefmain():
      asyncwithMaggClient("http://localhost:8000/mcp") asclient:
      tools=awaitclient.list_tools()
    • Using FastMCP with explicit token:
      fromfastmcpimportClientfromfastmcp.clientimportBearerAuthjwt_token="your-jwt-token-here"asyncwithClient("http://localhost:8000/mcp", auth=BearerAuth(jwt_token)) asclient:
      tools=awaitclient.list_tools()

Key Management

  • Keys are stored in ~/.ssh/magg/ by default
  • Private key can be set via MAGG_PRIVATE_KEY environment variable
  • To disable auth, remove keys or set non-existent key_path in .magg/auth.json

Authentication Commands

  • magg auth init - Initialize authentication (generates RSA keypair)
  • magg auth status - Check authentication configuration
  • magg auth token - Generate JWT token
  • magg 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.

Configuration

Magg stores its configuration in .magg/config.json in your current working directory. This allows for project-specific tool configurations.

Dynamic Configuration Reloading

Magg supports automatic configuration reloading without requiring a restart:

  • Automatic file watching: Detects changes to config.json and reloads automatically (uses watchdog when available)
  • SIGHUP signal: Send kill -HUP <pid> to trigger immediate reload (Unix-like systems)
  • MCP tool: Use magg_reload_config tool from any MCP client
  • Smart transitions: Only affected servers are restarted during reload

Configuration reload is enabled by default. You can control it with:

  • MAGG_AUTO_RELOAD=false - Disable automatic reloading
  • MAGG_RELOAD_POLL_INTERVAL=5.0 - Set polling interval in seconds (when watchdog unavailable)

See Configuration Reload Documentation for detailed information.

Environment Variables

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 mode
  • MAGG_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
}
}
}

Adding Servers

Servers can be added in several ways:

  1. Using the LLM (recommended):

    "Add the Playwright MCP server"
    "Search for and add a calculator tool"
    
  2. Manual configuration via magg_add_server:

    name: playwright
    url: https://github.com/microsoft/playwright-mcp
    command: npx @playwright/mcp@latest
    prefix: pw
    
  3. The magg server CLI (see below)

  4. Direct config editing: Edit .magg/config.json directly

Managing Servers from the CLI

Server and kit configuration can be managed entirely from the command line — no MCP client or running server required. The CLI edits .magg/config.json directly, and a running Magg instance picks up the changes automatically via config reload. (Tools that require a live server, like magg_search_servers, magg_check, and magg_smart_configure, remain available through any MCP client such as mbro.)

# List servers (human-readable, or JSON on stdout for scripting)
magg server list
magg server list --json
# Add a server
magg server add playwright https://github.com/microsoft/playwright-mcp \
--command "npx @playwright/mcp@latest" --prefix pw
# Add a server without enabling it, with transport options
magg server add web https://example.com/web --uri http://localhost:9000/mcp \
--transport '{"keep_alive": false}' --disable
# Update an existing server (pass '' to clear an optional field)
magg server update playwright --prefix play --notes "Browser automation"
magg server update playwright --command "npx @playwright/mcp@next"
magg server update playwright --notes ""# Enable / disable / inspect / remove
magg server enable playwright
magg server disable playwright
magg server info playwright --json
magg server remove playwright

Real-time Notifications with MaggClient

The MaggClient now supports real-time notifications from backend MCP servers:

frommaggimportMaggClient, MaggMessageHandler# Using callbackshandler=MaggMessageHandler(
on_tool_list_changed=lambdan: print("Tools changed!"),
on_progress=lambdan: print(f"Progress: {n.params.progress}")
)
asyncwithMaggClient("http://localhost:8000/mcp", message_handler=handler) asclient:
# Client will receive notifications while connectedtools=awaitclient.list_tools()

See Messaging Documentation for advanced usage including custom message handlers.

Kit Management

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
# Export the current configuration (or a loaded kit) as a kit file
magg kit export --name my-kit --output my-kit.json

When unloading a kit, servers that belong only to that kit are removed, while servers shared with other kits are kept.

You can also manage kits programmatically through Magg's tools when connected via an MCP client:

  • magg_list_kits - List all available kits
  • magg_load_kit - Load a kit and its servers
  • magg_unload_kit - Unload a kit
  • magg_kit_info - Get detailed kit information

Kits 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.

MBro Scripts

Automate common workflows with MBro scripts:

# Create a setup script
cat > setup.mbro <<EOF# Connect to Magg and check statusconnect magg magg servecall magg_statuscall magg_list_servers# Add a new server if neededcall magg_add_server name=calculator source="npx -y @modelcontextprotocol/server-calculator"EOF# Run the script
mbro -x setup.mbro

MCP 2026-07-28 (Stateless Spec)

The MCP 2026-07-28 spec moves the protocol to a stateless request/response core. Magg's take: something still has to own long-lived stdio subprocesses, backend connections, and tool-list caching — and that's exactly the layer an aggregator provides. See Magg and the Stateless MCP Spec for the impact analysis and migration plan, including how Magg bridges pre-2026 (stateful) backends to stateless-era clients and how hierarchical Magg deployments fit in.

Documentation

For more documentation, see docs/.

Appearances

Magg appears in multiple locations. Please feel free to submit a PR to add more appearances below in alphabetical order.

Listing, Index, and other MCP Sites

Magg ships a server.json manifest for the official MCP Registry (as io.github.sitbon/magg), and magg_search_servers queries the registry as a first-class discovery source alongside Glama, GitHub, and npm. See MCP Registry Documentation for publishing instructions.

mcp-name: io.github.sitbon/magg

Awesome GitHub MCP Lists

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

🧲 Magg - The MCP Aggregator

Python VersionPyPI VersionGitHub ReleaseDeepWikiDownloads

TestsDocker

A Model Context Protocol server that manages, aggregates, and proxies other MCP servers, enabling LLMs to dynamically extend their own capabilities.

What is Magg?

Magg is a meta-MCP server that acts as a central hub for managing multiple MCP servers. It provides tools that allow LLMs to:

  • Search for new MCP servers and discover setup instructions
  • Add and configure MCP servers dynamically
  • Enable/disable servers on demand
  • Aggregate tools from multiple servers under unified prefixes
  • Persist configurations across sessions

Think of Magg as a "package manager for LLM tools" - it lets AI assistants install and manage their own capabilities at runtime.

Features

  • Self-Service Tool Management: LLMs can search for and add new MCP servers without human intervention.
  • Dynamic Configuration Reloading: Automatically detects and applies config changes without restarting.
  • Automatic Tool Proxying: Tools from added servers are automatically exposed with configurable prefixes.
  • ProxyMCP Tool: A built-in tool that proxies the MCP protocol to itself, for clients that don't support notifications or dynamic tool updates (which is most of them currently).
  • Smart Configuration: Uses MCP sampling to intelligently configure servers from just a URL.
  • Persistent Configuration: Maintains server configurations in .magg/config.json.
  • Multiple Transport Support: Works with stdio, HTTP, and in-memory transports.
  • Bearer Token Authentication: Optional RSA-based JWT authentication for secure HTTP access.
  • Docker Support: Pre-built images for production, staging, and development workflows.
  • Health Monitoring: Built-in magg_status and magg_check tools for server health checks.
  • Real-time Messaging: Full support for MCP notifications and messages - receive tool/resource updates and progress notifications from backend servers.
  • Python 3.12+ Support: Fully compatible with Python 3.12 and 3.13.
  • Kit Management: Bundle related MCP servers into kits for easy loading/unloading as a group.
  • MBro CLI: Included MCP Browser for interactive exploration and management of MCP servers, with script support for automation.

Installation

Prerequisites

  • Python 3.12 or higher (3.13+ recommended)
  • uv (recommended) - Install from astral.sh/uv

Quick Install (Recommended)

The 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

Alternative: Run Directly from GitHub

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

Local Development

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

Docker

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

Docker Image Strategy

Magg uses a multi-stage Docker build with three target stages:

  • pro (Production): Minimal image with WARNING log level, suitable for production deployments
  • pre (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 troubleshooting

Images are automatically published to GitHub Container Registry with the following tags:

  • Version tags (from main branch): 1.2.3, 1.2, dev, 1.2-dev, 1.2-dev-py3.12, etc.
  • Branch tags (from beta branch): beta, beta-dev
  • Python-specific dev tags: beta-dev-py3.12, beta-dev-py3.13, etc.

Pull requests build and test images but do not publish them unless a maintainer adds the push-image label, which publishes ephemeral pr-NN / pr-NN-dev tags (same-repo PRs only). Ephemeral pr-* tags and untagged manifests are cleaned up weekly; version tags are kept forever, so pinned deployments are never affected.

Docker Compose

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.

Usage

Running Magg

Magg can run in three modes:

  1. Stdio Mode (default) - For integration with Claude Desktop, Cline, Cursor, etc.:

    magg serve
  2. HTTP Mode - For system-wide access or web integrations:

    magg serve --http --port 8000
  3. 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

Available Tools

Once Magg is running, it exposes the following tools to LLMs:

  • magg_list_servers - List all configured MCP servers
  • magg_add_server - Add a new MCP server
  • magg_remove_server - Remove a server
  • magg_enable_server / magg_disable_server - Toggle server availability
  • magg_search_servers - Search for MCP servers online
  • magg_list_tools - List all available tools from all servers
  • magg_smart_configure - Intelligently configure a server from a URL
  • magg_analyze_servers - Analyze configured servers and suggest improvements
  • magg_status - Get server and tool statistics
  • magg_check - Health check servers with repair actions (report/remount/unmount/disable)
  • magg_reload_config - Reload configuration from disk and apply changes
  • magg_load_kit - Load a kit and its servers into the configuration
  • magg_unload_kit - Unload a kit and optionally its servers from the configuration
  • magg_list_kits - List all available kits with their status
  • magg_kit_info - Get detailed information about a specific kit

Quick Inspection with MBro

Magg 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:

  • Scripts: Create .mbro files with commands for automation
  • Shell-style arguments: Use key=value syntax instead of JSON
  • Tab completion: Rich parameter hints after connecting

See the MBro Documentation for details.

Authentication

Magg supports optional bearer token authentication to secure access:

Quick Start

  1. Initialize authentication (creates RSA keypair):

    magg auth init
  2. Generate a JWT token for clients:

    # Generate token (displays on screen)
    magg auth token
    # Export as environment variableexport MAGG_JWT=$(magg auth token -q)
  3. Connect with authentication:

    • Using MaggClient (auto-loads from MAGG_JWT):
      frommagg.clientimportMaggClientasyncdefmain():
      asyncwithMaggClient("http://localhost:8000/mcp") asclient:
      tools=awaitclient.list_tools()
    • Using FastMCP with explicit token:
      fromfastmcpimportClientfromfastmcp.clientimportBearerAuthjwt_token="your-jwt-token-here"asyncwithClient("http://localhost:8000/mcp", auth=BearerAuth(jwt_token)) asclient:
      tools=awaitclient.list_tools()

Key Management

  • Keys are stored in ~/.ssh/magg/ by default
  • Private key can be set via MAGG_PRIVATE_KEY environment variable
  • To disable auth, remove keys or set non-existent key_path in .magg/auth.json

Authentication Commands

  • magg auth init - Initialize authentication (generates RSA keypair)
  • magg auth status - Check authentication configuration
  • magg auth token - Generate JWT token
  • magg 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.

Configuration

Magg stores its configuration in .magg/config.json in your current working directory. This allows for project-specific tool configurations.

Dynamic Configuration Reloading

Magg supports automatic configuration reloading without requiring a restart:

  • Automatic file watching: Detects changes to config.json and reloads automatically (uses watchdog when available)
  • SIGHUP signal: Send kill -HUP <pid> to trigger immediate reload (Unix-like systems)
  • MCP tool: Use magg_reload_config tool from any MCP client
  • Smart transitions: Only affected servers are restarted during reload

Configuration reload is enabled by default. You can control it with:

  • MAGG_AUTO_RELOAD=false - Disable automatic reloading
  • MAGG_RELOAD_POLL_INTERVAL=5.0 - Set polling interval in seconds (when watchdog unavailable)

See Configuration Reload Documentation for detailed information.

Environment Variables

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 mode
  • MAGG_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
}
}
}

Adding Servers

Servers can be added in several ways:

  1. Using the LLM (recommended):

    "Add the Playwright MCP server"
    "Search for and add a calculator tool"
    
  2. Manual configuration via magg_add_server:

    name: playwright
    url: https://github.com/microsoft/playwright-mcp
    command: npx @playwright/mcp@latest
    prefix: pw
    
  3. The magg server CLI (see below)

  4. Direct config editing: Edit .magg/config.json directly

Managing Servers from the CLI

Server and kit configuration can be managed entirely from the command line — no MCP client or running server required. The CLI edits .magg/config.json directly, and a running Magg instance picks up the changes automatically via config reload. (Tools that require a live server, like magg_search_servers, magg_check, and magg_smart_configure, remain available through any MCP client such as mbro.)

# List servers (human-readable, or JSON on stdout for scripting)
magg server list
magg server list --json
# Add a server
magg server add playwright https://github.com/microsoft/playwright-mcp \
--command "npx @playwright/mcp@latest" --prefix pw
# Add a server without enabling it, with transport options
magg server add web https://example.com/web --uri http://localhost:9000/mcp \
--transport '{"keep_alive": false}' --disable
# Update an existing server (pass '' to clear an optional field)
magg server update playwright --prefix play --notes "Browser automation"
magg server update playwright --command "npx @playwright/mcp@next"
magg server update playwright --notes ""# Enable / disable / inspect / remove
magg server enable playwright
magg server disable playwright
magg server info playwright --json
magg server remove playwright

Real-time Notifications with MaggClient

The MaggClient now supports real-time notifications from backend MCP servers:

frommaggimportMaggClient, MaggMessageHandler# Using callbackshandler=MaggMessageHandler(
on_tool_list_changed=lambdan: print("Tools changed!"),
on_progress=lambdan: print(f"Progress: {n.params.progress}")
)
asyncwithMaggClient("http://localhost:8000/mcp", message_handler=handler) asclient:
# Client will receive notifications while connectedtools=awaitclient.list_tools()

See Messaging Documentation for advanced usage including custom message handlers.

Kit Management

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
# Export the current configuration (or a loaded kit) as a kit file
magg kit export --name my-kit --output my-kit.json

When unloading a kit, servers that belong only to that kit are removed, while servers shared with other kits are kept.

You can also manage kits programmatically through Magg's tools when connected via an MCP client:

  • magg_list_kits - List all available kits
  • magg_load_kit - Load a kit and its servers
  • magg_unload_kit - Unload a kit
  • magg_kit_info - Get detailed kit information

Kits 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.

MBro Scripts

Automate common workflows with MBro scripts:

# Create a setup script
cat > setup.mbro <<EOF# Connect to Magg and check statusconnect magg magg servecall magg_statuscall magg_list_servers# Add a new server if neededcall magg_add_server name=calculator source="npx -y @modelcontextprotocol/server-calculator"EOF# Run the script
mbro -x setup.mbro

MCP 2026-07-28 (Stateless Spec)

The MCP 2026-07-28 spec moves the protocol to a stateless request/response core. Magg's take: something still has to own long-lived stdio subprocesses, backend connections, and tool-list caching — and that's exactly the layer an aggregator provides. See Magg and the Stateless MCP Spec for the impact analysis and migration plan, including how Magg bridges pre-2026 (stateful) backends to stateless-era clients and how hierarchical Magg deployments fit in.

Documentation

For more documentation, see docs/.

Appearances

Magg appears in multiple locations. Please feel free to submit a PR to add more appearances below in alphabetical order.

Listing, Index, and other MCP Sites

Magg ships a server.json manifest for the official MCP Registry (as io.github.sitbon/magg), and magg_search_servers queries the registry as a first-class discovery source alongside Glama, GitHub, and npm. See MCP Registry Documentation for publishing instructions.

mcp-name: io.github.sitbon/magg

Awesome GitHub MCP Lists

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Repository files navigation

🧲 Magg - The MCP Aggregator

Python VersionPyPI VersionGitHub ReleaseDeepWikiDownloads

TestsDocker

A Model Context Protocol server that manages, aggregates, and proxies other MCP servers, enabling LLMs to dynamically extend their own capabilities.

What is Magg?

Magg is a meta-MCP server that acts as a central hub for managing multiple MCP servers. It provides tools that allow LLMs to:

  • Search for new MCP servers and discover setup instructions
  • Add and configure MCP servers dynamically
  • Enable/disable servers on demand
  • Aggregate tools from multiple servers under unified prefixes
  • Persist configurations across sessions

Think of Magg as a "package manager for LLM tools" - it lets AI assistants install and manage their own capabilities at runtime.

Features

  • Self-Service Tool Management: LLMs can search for and add new MCP servers without human intervention.
  • Dynamic Configuration Reloading: Automatically detects and applies config changes without restarting.
  • Automatic Tool Proxying: Tools from added servers are automatically exposed with configurable prefixes.
  • ProxyMCP Tool: A built-in tool that proxies the MCP protocol to itself, for clients that don't support notifications or dynamic tool updates (which is most of them currently).
  • Smart Configuration: Uses MCP sampling to intelligently configure servers from just a URL.
  • Persistent Configuration: Maintains server configurations in .magg/config.json.
  • Multiple Transport Support: Works with stdio, HTTP, and in-memory transports.
  • Bearer Token Authentication: Optional RSA-based JWT authentication for secure HTTP access.
  • Docker Support: Pre-built images for production, staging, and development workflows.
  • Health Monitoring: Built-in magg_status and magg_check tools for server health checks.
  • Real-time Messaging: Full support for MCP notifications and messages - receive tool/resource updates and progress notifications from backend servers.
  • Python 3.12+ Support: Fully compatible with Python 3.12 and 3.13.
  • Kit Management: Bundle related MCP servers into kits for easy loading/unloading as a group.
  • MBro CLI: Included MCP Browser for interactive exploration and management of MCP servers, with script support for automation.

Installation

Prerequisites

  • Python 3.12 or higher (3.13+ recommended)
  • uv (recommended) - Install from astral.sh/uv

Quick Install (Recommended)

The 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

Alternative: Run Directly from GitHub

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

Local Development

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

Docker

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

Docker Image Strategy

Magg uses a multi-stage Docker build with three target stages:

  • pro (Production): Minimal image with WARNING log level, suitable for production deployments
  • pre (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 troubleshooting

Images are automatically published to GitHub Container Registry with the following tags:

  • Version tags (from main branch): 1.2.3, 1.2, dev, 1.2-dev, 1.2-dev-py3.12, etc.
  • Branch tags (from beta branch): beta, beta-dev
  • Python-specific dev tags: beta-dev-py3.12, beta-dev-py3.13, etc.

Pull requests build and test images but do not publish them unless a maintainer adds the push-image label, which publishes ephemeral pr-NN / pr-NN-dev tags (same-repo PRs only). Ephemeral pr-* tags and untagged manifests are cleaned up weekly; version tags are kept forever, so pinned deployments are never affected.

Docker Compose

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.

Usage

Running Magg

Magg can run in three modes:

  1. Stdio Mode (default) - For integration with Claude Desktop, Cline, Cursor, etc.:

    magg serve
  2. HTTP Mode - For system-wide access or web integrations:

    magg serve --http --port 8000
  3. 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

Available Tools

Once Magg is running, it exposes the following tools to LLMs:

  • magg_list_servers - List all configured MCP servers
  • magg_add_server - Add a new MCP server
  • magg_remove_server - Remove a server
  • magg_enable_server / magg_disable_server - Toggle server availability
  • magg_search_servers - Search for MCP servers online
  • magg_list_tools - List all available tools from all servers
  • magg_smart_configure - Intelligently configure a server from a URL
  • magg_analyze_servers - Analyze configured servers and suggest improvements
  • magg_status - Get server and tool statistics
  • magg_check - Health check servers with repair actions (report/remount/unmount/disable)
  • magg_reload_config - Reload configuration from disk and apply changes
  • magg_load_kit - Load a kit and its servers into the configuration
  • magg_unload_kit - Unload a kit and optionally its servers from the configuration
  • magg_list_kits - List all available kits with their status
  • magg_kit_info - Get detailed information about a specific kit

Quick Inspection with MBro

Magg 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:

  • Scripts: Create .mbro files with commands for automation
  • Shell-style arguments: Use key=value syntax instead of JSON
  • Tab completion: Rich parameter hints after connecting

See the MBro Documentation for details.

Authentication

Magg supports optional bearer token authentication to secure access:

Quick Start

  1. Initialize authentication (creates RSA keypair):

    magg auth init
  2. Generate a JWT token for clients:

    # Generate token (displays on screen)
    magg auth token
    # Export as environment variableexport MAGG_JWT=$(magg auth token -q)
  3. Connect with authentication:

    • Using MaggClient (auto-loads from MAGG_JWT):
      frommagg.clientimportMaggClientasyncdefmain():
      asyncwithMaggClient("http://localhost:8000/mcp") asclient:
      tools=awaitclient.list_tools()
    • Using FastMCP with explicit token:
      fromfastmcpimportClientfromfastmcp.clientimportBearerAuthjwt_token="your-jwt-token-here"asyncwithClient("http://localhost:8000/mcp", auth=BearerAuth(jwt_token)) asclient:
      tools=awaitclient.list_tools()

Key Management

  • Keys are stored in ~/.ssh/magg/ by default
  • Private key can be set via MAGG_PRIVATE_KEY environment variable
  • To disable auth, remove keys or set non-existent key_path in .magg/auth.json

Authentication Commands

  • magg auth init - Initialize authentication (generates RSA keypair)
  • magg auth status - Check authentication configuration
  • magg auth token - Generate JWT token
  • magg 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.

Configuration

Magg stores its configuration in .magg/config.json in your current working directory. This allows for project-specific tool configurations.

Dynamic Configuration Reloading

Magg supports automatic configuration reloading without requiring a restart:

  • Automatic file watching: Detects changes to config.json and reloads automatically (uses watchdog when available)
  • SIGHUP signal: Send kill -HUP <pid> to trigger immediate reload (Unix-like systems)
  • MCP tool: Use magg_reload_config tool from any MCP client
  • Smart transitions: Only affected servers are restarted during reload

Configuration reload is enabled by default. You can control it with:

  • MAGG_AUTO_RELOAD=false - Disable automatic reloading
  • MAGG_RELOAD_POLL_INTERVAL=5.0 - Set polling interval in seconds (when watchdog unavailable)

See Configuration Reload Documentation for detailed information.

Environment Variables

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 mode
  • MAGG_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
}
}
}

Adding Servers

Servers can be added in several ways:

  1. Using the LLM (recommended):

    "Add the Playwright MCP server"
    "Search for and add a calculator tool"
    
  2. Manual configuration via magg_add_server:

    name: playwright
    url: https://github.com/microsoft/playwright-mcp
    command: npx @playwright/mcp@latest
    prefix: pw
    
  3. The magg server CLI (see below)

  4. Direct config editing: Edit .magg/config.json directly

Managing Servers from the CLI

Server and kit configuration can be managed entirely from the command line — no MCP client or running server required. The CLI edits .magg/config.json directly, and a running Magg instance picks up the changes automatically via config reload. (Tools that require a live server, like magg_search_servers, magg_check, and magg_smart_configure, remain available through any MCP client such as mbro.)

# List servers (human-readable, or JSON on stdout for scripting)
magg server list
magg server list --json
# Add a server
magg server add playwright https://github.com/microsoft/playwright-mcp \
--command "npx @playwright/mcp@latest" --prefix pw
# Add a server without enabling it, with transport options
magg server add web https://example.com/web --uri http://localhost:9000/mcp \
--transport '{"keep_alive": false}' --disable
# Update an existing server (pass '' to clear an optional field)
magg server update playwright --prefix play --notes "Browser automation"
magg server update playwright --command "npx @playwright/mcp@next"
magg server update playwright --notes ""# Enable / disable / inspect / remove
magg server enable playwright
magg server disable playwright
magg server info playwright --json
magg server remove playwright

Real-time Notifications with MaggClient

The MaggClient now supports real-time notifications from backend MCP servers:

frommaggimportMaggClient, MaggMessageHandler# Using callbackshandler=MaggMessageHandler(
on_tool_list_changed=lambdan: print("Tools changed!"),
on_progress=lambdan: print(f"Progress: {n.params.progress}")
)
asyncwithMaggClient("http://localhost:8000/mcp", message_handler=handler) asclient:
# Client will receive notifications while connectedtools=awaitclient.list_tools()

See Messaging Documentation for advanced usage including custom message handlers.

Kit Management

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
# Export the current configuration (or a loaded kit) as a kit file
magg kit export --name my-kit --output my-kit.json

When unloading a kit, servers that belong only to that kit are removed, while servers shared with other kits are kept.

You can also manage kits programmatically through Magg's tools when connected via an MCP client:

  • magg_list_kits - List all available kits
  • magg_load_kit - Load a kit and its servers
  • magg_unload_kit - Unload a kit
  • magg_kit_info - Get detailed kit information

Kits 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.

MBro Scripts

Automate common workflows with MBro scripts:

# Create a setup script
cat > setup.mbro <<EOF# Connect to Magg and check statusconnect magg magg servecall magg_statuscall magg_list_servers# Add a new server if neededcall magg_add_server name=calculator source="npx -y @modelcontextprotocol/server-calculator"EOF# Run the script
mbro -x setup.mbro

MCP 2026-07-28 (Stateless Spec)

The MCP 2026-07-28 spec moves the protocol to a stateless request/response core. Magg's take: something still has to own long-lived stdio subprocesses, backend connections, and tool-list caching — and that's exactly the layer an aggregator provides. See Magg and the Stateless MCP Spec for the impact analysis and migration plan, including how Magg bridges pre-2026 (stateful) backends to stateless-era clients and how hierarchical Magg deployments fit in.

Documentation

For more documentation, see docs/.

Appearances

Magg appears in multiple locations. Please feel free to submit a PR to add more appearances below in alphabetical order.

Listing, Index, and other MCP Sites

Magg ships a server.json manifest for the official MCP Registry (as io.github.sitbon/magg), and magg_search_servers queries the registry as a first-class discovery source alongside Glama, GitHub, and npm. See MCP Registry Documentation for publishing instructions.

mcp-name: io.github.sitbon/magg

Awesome GitHub MCP Lists

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

🧲 Magg - The MCP Aggregator

Python VersionPyPI VersionGitHub ReleaseDeepWikiDownloads

TestsDocker

A Model Context Protocol server that manages, aggregates, and proxies other MCP servers, enabling LLMs to dynamically extend their own capabilities.

What is Magg?

Magg is a meta-MCP server that acts as a central hub for managing multiple MCP servers. It provides tools that allow LLMs to:

  • Search for new MCP servers and discover setup instructions
  • Add and configure MCP servers dynamically
  • Enable/disable servers on demand
  • Aggregate tools from multiple servers under unified prefixes
  • Persist configurations across sessions

Think of Magg as a "package manager for LLM tools" - it lets AI assistants install and manage their own capabilities at runtime.

Features

  • Self-Service Tool Management: LLMs can search for and add new MCP servers without human intervention.
  • Dynamic Configuration Reloading: Automatically detects and applies config changes without restarting.
  • Automatic Tool Proxying: Tools from added servers are automatically exposed with configurable prefixes.
  • ProxyMCP Tool: A built-in tool that proxies the MCP protocol to itself, for clients that don't support notifications or dynamic tool updates (which is most of them currently).
  • Smart Configuration: Uses MCP sampling to intelligently configure servers from just a URL.
  • Persistent Configuration: Maintains server configurations in .magg/config.json.
  • Multiple Transport Support: Works with stdio, HTTP, and in-memory transports.
  • Bearer Token Authentication: Optional RSA-based JWT authentication for secure HTTP access.
  • Docker Support: Pre-built images for production, staging, and development workflows.
  • Health Monitoring: Built-in magg_status and magg_check tools for server health checks.
  • Real-time Messaging: Full support for MCP notifications and messages - receive tool/resource updates and progress notifications from backend servers.
  • Python 3.12+ Support: Fully compatible with Python 3.12 and 3.13.
  • Kit Management: Bundle related MCP servers into kits for easy loading/unloading as a group.
  • MBro CLI: Included MCP Browser for interactive exploration and management of MCP servers, with script support for automation.

Installation

Prerequisites

  • Python 3.12 or higher (3.13+ recommended)
  • uv (recommended) - Install from astral.sh/uv

Quick Install (Recommended)

The 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

Alternative: Run Directly from GitHub

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

Local Development

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

Docker

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

Docker Image Strategy

Magg uses a multi-stage Docker build with three target stages:

  • pro (Production): Minimal image with WARNING log level, suitable for production deployments
  • pre (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 troubleshooting

Images are automatically published to GitHub Container Registry with the following tags:

  • Version tags (from main branch): 1.2.3, 1.2, dev, 1.2-dev, 1.2-dev-py3.12, etc.
  • Branch tags (from beta branch): beta, beta-dev
  • Python-specific dev tags: beta-dev-py3.12, beta-dev-py3.13, etc.

Pull requests build and test images but do not publish them unless a maintainer adds the push-image label, which publishes ephemeral pr-NN / pr-NN-dev tags (same-repo PRs only). Ephemeral pr-* tags and untagged manifests are cleaned up weekly; version tags are kept forever, so pinned deployments are never affected.

Docker Compose

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.

Usage

Running Magg

Magg can run in three modes:

  1. Stdio Mode (default) - For integration with Claude Desktop, Cline, Cursor, etc.:

    magg serve
  2. HTTP Mode - For system-wide access or web integrations:

    magg serve --http --port 8000
  3. 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

Available Tools

Once Magg is running, it exposes the following tools to LLMs:

  • magg_list_servers - List all configured MCP servers
  • magg_add_server - Add a new MCP server
  • magg_remove_server - Remove a server
  • magg_enable_server / magg_disable_server - Toggle server availability
  • magg_search_servers - Search for MCP servers online
  • magg_list_tools - List all available tools from all servers
  • magg_smart_configure - Intelligently configure a server from a URL
  • magg_analyze_servers - Analyze configured servers and suggest improvements
  • magg_status - Get server and tool statistics
  • magg_check - Health check servers with repair actions (report/remount/unmount/disable)
  • magg_reload_config - Reload configuration from disk and apply changes
  • magg_load_kit - Load a kit and its servers into the configuration
  • magg_unload_kit - Unload a kit and optionally its servers from the configuration
  • magg_list_kits - List all available kits with their status
  • magg_kit_info - Get detailed information about a specific kit

Quick Inspection with MBro

Magg 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:

  • Scripts: Create .mbro files with commands for automation
  • Shell-style arguments: Use key=value syntax instead of JSON
  • Tab completion: Rich parameter hints after connecting

See the MBro Documentation for details.

Authentication

Magg supports optional bearer token authentication to secure access:

Quick Start

  1. Initialize authentication (creates RSA keypair):

    magg auth init
  2. Generate a JWT token for clients:

    # Generate token (displays on screen)
    magg auth token
    # Export as environment variableexport MAGG_JWT=$(magg auth token -q)
  3. Connect with authentication:

    • Using MaggClient (auto-loads from MAGG_JWT):
      frommagg.clientimportMaggClientasyncdefmain():
      asyncwithMaggClient("http://localhost:8000/mcp") asclient:
      tools=awaitclient.list_tools()
    • Using FastMCP with explicit token:
      fromfastmcpimportClientfromfastmcp.clientimportBearerAuthjwt_token="your-jwt-token-here"asyncwithClient("http://localhost:8000/mcp", auth=BearerAuth(jwt_token)) asclient:
      tools=awaitclient.list_tools()

Key Management

  • Keys are stored in ~/.ssh/magg/ by default
  • Private key can be set via MAGG_PRIVATE_KEY environment variable
  • To disable auth, remove keys or set non-existent key_path in .magg/auth.json

Authentication Commands

  • magg auth init - Initialize authentication (generates RSA keypair)
  • magg auth status - Check authentication configuration
  • magg auth token - Generate JWT token
  • magg 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.

Configuration

Magg stores its configuration in .magg/config.json in your current working directory. This allows for project-specific tool configurations.

Dynamic Configuration Reloading

Magg supports automatic configuration reloading without requiring a restart:

  • Automatic file watching: Detects changes to config.json and reloads automatically (uses watchdog when available)
  • SIGHUP signal: Send kill -HUP <pid> to trigger immediate reload (Unix-like systems)
  • MCP tool: Use magg_reload_config tool from any MCP client
  • Smart transitions: Only affected servers are restarted during reload

Configuration reload is enabled by default. You can control it with:

  • MAGG_AUTO_RELOAD=false - Disable automatic reloading
  • MAGG_RELOAD_POLL_INTERVAL=5.0 - Set polling interval in seconds (when watchdog unavailable)

See Configuration Reload Documentation for detailed information.

Environment Variables

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 mode
  • MAGG_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
}
}
}

Adding Servers

Servers can be added in several ways:

  1. Using the LLM (recommended):

    "Add the Playwright MCP server"
    "Search for and add a calculator tool"
    
  2. Manual configuration via magg_add_server:

    name: playwright
    url: https://github.com/microsoft/playwright-mcp
    command: npx @playwright/mcp@latest
    prefix: pw
    
  3. The magg server CLI (see below)

  4. Direct config editing: Edit .magg/config.json directly

Managing Servers from the CLI

Server and kit configuration can be managed entirely from the command line — no MCP client or running server required. The CLI edits .magg/config.json directly, and a running Magg instance picks up the changes automatically via config reload. (Tools that require a live server, like magg_search_servers, magg_check, and magg_smart_configure, remain available through any MCP client such as mbro.)

# List servers (human-readable, or JSON on stdout for scripting)
magg server list
magg server list --json
# Add a server
magg server add playwright https://github.com/microsoft/playwright-mcp \
--command "npx @playwright/mcp@latest" --prefix pw
# Add a server without enabling it, with transport options
magg server add web https://example.com/web --uri http://localhost:9000/mcp \
--transport '{"keep_alive": false}' --disable
# Update an existing server (pass '' to clear an optional field)
magg server update playwright --prefix play --notes "Browser automation"
magg server update playwright --command "npx @playwright/mcp@next"
magg server update playwright --notes ""# Enable / disable / inspect / remove
magg server enable playwright
magg server disable playwright
magg server info playwright --json
magg server remove playwright

Real-time Notifications with MaggClient

The MaggClient now supports real-time notifications from backend MCP servers:

frommaggimportMaggClient, MaggMessageHandler# Using callbackshandler=MaggMessageHandler(
on_tool_list_changed=lambdan: print("Tools changed!"),
on_progress=lambdan: print(f"Progress: {n.params.progress}")
)
asyncwithMaggClient("http://localhost:8000/mcp", message_handler=handler) asclient:
# Client will receive notifications while connectedtools=awaitclient.list_tools()

See Messaging Documentation for advanced usage including custom message handlers.

Kit Management

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
# Export the current configuration (or a loaded kit) as a kit file
magg kit export --name my-kit --output my-kit.json

When unloading a kit, servers that belong only to that kit are removed, while servers shared with other kits are kept.

You can also manage kits programmatically through Magg's tools when connected via an MCP client:

  • magg_list_kits - List all available kits
  • magg_load_kit - Load a kit and its servers
  • magg_unload_kit - Unload a kit
  • magg_kit_info - Get detailed kit information

Kits 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.

MBro Scripts

Automate common workflows with MBro scripts:

# Create a setup script
cat > setup.mbro <<EOF# Connect to Magg and check statusconnect magg magg servecall magg_statuscall magg_list_servers# Add a new server if neededcall magg_add_server name=calculator source="npx -y @modelcontextprotocol/server-calculator"EOF# Run the script
mbro -x setup.mbro

MCP 2026-07-28 (Stateless Spec)

The MCP 2026-07-28 spec moves the protocol to a stateless request/response core. Magg's take: something still has to own long-lived stdio subprocesses, backend connections, and tool-list caching — and that's exactly the layer an aggregator provides. See Magg and the Stateless MCP Spec for the impact analysis and migration plan, including how Magg bridges pre-2026 (stateful) backends to stateless-era clients and how hierarchical Magg deployments fit in.

Documentation

For more documentation, see docs/.

Appearances

Magg appears in multiple locations. Please feel free to submit a PR to add more appearances below in alphabetical order.

Listing, Index, and other MCP Sites

Magg ships a server.json manifest for the official MCP Registry (as io.github.sitbon/magg), and magg_search_servers queries the registry as a first-class discovery source alongside Glama, GitHub, and npm. See MCP Registry Documentation for publishing instructions.

mcp-name: io.github.sitbon/magg

Awesome GitHub MCP Lists

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

🧲 Magg - The MCP Aggregator

Python VersionPyPI VersionGitHub ReleaseDeepWikiDownloads

TestsDocker

A Model Context Protocol server that manages, aggregates, and proxies other MCP servers, enabling LLMs to dynamically extend their own capabilities.

What is Magg?

Magg is a meta-MCP server that acts as a central hub for managing multiple MCP servers. It provides tools that allow LLMs to:

  • Search for new MCP servers and discover setup instructions
  • Add and configure MCP servers dynamically
  • Enable/disable servers on demand
  • Aggregate tools from multiple servers under unified prefixes
  • Persist configurations across sessions

Think of Magg as a "package manager for LLM tools" - it lets AI assistants install and manage their own capabilities at runtime.

Features

  • Self-Service Tool Management: LLMs can search for and add new MCP servers without human intervention.
  • Dynamic Configuration Reloading: Automatically detects and applies config changes without restarting.
  • Automatic Tool Proxying: Tools from added servers are automatically exposed with configurable prefixes.
  • ProxyMCP Tool: A built-in tool that proxies the MCP protocol to itself, for clients that don't support notifications or dynamic tool updates (which is most of them currently).
  • Smart Configuration: Uses MCP sampling to intelligently configure servers from just a URL.
  • Persistent Configuration: Maintains server configurations in .magg/config.json.
  • Multiple Transport Support: Works with stdio, HTTP, and in-memory transports.
  • Bearer Token Authentication: Optional RSA-based JWT authentication for secure HTTP access.
  • Docker Support: Pre-built images for production, staging, and development workflows.
  • Health Monitoring: Built-in magg_status and magg_check tools for server health checks.
  • Real-time Messaging: Full support for MCP notifications and messages - receive tool/resource updates and progress notifications from backend servers.
  • Python 3.12+ Support: Fully compatible with Python 3.12 and 3.13.
  • Kit Management: Bundle related MCP servers into kits for easy loading/unloading as a group.
  • MBro CLI: Included MCP Browser for interactive exploration and management of MCP servers, with script support for automation.

Installation

Prerequisites

  • Python 3.12 or higher (3.13+ recommended)
  • uv (recommended) - Install from astral.sh/uv

Quick Install (Recommended)

The 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

Alternative: Run Directly from GitHub

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

Local Development

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

Docker

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

Docker Image Strategy

Magg uses a multi-stage Docker build with three target stages:

  • pro (Production): Minimal image with WARNING log level, suitable for production deployments
  • pre (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 troubleshooting

Images are automatically published to GitHub Container Registry with the following tags:

  • Version tags (from main branch): 1.2.3, 1.2, dev, 1.2-dev, 1.2-dev-py3.12, etc.
  • Branch tags (from beta branch): beta, beta-dev
  • Python-specific dev tags: beta-dev-py3.12, beta-dev-py3.13, etc.

Pull requests build and test images but do not publish them unless a maintainer adds the push-image label, which publishes ephemeral pr-NN / pr-NN-dev tags (same-repo PRs only). Ephemeral pr-* tags and untagged manifests are cleaned up weekly; version tags are kept forever, so pinned deployments are never affected.

Docker Compose

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.

Usage

Running Magg

Magg can run in three modes:

  1. Stdio Mode (default) - For integration with Claude Desktop, Cline, Cursor, etc.:

    magg serve
  2. HTTP Mode - For system-wide access or web integrations:

    magg serve --http --port 8000
  3. 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

Available Tools

Once Magg is running, it exposes the following tools to LLMs:

  • magg_list_servers - List all configured MCP servers
  • magg_add_server - Add a new MCP server
  • magg_remove_server - Remove a server
  • magg_enable_server / magg_disable_server - Toggle server availability
  • magg_search_servers - Search for MCP servers online
  • magg_list_tools - List all available tools from all servers
  • magg_smart_configure - Intelligently configure a server from a URL
  • magg_analyze_servers - Analyze configured servers and suggest improvements
  • magg_status - Get server and tool statistics
  • magg_check - Health check servers with repair actions (report/remount/unmount/disable)
  • magg_reload_config - Reload configuration from disk and apply changes
  • magg_load_kit - Load a kit and its servers into the configuration
  • magg_unload_kit - Unload a kit and optionally its servers from the configuration
  • magg_list_kits - List all available kits with their status
  • magg_kit_info - Get detailed information about a specific kit

Quick Inspection with MBro

Magg 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:

  • Scripts: Create .mbro files with commands for automation
  • Shell-style arguments: Use key=value syntax instead of JSON
  • Tab completion: Rich parameter hints after connecting

See the MBro Documentation for details.

Authentication

Magg supports optional bearer token authentication to secure access:

Quick Start

  1. Initialize authentication (creates RSA keypair):

    magg auth init
  2. Generate a JWT token for clients:

    # Generate token (displays on screen)
    magg auth token
    # Export as environment variableexport MAGG_JWT=$(magg auth token -q)
  3. Connect with authentication:

    • Using MaggClient (auto-loads from MAGG_JWT):
      frommagg.clientimportMaggClientasyncdefmain():
      asyncwithMaggClient("http://localhost:8000/mcp") asclient:
      tools=awaitclient.list_tools()
    • Using FastMCP with explicit token:
      fromfastmcpimportClientfromfastmcp.clientimportBearerAuthjwt_token="your-jwt-token-here"asyncwithClient("http://localhost:8000/mcp", auth=BearerAuth(jwt_token)) asclient:
      tools=awaitclient.list_tools()

Key Management

  • Keys are stored in ~/.ssh/magg/ by default
  • Private key can be set via MAGG_PRIVATE_KEY environment variable
  • To disable auth, remove keys or set non-existent key_path in .magg/auth.json

Authentication Commands

  • magg auth init - Initialize authentication (generates RSA keypair)
  • magg auth status - Check authentication configuration
  • magg auth token - Generate JWT token
  • magg 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.

Configuration

Magg stores its configuration in .magg/config.json in your current working directory. This allows for project-specific tool configurations.

Dynamic Configuration Reloading

Magg supports automatic configuration reloading without requiring a restart:

  • Automatic file watching: Detects changes to config.json and reloads automatically (uses watchdog when available)
  • SIGHUP signal: Send kill -HUP <pid> to trigger immediate reload (Unix-like systems)
  • MCP tool: Use magg_reload_config tool from any MCP client
  • Smart transitions: Only affected servers are restarted during reload

Configuration reload is enabled by default. You can control it with:

  • MAGG_AUTO_RELOAD=false - Disable automatic reloading
  • MAGG_RELOAD_POLL_INTERVAL=5.0 - Set polling interval in seconds (when watchdog unavailable)

See Configuration Reload Documentation for detailed information.

Environment Variables

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 mode
  • MAGG_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
}
}
}

Adding Servers

Servers can be added in several ways:

  1. Using the LLM (recommended):

    "Add the Playwright MCP server"
    "Search for and add a calculator tool"
    
  2. Manual configuration via magg_add_server:

    name: playwright
    url: https://github.com/microsoft/playwright-mcp
    command: npx @playwright/mcp@latest
    prefix: pw
    
  3. The magg server CLI (see below)

  4. Direct config editing: Edit .magg/config.json directly

Managing Servers from the CLI

Server and kit configuration can be managed entirely from the command line — no MCP client or running server required. The CLI edits .magg/config.json directly, and a running Magg instance picks up the changes automatically via config reload. (Tools that require a live server, like magg_search_servers, magg_check, and magg_smart_configure, remain available through any MCP client such as mbro.)

# List servers (human-readable, or JSON on stdout for scripting)
magg server list
magg server list --json
# Add a server
magg server add playwright https://github.com/microsoft/playwright-mcp \
--command "npx @playwright/mcp@latest" --prefix pw
# Add a server without enabling it, with transport options
magg server add web https://example.com/web --uri http://localhost:9000/mcp \
--transport '{"keep_alive": false}' --disable
# Update an existing server (pass '' to clear an optional field)
magg server update playwright --prefix play --notes "Browser automation"
magg server update playwright --command "npx @playwright/mcp@next"
magg server update playwright --notes ""# Enable / disable / inspect / remove
magg server enable playwright
magg server disable playwright
magg server info playwright --json
magg server remove playwright

Real-time Notifications with MaggClient

The MaggClient now supports real-time notifications from backend MCP servers:

frommaggimportMaggClient, MaggMessageHandler# Using callbackshandler=MaggMessageHandler(
on_tool_list_changed=lambdan: print("Tools changed!"),
on_progress=lambdan: print(f"Progress: {n.params.progress}")
)
asyncwithMaggClient("http://localhost:8000/mcp", message_handler=handler) asclient:
# Client will receive notifications while connectedtools=awaitclient.list_tools()

See Messaging Documentation for advanced usage including custom message handlers.

Kit Management

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
# Export the current configuration (or a loaded kit) as a kit file
magg kit export --name my-kit --output my-kit.json

When unloading a kit, servers that belong only to that kit are removed, while servers shared with other kits are kept.

You can also manage kits programmatically through Magg's tools when connected via an MCP client:

  • magg_list_kits - List all available kits
  • magg_load_kit - Load a kit and its servers
  • magg_unload_kit - Unload a kit
  • magg_kit_info - Get detailed kit information

Kits 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.

MBro Scripts

Automate common workflows with MBro scripts:

# Create a setup script
cat > setup.mbro <<EOF# Connect to Magg and check statusconnect magg magg servecall magg_statuscall magg_list_servers# Add a new server if neededcall magg_add_server name=calculator source="npx -y @modelcontextprotocol/server-calculator"EOF# Run the script
mbro -x setup.mbro

MCP 2026-07-28 (Stateless Spec)

The MCP 2026-07-28 spec moves the protocol to a stateless request/response core. Magg's take: something still has to own long-lived stdio subprocesses, backend connections, and tool-list caching — and that's exactly the layer an aggregator provides. See Magg and the Stateless MCP Spec for the impact analysis and migration plan, including how Magg bridges pre-2026 (stateful) backends to stateless-era clients and how hierarchical Magg deployments fit in.

Documentation

For more documentation, see docs/.

Appearances

Magg appears in multiple locations. Please feel free to submit a PR to add more appearances below in alphabetical order.

Listing, Index, and other MCP Sites

Magg ships a server.json manifest for the official MCP Registry (as io.github.sitbon/magg), and magg_search_servers queries the registry as a first-class discovery source alongside Glama, GitHub, and npm. See MCP Registry Documentation for publishing instructions.

mcp-name: io.github.sitbon/magg

Awesome GitHub MCP Lists

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Repository files navigation

🧲 Magg - The MCP Aggregator

Python VersionPyPI VersionGitHub ReleaseDeepWikiDownloads

TestsDocker

A Model Context Protocol server that manages, aggregates, and proxies other MCP servers, enabling LLMs to dynamically extend their own capabilities.

What is Magg?

Magg is a meta-MCP server that acts as a central hub for managing multiple MCP servers. It provides tools that allow LLMs to:

  • Search for new MCP servers and discover setup instructions
  • Add and configure MCP servers dynamically
  • Enable/disable servers on demand
  • Aggregate tools from multiple servers under unified prefixes
  • Persist configurations across sessions

Think of Magg as a "package manager for LLM tools" - it lets AI assistants install and manage their own capabilities at runtime.

Features

  • Self-Service Tool Management: LLMs can search for and add new MCP servers without human intervention.
  • Dynamic Configuration Reloading: Automatically detects and applies config changes without restarting.
  • Automatic Tool Proxying: Tools from added servers are automatically exposed with configurable prefixes.
  • ProxyMCP Tool: A built-in tool that proxies the MCP protocol to itself, for clients that don't support notifications or dynamic tool updates (which is most of them currently).
  • Smart Configuration: Uses MCP sampling to intelligently configure servers from just a URL.
  • Persistent Configuration: Maintains server configurations in .magg/config.json.
  • Multiple Transport Support: Works with stdio, HTTP, and in-memory transports.
  • Bearer Token Authentication: Optional RSA-based JWT authentication for secure HTTP access.
  • Docker Support: Pre-built images for production, staging, and development workflows.
  • Health Monitoring: Built-in magg_status and magg_check tools for server health checks.
  • Real-time Messaging: Full support for MCP notifications and messages - receive tool/resource updates and progress notifications from backend servers.
  • Python 3.12+ Support: Fully compatible with Python 3.12 and 3.13.
  • Kit Management: Bundle related MCP servers into kits for easy loading/unloading as a group.
  • MBro CLI: Included MCP Browser for interactive exploration and management of MCP servers, with script support for automation.

Installation

Prerequisites

  • Python 3.12 or higher (3.13+ recommended)
  • uv (recommended) - Install from astral.sh/uv

Quick Install (Recommended)

The 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

Alternative: Run Directly from GitHub

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

Local Development

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

Docker

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

Docker Image Strategy

Magg uses a multi-stage Docker build with three target stages:

  • pro (Production): Minimal image with WARNING log level, suitable for production deployments
  • pre (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 troubleshooting

Images are automatically published to GitHub Container Registry with the following tags:

  • Version tags (from main branch): 1.2.3, 1.2, dev, 1.2-dev, 1.2-dev-py3.12, etc.
  • Branch tags (from beta branch): beta, beta-dev
  • Python-specific dev tags: beta-dev-py3.12, beta-dev-py3.13, etc.

Pull requests build and test images but do not publish them unless a maintainer adds the push-image label, which publishes ephemeral pr-NN / pr-NN-dev tags (same-repo PRs only). Ephemeral pr-* tags and untagged manifests are cleaned up weekly; version tags are kept forever, so pinned deployments are never affected.

Docker Compose

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.

Usage

Running Magg

Magg can run in three modes:

  1. Stdio Mode (default) - For integration with Claude Desktop, Cline, Cursor, etc.:

    magg serve
  2. HTTP Mode - For system-wide access or web integrations:

    magg serve --http --port 8000
  3. 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

Available Tools

Once Magg is running, it exposes the following tools to LLMs:

  • magg_list_servers - List all configured MCP servers
  • magg_add_server - Add a new MCP server
  • magg_remove_server - Remove a server
  • magg_enable_server / magg_disable_server - Toggle server availability
  • magg_search_servers - Search for MCP servers online
  • magg_list_tools - List all available tools from all servers
  • magg_smart_configure - Intelligently configure a server from a URL
  • magg_analyze_servers - Analyze configured servers and suggest improvements
  • magg_status - Get server and tool statistics
  • magg_check - Health check servers with repair actions (report/remount/unmount/disable)
  • magg_reload_config - Reload configuration from disk and apply changes
  • magg_load_kit - Load a kit and its servers into the configuration
  • magg_unload_kit - Unload a kit and optionally its servers from the configuration
  • magg_list_kits - List all available kits with their status
  • magg_kit_info - Get detailed information about a specific kit

Quick Inspection with MBro

Magg 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:

  • Scripts: Create .mbro files with commands for automation
  • Shell-style arguments: Use key=value syntax instead of JSON
  • Tab completion: Rich parameter hints after connecting

See the MBro Documentation for details.

Authentication

Magg supports optional bearer token authentication to secure access:

Quick Start

  1. Initialize authentication (creates RSA keypair):

    magg auth init
  2. Generate a JWT token for clients:

    # Generate token (displays on screen)
    magg auth token
    # Export as environment variableexport MAGG_JWT=$(magg auth token -q)
  3. Connect with authentication:

    • Using MaggClient (auto-loads from MAGG_JWT):
      frommagg.clientimportMaggClientasyncdefmain():
      asyncwithMaggClient("http://localhost:8000/mcp") asclient:
      tools=awaitclient.list_tools()
    • Using FastMCP with explicit token:
      fromfastmcpimportClientfromfastmcp.clientimportBearerAuthjwt_token="your-jwt-token-here"asyncwithClient("http://localhost:8000/mcp", auth=BearerAuth(jwt_token)) asclient:
      tools=awaitclient.list_tools()

Key Management

  • Keys are stored in ~/.ssh/magg/ by default
  • Private key can be set via MAGG_PRIVATE_KEY environment variable
  • To disable auth, remove keys or set non-existent key_path in .magg/auth.json

Authentication Commands

  • magg auth init - Initialize authentication (generates RSA keypair)
  • magg auth status - Check authentication configuration
  • magg auth token - Generate JWT token
  • magg 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.

Configuration

Magg stores its configuration in .magg/config.json in your current working directory. This allows for project-specific tool configurations.

Dynamic Configuration Reloading

Magg supports automatic configuration reloading without requiring a restart:

  • Automatic file watching: Detects changes to config.json and reloads automatically (uses watchdog when available)
  • SIGHUP signal: Send kill -HUP <pid> to trigger immediate reload (Unix-like systems)
  • MCP tool: Use magg_reload_config tool from any MCP client
  • Smart transitions: Only affected servers are restarted during reload

Configuration reload is enabled by default. You can control it with:

  • MAGG_AUTO_RELOAD=false - Disable automatic reloading
  • MAGG_RELOAD_POLL_INTERVAL=5.0 - Set polling interval in seconds (when watchdog unavailable)

See Configuration Reload Documentation for detailed information.

Environment Variables

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 mode
  • MAGG_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
}
}
}

Adding Servers

Servers can be added in several ways:

  1. Using the LLM (recommended):

    "Add the Playwright MCP server"
    "Search for and add a calculator tool"
    
  2. Manual configuration via magg_add_server:

    name: playwright
    url: https://github.com/microsoft/playwright-mcp
    command: npx @playwright/mcp@latest
    prefix: pw
    
  3. The magg server CLI (see below)

  4. Direct config editing: Edit .magg/config.json directly

Managing Servers from the CLI

Server and kit configuration can be managed entirely from the command line — no MCP client or running server required. The CLI edits .magg/config.json directly, and a running Magg instance picks up the changes automatically via config reload. (Tools that require a live server, like magg_search_servers, magg_check, and magg_smart_configure, remain available through any MCP client such as mbro.)

# List servers (human-readable, or JSON on stdout for scripting)
magg server list
magg server list --json
# Add a server
magg server add playwright https://github.com/microsoft/playwright-mcp \
--command "npx @playwright/mcp@latest" --prefix pw
# Add a server without enabling it, with transport options
magg server add web https://example.com/web --uri http://localhost:9000/mcp \
--transport '{"keep_alive": false}' --disable
# Update an existing server (pass '' to clear an optional field)
magg server update playwright --prefix play --notes "Browser automation"
magg server update playwright --command "npx @playwright/mcp@next"
magg server update playwright --notes ""# Enable / disable / inspect / remove
magg server enable playwright
magg server disable playwright
magg server info playwright --json
magg server remove playwright

Real-time Notifications with MaggClient

The MaggClient now supports real-time notifications from backend MCP servers:

frommaggimportMaggClient, MaggMessageHandler# Using callbackshandler=MaggMessageHandler(
on_tool_list_changed=lambdan: print("Tools changed!"),
on_progress=lambdan: print(f"Progress: {n.params.progress}")
)
asyncwithMaggClient("http://localhost:8000/mcp", message_handler=handler) asclient:
# Client will receive notifications while connectedtools=awaitclient.list_tools()

See Messaging Documentation for advanced usage including custom message handlers.

Kit Management

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
# Export the current configuration (or a loaded kit) as a kit file
magg kit export --name my-kit --output my-kit.json

When unloading a kit, servers that belong only to that kit are removed, while servers shared with other kits are kept.

You can also manage kits programmatically through Magg's tools when connected via an MCP client:

  • magg_list_kits - List all available kits
  • magg_load_kit - Load a kit and its servers
  • magg_unload_kit - Unload a kit
  • magg_kit_info - Get detailed kit information

Kits 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.

MBro Scripts

Automate common workflows with MBro scripts:

# Create a setup script
cat > setup.mbro <<EOF# Connect to Magg and check statusconnect magg magg servecall magg_statuscall magg_list_servers# Add a new server if neededcall magg_add_server name=calculator source="npx -y @modelcontextprotocol/server-calculator"EOF# Run the script
mbro -x setup.mbro

MCP 2026-07-28 (Stateless Spec)

The MCP 2026-07-28 spec moves the protocol to a stateless request/response core. Magg's take: something still has to own long-lived stdio subprocesses, backend connections, and tool-list caching — and that's exactly the layer an aggregator provides. See Magg and the Stateless MCP Spec for the impact analysis and migration plan, including how Magg bridges pre-2026 (stateful) backends to stateless-era clients and how hierarchical Magg deployments fit in.

Documentation

For more documentation, see docs/.

Appearances

Magg appears in multiple locations. Please feel free to submit a PR to add more appearances below in alphabetical order.

Listing, Index, and other MCP Sites

Magg ships a server.json manifest for the official MCP Registry (as io.github.sitbon/magg), and magg_search_servers queries the registry as a first-class discovery source alongside Glama, GitHub, and npm. See MCP Registry Documentation for publishing instructions.

mcp-name: io.github.sitbon/magg

Awesome GitHub MCP Lists