DE
dealenx/ai-factory-extension-mcp-template
ai-factory-extension-mcp-template
A minimal template for packaging MCP servers as an ai-factory extension. Use it to quickly distribute one or more MCP servers across all agents managed by ai-factory.
Quick Start
- Click "Use this template" on GitHub to create your own repository from this template, then clone it. Alternatively, fork or clone this repository directly.
- Edit
extension.json— set your extensionname,version,description, and list every MCP server in themcpServersarray. - For each server, create a JSON template in the
mcp/directory. - Install the extension into your project:
# from a local directory
ai-factory extension add ./ai-factory-extension-mcp-template
# or from a git repo
ai-factory extension add https://github.com/<user>/<repo>.gitThat's it — ai-factory merges the MCP server configs into every agent that supports MCP (Claude Code, Cline, etc.).
Project Structure
ai-factory-extension-mcp-template/
├── extension.json # Extension manifest (required)
├── mcp/ # MCP server templates
│ └── playwright.json # Example: Playwright MCP server
├── package.json
├── LICENSE
└── README.md
How It Works
extension.json
The manifest declares which MCP servers the extension provides:
{
"name": "ai-factory-extension-mcp-template",
"version": "1.0.0",
"description": "Template: hello MCP server inside ai-factory extension",
"mcpServers": [
{
"key": "playwright",
"template": "./mcp/playwright.json",
"instruction": "Playwright MCP: Install Chrome to use a web browser"
}
]
}| Field | Description |
|---|---|
key |
Unique identifier for the server entry in the agent's settings file. |
template |
Path to a JSON file with the server's command, args, and env. |
instruction |
Message shown to the user after install (e.g. required env vars). |
MCP Template (mcp/*.json)
Each template follows the standard MCP server format:
{
"command": "npx",
"args": ["@playwright/mcp@latest"]
}You can also pass environment variables:
{
"command": "npx",
"args": ["-y", "@my-org/my-mcp-server"],
"env": {
"MY_API_KEY": "${MY_API_KEY}"
}
}Adding More MCP Servers
- Create a new template file in
mcp/, e.g.mcp/my-server.json. - Add a new entry to the
mcpServersarray inextension.json:
{
"key": "my-server",
"template": "./mcp/my-server.json",
"instruction": "Set MY_API_KEY environment variable before use"
}- Re-install the extension to apply:
ai-factory extension remove ai-factory-extension-mcp-template
ai-factory extension add ./ai-factory-extension-mcp-templateManaging the Extension
# List installed extensions
ai-factory extension list
# Remove the extension (cleans up MCP entries from agent configs)
ai-factory extension remove ai-factory-extension-mcp-templateDocumentation
- ai-factory Extensions Guide — full reference for extension manifest fields, MCP servers, injections, commands, skills, and agents.
License
On this page
Contributors
MIT License
Created February 22, 2026
Updated March 1, 2026