UAT: MCPToolFilter and MCPTransport declared in adapter.py __all__ but missing from cleveragents.mcp package public API #3825

Open
opened 2026-04-06 06:47:38 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: bugfix/mcp-package-missing-exports
  • Commit Message: fix(mcp): export MCPToolFilter and MCPTransport from cleveragents.mcp __init__
  • Milestone: (none — backlog)
  • Parent Epic: #397

Backlog note: This issue was discovered during autonomous operation
on milestone v3.5.0. It does not block milestone completion and has been
placed in the backlog for human review and future milestone assignment.

Background and Context

During UAT testing of the cleveragents.mcp package public API, two classes were found to be declared in src/cleveragents/mcp/adapter.py's __all__ but not re-exported from src/cleveragents/mcp/__init__.py.

adapter.py __all__:

__all__ = [
    "MCPCapabilityMetadata",
    "MCPServerConfig",
    "MCPToolAdapter",
    "MCPToolDescriptor",
    "MCPToolFilter",   # ← declared here
    "MCPToolResult",
    "MCPTransport",    # ← declared here
]

mcp/__init__.py __all__:

__all__ = [
    "MCPCapabilityMetadata",
    "MCPRefreshHook",
    "MCPServerConfig",
    "MCPToolAdapter",
    "MCPToolDescriptor",
    "MCPToolResult",
    "McpClient",
    "McpClientConfig",
    "McpClientState",
    "McpRegistry",
    "SandboxPathRewriter",
    "SandboxPathRewriterConfig",
    # MCPToolFilter is MISSING
    # MCPTransport is MISSING
]

Current Behavior

MCPToolFilter and MCPTransport are not importable from the cleveragents.mcp package top-level namespace, despite being declared in adapter.py's __all__ as part of the intended public API.

Reproduction:

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

# Workaround (internal path, not public API):
from cleveragents.mcp.adapter import MCPToolFilter  # Works
from cleveragents.mcp.adapter import MCPTransport   # Works

Expected Behavior

Both MCPToolFilter and MCPTransport should be importable directly from cleveragents.mcp:

from cleveragents.mcp import MCPToolFilter  # Should work
from cleveragents.mcp import MCPTransport   # Should work

Impact:

  • MCPToolFilter — Users who want to filter which MCP tools are discovered/registered cannot import it from cleveragents.mcp. They must use the internal cleveragents.mcp.adapter path.
  • MCPTransport — Users who want to implement custom transports (e.g., for testing or custom protocols) cannot import the base class from cleveragents.mcp. They must use the internal path.

Both classes are part of the intended public API (they are in adapter.py's __all__), but the package-level __init__.py does not re-export them, making them inaccessible via the public package namespace.

Subtasks

  • Add MCPToolFilter to src/cleveragents/mcp/__init__.py imports and __all__
  • Add MCPTransport to src/cleveragents/mcp/__init__.py imports and __all__
  • Verify from cleveragents.mcp import MCPToolFilter works after fix
  • Verify from cleveragents.mcp import MCPTransport works after fix
  • Tests (Behave): Add scenarios verifying both symbols are importable from the package top-level
  • Verify coverage >= 97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

Definition of Done

This issue is complete when:

  • from cleveragents.mcp import MCPToolFilter works without error
  • from cleveragents.mcp import MCPTransport works without error
  • All existing MCP tests still pass
  • All nox stages pass
  • Coverage >= 97%
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.

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

## Metadata - **Branch**: `bugfix/mcp-package-missing-exports` - **Commit Message**: `fix(mcp): export MCPToolFilter and MCPTransport from cleveragents.mcp __init__` - **Milestone**: *(none — backlog)* - **Parent Epic**: #397 > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.5.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. ## Background and Context During UAT testing of the `cleveragents.mcp` package public API, two classes were found to be declared in `src/cleveragents/mcp/adapter.py`'s `__all__` but **not re-exported** from `src/cleveragents/mcp/__init__.py`. **`adapter.py` `__all__`:** ```python __all__ = [ "MCPCapabilityMetadata", "MCPServerConfig", "MCPToolAdapter", "MCPToolDescriptor", "MCPToolFilter", # ← declared here "MCPToolResult", "MCPTransport", # ← declared here ] ``` **`mcp/__init__.py` `__all__`:** ```python __all__ = [ "MCPCapabilityMetadata", "MCPRefreshHook", "MCPServerConfig", "MCPToolAdapter", "MCPToolDescriptor", "MCPToolResult", "McpClient", "McpClientConfig", "McpClientState", "McpRegistry", "SandboxPathRewriter", "SandboxPathRewriterConfig", # MCPToolFilter is MISSING # MCPTransport is MISSING ] ``` ## Current Behavior `MCPToolFilter` and `MCPTransport` are not importable from the `cleveragents.mcp` package top-level namespace, despite being declared in `adapter.py`'s `__all__` as part of the intended public API. **Reproduction:** ```python from cleveragents.mcp import MCPToolFilter # ImportError from cleveragents.mcp import MCPTransport # ImportError # Workaround (internal path, not public API): from cleveragents.mcp.adapter import MCPToolFilter # Works from cleveragents.mcp.adapter import MCPTransport # Works ``` ## Expected Behavior Both `MCPToolFilter` and `MCPTransport` should be importable directly from `cleveragents.mcp`: ```python from cleveragents.mcp import MCPToolFilter # Should work from cleveragents.mcp import MCPTransport # Should work ``` **Impact:** - `MCPToolFilter` — Users who want to filter which MCP tools are discovered/registered cannot import it from `cleveragents.mcp`. They must use the internal `cleveragents.mcp.adapter` path. - `MCPTransport` — Users who want to implement custom transports (e.g., for testing or custom protocols) cannot import the base class from `cleveragents.mcp`. They must use the internal path. Both classes are part of the intended public API (they are in `adapter.py`'s `__all__`), but the package-level `__init__.py` does not re-export them, making them inaccessible via the public package namespace. ## Subtasks - [ ] Add `MCPToolFilter` to `src/cleveragents/mcp/__init__.py` imports and `__all__` - [ ] Add `MCPTransport` to `src/cleveragents/mcp/__init__.py` imports and `__all__` - [ ] Verify `from cleveragents.mcp import MCPToolFilter` works after fix - [ ] Verify `from cleveragents.mcp import MCPTransport` works after fix - [ ] Tests (Behave): Add scenarios verifying both symbols are importable from the package top-level - [ ] Verify coverage >= 97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done This issue is complete when: - [ ] `from cleveragents.mcp import MCPToolFilter` works without error - [ ] `from cleveragents.mcp import MCPTransport` works without error - [ ] All existing MCP tests still pass - All nox stages pass - Coverage >= 97% - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
Author
Owner

Label compliance fix applied:

  • Removed conflicting labels: Priority/Medium (kept Priority/Backlog), State/In Progress (kept State/Verified)
  • Reason: Issue had two conflicting Priority/* labels and two conflicting State/* labels. State/Verified is more advanced than State/In Progress, and Priority/Backlog is the appropriate default for backlog items.

Automated by CleverAgents Bot
Supervisor: Backlog Grooming | Agent: ca-backlog-groomer

Label compliance fix applied: - Removed conflicting labels: `Priority/Medium` (kept `Priority/Backlog`), `State/In Progress` (kept `State/Verified`) - Reason: Issue had two conflicting Priority/* labels and two conflicting State/* labels. `State/Verified` is more advanced than `State/In Progress`, and `Priority/Backlog` is the appropriate default for backlog items. --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: ca-backlog-groomer
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
#397 Epic: Server & Autonomy Infrastructure
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#3825
No description provided.