Commit Graph

5 Commits

Author SHA1 Message Date
Adam
3274cfafe7 add concurrent session management and resource isolation
Implement concurrent session management for MCP server with:

- SessionManager with computer instance pooling
- Concurrent task execution support
- New tools: get_session_stats, cleanup_session
- Graceful shutdown and resource cleanup
- Fix nested asyncio event loop issues
- Add comprehensive tests and documentation

Enables multiple concurrent clients with proper resource isolation
while maintaining backward compatibility.
2025-10-06 18:37:10 -04:00
Adam
37864faef2 Fix MCP server startup and tool schema issues in server.py and start_mcp_server.sh
Changes
- Refactored `server.py`:
  - Delayed server instantiation to avoid double-import issues and RuntimeWarning.
  - Reworked `run_cua_task` and `run_multi_cua_tasks` to yield structured output
    (text + screenshots) in a Pydantic-compatible format.
  - Added helper functions for normalising message content, extracting text,
    and serialising tool outputs.
  - Improved logging and error handling for clearer debugging.

- Updated `start_mcp_server.sh`:
  - Ensures Python path points to repo-local `.venv`.
  - Sets `PYTHONPATH` correctly for all `libs/python/*` packages.
  - Added clear debug output for python binary, repo dir, and PYTHONPATH.

Why
- Fixed `PydanticSchemaGenerationError` when returning `Image` objects from
  tool functions.
- Prevented `FastMCP.__init__()` errors by aligning with supported arguments.
- Removed duplicate module loading at startup that triggered RuntimeWarnings.
- Improved clarity of server startup logs for easier integration with Claude Desktop.

Outcome
The MCP server now starts cleanly, registers all tools, and stays connected
with Claude Desktop without schema errors or double-import issues.
2025-09-30 18:52:04 -04:00
Adam
65263112cd Stream MCP responses instead of buffering 2025-09-25 16:07:53 -04:00
Dillon DuPont
96e4b7586a update mcp server to cua-agent==0.4.x 2025-08-05 10:51:21 -04:00
Morgan Dean
0246d18347 Reorganize lib folder w/typescript and python roots, initialize core library. 2025-06-23 10:22:36 -07:00