Skip to content

mcp(resources): Add socket_name support to resource handlers #647

@tony

Description

@tony

Context

All 6 resource handlers in src/libtmux/mcp/resources/hierarchy.py call _get_server() with no arguments, while every tool function accepts socket_name: str | None = None. The server instructions at server.py:20 promise multi-server support via socket_name, creating a capability gap between tools and resources.

Problem

Resources always connect to the default socket (or LIBTMUX_SOCKET env var). There's no way to read resources from alternate tmux sockets.

Proposed Solution

Investigate whether FastMCP resource URI templates can accept query parameters (e.g., tmux://sessions?socket=foo) or if a separate approach is needed. This may require upstream FastMCP changes.

Files

  • src/libtmux/mcp/resources/hierarchy.py — all 6 resource handlers

Metadata

Metadata

Assignees

No one assigned

    Labels

    MCPMCP server (src/libtmux/mcp/)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions