An MCP server for spawning isolated Qwen sub-agents with secure project isolation and dynamic tool management.
- Dynamic Agent Discovery: Automatically discovers and loads agent configurations
- Project Isolation: Each agent operates in isolated environments with separate workspaces
- Security-First Design: Comprehensive file safety checks and environment variable protection
- Conversation Management: Persistent history and context sharing between agents
- Dynamic Tool Generation: Auto-creates MCP tools for each discovered agent type
- Flexible Configuration: Customizable timeouts, cleanup policies, and agent permissions
-
Clone the repository:
git clone https://github.com/greenmutton/kommand.git cd kommand -
Install dependencies:
pip install fastmcp==2.11.0
-
Set up environment variables:
export KOMMAND_BASE_DIR="$HOME/base/kommand" export KOMMAND_VENV="$HOME/base/venvs/kommand/bin/activate"
Currently this project has only been tested with qwen-code (a fork of gemini-cli). However it can easily be extended to work with any CLI agent that supports non-interactive task-passing via stdin. Explicit support for other CLI agents is planned in a later release.
A more advanced organization system for handling a large number of specialist agents is also in the plans.
Create agent directories under $KOMMAND_BASE_DIR/agents/ with:
specialization.json- Agent configurationsystem_prompt.txt- Agent's system prompt.env- Environment variables, such as OPENAI_API_KEY, OPENAI_BASE_URL, OPENAI_MODEL
Example specialization.json:
{
"mcp_servers": ["filesystem", "git"],
"sub_agents": ["researcher", "analyst"],
"timeout_sec": 30000,
"cleanup_after": true,
"max_workspace_files": 50
}"mcpServers": {
"mcp-kommander": {
"command": "/path/to/venvs/kommander-venv/bin/activate",
"args": [
"/path/to/mcp_kommander.py"
],
"env": {
"KOMMAND_BASE_DIR": "/path/to/base/dir",
"KOMMAND_VENV": "/path/to/venvs/kommander-venv/bin/activate"
}
}
}Each agent has:
workspace/- Temporary working filesoutput/- Generated artifactslogs/- Execution logsconversation_history.json- Persistent conversation history
- File safety checks with extension and content validation
- Sensitive environment variable protection
- Path traversal prevention
- Execution permission restrictions
- Workspace file count and size limits
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
GLM-4.5, K2, @greenmutton
MIT License - see LICENSE file for details.