set loggingConsumer after client initialization
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
- Domain
- api, backend-api-design
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
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from modelcontextprotocol/java-sdk
-
area/transport bug P2
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
modelcontextprotocol/java-sdk#1136 ·
-
area/client bug P2
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
modelcontextprotocol/java-sdk#1124 · 1 comment ·
-
ServerCapabilities.logging is added unconditionally, overriding the caller's explicit capabilities Openbug P2 ready for work
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
modelcontextprotocol/java-sdk#1086 · 1 comment ·
-
enhancement good first issue P3
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
modelcontextprotocol/java-sdk#1067 ·
-
bug P2 ready for work
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
modelcontextprotocol/java-sdk#898 · 1 comment ·
All issues in modelcontextprotocol/java-sdk
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Two open-case totals on one screen: the Programs tile says 15,858 and the nav badge says 15,868 Openbug frontend maui-pilot
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
objectionary/eo-graphs#74 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100