Allow custom or numeric request ID generation (Snowflake MCP server rejects string IDs)
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
Research direction
Start by tracing the private generateRequestId() method and internal counter, then inspect how the McpClient builder and transport pass request IDs. Done means the SDK exposes a configurable generator that can produce numeric IDs while preserving existing behavior; verify request and response IDs remain compatible.
Written by the indexing model from the issue text.
Description
Expected Behavior
The Java SDK should provide a way to configure how request IDs are generated. This could include:
- A public interface or callback for supplying a custom RequestIdGenerator.
- Configuration options to choose between UUID-based, string-based, or numeric-only IDs.
This would help support MCP servers that require strict numeric IDs or forbid UUID/string-based request IDs.
Current Behavior
Currently, the Java SDK:
- Uses a private generateRequestId() method.
- Uses an internal private counter.
- Produces UUID-counter formatted IDs like "62d0970d-0".
- Provides no public extension point to override or customize ID generation.
This causes compatibility issues with MCP servers (such as Snowflake's MCP implementation) that accept only numeric IDs.
Example (hypothetical API):
McpClient client = McpClient.builder()
.withRequestIdGenerator(() -> String.valueOf(counter.incrementAndGet()))
.build();
Context
When integrating with the Snowflake MCP server, requests are rejected because the Java SDK always generates UUID-based IDs.
Workarounds include:
- Implementing a custom transport such as SimpleHttpTransport.
- Remapping request and response IDs manually.
These solutions work but duplicate SDK logic and introduce unnecessary complexity. Providing a built-in, configurable ID generation mechanism would make the SDK more flexible and easier to use.
- 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
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
elastic/gradle-plugins#157 ·
-
enhancement Tools
Difficulty 1/5 Under an hour Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
apache/rocketmq-dashboard#5008 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
DETECT_PARAMETER_NAMES=false silently disables @ConstructorProperties-based Creator detection too Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
FasterXML/jackson-databind#6229 ·