NanoGridBot - AI Agent Development Console powered by Claude Agent SDK. Build, test, and verify AI agents with Skills, MCP, and CLI integrations using the most capable agent runtime.
NanoGridBot is a comprehensive agent development platform powered by Claude Agent SDK. It provides the most capable agent runtime with deep Skills, MCP, and CLI integration verification capabilities:
- π₯ Claude Agent SDK Powered - Most capable agent runtime with Claude Code
- π οΈ Skills & MCP Integration - Verify Skills, MCP servers, and CLI tools in isolated containers
- π Model Switching - Via container env vars (ANTHROPIC_MODEL, ANTHROPIC_API_KEY, etc.)
- π‘ 8 IM Channels - Test in production-like environments (WhatsApp, Telegram, Slack, Discord, QQ, Feishu, WeCom, DingTalk)
- β‘ Interactive Shell - Real-time debugging with session resume capability
- π οΈ 5 CLI Modes: serve, shell, run, logs, session
| Feature | Traditional Development | NanoGridBot |
|---|---|---|
| Agent Runtime | Manual setup | Claude Agent SDK - most powerful capability |
| Skills/MCP/CLI | Hard to test | Integrated verification in isolated containers |
| Debugging | Logs + print | Interactive shell + Web real-time monitoring |
| Multi-turn | Stateless | Session resume + IPC message streaming |
| Team Collaboration | Single agent | Claude Agent SDK Teams support |
- Skills & MCP Verification - Verify Skills, MCP servers, and CLI tools in isolated containers
- Interactive Agent Development - Use
shellmode for real-time debugging - Agent Behavior Testing - Test agent behavior across 8 IM channels
- Feature Prototyping - Use
runmode for quick prompt/feature validation - Personal AI Assistant - Deploy with
servemode for daily use - Task Automation - Schedule recurring tasks with built-in scheduler
- Python 3.12+
- Docker
- Git
# Clone repository
git clone https://github.com/yourusername/nanogridbot.git
cd nanogridbot
# Install with uv (recommended)
uv sync
# Build Agent container image
docker build -t nanogridbot-agent:latest container/
# Start service
uv run nanogridbot serve# 1. Serve mode: Start full service with Web dashboard
nanogridbot serve
nanogridbot serve --host 0.0.0.0 --port 8080
# 2. Shell mode: Interactive container session (multi-turn conversation)
nanogridbot shell
nanogridbot shell -g myproject # Specify group
nanogridbot shell --resume session-id # Resume previous session
# 3. Run mode: Single-shot non-interactive execution
nanogridbot run -p "Explain what recursion is"
echo "Your question" | nanogridbot run -p -
nanogridbot run -g myproject -p "Analyze code" # Specify group
nanogridbot run -g myproject -p "Task" --timeout 60 --env KEY=VALUE
# 4. Logs mode: View and follow logs
nanogridbot logs -n 100 # Show last 100 lines
nanogridbot logs -f # Follow log output
# 5. Session mode: Manage interactive sessions
nanogridbot session ls # List sessions
nanogridbot session kill <id> # Terminate session
nanogridbot session resume <id> # Show resume infoβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β NanoGridBot Agent Development Platform β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
β β CLI Tools β β Web Dashboardβ β Channels β β
β β(Debug/Test) β β (Status/Logs)β β(Multi-platformβ β
β ββββββββ¬ββββββββ ββββββββ¬ββββββββ ββββββββ¬ββββββββ β
β β β β β
β ββββββββββββββββββββββΌβββββββββββββββββββββ β
β βΌ β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Core Orchestration Layer β β
β β β’ Message Routing β’ Task Scheduling β’ Container β β
β β β’ Plugin Loading β’ Group Queue β β
β βββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββ β
β β β
β βΌ β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Container Isolation Layer β β
β β β’ Docker Container β’ Filesystem Isolation β’ IPC β β
β β β’ Claude Agent SDK β’ Session Management β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Module | Responsibility | File |
|---|---|---|
| Orchestrator | Global state management, message loop, channel coordination | core/orchestrator.py |
| ContainerRunner | Container lifecycle, mount configuration | core/container_runner.py |
| ContainerSession | Interactive session management, IPC communication | core/container_session.py |
| GroupQueue | Concurrency control, message queuing, retry mechanism | core/group_queue.py |
| TaskScheduler | Cron/Interval/OneTime task scheduling | core/task_scheduler.py |
| Router | Message routing, trigger matching, broadcasting | core/router.py |
| Database | SQLite persistence, message cache | database/ |
| Channels | 8 messaging platform adapters | channels/ |
- Claude Agent SDK Native Capabilities: Built on Claude Code with Agent Teams, Session Resume, and Transcript Archiving
- MCP Deep Integration: Configure custom MCP servers via
mcpServers, agents can invoke them directly - Skills Zero-Threshold Verification: Use
shellmode to directly test Skills performance in agents - Filesystem Isolation: Each group has independent
/workspace/groupdirectory for secure isolation - Conversation Persistence: PreCompact Hook automatically archives conversation history
- IPC Message Streaming: Multi-turn dialogue support with real-time message push to running agents
NanoGridBot borrowed the core container isolation concept from NanoClaw and enhanced it:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Host System (NanoGridBot) β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Agent Container (Docker) β β
β β β’ Claude Agent SDK β β
β β β’ Non-root user (node:1000) β β
β β β’ Explicit mounts (whitelist only) β β
β β β’ Network isolation (--network=none) β β
β β β’ IPC file watching (follow-up messages) β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β²
β JSON via stdin/stdout
β OR IPC files
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Host System (NanoGridBot) β
β β’ Message polling (2s interval) β
β β’ SQLite state persistence β
β β’ Group queue (concurrency control) β
β β’ Task scheduling (Cron) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- β Model Switching: Via container env vars (ANTHROPIC_MODEL, ANTHROPIC_API_KEY, etc.)
- β Container Isolation: Agents run in isolated Docker containers for security
- β Session Management: Multi-turn dialogue support with session persistence
- β Context Management: Independent context for different projects/groups
- β Real-time Monitoring: Web dashboard for Agent status and output
- β Interactive Debugging: Shell mode for direct Agent conversation
8 IM channels enable realistic scenario simulation for agent behavior testing, not the primary development goal.
| Channel | SDK | Status |
|---|---|---|
| pywa | β | |
| Telegram | python-telegram-bot | β |
| Slack | python-slack-sdk | β |
| Discord | discord.py | β |
| NoneBot2/OneBot | β | |
| Feishu | lark-oapi | β |
| WeCom | httpx | β |
| DingTalk | dingtalk-stream | β |
- π Plugin System: Hot-reload plugins, custom processing logic
- π Web Dashboard: Real-time status, task management, log viewing
- π Task Scheduling: Cron expressions, interval tasks, one-time tasks
- π Security Isolation: Mount whitelist, path traversal protection
# Help
nanogridbot --help
# Version
nanogridbot --version
# Serve mode: Full service with web dashboard
nanogridbot serve # Default
nanogridbot serve --host 0.0.0.0 # Custom address
nanogridbot serve --port 9000 # Custom port
nanogridbot serve --debug # Debug mode
# Shell mode: Interactive container session (multi-turn)
nanogridbot shell # Default (group: cli)
nanogridbot shell -g myproject # Specify group folder
nanogridbot shell --resume session-id # Resume previous session
nanogridbot shell --attach # Attach to container shell
# Run mode: Single-shot non-interactive execution
nanogridbot run -p "Explain what closures are"
echo "Question" | nanogridbot run -p - # Pipe input
nanogridbot run -g mygroup -p "Task" # Specify group
nanogridbot run -p "Task" --timeout 60 # Custom timeout
nanogridbot run -p "Task" -e KEY=VALUE # Environment variables
# Logs mode: View and follow logs
nanogridbot logs -n 100 # Show last 100 lines
nanogridbot logs -f # Follow log output
# Session mode: Manage interactive sessions
nanogridbot session ls # List all sessions
nanogridbot session kill <id> # Terminate a session
nanogridbot session resume <id> # Show resume infoAll CLI modes support shared LLM parameters:
--model MODEL # Model name (default: claude-sonnet-4-20250514)
--max-tokens MAX_TOKENS # Max tokens (default: 4096)
--temperature TEMP # Temperature (default: 0.7)
--system SYSTEM # System prompt
--stream # Stream outputnanogridbot/
βββ src/nanogridbot/ # Source code
β βββ core/ # Core modules
β β βββ orchestrator.py
β β βββ container_runner.py
β β βββ container_session.py
β β βββ group_queue.py
β β βββ task_scheduler.py
β β βββ router.py
β β βββ mount_security.py
β βββ database/ # Database layer
β βββ channels/ # Messaging channels
β βββ plugins/ # Plugin system
β βββ web/ # Web dashboard
β βββ cli.py # CLI entry
βββ container/ # Agent container
βββ tests/ # Tests
βββ docs/ # Documentation
βββ data/ # Runtime data
# Run tests
pytest -xvs
# Coverage report
pytest --cov=src --cov-report=html
# Code formatting
black . && isort .
# Type checking
mypy src/
# Linting
ruff check .# plugins/my_plugin/plugin.py
from nanogridbot.plugins.base import Plugin
class MyPlugin(Plugin):
@property
def name(self) -> str:
return "my_plugin"
async def on_message_received(self, message):
# Process message
return message# Build image
docker-compose build
# Start service
docker-compose up -d
# View logs
docker-compose logs -f
# Stop service
docker-compose down- Configure environment variables
- Set mount whitelist
- Configure reverse proxy (Nginx)
- Enable HTTPS
- Configure monitoring alerts
- Architecture Design - Detailed module design and code examples
- Implementation Plan - Development phase planning
- Project Comparison Analysis - Comparison with similar projects
- Quick Start - Installation and usage guide
- Work Log - Development progress
- NanoClaw - Source of container isolation inspiration
- Expanded from "messaging bot" to "agent development platform"
- FastAPI - Web framework
- Pydantic - Data validation
MIT License - See LICENSE file.
Version: v0.1.0-alpha
Last Updated: 2026-02-16