Skip to content

py/plugins/mcp: client errors for a hosted server don't name its host #204

Done

Description

@hilariie

Part of genkit-ai/genkit#6194.

When a server runs behind an McpHost, a few errors and one log line from McpClient still treat it as a standalone client. They say "MCP client" and leave out the host, so two hosts that each run a git server produce the same text:

  • MCP client 'git' is closed, from a tool call made after disconnect, a replace, or host.close()
  • MCP client 'git' restarted during the request; retry it, from a tool call that was in flight during reconnect
  • the MCP connection did not close on its event loop in time warning, which logs client= where the host's own logs use server=/host=

Connection errors already name the host since genkit-ai/genkit#6930 (MCP connection to 'git' on host 'hosted' ('uvx') failed). These three should match, and the tests that pin the current text need updating.

Activity

  1. yumin2002 commented on Nov 10, 2026

    @yumin2002
    Contributor

    Hi! I’d like to work on this issue if it’s still available. Can you assign it to me?

  2. genkit-bot commented on Dec 1, 2026

    @genkit-bot

    This has already been fixed on main in packages/genkit-mcp/src/genkit_mcp/_client.py (PR #148): McpClient._target now includes the server and host names in closed and restart errors, and McpClient._wait_for_close logs server and host keys for hosted servers, with regression tests in packages/genkit-mcp/tests/mcp_host_test.py and packages/genkit-mcp/tests/mcp_client_test.py. Closing as already fixed; please reopen if you still see a hosted server error or log missing its host.

    Run 24ba00a3-91bb-4395-b441-70977daa80c9 · Cloud Run logs · Dashboard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions