Test harness: test_mcp_tool_plugins.py. Run with: python -m unittest -v test_mcp_tool_plugins.py
Coverage
- Discovery of decorated synchronous and asynchronous tools.
- A standard-library wrapper tool using math.factorial.
- Hot replacement: rewriting a plugin module is observed on the next discovery.
- Duplicate tool names: the first search directory wins.
- Broken plugin modules are logged and skipped without blocking valid plugins.
- Mailbox metadata search across envoy, other, and all stores, including recipient filters and limits.
- JobServe and David Lloyd JSON GDBM stores using temporary test databases.
- Raw email parsing from a temporary GDBM store, including leading BOM handling.
- Conditional read-only smoke tests against the real JobServe and raw email stores when present.
Result
Plugin Path
MISC_MCP_TOOL_PATH is a separate PYTHONPATH-style search variable. On Linux, directories are separated with a colon, for example: MISC_MCP_TOOL_PATH=/path/one:/path/two
Expanded Coverage
- Empty and missing plugin paths, ignored non-Python and underscore files.
- Schema and default argument preservation, primitive/null result serialization, and missing argument failures.
- Synchronous and asynchronous crash tracebacks, syntax-error reload recovery, and content-based hot reload.
- Case-insensitive mailbox queries, limit coercion, missing databases/emails, empty UIDLs, corrupt JSON records, and unchanged raw GDBM values after reads.
Remediation update: the suite now covers production plugin gating, traceback redaction, last-known-good reloads, mailbox scan and email-size bounds, tracked dev_file packaging, and deployment script checks. The current result is 30 passing tests.