Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

set loggingConsumer after client initialization

Open
#938 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
58/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
java

Research direction

Start by reading McpClient initialization and capability-query flow, then compare it with McpClientTransport's loggingConsumer configuration. Verify how setLoggingLevel and setLoggingConsumer behave before initialization. Done means a consumer can be registered after getServerCapabilities() confirms logging support, without breaking the existing pre-initialization builder usage.

Written by the indexing model from the issue text.

Description

waiting for triage

Expected Behavior

We should be able to set a loggingConsumer on McpClient after querying its capabilities.

var capabilities = client.getServerCapabilities();
if (capabilities.logging() != null) {
    client.setLoggingLevel(McpSchema.LoggingLevel.INFO);
    client.setLoggingConsumer(consumer);
}

Current Behavior

Currently, we can set a loggingConsumer with McpClientTransport before client initialization. For example,

McpClient.sync(server.transport())
                .loggingConsumer(consumer)
                .build();

Context

However, many MCP servers' logging capabilities are not enabled. But we cannot query if the server has this capability before client initialization. Such a poor design makes it impossible to register a logging consumer safely.

Dominant language
Java
Stars
3.7k
Forks
1.1k
Avg merge
1d 15h
Merged PRs (30d)
9

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from modelcontextprotocol/java-sdk

All issues in modelcontextprotocol/java-sdk

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.