Magg is a Model Context Protocol (MCP) aggregator server that enables LLMs to dynamically extend their capabilities. It acts as a central hub for managing multiple MCP servers, allowing AI assistants to discover, install, and configure their own tools at runtime.
uv
(recommended) - Install from astral.sh/uvThe easiest way to install Magg is using uv
:
# Install Magg as a tool
uv tool install magg
# Run with stdio transport (for Claude Desktop, Cline, etc.)
magg serve
# Run with HTTP transport (for system-wide access)
magg serve --http
You can run Magg directly 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
Magg is available as pre-built Docker images:
# Run production image
docker run -p 8000:8000 ghcr.io/sitbon/magg:latest
# Run with authentication (mount 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 with custom config directory
docker run -p 8000:8000 \
-v /path/to/config:/home/magg/.magg \
ghcr.io/sitbon/magg:latest
Magg can run in two modes:
Stdio Mode (default) - For integration with Claude Desktop, Cline, Cursor, etc.:
magg serve
HTTP Mode - For system-wide access or web integrations:
magg serve --http --port 8000
Once Magg is running, it exposes these tools to LLMs:
magg_list_servers
- List all configured MCP serversmagg_add_server
- Add a new MCP servermagg_remove_server
- Remove a servermagg_enable_server
/ magg_disable_server
- Toggle server availabilitymagg_search_servers
- Search for MCP servers onlinemagg_list_tools
- List all available tools from all serversmagg_smart_configure
- Intelligently configure a server from a URLmagg_analyze_servers
- Analyze configured servers and suggest improvementsmagg_status
- Get server and tool statisticsmagg_check
- Health check servers with repair actionsmagg_reload_config
- Reload configuration from diskmagg_load_kit
- Load a kit and its servers into the configurationmagg_unload_kit
- Unload a kit from the configurationmagg_list_kits
- List all available kits with their statusmagg_kit_info
- Get detailed information about a specific kitMagg supports optional bearer token authentication:
# Initialize authentication (creates RSA keypair)
magg auth init
# Generate a JWT token for clients
magg auth token
# Export as environment variable
export MAGG_JWT=$(magg auth token -q)
Connect with authentication using MaggClient
:
from magg.client import MaggClient
async def main():
async with MaggClient("http://localhost:8000/mcp") as client:
tools = await client.list_tools()
Magg stores its configuration in .magg/config.json
in your current working directory. Example configuration:
{
"servers": {
"calculator": {
"name": "calculator",
"source": "https://github.com/executeautomation/calculator-mcp",
"command": "npx @executeautomation/calculator-mcp",
"prefix": "calc",
"enabled": true
}
}
}
Servers can be added in several ways:
Using the LLM (recommended):
"Add the Playwright MCP server"
"Search for and add a calculator tool"
Manual configuration via magg_add_server
:
name: playwright
url: https://github.com/microsoft/playwright-mcp
command: npx @playwright/mcp@latest
prefix: pw
Direct config editing: Edit .magg/config.json
directly
Magg supports organizing related MCP servers into "kits" - bundles that can be loaded and unloaded as a group:
# List available kits
mbro call magg_list_kits
# Load a kit (adds all its servers)
mbro call magg_load_kit name="web-tools"
# Unload a kit (removes servers only in that kit)
mbro call magg_unload_kit name="web-tools"
Kits are JSON files stored in ~/.magg/kit.d/
or .magg/kit.d/
that define a collection of related servers.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "magg" '{"command":"magg","args":["serve"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"magg": {
"command": "magg",
"args": [
"serve"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"magg": {
"command": "magg",
"args": [
"serve"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect