+
Skip to content

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Sep 4, 2025

Coding agent has begun work on Enhancing MCP Client Logging in Live Tests and will replace this description as work progresses.

See problem context

TITLE: Enhancing MCP Client Logging in Live Tests

USER INTENT: The user aims to improve the logging mechanism for the MCP client in live tests by redirecting the MCP server's stderr output to XUnit's test output helper.

TASK DESCRIPTION: The user wants to refactor the existing test structure to utilize IAsyncLifetime in the CommandTestsBase class, allowing for better logging of informational messages from the MCP server. This involves moving initialization logic from LiveTestFixture to CommandTestsBase, updating the MCP server to log to stderr, and ensuring that all logs are captured and displayed in the test output.

EXISTING:

  • The current live test classes are using LiveTestFixture for setup, which is not optimal for logging.
  • The MCP client logs are not being redirected to XUnit's output helper.
  • The ClientToolTests class implements its own IAsyncLifetime instead of inheriting from a base class.

PENDING:

  • Implement IAsyncLifetime in CommandTestsBase.
  • Move the InitializeAsync method from LiveTestFixture to CommandTestsBase.
  • Update the ClientToolTests to inherit from CommandTestsBase.
  • Remove LiveTestFixture.cs.
  • Update the MCP server to add a console logging provider and set the stderr threshold to debug.

CODE STATE:

  1. CommandTestsBase.cs: Needs to be updated to include IAsyncLifetime and handle stderr logging.
  2. ClientToolTests.cs: Should inherit from CommandTestsBase and utilize its logging capabilities.
  3. LiveTestFixture.cs: To be deleted after moving necessary logic to CommandTestsBase.

RELEVANT CODE/DOCUMENTATION SNIPPETS:

  • CommandTestsBase.cs:
    public class CommandTestsBase : IAsyncLifetime
    {
        // Add methods to initialize MCP client and redirect stderr to output helper
    }
  • ClientToolTests.cs:
    public class ClientToolTests : CommandTestsBase
    {
        // Update to remove custom IAsyncLifetime implementation
    }

OTHER NOTES:

  • The user prefers to add a -debug option to the server start command to control logging verbosity.
  • The user plans to leverage existing work on determining when the MCP server should be in debug mode.
  • The implementation will enhance the visibility of logs during test execution, making it easier to diagnose issues.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载