Title: Unable to call tools with Chinese names using HttpClientSseClientTransport and HttpClientStreamableHttpTransport · Issue #260 · modelcontextprotocol/java-sdk · GitHub
Open Graph Title: Unable to call tools with Chinese names using HttpClientSseClientTransport and HttpClientStreamableHttpTransport · Issue #260 · modelcontextprotocol/java-sdk
X Title: Unable to call tools with Chinese names using HttpClientSseClientTransport and HttpClientStreamableHttpTransport · Issue #260 · modelcontextprotocol/java-sdk
Description: Bug description When I call the tool which name is Chinese, The mcp client will throws Exception below. Exception in thread "main" io.modelcontextprotocol.spec.McpError: Tool not found: 天��� at io.modelcontextprotocol.spec.McpCli...
Open Graph Description: Bug description When I call the tool which name is Chinese, The mcp client will throws Exception below. Exception in thread "main" io.modelcontextprotocol.spec.McpError: Tool not found: 天æ°�é¢�æ�...
X Description: Bug description When I call the tool which name is Chinese, The mcp client will throws Exception below. Exception in thread "main" io.modelcontextprotocol.spec.McpError: Tool not found: å...
Opengraph URL: https://github.com/modelcontextprotocol/java-sdk/issues/260
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unable to call tools with Chinese names using HttpClientSseClientTransport and HttpClientStreamableHttpTransport","articleBody":"\n\n**Bug description**\nWhen I call the tool which name is Chinese, The mcp client will throws Exception below.\n```\nException in thread \"main\" io.modelcontextprotocol.spec.McpError: Tool not found: 天æ°é¢æ¥\n\tat io.modelcontextprotocol.spec.McpClientSession.lambda$sendRequest$11(McpClientSession.java:248)\n\tSuppressed: The stacktrace has been enhanced by Reactor, refer to additional information below:\n```\nThe tool name is messy code. \n\n\n**Environment**\nSpring AI 1.0.0 , mcp 0.10.0 , without vector store\n\n**Java SDK**\nOpenjdk17\n\n**Steps to reproduce**\nJust add a tool with a Chinese name(such as 天气预报), then call the tool.\n\n**Recommendation**\n**sendMessage in HttpClientSseClientTransport.java** \n```\nString jsonText = this.objectMapper.writeValueAsString(message);\n\t\t\tURI requestUri = Utils.resolveUri(baseUri, endpoint);\n\t\t\tHttpRequest request = this.requestBuilder.uri(requestUri)\n\t\t\t\t.setHeader(\"Content-Type\", \"application/json;charset=UTF-8\")\n\t\t\t\t.POST(HttpRequest.BodyPublishers.ofString(jsonText))\n\t\t\t\t.build();\n```\n\nSo just set the default request encoding of HttpRequest in the HttpClientSseClientTransport to UTF-8.\n","author":{"url":"https://github.com/pcalpha","@type":"Person","name":"pcalpha"},"datePublished":"2025-05-23T08:37:16.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/260/java-sdk/issues/260"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:bfe5d3a8-4bbf-6f25-f639-4ecabc75db12 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9A4E:E49D9:F4591A:145C69F:6A605A95 |
| html-safe-nonce | e6b57d38720d2643c6c1aff2aaa40692555bd01e048364e5642736ae122b1bfc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QTRFOkU0OUQ5OkY0NTkxQToxNDVDNjlGOjZBNjA1QTk1IiwidmlzaXRvcl9pZCI6IjY0MDAzNzcwODUzNzU4MzA2NzciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 640268c1e047d1ab9441428dbf6f8220a28f30e937ec4af75e36e13e0b228177 |
| hovercard-subject-tag | issue:3085649648 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/modelcontextprotocol/java-sdk/260/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b232fed74194f777111a1b9cb0ef9811e090be92733eefe7f965383dd910c31b/modelcontextprotocol/java-sdk/issues/260 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b232fed74194f777111a1b9cb0ef9811e090be92733eefe7f965383dd910c31b/modelcontextprotocol/java-sdk/issues/260 |
| og:image:alt | Bug description When I call the tool which name is Chinese, The mcp client will throws Exception below. Exception in thread "main" io.modelcontextprotocol.spec.McpError: Tool not found: 天æ°�é¢�æ�... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | pcalpha |
| hostname | github.com |
| expected-hostname | github.com |
| None | 60da8c2a42fa2bbf5f7567474990ec467836a84444262a58e200fa91b7f3d2d0 |
| turbo-cache-control | no-preview |
| go-import | github.com/modelcontextprotocol/java-sdk git https://github.com/modelcontextprotocol/java-sdk.git |
| octolytics-dimension-user_id | 182288589 |
| octolytics-dimension-user_login | modelcontextprotocol |
| octolytics-dimension-repository_id | 919609219 |
| octolytics-dimension-repository_nwo | modelcontextprotocol/java-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 919609219 |
| octolytics-dimension-repository_network_root_nwo | modelcontextprotocol/java-sdk |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9824515e740d83d5eb82168a089b806ab0fe04a1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width