/ 目錄 / 演練場 / Nanobot
● 社群 HKUDS ⚡ 即開即用

Nanobot

作者 HKUDS · HKUDS/nanobot

If FastMCP and Upsonic feel heavy: Nanobot is a few hundred lines of Python that gives you a working personal agent with MCP support.

Nanobot is an academic-style minimal agent framework. Strips most abstraction; you bring tools and an LLM, it gives you the loop. Use it when you want a teachable, hackable baseline for an MCP-aware agent.

為什麼要用

核心特性

即時演示

實際使用效果

就緒

安裝

選擇你的客戶端

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "nanobot-mcp": {
      "command": "uvx",
      "args": [
        "nanobot",
        "serve",
        "--mcp"
      ]
    }
  }
}

開啟 Claude Desktop → Settings → Developer → Edit Config。儲存後重啟應用。

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "nanobot-mcp": {
      "command": "uvx",
      "args": [
        "nanobot",
        "serve",
        "--mcp"
      ]
    }
  }
}

Cursor 使用與 Claude Desktop 相同的 mcpServers 格式。專案級設定優先於全域。

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "nanobot-mcp": {
      "command": "uvx",
      "args": [
        "nanobot",
        "serve",
        "--mcp"
      ]
    }
  }
}

點擊 Cline 側欄中的 MCP Servers 圖示,然後選 "Edit Configuration"。

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "nanobot-mcp": {
      "command": "uvx",
      "args": [
        "nanobot",
        "serve",
        "--mcp"
      ]
    }
  }
}

格式與 Claude Desktop 相同。重啟 Windsurf 生效。

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "nanobot-mcp",
      "command": "uvx",
      "args": [
        "nanobot",
        "serve",
        "--mcp"
      ]
    }
  ]
}

Continue 使用伺服器物件陣列,而非映射。

~/.config/zed/settings.json
{
  "context_servers": {
    "nanobot-mcp": {
      "command": {
        "path": "uvx",
        "args": [
          "nanobot",
          "serve",
          "--mcp"
        ]
      }
    }
  }
}

加入 context_servers。Zed 儲存後熱重載。

claude mcp add nanobot-mcp -- uvx nanobot serve --mcp

一行命令搞定。用 claude mcp list 驗證,claude mcp remove 移除。

使用場景

實戰用法: Nanobot

Learn the agent loop by reading the source

👤 Developers ⏱ ~15 min intermediate

何時使用: You want to understand what FastMCP / Upsonic do under the hood.

步驟
  1. Read
    Open the main module — single-file core.✓ 已複製
    → Mental model
  2. Run
    Start the bot; call its MCP tools from Claude.✓ 已複製
    → Works
  3. Modify
    Add a tool or change the planner.✓ 已複製
    → Fork ready

結果: Working hackable baseline for your own agent.

組合

與其他 MCP 搭配,撬動十倍槓桿

nanobot-mcp + fastmcp-prefect

Prototype with Nanobot; harden with FastMCP for production

Combine nanobot-mcp with fastmcp-prefect: Prototype with Nanobot; harden with FastMCP for production✓ 已複製

工具

此 MCP 暴露的能力

工具輸入參數何時呼叫成本
run (see docs) Run a task through the nanobot loop 1 call

成本與限制

運行它的成本

API 配額
Bound by LLM
每次呼叫 Token 數
Normal
費用
Free OSS
提示
Keep tool sets small — Nanobot is minimal, not magical

安全

權限、密鑰、影響範圍

憑證儲存: LLM keys in env
資料出站: Configured provider

故障排查

常見錯誤與修復

Planner gets stuck

Add a step budget; minimal planners need explicit halts

替代方案

Nanobot 對比其他方案

替代方案何時用它替代權衡
FastMCPProduction serverMore framework

更多

資源

📖 閱讀 GitHub 上的官方 README

🐙 查看未解決的 issue

🔍 瀏覽全部 400+ MCP 伺服器和 Skills