#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
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| Rank | Project | Score |
|---|---|---|
| 1 | deepseek-harnessPlugin-based agent harness from DeepSeek with a local Web UI | 98 out of 100 |
| 2 | composioTypeScript and Python SDKs that give agents authenticated tools across 1000+ apps | 92 out of 100 |
| 3 | conductorDurable workflow engine that orchestrates microservices and LLM agents from JSON | 91 out of 100 |
| #4 | a2uiProtocol and renderers for agents to stream native UI instead of text | 87 out of 100 |
| #5 | mcp-useTypeScript framework for building MCP servers with React Views and an Inspector | 87 out of 100 |