#6363rd of 65 in Agent and MCP starters

nanoagent

Single-file Python agent loop with bash, read and write tools

Stars
782
License
MIT
Last commit
Mar 2026
Language
Python
Stars, last 29 weeks+226
25 Apr 2026: 556 stars2 May 2026: 566 stars9 May 2026: 580 stars16 May 2026: 592 stars23 May 2026: 601 stars30 May 2026: 614 stars6 Jun 2026: 624 stars13 Jun 2026: 637 stars20 Jun 2026: 652 stars27 Jun 2026: 657 stars4 Jul 2026: 667 stars11 Jul 2026: 681 stars18 Jul 2026: 687 stars25 Jul 2026: 698 stars1 Aug 2026: 702 stars8 Aug 2026: 707 stars15 Aug 2026: 709 stars22 Aug 2026: 716 stars29 Aug 2026: 732 stars5 Sept 2026: 739 stars12 Sept 2026: 743 stars19 Sept 2026: 748 stars26 Sept 2026: 751 stars3 Oct 2026: 754 stars10 Oct 2026: 758 stars17 Oct 2026: 765 stars24 Oct 2026: 769 stars31 Oct 2026: 773 stars7 Nov 2026: 778 stars14 Nov 2026: 782 stars

556 on 25 Apr 2026782 on 14 Nov 2026

From GitHub's daily star counts.

Checked on GitHub.

Overview

nanoAgent is a roughly 100-line Python script that runs an OpenAI function-calling loop with three tools: execute_bash, read_file and write_file. It takes a task as a command-line argument and iterates until the model stops calling tools. Malformed JSON arguments and unknown tool names are returned to the model as tool errors instead of crashing the loop.

Who it is for: Developers learning how a tool-calling agent loop works

Strengths

  • Whole agent is about 100 lines, easy to read and modify
  • Base URL and model set by env vars, so OpenAI-compatible endpoints work
  • Tool-call errors are fed back to the model rather than crashing
  • MIT license and a single pip requirements file

Weaknesses

  • Runs arbitrary bash commands with no sandbox or confirmation step
  • Only three tools; no MCP support in this repo
  • CLI one-shot only: no UI, memory or conversation persistence documented
  • Uses the OpenAI chat completions API; other provider formats are not documented

What it needs

  • Python, OpenAI function-calling models (default example gpt-4o-mini)
  • Needs OpenAI-compatible API key

Also in Agent and MCP starters

See all 65
Also in Agent and MCP starters
RankProjectScore
1deepseek-harnessPlugin-based agent harness from DeepSeek with a local Web UI283.2k stars+30,811 (+12%) in 30 daysMIT98 out of 100
2composioTypeScript and Python SDKs that give agents authenticated tools across 1000+ apps31.2k starsMIT92 out of 100
3conductorDurable workflow engine that orchestrates microservices and LLM agents from JSON32.5k starsApache-2.091 out of 100
#4a2uiProtocol and renderers for agents to stream native UI instead of text Live demo ↗ (opens in a new tab)17.6k stars+874 (+5.2%) in 30 daysApache-2.087 out of 100
#5mcp-useTypeScript framework for building MCP servers with React Views and an Inspector Live demo ↗ (opens in a new tab)11k stars+217 (+2.0%) in 30 daysMIT87 out of 100