Skip to content
Back to search

nano-agent

A MCP Server for a small scale engineering agents with multi-provider LLM support.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/disler--nano-agent/badge.svg)](/listings/disler--nano-agent)

HTML

<a href="/listings/disler--nano-agent"><img src="/api/listings/disler--nano-agent/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Quick Install (Recommended)

- Install [Astral UV](https://docs.astral.sh/uv/getting-started/installation/) - Setup [Claude Code](https://docs.anthropic.com/en/docs/claude-code/overview) - Setup [Ollama](https://ollama.com/) - Get your OpenAI API key and Anthropic API key - Setup dotenv - `cp ./.env.sample ./.env` and fill out variables - `cp ./apps/nano_agent_mcp_server/.env.sample ./apps/nano_agent_mcp_server/.env` and fill out variables - Clone the repository - `git clone https://github.com/disler/nano-agent` - Global Install `nano-agent` to expose it for Claude Code (any mcp client) - `cd nano-agent/apps/nano_agent_mcp_server` - `./scripts/install.sh` - `uv tool install -e .` - cp `.mcp.json.sample` to `.mcp.json` to use `nano-agent` - You should end up with a `.mcp.json` file that looks like this:

{
  "mcpServers": {
    "nano-agent": {
      "command": "nano-agent",
      "args": []
    }
  }
}

- You can also test without installing `nano-agent` globally by running it this directory with

{
  "mcpServers": {
    "nano-agent": {
      "command": "uv",
      "args": ["--directory", "apps/nano_agent_mcp_server", "run", "nano-agent"]
    }
  }
}

Now you can follow the [Nano Agent Interaction section below](#nano-agent-interaction) to test out the nano agent.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 509 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # Nano Agent
  2. > Watched how we used GPT-5 and Claude Code with nano-agents [here](https://youtu.be/tcZ3W8QYirQ).
  3. **What?** A MCP Server for experimental, small scale engineering agents with multi-provider LLM support.
  4. **Why?** To test and compare **Agentic** Capabilities of Cloud and Local LLMs across Performance, Speed, and Cost.
  5. > "It's not about a single prompt call anymore. It's about how well your agent chains together multiple tools to accomplish real engineering results on your behalf." - From our evaluation
  6. <img src="images/nano-agent.png" alt="Nano Agent" style="max-width: 800px;">
  7. ### 🎬 See It In Action
  8. **Multi-Model Evaluation Flow** - Watch 9 models (GPT-5, Claude Opus, Local GPT-OSS) running in parallel on the same M4 Max:
  9. <img src="images/multi-model-eval-flow.gif" alt="Multi-Model Evaluation Flow" style="max-width: 800px;">
  10. **Model Comparison: GPT-5 vs Local Models** - Surprising results: GPT-OSS 20B/120B running on-device with $0.00 cost:
  11. <img src="images/model-comparison-gpt5-oss.gif" alt="Model Comparison GPT-5 vs OSS" style="max-width: 800px;">
  12. ### 🔥 Key Findings from Our Testing
  13. - **Surprising Winners**: GPT-5 Nano/Mini often outperform larger models when factoring in speed and cost
  14. - **Local Revolution**: GPT-OSS 20B/120B models complete real agentic coding tasks on M4 Max (128GB RAM)
  15. - **Cost Reality Check**: Claude Opus 4.1 is extraordinarily expensive - performance isn't everything
  16. - **The Trade-off Triangle**: Performance vs Speed vs Cost - you don't always need the most expensive model
  17. ## Installation
  18. ### Quick Install (Recommended)
  19. - Install [Astral UV](https://docs.astral.sh/uv/getting-started/installation/)
  20. - Setup [Claude Code](https://docs.anthropic.com/en/docs/claude-code/overview)
  21. - Setup [Ollama](https://ollama.com/)
  22. - Get your OpenAI API key and Anthropic API key
  23. - Setup dotenv
  24. - `cp ./.env.sample ./.env` and fill out variables
  25. - `cp ./apps/nano_agent_mcp_server/.env.sample ./apps/nano_agent_mcp_server/.env` and fill out variables
  26. - Clone the repository
  27. - `git clone https://github.com/disler/nano-agent`
  28. - Global Install `nano-agent` to expose it for Claude Code (any mcp client)
  29. - `cd nano-agent/apps/nano_agent_mcp_server`
  30. - `./scripts/install.sh`
  31. - `uv tool install -e .`
  32. - cp `.mcp.json.sample` to `.mcp.json` to use `nano-agent`
  33. - You should end up with a `.mcp.json` file that looks like this:
  34. ```json
  35. {
  36. "mcpServers": {
  37. "nano-agent": {
  38. "command": "nano-agent",
  39. "args": []
  40. }
  41. }
  42. }
  43. ```
  44. - You can also test without installing `nano-agent` globally by running it this directory with
  45. ```json
  46. {
  47. "mcpServers": {
  48. "nano-agent": {
  49. "command": "uv",
  50. "args": ["--directory", "apps/nano_agent_mcp_server", "run", "nano-agent"]
  51. }
  52. }
  53. }
  54. ```
  55. Now you can follow the [Nano Agent Interaction section below](#nano-agent-interaction) to test out the nano agent.
  56. ## Nano Agent Interaction
  57. There are three ways to interact with the nano agent.
  58. 1. Nano Agent **Through the CLI** (`uv run nano-cli run`)
  59. - Great for understanding agent capabilities
  60. 2. Nano Agent **Through Claude Code** or any MCP client (`.mcp.json` or equivalent configuration)
  61. - Great for delegating work and scaling up compute in the field
  62. 3. Nano Agent **Through the Higher Order Prompt** (HOP) and Lower Order Prompt (LOP) pattern to test and compare models across providers and models.
  63. ### Through the CLI
  64. Remember, when running directly your current directory is where ever you run `uv run nano-cli run` from.
  65. ```bash
  66. cd apps/nano_agent_mcp_server
  67. # Test tools without API
  68. uv run nano-cli test-tools
  69. # Run with different models (provider auto-detected from model name)
  70. uv run nano-cli run "List all Python files in the current directory" # gpt-5-mini (default)
  71. uv run nano-cli run "Create a hello world script in python" --model gpt-5-nano
  72. uv run nano-cli run "Summarize the README.md" --model gpt-5
  73. # Test Anthropic models (requires ANTHROPIC_API_KEY)
  74. uv run nano-cli run "Hello" --model claude-3-haiku-20240307 --provider anthropic
  75. uv run nano-cli run "Hello" --model claude-sonnet-4-20250514 --provider anthropic
  76. uv run nano-cli run "Hello" --model claude-opus-4-20250514 --provider anthropic
  77. uv run nano-cli run "Hello" --model claude-opus-4-1-20250805 --provider anthropic
  78. # Test local Ollama models (requires ollama service) (be sure to install the model first with `ollama pull gpt-oss:20b`)
  79. uv run nano-cli run "List files" --model gpt-oss:20b --provider ollama
  80. uv run nano-cli run "List files and count the total number of files and directories" --model gpt-oss:120b --provider ollama
  81. # Verbose mode (shows token usage)
  82. uv run nano-cli run "Create and edit a test file" --verbose
  83. ```
  84. ### Through Claude Code
  85. #### Call the MCP server directly
  86. ```prompt
  87. mcp nano-agent: prompt_nano_agent "Create a hello world script in python" --model gpt-5
  88. mcp nano-agent: prompt_nano_agent "Summarize the README.md" --model claude-opus-4-1-20250805 --provider anthropic
  89. mcp nano-agent: prompt_nano_agent "Read the first 10 lines and last 10 lines of the README.md" --verbose
  90. etc...
  91. ```
  92. #### Call the MCP server through a sub-agent
  93. ```prompt
  94. @agent-nano-agent-gpt-5-mini "Create a hello world script in python"
  95. @agent-nano-agent-gpt-5 "Summarize the <file name>"
  96. @agent-nano-agent-claude-opus-4-1 "<insert agentic prompt here>"
  97. @agent-nano-agent-gpt-oss-20b "<insert agentic prompt here>"
  98. @agent-nano-agent-gpt-oss-120b "<insert agentic prompt here>"
  99. @agent-nano-agent-claude-sonnet-4 "<insert agentic prompt here>"
  100. @agent-nano-agent-claude-3-haiku "<insert agentic prompt here>"
  101. ```
  102. ### Through the Higher Order Prompt (HOP) and Lower Order Prompt (LOP) pattern
  103. In Claude Code call
  104. ```
  105. /perf:hop_evaluate_nano_agents .claude/commands/perf/lop_eval_1__dummy_test.md
  106. /perf:hop_evaluate_nano_agents .claude/commands/perf/lop_eval_2__basic_read_test.md
  107. /perf:hop_evaluate_nano_agents .claude/commands/perf/lop_eval_3__file_operations_test.md
  108. /perf:hop_evaluate_nano_agents .claude/commands/perf/lop_eval_4__code_analysis_test.md
  109. /perf:hop_evaluate_nano_agents .claude/commands/perf/lop_eval_5__complex_engineering_test.md
  110. ```
  111. #### Understanding HOP/LOP: How It Works
  112. The **HOP/LOP pattern** enables systematic parallel evaluation of multiple models:
  113. - **HOP (Higher Order Prompt)**: The orchestrator that reads test files, delegates to agents in parallel, and grades results
  114. - **LOP (Lower Order Prompt)**: Individual test definitions with prompts, expected outputs, and grading rubrics
  115. - **Execution Flow**: HOP → reads LOP → calls 9 agents simultaneously → collects results → generates comparison tables
  116. **Example**: When you run `/perf:hop_evaluate_nano_agents lop_eval_3__file_operations_test.md`:
  117. 1. HOP reads the test specification from the LOP file
  118. 2. Extracts the prompt and list of agents to test
  119. 3. Executes all agents in parallel (GPT-5, Claude, Local models)
  120. 4. Each agent runs in isolation via the nano-agent MCP server
  121. 5. Results are graded on Performance, Speed, and Cost
  122. 6. Output shows ranked comparison with surprising results (e.g., Claude-3-haiku often beats expensive models)
  123. This architecture ensures fair comparison by using the same OpenAI Agent SDK for all providers, creating a true apples-to-apples benchmark.
  124. ## Features
  125. - 🤖 **Multi-Provider Support**: Seamlessly switch between OpenAI (GPT-5), Anthropic (Claude), and Ollama (local models)
  126. - 🔧 **File System Operations**: Read, write, edit, and analyze files autonomously
  127. - 🏗️ **Nested Agent Architecture**: MCP server spawns internal agents for task execution
  128. - 🎯 **Unified Interface**: All providers use the same OpenAI SDK for consistency
  129. - 📦 **Experiment Ready**: Decent testing, error handling, and token tracking
  130. - 🚀 **Easy Integration**: Works with Claude Desktop, or as a CLI
  131. ## Nano-Agent Tools
  132. > Feel free to add/remove/improve tools as you see fit.
  133. Nano-Agent tools are stored in `nano_agent_tools.py`.
  134. Tools are:
  135. - `read_file` - Read file contents
  136. - `list_directory` - List directory contents (defaults to current working directory)
  137. - `write_file` - Create or overwrite files
  138. - `get_file_info` - Get file metadata (size, dates, type)
  139. - `edit_file` - Edit files by replacing exact text matches
  140. ## Project Structure
  141. ```
  142. nano-agent/
  143. ├── apps/ # ⚠️ ALL APPLICATION CODE GOES HERE
  144. │ └── nano_agent_mcp_server/ # Main MCP server application
  145. │ ├── src/ # Source code
  146. │ │ └── nano_agent/ # Main package
  147. │ │ ├── modules/ # Core modules
  148. │ │ │ ├── constants.py # Model/provider constants & defaults
  149. │ │ │ ├── data_types.py # Pydantic models & type definitions
  150. │ │ │ ├── files.py # File system operations
  151. │ │ │ ├── nano_agent.py # Main agent execution logic
  152. │ │ │ ├── nano_agent_tools.py # Internal agent tool implementations
  153. │ │ │ ├── provider_config.py # Multi-provider configuration
  154. │ │ │ ├── token_tracking.py # Token usage & cost tracking
  155. │ │ │ └── typing_fix.py # Type compatibility fixes
  156. │ │ ├── __main__.py # MCP server entry point
  157. │ │ └── cli.py # CLI interface (nano-cli)
  158. │ ├── tests/ # Test suite
  159. │ │ ├── nano_agent/ # Unit tests
  160. │ │ └── isolated/ # Provider integration tests
  161. │ ├── scripts/ # Installation & utility scripts
  162. │ ├── pyproject.toml # Project configuration & dependencies
  163. │ ├── uv.lock # Locked dependency versions
  164. │ └── .env.sample # Environment variables template
  165. ├── .claude/ # Claude Code configuration
  166. │ ├── agents/ # Sub-agent configurations (9 models)
  167. │ │ ├── nano-agent-gpt-5-nano.md # OpenAI GPT-5 Nano
  168. │ │ ├── nano-agent-gpt-5-mini.md # OpenAI GPT-5 Mini (default)
  169. │ │ ├── nano-agent-gpt-5.md # OpenAI GPT-5
  170. │ │ ├── nano-agent-claude-opus-4-1.md # Claude Opus 4.1
  171. │ │ ├── nano-agent-claude-opus-4.md # Claude Opus 4
  172. │ │ ├── nano-agent-claude-sonnet-4.md # Claude Sonnet 4
  173. │ │ ├── nano-agent-claude-3-haiku.md # Claude 3 Haiku
  174. │ │ ├── nano-agent-gpt-oss-20b.md # Ollama 20B model
  175. │ │ ├── nano-agent-gpt-oss-120b.md # Ollama 120B model
  176. │ │ └── hello-world.md # Simple greeting agent
  177. │ ├── commands/ # Claude Code commands
  178. │ │ ├── perf/ # Performance evaluation commands
  179. │ │ │ ├── hop_evaluate_nano_agents.md # Higher Order Prompt orchestrator
  180. │ │ │ ├── lop_eval_1__dummy_test.md # Simple Q&A test
  181. │ │ │ ├── lop_eval_2__basic_read_test.md # File reading test
  182. │ │ │ ├── lop_eval_3__file_operations_test.md # Complex I/O test
  183. │ │ │ ├── lop_eval_4__code_analysis_test.md # Code understanding
  184. │ │ │ └── lop_eval_5__complex_engineering_test.md # Full project test
  185. │ │ ├── convert_paths_absolute.md # Convert to absolute paths
  186. │ │ ├── convert_paths_relative.md # Convert to relative paths
  187. │ │ ├── create_worktree.md # Git worktree management
  188. │ │ ├── plan.md # Planning template
  189. │ │ ├── prime.md # Codebase understanding
  190. │ │ └── build.md # Build commands
  191. │ ├── hooks/ # Development hooks
  192. │ ├── settings.json # Portable settings (relative paths)
  193. │ └── settings.local.json # Local settings (absolute paths)
  194. ├── eval_results_1_dummy_test.md # Q&A test benchmark results
  195. ├── eval_results_2_basic_read_test.md # File reading benchmark results
  196. ├── eval_results_3_file_operations_test.md # I/O benchmark results
  197. ├── eval_results_4_code_analysis_test.md # Code analysis benchmark results
  198. ├── eval_results_5_complex_engineering_test.md # Project creation benchmark results
  199. ├── images/ # Documentation images
  200. │ └── nano-agent.png # Project logo/diagram
  201. ├── app_docs/ # Application-specific documentation
  202. ├── ai_docs/ # AI/LLM documentation & guides
  203. │ ├── python_uv_mcp_server_cookbook.md # MCP server development guide
  204. │ ├── openai_agent_sdk_*.md # OpenAI SDK documentation
  205. │ ├── anthropic_openai_compat.md # Anthropic compatibility guide
  206. │ ├── ollama_openai_compat.md # Ollama compatibility guide
  207. │ └── new_openai_gpt_models.md # GPT-5 model specifications
  208. └── specs/ # Technical specifications
  209. ```
  210. ## Development Guidelines
  211. ### Prerequisites
  212. - Python 3.12+ (required for proper typing support)
  213. - [uv](https://github.com/astral-sh/uv) package manager
  214. - OpenAI API key (for GPT-5 model tests)
  215. ### Development Setup
  216. ```bash
  217. cd apps/nano_agent_mcp_server
  218. uv sync --extra test # Include test dependencies
  219. ```
  220. ### Claude Code Hook Configuration
  221. If you're using Claude Code to work on this codebase, the project includes hooks for enhanced development experience. The hooks use relative paths by default for portability.
  222. **To activate hooks with absolute paths for your local environment:**
  223. Convert relative paths to absolute paths in .claude/settings.local.json
  224. Run this command in Claude Code:
  225. This updates all hook paths to use your machine's absolute paths
  226. A backup is automatically created at .claude/settings.json.backup
  227. `/convert_paths_absolute.md`
  228. **Note:** The hooks are optional but provide useful features like:
  229. - Pre/post tool use notifications
  230. - Session tracking
  231. - Event logging for debugging
  232. For production use, see [Installation](#installation) section above.
  233. #### UV Dependency Management
  234. When working with UV and optional dependencies:
  235. - `uv sync` - Installs only the main dependencies (mcp, typer, rich)
  236. - `uv sync --extra test` - Installs main + test dependencies (includes pytest, openai, etc.)
  237. - `uv sync --all-extras` - Installs main + all optional dependency groups
  238. - `uv pip list` - Shows all installed packages in the virtual environment
  239. **Important:** Always use `--extra test` when you need to run tests, as `uv sync` alone will remove test dependencies.
  240. ### Configuration
  241. 1. Copy the environment template:
  242. ```bash
  243. cp .env.sample .env
  244. ```
  245. 2. Add your OpenAI API key:
  246. ```bash
  247. echo "OPENAI_API_KEY=sk-your-key-here" > .env
  248. ```
  249. ### Running the Server
  250. ```bash
  251. cd apps/nano_agent_mcp_server
  252. uv run nano-agent --help
  253. ```
  254. The server communicates via stdin/stdout using the MCP protocol.
  255. ## Nano Agent Architecture
  256. ### Nested Agent Hierarchy
  257. **Key Concept:** This is a nested agent system with two distinct agent layers.
  258. ```text
  259. ┌─────────────────────────────────────────────────────────────┐
  260. │ OUTER AGENT (e.g., Claude Code, any MCP client) │
  261. │ • Communicates via MCP protocol │
  262. │ • Sees ONE tool: prompt_nano_agent │
  263. │ • Sends natural language prompts to nano-agent │
  264. └─────────────────────────────────────────────────────────────┘
  265. │
  266. │ MCP Protocol
  267. ▼
  268. ┌─────────────────────────────────────────────────────────────┐
  269. │ NANO-AGENT MCP SERVER (apps/nano_agent_mcp_server) │
  270. │ • Exposes SINGLE MCP tool: prompt_nano_agent │
  271. │ • Receives prompts from outer agent │
  272. │ • Spawns internal OpenAI agent to handle request │
  273. └─────────────────────────────────────────────────────────────┘
  274. │
  275. │ Creates & Manages
  276. ▼
  277. ┌─────────────────────────────────────────────────────────────┐
  278. │ INNER AGENT (OpenAI GPT with function calling) │
  279. │ • Created fresh for each prompt_nano_agent call │
  280. │ • Has its OWN tools (not visible to outer agent): │
  281. │ - read_file: Read file contents │
  282. │ - list_directory: List directory contents │
  283. │ - write_file: Create/overwrite files │
  284. │ - get_file_info: Get file metadata │
  285. │ • Runs autonomous loop (max 20 turns) │
  286. │ • Returns final result to MCP server → outer agent │
  287. └─────────────────────────────────────────────────────────────┘
  288. ```
  289. ## Validation & Testing
  290. ### Unit Tests (Real API Calls)
  291. ```bash
  292. # Run all integration tests
  293. uv run pytest tests/ -v
  294. # Test specific functionality
  295. uv run pytest tests/nano_agent/modules/test_nano_agent.py::TestExecuteNanoAgent -v
  296. # Quick validation
  297. uv run pytest -k "test_execute_nano_agent_success" -v
  298. ```
  299. ### CLI Validation
  300. ```bash
  301. # Validate tools work (no API needed)
  302. uv run nano-cli test-tools
  303. # Quick agent test
  304. export OPENAI_API_KEY=sk-your-key
  305. uv run nano-cli run "What is 2+2?" # Uses DEFAULT_MODEL
  306. ```
  307. ## Multi-Provider Support
  308. The nano agent supports multiple LLM providers through a unified interface using the OpenAI SDK. All providers are accessed through OpenAI-compatible endpoints, providing a consistent API.
  309. ### Available Providers & Models
  310. > Feel free to add/remove providers and models as you see fit.
  311. #### OpenAI (Default)
  312. - **Models**: `gpt-5`, `gpt-5-mini` (default), `gpt-5-nano`, `gpt-4o`
  313. - **Requirements**: `OPENAI_API_KEY` environment variable
  314. - **Special Features**:
  315. - GPT-5 models use `max_completion_tokens` instead of `max_tokens`
  316. - GPT-5 models only support temperature=1
  317. - Extended context windows (400K tokens)
  318. #### Anthropic
  319. - **Models**: `claude-opus-4-1-20250805`, `claude-opus-4-20250514`, `claude-sonnet-4-20250514`, `claude-3-haiku-20240307`
  320. - **Requirements**: `ANTHROPIC_API_KEY` environment variable
  321. - **Implementation**: Uses Anthropic's OpenAI-compatible endpoint
  322. - **Base URL**: `https://api.anthropic.com/v1/`
  323. #### Ollama (Local Models)
  324. - **Models**: `gpt-oss:20b`, `gpt-oss:120b`, or any model you've pulled locally
  325. - **Requirements**: Ollama service running locally
  326. - **Implementation**: Uses Ollama's OpenAI-compatible API
  327. - **Base URL**: `http://localhost:11434/v1`
  328. ### Using Different Providers
  329. #### CLI Usage
  330. ```bash
  331. # OpenAI (default)
  332. uv run nano-cli run "Create a hello world script"
  333. # Use specific OpenAI model
  334. uv run nano-cli run "Analyze this code" --model gpt-5 --provider openai
  335. # Anthropic
  336. uv run nano-cli run "Write a test file" --model claude-3-haiku-20240307 --provider anthropic
  337. # Ollama (local)
  338. uv run nano-cli run "List files" --model gpt-oss:20b --provider ollama
  339. ```
  340. ## Multi-Model Evaluation System
  341. The nano-agent includes a sophisticated multi-layer evaluation system for comparing LLM performance across different providers and models. This creates a level playing field for benchmarking by using the same execution environment (OpenAI Agent SDK) regardless of the underlying provider.
  342. > "Don't trust any individual benchmark. You need to crack open the hood of all these models and say, where is the true value?" - Engineering is all about trade-offs.
  343. ### 🎯 The Bread and Butter: HOP/LOP Pattern
  344. The evaluation system's core innovation is the **HOP/LOP (Higher Order Prompt / Lower Order Prompt)** pattern, which creates a hierarchical orchestration system for parallel model testing:
  345. ```text
  346. ┌─────────────────────────────────────────────────────────────┐
  347. │ 1. HIGHER ORDER PROMPT (HOP) │
  348. │ File: .claude/commands/perf/hop_evaluate_nano_agents.md │
  349. │ • Orchestrates entire evaluation process │
  350. │ • Accepts test case files as $ARGUMENTS │
  351. │ • Formats and grades results │
  352. │ • Generates performance comparison tables │
  353. └─────────────────────────────────────────────────────────────┘
  354. │
  355. │ Reads & Executes
  356. ▼
  357. ┌─────────────────────────────────────────────────────────────┐
  358. │ 2. LOWER ORDER PROMPT (LOP) │
  359. │ Files: .claude/commands/perf/lop_eval_*.md │
  360. │ • Defines test cases (prompts to evaluate) │
  361. │ • Lists agents to test (@agent-nano-agent-*) │
  362. │ • Specifies expected outputs │
  363. │ • Provides grading rubrics │
  364. └─────────────────────────────────────────────────────────────┘
  365. │
  366. │ @agent References
  367. ▼
  368. ┌─────────────────────────────────────────────────────────────┐
  369. │ 3. CLAUDE CODE SUB-AGENTS │
  370. │ Files: .claude/agents/nano-agent-*.md │
  371. │ • Individual agent configurations │
  372. │ • Each specifies model + provider combination │
  373. │ • Color-coded by model family: │
  374. │ - green: GPT-5 series (nano, mini, standard) │
  375. │ - blue: GPT-OSS series (20b, 120b) │
  376. │ - purple: Claude 4 Opus models │
  377. │ - orange: Claude 4 Sonnet & Claude 3 Haiku │
  378. └─────────────────────────────────────────────────────────────┘
  379. │
  380. │ Calls MCP Server
  381. ▼
  382. ┌─────────────────────────────────────────────────────────────┐
  383. │ 4. NANO-AGENT MCP SERVER │
  384. │ Function: prompt_nano_agent(prompt, model, provider) │
  385. │ • Creates isolated agent instance per request │
  386. │ • Uses OpenAI Agent SDK for ALL providers │
  387. │ • Ensures consistent execution environment │
  388. │ • Returns structured results with metrics │
  389. └─────────────────────────────────────────────────────────────┘
  390. ```
  391. ### Why This Architecture?
  392. 1. **Fair Comparison**: All models use the same OpenAI Agent SDK, eliminating implementation differences
  393. 2. **Parallel Execution**: Agents run simultaneously, reducing temporal variations
  394. 3. **Structured Metrics**: Consistent tracking of time, tokens, and costs across all providers
  395. 4. **Extensibility**: Easy to add new models, providers, or test cases
  396. 5. **Visual Hierarchy**: Color-coded agents make results easy to scan in Claude Code
  397. 6. **Reproducibility**: Same prompts and execution environment ensure consistent benchmarks
  398. ## License
  399. MIT
  400. ## Master AI Coding
  401. > And prepare for Agentic Engineering
  402. Learn to code with AI with foundational [Principles of AI Coding](https://agenticengineer.com/principled-ai-coding?y=nanoagent)
  403. Follow the [IndyDevDan youtube channel](https://www.youtube.com/@indydevdan) for more AI coding tips and tricks.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.