devduck 0.3.0__py3-none-any.whl → 0.4.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of devduck might be problematic. Click here for more details.

devduck/__init__.py CHANGED
@@ -677,29 +677,33 @@ class DevDuck:
677
677
  except ImportError as e:
678
678
  logger.warning(f"devduck.tools import failed: {e}")
679
679
 
680
- try:
681
- from strands_fun_tools import (
682
- listen,
683
- cursor,
684
- clipboard,
685
- screen_reader,
686
- yolo_vision,
687
- )
680
+ # Skip fun tools in --mcp mode (they're not needed for MCP server)
681
+ if "--mcp" not in sys.argv:
682
+ try:
683
+ from strands_fun_tools import (
684
+ listen,
685
+ cursor,
686
+ clipboard,
687
+ screen_reader,
688
+ yolo_vision,
689
+ )
688
690
 
689
- core_tools.extend(
690
- [listen, cursor, clipboard, screen_reader, yolo_vision]
691
- )
692
- except ImportError:
693
- logger.info(
694
- "strands-fun-tools not installed - vision/audio tools unavailable (install with: pip install devduck[all])"
695
- )
691
+ core_tools.extend(
692
+ [listen, cursor, clipboard, screen_reader, yolo_vision]
693
+ )
694
+ except ImportError:
695
+ logger.info(
696
+ "strands-fun-tools not installed - vision/audio tools unavailable (install with: pip install devduck[all])"
697
+ )
698
+ else:
699
+ logger.info("--mcp mode: skipping vision/audio tools")
696
700
 
697
701
  try:
698
702
  from strands_tools import (
699
703
  shell,
700
704
  editor,
701
705
  calculator,
702
- python_repl,
706
+ # python_repl,
703
707
  image_reader,
704
708
  use_agent,
705
709
  load_tool,
@@ -713,7 +717,7 @@ class DevDuck:
713
717
  shell,
714
718
  editor,
715
719
  calculator,
716
- python_repl,
720
+ # python_repl,
717
721
  image_reader,
718
722
  use_agent,
719
723
  load_tool,
@@ -1267,7 +1271,13 @@ def weather(action: str, location: str = None) -> Dict[str, Any]:
1267
1271
 
1268
1272
  # 🦆 Auto-initialize when imported
1269
1273
  # Check environment variables to control server configuration
1274
+ # Also check if --mcp flag is present to skip auto-starting servers
1270
1275
  _auto_start = os.getenv("DEVDUCK_AUTO_START_SERVERS", "true").lower() == "true"
1276
+
1277
+ # Disable auto-start if --mcp flag is present (stdio mode)
1278
+ if "--mcp" in sys.argv:
1279
+ _auto_start = False
1280
+
1271
1281
  _tcp_port = int(os.getenv("DEVDUCK_TCP_PORT", "9999"))
1272
1282
  _ws_port = int(os.getenv("DEVDUCK_WS_PORT", "8080"))
1273
1283
  _mcp_port = int(os.getenv("DEVDUCK_MCP_PORT", "8000"))
@@ -1561,15 +1571,33 @@ def cli():
1561
1571
  Examples:
1562
1572
  devduck # Start interactive mode
1563
1573
  devduck "your query here" # One-shot query
1574
+ devduck --mcp # MCP stdio mode (for Claude Desktop)
1564
1575
  devduck --tcp-port 9000 # Custom TCP port
1565
1576
  devduck --no-tcp --no-ws # Disable TCP and WebSocket
1566
1577
  devduck --mcp-port 3000 # Custom MCP port
1578
+
1579
+ Claude Desktop Config:
1580
+ {
1581
+ "mcpServers": {
1582
+ "devduck": {
1583
+ "command": "uvx",
1584
+ "args": ["devduck", "--mcp"]
1585
+ }
1586
+ }
1587
+ }
1567
1588
  """,
1568
1589
  )
1569
1590
 
1570
1591
  # Query argument
1571
1592
  parser.add_argument("query", nargs="*", help="Query to send to the agent")
1572
1593
 
1594
+ # MCP stdio mode flag
1595
+ parser.add_argument(
1596
+ "--mcp",
1597
+ action="store_true",
1598
+ help="Start MCP server in stdio mode (for Claude Desktop integration)",
1599
+ )
1600
+
1573
1601
  # Server configuration
1574
1602
  parser.add_argument(
1575
1603
  "--tcp-port", type=int, default=9999, help="TCP server port (default: 9999)"
@@ -1601,6 +1629,30 @@ Examples:
1601
1629
 
1602
1630
  logger.info("CLI mode started")
1603
1631
 
1632
+ # Handle --mcp flag for stdio mode
1633
+ if args.mcp:
1634
+ logger.info("Starting MCP server in stdio mode (blocking, foreground)")
1635
+ print("🦆 Starting MCP stdio server...", file=sys.stderr)
1636
+
1637
+ # Don't auto-start HTTP/TCP/WS servers for stdio mode
1638
+ if devduck.agent:
1639
+ try:
1640
+ # Start MCP server in stdio mode - this BLOCKS until terminated
1641
+ devduck.agent.tool.mcp_server(
1642
+ action="start",
1643
+ transport="stdio",
1644
+ expose_agent=True,
1645
+ agent=devduck.agent,
1646
+ )
1647
+ except Exception as e:
1648
+ logger.error(f"Failed to start MCP stdio server: {e}")
1649
+ print(f"🦆 Error: {e}", file=sys.stderr)
1650
+ sys.exit(1)
1651
+ else:
1652
+ print("🦆 Agent not available", file=sys.stderr)
1653
+ sys.exit(1)
1654
+ return
1655
+
1604
1656
  if args.query:
1605
1657
  query = " ".join(args.query)
1606
1658
  logger.info(f"CLI query: {query}")
devduck/_version.py CHANGED
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '0.3.0'
32
- __version_tuple__ = version_tuple = (0, 3, 0)
31
+ __version__ = version = '0.4.0'
32
+ __version_tuple__ = version_tuple = (0, 4, 0)
33
33
 
34
34
  __commit_id__ = commit_id = None
@@ -190,9 +190,11 @@ def _start_mcp_server(
190
190
  agent_invoke_tool = types.Tool(
191
191
  name="devduck",
192
192
  description=(
193
- "Invoke the full DevDuck agent with a natural language prompt. "
194
- "Use this for complex queries that require reasoning across multiple tools "
195
- "or when you need a conversational response from the agent."
193
+ "Invoke a FULL DevDuck instance with complete capabilities. "
194
+ "Each invocation creates a fresh DevDuck agent with self-healing, "
195
+ "hot-reload, all tools, knowledge base integration, and system prompt building. "
196
+ "Use this for complex queries requiring reasoning, multi-tool orchestration, "
197
+ "or when you need the complete DevDuck experience via MCP."
196
198
  ),
197
199
  inputSchema={
198
200
  "type": "object",
@@ -228,7 +230,7 @@ def _start_mcp_server(
228
230
  try:
229
231
  logger.debug(f"call_tool: name={name}, arguments={arguments}")
230
232
 
231
- # Handle agent invocation tool - use the devduck instance directly
233
+ # Handle agent invocation tool - create a full DevDuck instance
232
234
  if name == "devduck" and expose_agent:
233
235
  prompt = arguments.get("prompt")
234
236
  if not prompt:
@@ -241,8 +243,34 @@ def _start_mcp_server(
241
243
 
242
244
  logger.debug(f"Invoking devduck with prompt: {prompt[:100]}...")
243
245
 
244
- # Use the devduck agent directly (don't create a new instance)
245
- result = agent(prompt)
246
+ # Create a NEW DevDuck instance for this MCP invocation
247
+ # This gives full DevDuck power: self-healing, hot-reload, all tools, etc.
248
+ try:
249
+ from devduck import DevDuck
250
+
251
+ # Create fresh DevDuck instance (no auto-start to avoid recursion)
252
+ mcp_devduck = DevDuck(auto_start_servers=False)
253
+ mcp_agent = mcp_devduck.agent
254
+
255
+ if not mcp_agent:
256
+ return [
257
+ types.TextContent(
258
+ type="text",
259
+ text="❌ Error: Failed to create DevDuck instance",
260
+ )
261
+ ]
262
+
263
+ # Execute with full DevDuck capabilities
264
+ result = mcp_agent(prompt)
265
+
266
+ except Exception as e:
267
+ logger.error(f"DevDuck creation failed: {e}", exc_info=True)
268
+ return [
269
+ types.TextContent(
270
+ type="text",
271
+ text=f"❌ Error creating DevDuck instance: {str(e)}",
272
+ )
273
+ ]
246
274
 
247
275
  # Extract text response from agent result
248
276
  response_text = str(result)
@@ -0,0 +1,260 @@
1
+ Metadata-Version: 2.4
2
+ Name: devduck
3
+ Version: 0.4.0
4
+ Summary: 🦆 Extreme minimalist self-adapting AI agent - one file, self-healing, runtime dependencies
5
+ Author-email: duck <hey@devduck.dev>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/cagataycali/devduck
8
+ Project-URL: Repository, https://github.com/cagataycali/devduck.git
9
+ Project-URL: Documentation, https://github.com/cagataycali/devduck#readme
10
+ Project-URL: Bug Tracker, https://github.com/cagataycali/devduck/issues
11
+ Keywords: ai,agent,minimalist,self-healing,ollama,strands-agents
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Intended Audience :: System Administrators
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
23
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
+ Classifier: Topic :: System :: Systems Administration
25
+ Classifier: Topic :: Utilities
26
+ Requires-Python: >=3.10
27
+ Description-Content-Type: text/markdown
28
+ License-File: LICENSE
29
+ Requires-Dist: strands-agents
30
+ Requires-Dist: prompt_toolkit
31
+ Requires-Dist: strands-agents[ollama]
32
+ Requires-Dist: strands-agents-tools
33
+ Requires-Dist: strands-agentcore-tools
34
+ Requires-Dist: beautifulsoup4
35
+ Requires-Dist: colorama
36
+ Requires-Dist: websockets
37
+ Requires-Dist: strands-mcp-server
38
+ Provides-Extra: all
39
+ Requires-Dist: strands-agents[openai]; extra == "all"
40
+ Requires-Dist: strands-agents[anthropic]; extra == "all"
41
+ Requires-Dist: strands-fun-tools[audio]; extra == "all"
42
+ Requires-Dist: strands-fun-tools[vision]; extra == "all"
43
+ Requires-Dist: strands-fun-tools[all]; extra == "all"
44
+ Dynamic: license-file
45
+
46
+ # 🦆 DevDuck
47
+
48
+ **Self-healing agent. One file. Zero config.**
49
+
50
+ Minimalist AI that adapts to your environment and fixes itself when things break.
51
+
52
+ ## Install
53
+
54
+ ```bash
55
+ pipx install "devduck[all]" # Full install (recommended)
56
+ ```
57
+
58
+ Requires: Python 3.10+, Ollama (or set `MODEL_PROVIDER`)
59
+
60
+ ## Quick Start
61
+
62
+ ```bash
63
+ devduck # Interactive mode (auto-starts servers)
64
+ devduck "analyze this code" # CLI mode
65
+ ```
66
+
67
+ ```python
68
+ import devduck
69
+ devduck("calculate 2+2") # Python API
70
+ ```
71
+
72
+ ## Core Features
73
+
74
+ - **🔧 Self-healing** - Auto-fixes dependencies, models, errors
75
+ - **🔥 Hot-reload** - Save `.py` files in `./tools/`, use instantly (no restart)
76
+ - **🧠 RAG memory** - Set `STRANDS_KNOWLEDGE_BASE_ID` for automatic context retrieval/storage
77
+ - **🌍 Multi-protocol** - TCP (9999), WebSocket (8080), MCP (8000), CLI, Python
78
+ - **📚 19+ tools** - shell, editor, calculator, python, GitHub, subagents, and more
79
+ - **🎯 Adaptive** - Auto-selects model by OS (macOS: 1.7b, Linux: 30b)
80
+
81
+ ## Auto-Started Servers
82
+
83
+ When you run `devduck`, 3 servers start automatically:
84
+
85
+ | Server | Endpoint | Usage |
86
+ |--------|----------|-------|
87
+ | 🌐 **Web UI** | [cagataycali.github.io/devduck](http://cagataycali.github.io/devduck) | Browser interface |
88
+ | 🔌 **TCP** | `localhost:9999` | `nc localhost 9999` |
89
+ | 🌊 **WebSocket** | `ws://localhost:8080` | Structured JSON messages |
90
+ | 🔗 **MCP** | `http://localhost:8000/mcp` | Model Context Protocol |
91
+
92
+ **Customize ports:**
93
+ ```bash
94
+ devduck --tcp-port 9000 --ws-port 8001 --mcp-port 3000
95
+ devduck --no-tcp --no-ws # Disable specific servers
96
+ ```
97
+
98
+ ## Connect Options
99
+
100
+ ### MCP Client (Claude Desktop)
101
+
102
+ **Simple stdio mode (recommended):**
103
+ ```json
104
+ {
105
+ "mcpServers": {
106
+ "devduck": {
107
+ "command": "uvx",
108
+ "args": ["devduck", "--mcp"]
109
+ }
110
+ }
111
+ }
112
+ ```
113
+
114
+ **Proxy mode (if devduck already running):**
115
+ ```json
116
+ {
117
+ "mcpServers": {
118
+ "devduck": {
119
+ "command": "uvx",
120
+ "args": ["strands-mcp-server", "--upstream-url", "http://localhost:8000/mcp/"]
121
+ }
122
+ }
123
+ }
124
+ ```
125
+
126
+ ### Terminal (TCP)
127
+ ```bash
128
+ nc localhost 9999
129
+ > analyze logs
130
+ ```
131
+
132
+ ### Shell Prefix
133
+ ```bash
134
+ devduck
135
+ 🦆 ! git status # Run shell commands with !
136
+ ```
137
+
138
+ ## Hot-Reload Tool Creation
139
+
140
+ Create tools instantly—no restart needed:
141
+
142
+ ```python
143
+ # ./tools/tip_calc.py
144
+ from strands import tool
145
+
146
+ @tool
147
+ def calculate_tip(amount: float, percent: float = 15.0) -> str:
148
+ """Calculate restaurant tip."""
149
+ tip = amount * (percent / 100)
150
+ return f"Tip: ${tip:.2f} | Total: ${amount + tip:.2f}"
151
+ ```
152
+
153
+ Save → Available instantly → Use: `devduck "calculate tip for $42"`
154
+
155
+ ## Built-in Tools (19+)
156
+
157
+ | Category | Tools |
158
+ |----------|-------|
159
+ | **Development** | shell, editor, python_repl, load_tool, environment |
160
+ | **GitHub** | use_github, create_subagent, gist, add_comment, list_issues |
161
+ | **Network** | tcp, websocket, mcp_server, mcp_client, http_request |
162
+ | **AI** | use_agent, install_tools, retrieve, store_in_kb |
163
+ | **Utilities** | calculator, image_reader, scraper, system_prompt, view_logs |
164
+
165
+ ## Multi-Model Support
166
+
167
+ Switch models via environment variables:
168
+
169
+ ```bash
170
+ # Bedrock (Claude)
171
+ export MODEL_PROVIDER="bedrock"
172
+ export STRANDS_MODEL_ID="us.anthropic.claude-sonnet-4-5-20250929-v1:0"
173
+ export STRANDS_MAX_TOKENS="64000"
174
+
175
+ # Anthropic API
176
+ export MODEL_PROVIDER="anthropic"
177
+ export STRANDS_MODEL_ID="claude-sonnet-4-20250514"
178
+
179
+ # Ollama (default)
180
+ export MODEL_PROVIDER="ollama"
181
+ export OLLAMA_HOST="http://localhost:11434"
182
+ ```
183
+
184
+ ## Knowledge Base (RAG)
185
+
186
+ Enable automatic memory across sessions:
187
+
188
+ ```bash
189
+ export STRANDS_KNOWLEDGE_BASE_ID="your-kb-id"
190
+ devduck # Auto-retrieves context before queries, stores after responses
191
+ ```
192
+
193
+ Works with AWS Bedrock Knowledge Bases.
194
+
195
+ ## Environment Variables
196
+
197
+ | Variable | Default | Description |
198
+ |----------|---------|-------------|
199
+ | `MODEL_PROVIDER` | `ollama` | Model provider (bedrock, anthropic, ollama) |
200
+ | `STRANDS_KNOWLEDGE_BASE_ID` | - | Enable auto-RAG with KB ID |
201
+ | `DEVDUCK_TCP_PORT` | `9999` | TCP server port |
202
+ | `DEVDUCK_WS_PORT` | `8080` | WebSocket port |
203
+ | `DEVDUCK_MCP_PORT` | `8000` | MCP server port |
204
+ | `DEVDUCK_ENABLE_TCP` | `true` | Enable TCP server |
205
+ | `DEVDUCK_ENABLE_WS` | `true` | Enable WebSocket |
206
+ | `DEVDUCK_ENABLE_MCP` | `true` | Enable MCP server |
207
+ | `DEVDUCK_LOG_LINE_COUNT` | `50` | Log lines in context |
208
+ | `SYSTEM_PROMPT` | - | Custom system prompt |
209
+
210
+ ## Dynamic Tool Loading
211
+
212
+ Load tools from any Python package at runtime:
213
+
214
+ ```python
215
+ devduck
216
+ 🦆 install_tools(action="install_and_load",
217
+ package="strands-fun-tools",
218
+ module="strands_fun_tools")
219
+ ```
220
+
221
+ No restart required—tools available immediately.
222
+
223
+ ## System Prompt Management
224
+
225
+ Modify agent behavior dynamically:
226
+
227
+ ```bash
228
+ devduck
229
+ 🦆 system_prompt(action="update", prompt="You are a senior Python expert.")
230
+ 🦆 system_prompt(action="view") # See current prompt
231
+ ```
232
+
233
+ ## Logs
234
+
235
+ ```bash
236
+ devduck
237
+ 🦆 view_logs(action="view", lines=100)
238
+ 🦆 view_logs(action="search", pattern="error")
239
+ 🦆 view_logs(action="stats")
240
+ ```
241
+
242
+ Log location: `/tmp/devduck/logs/devduck.log`
243
+
244
+ ## GitHub Actions
245
+
246
+ Run DevDuck in CI/CD:
247
+
248
+ ```yaml
249
+ - name: DevDuck Analysis
250
+ uses: cagataycali/devduck@main
251
+ with:
252
+ query: "analyze test coverage"
253
+ model: "us.anthropic.claude-sonnet-4-20250514-v1:0"
254
+ ```
255
+
256
+ ---
257
+
258
+ **One file. 19+ tools. Self-healing. Hot-reload. RAG memory.**
259
+
260
+ *Built with [Strands Agents SDK](https://github.com/strands-agents/sdk-python)*
@@ -1,18 +1,18 @@
1
- devduck/__init__.py,sha256=L_wVHAoQSMcnZaz-8vhGir9itE7RGq7jqSqTN6Uya1A,58613
1
+ devduck/__init__.py,sha256=3Iks5DQyjZgf7Y3AE3SO5Cv3XRKasVDhvs_xr9aU9QA,60387
2
2
  devduck/__main__.py,sha256=aeF2RR4k7lzSR2X1QKV9XQPCKhtsH0JYUv2etBBqmL0,145
3
- devduck/_version.py,sha256=5zTqm8rgXsWYBpB2M3Zw_K1D-aV8wP7NsBLrmMKkrAQ,704
3
+ devduck/_version.py,sha256=2_0GUP7yBCXRus-qiJKxQD62z172WSs1sQ6DVpPsbmM,704
4
4
  devduck/test_redduck.py,sha256=nqRchR7d54jWGx7JN5tji2ZV4Ek4L9s-P7hp0mKjA0Y,1773
5
5
  devduck/tools/__init__.py,sha256=mu3V4jL2ACN4f-pnUID_A2p6o3Yc_-V_y9071PduCR0,177
6
6
  devduck/tools/create_subagent.py,sha256=UzRz9BmU4PbTveZROEpZ311aH-u-i6x89gttu-CniAE,24687
7
7
  devduck/tools/install_tools.py,sha256=wm_67b9IfY-2wRuWgxuEKhaSIV5vNfbGmZL3G9dGi2A,10348
8
- devduck/tools/mcp_server.py,sha256=oyF1gb7K-OlxyJLUO3L-vNo2ajKzIrcnT1crwKMOkhU,20118
8
+ devduck/tools/mcp_server.py,sha256=Ybp0PcJKW2TOvghsRL-i8Guqc9WokPwOD2bhVgzoj6Q,21490
9
9
  devduck/tools/store_in_kb.py,sha256=-JM-oRQKR3FBubKHFHmXRnZSvi9dVgHxG0lismMgG2k,6861
10
10
  devduck/tools/tcp.py,sha256=HkJ_j1t7hsPMxNL51bYHvPkHoTfro9Nov6vClwvwkEk,21943
11
11
  devduck/tools/use_github.py,sha256=nr3JSGk48mKUobpgW__2gu6lFyUj93a1XRs3I6vH8W4,13682
12
12
  devduck/tools/websocket.py,sha256=lRJZt813iHorVr5UI66Lq-lmaFuLYAfpodeV2gtda7k,16635
13
- devduck-0.3.0.dist-info/licenses/LICENSE,sha256=CVGEiNh6cW1mgAKW83Q0P4xrQEXvqc6W-rb789W_IHM,1060
14
- devduck-0.3.0.dist-info/METADATA,sha256=pg0OIugkyVKbHA39NYYBJxr0MRVunCI9-XtwWr9Pcn4,4243
15
- devduck-0.3.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
16
- devduck-0.3.0.dist-info/entry_points.txt,sha256=BAMQaIg_BLZQOTk12bT7hy1dE9oGPLt-_dTbI4cnBnQ,40
17
- devduck-0.3.0.dist-info/top_level.txt,sha256=ySXWlVronp8xHYfQ_Hdfr463e0EnbWuqyuxs94EU7yk,8
18
- devduck-0.3.0.dist-info/RECORD,,
13
+ devduck-0.4.0.dist-info/licenses/LICENSE,sha256=CVGEiNh6cW1mgAKW83Q0P4xrQEXvqc6W-rb789W_IHM,1060
14
+ devduck-0.4.0.dist-info/METADATA,sha256=YIeou0tJig_jTk0xc03I_cy7KL-4zpsvQDtcWORN7Vo,7363
15
+ devduck-0.4.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
16
+ devduck-0.4.0.dist-info/entry_points.txt,sha256=BAMQaIg_BLZQOTk12bT7hy1dE9oGPLt-_dTbI4cnBnQ,40
17
+ devduck-0.4.0.dist-info/top_level.txt,sha256=ySXWlVronp8xHYfQ_Hdfr463e0EnbWuqyuxs94EU7yk,8
18
+ devduck-0.4.0.dist-info/RECORD,,
@@ -1,152 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: devduck
3
- Version: 0.3.0
4
- Summary: 🦆 Extreme minimalist self-adapting AI agent - one file, self-healing, runtime dependencies
5
- Author-email: duck <hey@devduck.dev>
6
- License-Expression: MIT
7
- Project-URL: Homepage, https://github.com/cagataycali/devduck
8
- Project-URL: Repository, https://github.com/cagataycali/devduck.git
9
- Project-URL: Documentation, https://github.com/cagataycali/devduck#readme
10
- Project-URL: Bug Tracker, https://github.com/cagataycali/devduck/issues
11
- Keywords: ai,agent,minimalist,self-healing,ollama,strands-agents
12
- Classifier: Development Status :: 4 - Beta
13
- Classifier: Environment :: Console
14
- Classifier: Intended Audience :: Developers
15
- Classifier: Intended Audience :: System Administrators
16
- Classifier: Operating System :: OS Independent
17
- Classifier: Programming Language :: Python :: 3
18
- Classifier: Programming Language :: Python :: 3.10
19
- Classifier: Programming Language :: Python :: 3.11
20
- Classifier: Programming Language :: Python :: 3.12
21
- Classifier: Programming Language :: Python :: 3.13
22
- Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
23
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
- Classifier: Topic :: System :: Systems Administration
25
- Classifier: Topic :: Utilities
26
- Requires-Python: >=3.10
27
- Description-Content-Type: text/markdown
28
- License-File: LICENSE
29
- Requires-Dist: strands-agents
30
- Requires-Dist: prompt_toolkit
31
- Requires-Dist: strands-agents[ollama]
32
- Requires-Dist: strands-agents-tools
33
- Requires-Dist: strands-agentcore-tools
34
- Requires-Dist: beautifulsoup4
35
- Requires-Dist: colorama
36
- Requires-Dist: websockets
37
- Provides-Extra: all
38
- Requires-Dist: strands-agents[openai]; extra == "all"
39
- Requires-Dist: strands-agents[anthropic]; extra == "all"
40
- Requires-Dist: strands-fun-tools[audio]; extra == "all"
41
- Requires-Dist: strands-fun-tools[vision]; extra == "all"
42
- Requires-Dist: strands-fun-tools[all]; extra == "all"
43
- Requires-Dist: strands-mcp-server; extra == "all"
44
- Dynamic: license-file
45
-
46
- # 🦆 DevDuck
47
-
48
- **One file. Self-healing. Adaptive.**
49
-
50
- Minimalist AI agent that fixes itself when things break.
51
-
52
- ## Install
53
-
54
- ```bash
55
- # Minimal install
56
- pipx install devduck
57
-
58
- # Full install (all tools)
59
- pipx install "devduck[all]"
60
- ```
61
-
62
- Requires: Python 3.10+, Ollama running (or set MODEL_PROVIDER)
63
-
64
- ## Use
65
-
66
- ```bash
67
- # Start DevDuck (auto-starts TCP, WebSocket, MCP servers)
68
- devduck
69
-
70
- # CLI mode
71
- devduck "what's the time?"
72
-
73
- # Python
74
- import devduck
75
- devduck("calculate 2+2")
76
- ```
77
-
78
- ## Auto-Started Servers
79
-
80
- When you run `devduck`, three servers start automatically:
81
-
82
- - **🌐 Web UI**: [http://cagataycali.github.io/devduck](http://cagataycali.github.io/devduck) (auto-connects)
83
- - **🔌 TCP**: `nc localhost 9999` (raw socket)
84
- - **🌊 WebSocket**: `ws://localhost:8080` (structured JSON)
85
- - **🔗 MCP**: `http://localhost:8000/mcp` (Model Context Protocol)
86
-
87
- ### Connect via MCP
88
-
89
- Add to your MCP client (e.g., Claude Desktop):
90
-
91
- ```json
92
- {
93
- "mcpServers": {
94
- "devduck": {
95
- "command": "uvx",
96
- "args": [
97
- "strands-mcp-server",
98
- "--upstream-url",
99
- "http://localhost:8000/mcp/"
100
- ],
101
- "disabled": false
102
- }
103
- }
104
- }
105
- ```
106
-
107
- ### Connect via Terminal
108
-
109
- ```bash
110
- # Direct TCP connection
111
- nc localhost 9999
112
- > what's the time?
113
- ```
114
-
115
- ## Features
116
-
117
- - **Self-healing** - Auto-fixes deps, models, errors
118
- - **Hot-reload** - Create tools in `./tools/*.py`, use instantly
119
- - **Adaptive** - Picks model based on OS (macOS: 1.7b, Linux: 30b)
120
- - **14 tools** - shell, editor, files, python, calculator, tcp, etc.
121
- - **History aware** - Remembers shell/conversation context
122
- - **Multi-protocol** - TCP, WebSocket, MCP, CLI, Python
123
-
124
- ## Create Tool
125
-
126
- ```python
127
- # ./tools/greet.py
128
- from strands import tool
129
-
130
- @tool
131
- def greet(name: str) -> str:
132
- return f"Hello {name}!"
133
- ```
134
-
135
- Save. Done. Use immediately.
136
-
137
- ## Multi-Model
138
-
139
- ```bash
140
- export MODEL_PROVIDER="bedrock"
141
- export STRANDS_MODEL_ID="us.anthropic.claude-sonnet-4-5-20250929-v1:0"
142
- export STRANDS_ADDITIONAL_REQUEST_FIELDS='{"anthropic_beta": ["interleaved-thinking-2025-05-14", "context-1m-2025-08-07"], "thinking": {"type": "enabled", "budget_tokens": 2048}}'
143
- export STRANDS_MAX_TOKENS="64000"
144
-
145
- devduck "analyze data"
146
- ```
147
-
148
- ---
149
-
150
- **Quack.** 🦆
151
-
152
- *Built with [Strands Agents SDK](https://github.com/strands-agents/sdk-python)*