How hkuds/anytool works
AnyTool is a universal tool-use layer for AI agents: a task enters through the tool layer, is turned into tool retrieval and execution across available backends, and returns a response. Its major branches include MCP, shell, GUI, and web automation, plus quality-aware selection, recording, and optional remote shell/GUI execution through the local server. The README establishes the product workflow and execution modes; several orchestration and backend files were not excerpted, so those connections are shown as unverified where needed.
Main entry points: grounding_client.py Grounding Client · main.py Local Server · tool_layer.py Tool Layer · session.py Shell Backend
Components 23
Agent Orchestration
- Tool Layer
anytool/tool_layer.py - Tool Retrieval
anytool/grounding/core/search_tools.py
Grounding Runtime
- Grounding Client
anytool/grounding/core/grounding_client.py - Session Runtime
anytool/grounding/core/session.py - Tool Execution
anytool/grounding/core/tool/base.py
Tool Backends
- MCP Servers
anytool/grounding/backends/mcp/client.py - MCP Session
anytool/grounding/backends/mcp/session.py - MCP Installer
anytool/grounding/backends/mcp/installer.py - Shell Backend
anytool/grounding/backends/shell/session.py - Local Shell
anytool/grounding/backends/shell/transport/local_connector.py - GUI Backend
anytool/grounding/backends/gui - Web Backend
anytool/grounding/backends/web
Quality and Recording
- Quality Manager
anytool/grounding/core/quality/manager.py - Quality Store
anytool/grounding/core/quality/store.py - Recording Manager
anytool/recording/manager.py - Recorder
anytool/recording/recorder.py - Video Capture
anytool/recording/video.py
Remote Execution
- Local Server
anytool/local_server/main.py - Server Health
anytool/local_server/health_checker.py - Feature Checks
anytool/local_server/feature_checker.py - Platform Adapters
anytool/local_server/platform_adapters - Screenshot Utilities
anytool/local_server/utils/screenshot.py
Other components
- Agent or User
Connections 29
- Agent or User → Tool Layer: submits task
README.md - Tool Layer → Tool Retrieval: retrieves tools
- Tool Layer → Grounding Client: orchestrates tools
- Grounding Client → Tool Retrieval: requests candidates
anytool/grounding/core/grounding_client.py - Grounding Client → Session Runtime: manages sessions
anytool/grounding/core/grounding_client.py - Grounding Client → Tool Execution: dispatches calls
anytool/grounding/core/grounding_client.py - Tool Retrieval → Tool Execution: ranks tools
anytool/grounding/core/search_tools.py - Grounding Client → MCP Servers: selects provider
- MCP Servers → MCP Session: creates sessions
anytool/grounding/backends/mcp/client.py - MCP Servers → MCP Installer: checks dependencies
anytool/grounding/backends/mcp/client.py - MCP Session → Session Runtime: extends runtime
anytool/grounding/backends/mcp/session.py - Grounding Client → Shell Backend: selects provider
- Shell Backend → Session Runtime: extends runtime
anytool/grounding/backends/shell/session.py - Shell Backend → Local Shell: runs scripts
anytool/grounding/backends/shell/session.py - Grounding Client → GUI Backend: selects provider
- Grounding Client → Web Backend: selects provider
- Quality Manager → Quality Store: persists records
anytool/grounding/core/quality/manager.py - Tool Retrieval → Quality Manager: adjusts ranking
anytool/grounding/core/search_tools.py - Tool Execution → Quality Manager: records execution
- Tool Layer → Recording Manager: configures recording
- Recording Manager → Recorder: records steps
anytool/recording/manager.py - Recording Manager → Video Capture: controls capture
- Agent or User → Local Server: starts service
README.md - Local Server → Server Health: checks health
anytool/local_server/main.py - Local Server → Feature Checks: checks features
anytool/local_server/main.py - Local Server → Platform Adapters: routes platform work
anytool/local_server/main.py - Screenshot Utilities → Platform Adapters: uses adapters
anytool/local_server/utils/screenshot.py - Shell Backend → Local Server: uses HTTP mode
README.md - GUI Backend → Local Server: uses HTTP mode
README.md