Agent Factory MCP
Allows interaction with Ollama for running local LLM models, enabling AI agents to leverage locally-hosted language models.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Agent Factory MCP Register ollama as a local LLM agent for local inference."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Agent Factory MCP
A universal Model Context Protocol (MCP) server that automatically discovers and registers CLI tools as MCP tools. Transform any CLI tool (Qwen, Ollama, Aider, etc.) into an AI-powered agent with persona configuration.
Features
Auto-Discovery: Automatically parse CLI
--helpoutput to generate tool metadataZero-Code Registration: Register tools via config file or command-line arguments
Persona Support: Configure system prompts to create specialized AI agents
Multi-Provider: Use multiple AI tools simultaneously (Qwen, Gemini, Aider, etc.)
Runtime Registration: Add new tools dynamically via MCP protocol
Related MCP server: AutoMCP
Architecture
graph TB
subgraph "MCP Client"
A[Claude Desktop / Claude Code]
end
subgraph "Agent Factory MCP Server"
B[Server Entry Point]
C[Config Loader]
D[Tool Registry]
E[Dynamic Tool Factory]
subgraph "Providers"
F[QwenProvider]
G[GenericCliProvider]
end
subgraph "Parsers"
H[HelpParser]
end
end
subgraph "CLI Tools"
I[qwen]
J[gemini]
K[aider]
L[ollama]
M[...any CLI tool]
end
A -->|stdio| B
B --> C
B -->|CLI args| G
C -->|load config| D
G -->|create| D
D --> E
E -->|generate| F
F -->|execute| I
F -->|execute| J
F -->|execute| K
G -->|parse --help| H
H -->|metadata| GState Transition
stateDiagram-v2
[*] --> Initialization
Initialization --> LoadConfig: Start
Initialization --> ProcessCLIArgs: CLI args provided
LoadConfig --> ProcessCLIArgs: Config loaded
ProcessCLIArgs --> RegisterProviders
RegisterProviders --> ProviderCreated: Tool available
RegisterProviders --> ProviderSkipped: Tool not found
ProviderCreated --> GenerateTools
ProviderSkipped --> RegisterProviders: Next tool
GenerateTools --> ToolRegistered
ToolRegistered --> RegisterProviders: Next tool
RegisterProviders --> ServerRunning: All tools processed
ServerRunning --> [*]: Ready for MCP requests
ServerRunning --> RuntimeRegistration: register_cli_tool called
RuntimeRegistration --> ServerRunning: Tool added
note right of LoadConfig
Loads ai-tools.json
or .qwencoderc.json
end note
note right of ProcessCLIArgs
Parses CLI args like:
npx agent-factory-mcp qwen gemini aider
end noteInstallation
# Install via npm
npm install -g agent-factory-mcp
# Or use with npx without installation
npx agent-factory-mcp
# Or use with bun
bunx agent-factory-mcpConfiguration
Method 1: Command-Line Arguments
Register tools directly via CLI arguments:
npx agent-factory-mcp qwen gemini aiderMethod 2: Configuration File
Create ai-tools.json in your project root:
{
"$schema": "./schema.json",
"version": "1.0",
"tools": [
{
"command": "qwen",
"alias": "code-reviewer",
"description": "Code review expert focusing on security and performance",
"systemPrompt": "You are a senior code reviewer. Focus on security vulnerabilities, performance issues, and maintainability."
},
{
"command": "qwen",
"alias": "doc-writer",
"description": "Technical documentation specialist",
"systemPrompt": "You write clear, concise technical documentation for developers."
}
]
}Method 3: Runtime Registration
Use the register_cli_tool MCP tool:
register_cli_tool({
command: "ollama",
alias: "local-llm",
description: "Run local LLM models via Ollama",
systemPrompt: "You are a helpful AI assistant running locally.",
persist: true
})MCP Client Setup
Claude Desktop
Add to your Claude Desktop config:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/claude/claude_desktop_config.json
{
"mcpServers": {
"agent-factory": {
"command": "npx",
"args": ["agent-factory-mcp", "qwen", "gemini", "aider"]
}
}
}Claude Code CLI
claude mcp add agent-factory -- npx agent-factory-mcp qwen gemini aiderUsage Examples
Using Specialized Agents
# Code review with security focus
"Use code-reviewer to analyze this file for security issues"
# Documentation generation
"Ask doc-writer to generate API docs for this module"
# General AI assistance
"Use ask-qwen to explain this code"Multiple AI Tools
# Use different AIs for different tasks
"Use gemini-vision to analyze this screenshot"
"Use aider to refactor this function"
"Use qwen to review the changes"Configuration Schema
See schema.json for the full configuration schema:
Field | Type | Required | Description |
| string | ✅ | CLI command to register (e.g., "qwen", "ollama") |
| boolean | ❌ | Whether the tool is enabled (default: true) |
| string | ❌ | Custom tool name (default: "ask-{command}") |
| string | ❌ | Custom tool description |
| string | ❌ | System prompt for AI persona |
| string | ❌ | Provider type: "cli-auto" or "custom" |
| object | ❌ | Default argument values |
Development
# Install dependencies
bun install
# Build
bun run build
# Run tests
bun test
# Type check
bun run type-check
# Lint
bun run lint
# Format
bun run formatProject Structure
agent-factory-mcp/
├── src/
│ ├── index.ts # Server entry point
│ ├── constants.ts # Constants
│ ├── providers/ # Provider implementations
│ │ ├── base-cli.provider.ts
│ │ ├── generic-cli.provider.ts
│ │ └── qwen.provider.ts
│ ├── tools/ # Tool registry and factory
│ │ ├── registry.ts
│ │ ├── dynamic-tool-factory.ts
│ │ └── simple-tools.ts
│ ├── parsers/ # CLI help parser
│ │ └── help-parser.ts
│ ├── types/ # TypeScript types
│ │ └── cli-metadata.ts
│ └── utils/ # Utilities
│ ├── configLoader.ts
│ ├── commandExecutor.ts
│ ├── logger.ts
│ └── progressManager.ts
├── test/ # Test files
├── ai-tools.json.example # Example configuration
├── schema.json # JSON schema
└── Taskfile.yml # Task runner configurationContributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License - see LICENSE for details.
Available Tools
4 toolsask-qwenA
Execute Qwen AI to get responses. Supports model selection.
Inputs: prompt (required), model.
HelpA
Shows the QwenCode help text
Inputs: no named parameters.
PingB
A simple test tool that echoes back a message
Inputs: message.
register_cli_toolA
Dynamically register a CLI tool as an MCP tool. The tool must be available in PATH.
Inputs: command (required), alias, persist, description, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool serves a distinct purpose: Ping for connectivity testing, Help for documentation, register_cli_tool for dynamic tool registration, and ask-qwen for AI queries. No overlap exists.
Tool names use inconsistent conventions: Ping and Help are capitalized and single words, register_cli_tool is lowercase snake_case, and ask-qwen uses a lowercase dash. No clear pattern.
With only 4 tools, the set is well-scoped for a lightweight toolkit combining testing, help, registration, and AI query capabilities. Not excessive or insufficient.
Given the server name 'Agent Factory MCP', the tool surface is incomplete—missing basic agent management operations like list, delete, or update agents. The current tools do not form a coherent factory workflow.
Maintenance
Related MCP Connectors
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
A registry of AI agent tools — MCP servers, APIs, CLIs, SDKs — kept current by automated ingestion.
MCP server for building and testing AI agents with multi-model experimentation and insights.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that publishes CLI tools on your machine for discoverability by LLMs4 npm1MIT
- AlicenseNot gradedqualityDmaintenanceAutomatically converts CLI tools, APIs, and programs into MCP servers for LLM and agentic use, enabling rapid integration without manual server implementation.1MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables AI agents to automatically discover, install, and learn to use new tools without manual configuration.62 npm19MIT
- AlicenseNot gradedqualityCmaintenanceUniversal MCP server that wraps any CLI tool, enabling AI assistants to run commands via natural language.1MIT