Commit Graph

3 Commits

Author SHA1 Message Date
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
Dillon DuPont
394ebaac3c Completed python refactor migration 2025-07-01 16:04:06 -04:00
Morgan Dean
0246d18347 Reorganize lib folder w/typescript and python roots, initialize core library. 2025-06-23 10:22:36 -07:00