UAT: MCPToolFilter and MCPTransport not exported from cleveragents.mcp package — public API incomplete #2111

Open
opened 2026-04-03 04:09:36 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: fix/mcp-missing-public-api-exports-mcptoolfilter-mcptransport
  • Commit Message: fix(mcp): export MCPToolFilter and MCPTransport from cleveragents.mcp package __init__
  • Milestone: v3.7.0
  • Parent Epic: #399

Bug Report

Severity Assessment

  • Impact: High — any user trying to filter MCP tools using the documented API, or implement a custom MCP transport, will receive an ImportError at import time. Both types are referenced in the public API documentation (docs/api/mcp.md and docs/reference/mcp_adapter.md) and are required for standard MCP adapter usage patterns.
  • Likelihood: Certain — the imports fail 100% of the time for any consumer of the public API.
  • Priority: High

What Was Tested

Code-level analysis of the cleveragents.mcp package's public API surface against the specification and published API documentation.

Location

  • File: src/cleveragents/mcp/__init__.py — missing re-exports for MCPToolFilter and MCPTransport
  • File: src/cleveragents/mcp/adapter.py lines 40–48 — __all__ includes both symbols but the package __init__.py does not import or re-export them

Expected Behavior (from spec)

Per docs/api/mcp.md and docs/reference/mcp_adapter.md, the cleveragents.mcp package must export all public types needed to use the MCP adapter:

  • MCPToolFilter — required to filter tools during discover_tools() and register_tools() calls
  • MCPTransport — base class for custom transport implementations

Both are declared in adapter.py's __all__ list and are part of the documented public API surface.

Actual Behavior

from cleveragents.mcp import MCPToolFilter  # ImportError: cannot import name 'MCPToolFilter'
from cleveragents.mcp import MCPTransport   # ImportError: cannot import name 'MCPTransport'

Both MCPToolFilter and MCPTransport are defined in src/cleveragents/mcp/adapter.py and listed in that module's __all__, but neither is imported or re-exported in src/cleveragents/mcp/__init__.py.

Steps to Reproduce

from cleveragents.mcp import MCPToolFilter  # Fails with ImportError
from cleveragents.mcp import MCPTransport   # Fails with ImportError

Root Cause

src/cleveragents/mcp/__init__.py does not include MCPToolFilter or MCPTransport in its imports from adapter.py, despite both being declared in adapter.py's __all__ and being part of the documented public API.

Subtasks

  • Confirm MCPToolFilter and MCPTransport are defined in src/cleveragents/mcp/adapter.py and present in its __all__
  • Add MCPToolFilter and MCPTransport to the imports in src/cleveragents/mcp/__init__.py
  • Add both symbols to __all__ in src/cleveragents/mcp/__init__.py if an __all__ list is present
  • Verify from cleveragents.mcp import MCPToolFilter and from cleveragents.mcp import MCPTransport succeed after the fix
  • Write Behave unit test scenarios covering successful import of MCPToolFilter and MCPTransport from the package
  • Write Robot Framework integration test verifying the public API surface of cleveragents.mcp
  • Run nox -e typecheck and confirm no type errors introduced
  • Run nox -e lint and confirm no lint errors
  • Run nox -e unit_tests and confirm all tests pass
  • Run nox -e coverage_report and confirm coverage ≥ 97%
  • Run full nox suite and confirm all sessions pass

Definition of Done

  • from cleveragents.mcp import MCPToolFilter succeeds without error
  • from cleveragents.mcp import MCPTransport succeeds without error
  • Both symbols are present in cleveragents.mcp.__all__ (if __all__ is defined)
  • Behave unit tests added covering the corrected public API exports
  • Robot Framework integration test added verifying the cleveragents.mcp public API surface
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly (fix(mcp): export MCPToolFilter and MCPTransport from cleveragents.mcp package __init__), followed by a blank line, then additional detail lines
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly (fix/mcp-missing-public-api-exports-mcptoolfilter-mcptransport)
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done
  • All nox stages pass
  • Coverage >= 97%

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-new-issue-creator

## Metadata - **Branch**: `fix/mcp-missing-public-api-exports-mcptoolfilter-mcptransport` - **Commit Message**: `fix(mcp): export MCPToolFilter and MCPTransport from cleveragents.mcp package __init__` - **Milestone**: v3.7.0 - **Parent Epic**: #399 ## Bug Report ### Severity Assessment - **Impact**: High — any user trying to filter MCP tools using the documented API, or implement a custom MCP transport, will receive an `ImportError` at import time. Both types are referenced in the public API documentation (`docs/api/mcp.md` and `docs/reference/mcp_adapter.md`) and are required for standard MCP adapter usage patterns. - **Likelihood**: Certain — the imports fail 100% of the time for any consumer of the public API. - **Priority**: High ### What Was Tested Code-level analysis of the `cleveragents.mcp` package's public API surface against the specification and published API documentation. ### Location - **File**: `src/cleveragents/mcp/__init__.py` — missing re-exports for `MCPToolFilter` and `MCPTransport` - **File**: `src/cleveragents/mcp/adapter.py` lines 40–48 — `__all__` includes both symbols but the package `__init__.py` does not import or re-export them ### Expected Behavior (from spec) Per `docs/api/mcp.md` and `docs/reference/mcp_adapter.md`, the `cleveragents.mcp` package must export all public types needed to use the MCP adapter: - `MCPToolFilter` — required to filter tools during `discover_tools()` and `register_tools()` calls - `MCPTransport` — base class for custom transport implementations Both are declared in `adapter.py`'s `__all__` list and are part of the documented public API surface. ### Actual Behavior ```python from cleveragents.mcp import MCPToolFilter # ImportError: cannot import name 'MCPToolFilter' from cleveragents.mcp import MCPTransport # ImportError: cannot import name 'MCPTransport' ``` Both `MCPToolFilter` and `MCPTransport` are defined in `src/cleveragents/mcp/adapter.py` and listed in that module's `__all__`, but neither is imported or re-exported in `src/cleveragents/mcp/__init__.py`. ### Steps to Reproduce ```python from cleveragents.mcp import MCPToolFilter # Fails with ImportError from cleveragents.mcp import MCPTransport # Fails with ImportError ``` ### Root Cause `src/cleveragents/mcp/__init__.py` does not include `MCPToolFilter` or `MCPTransport` in its imports from `adapter.py`, despite both being declared in `adapter.py`'s `__all__` and being part of the documented public API. ## Subtasks - [ ] Confirm `MCPToolFilter` and `MCPTransport` are defined in `src/cleveragents/mcp/adapter.py` and present in its `__all__` - [ ] Add `MCPToolFilter` and `MCPTransport` to the imports in `src/cleveragents/mcp/__init__.py` - [ ] Add both symbols to `__all__` in `src/cleveragents/mcp/__init__.py` if an `__all__` list is present - [ ] Verify `from cleveragents.mcp import MCPToolFilter` and `from cleveragents.mcp import MCPTransport` succeed after the fix - [ ] Write Behave unit test scenarios covering successful import of `MCPToolFilter` and `MCPTransport` from the package - [ ] Write Robot Framework integration test verifying the public API surface of `cleveragents.mcp` - [ ] Run `nox -e typecheck` and confirm no type errors introduced - [ ] Run `nox -e lint` and confirm no lint errors - [ ] Run `nox -e unit_tests` and confirm all tests pass - [ ] Run `nox -e coverage_report` and confirm coverage ≥ 97% - [ ] Run full `nox` suite and confirm all sessions pass ## Definition of Done - [ ] `from cleveragents.mcp import MCPToolFilter` succeeds without error - [ ] `from cleveragents.mcp import MCPTransport` succeeds without error - [ ] Both symbols are present in `cleveragents.mcp.__all__` (if `__all__` is defined) - [ ] Behave unit tests added covering the corrected public API exports - [ ] Robot Framework integration test added verifying the `cleveragents.mcp` public API surface - [ ] A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly (`fix(mcp): export MCPToolFilter and MCPTransport from cleveragents.mcp package __init__`), followed by a blank line, then additional detail lines - [ ] The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly (`fix/mcp-missing-public-api-exports-mcptoolfilter-mcptransport`) - [ ] The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done - [ ] All nox stages pass - [ ] Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
freemo added this to the v3.7.0 milestone 2026-04-03 04:09:42 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: High (confirmed) — Public API exports are broken. Users get ImportError when trying to use documented MCP types.
  • Milestone: v3.7.0 (confirmed — MCP adapter, Epic #399)
  • MoSCoW: Should Have — The MCP public API should export all documented types. This is a simple fix (add imports to __init__.py) but affects any consumer of the MCP adapter API.
  • Parent Epic: #399 (confirmed correct)

Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: ca-project-owner

Issue triaged by project owner: - **State**: Verified - **Priority**: High (confirmed) — Public API exports are broken. Users get ImportError when trying to use documented MCP types. - **Milestone**: v3.7.0 (confirmed — MCP adapter, Epic #399) - **MoSCoW**: Should Have — The MCP public API should export all documented types. This is a simple fix (add imports to `__init__.py`) but affects any consumer of the MCP adapter API. - **Parent Epic**: #399 (confirmed correct) --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
freemo self-assigned this 2026-04-03 16:58:06 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Blocks
#399 Epic: Post-MVP Server & Clients
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#2111
No description provided.