You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have checked that this question would not be more appropriate as an issue in a specific repository
I have searched existing discussions and documentation for answers
Question Category
Protocol Specification
SDK Usage
Server Implementation
General Implementation
Documentation
Other
Your Question
Hi
I have built an MCP Server with Stdio transport.
I see that clients have length limits on the full tool name as its registered with the client. For example with Claude Desktop the limit is 64 and with cursor limit is 60.
If the full name exceeds 60 then cursor will display an error for that tool.
"Combined server and tool name length(87) excceds 60 characters)"
The problem is that the full tool name is a combination of the Mcp server Name as configured in the mcp.json file + the tool name.
For example
If the configuration of mcp.json is
{
"mcpServers": { "My MCP Server": {
"command": "node",
"args": ["C:\Dev_Env\mcp\main.js"],
"env":{
"LOG_LEVEL" : "debug"
}
}
}
}
and the tool name is getFiles
server.registerTool('getFiles', ...
The full name of the tool as registered with the MCP client will be "My MCP Server: getFiles"
Problem: I want to log an error and throw an exception , when I register all my tools , if one of the tools total length exceeds 60 , HOWEVER
I cant find away to know what the MCP Server Name is in my code. My mcp server config file , is configured by a customer so I dont know what property name customer will give the server in advance.
Question: How can I discover this name in my mcp server code. how can I calculate the total length of the full tool name as registered with the client. I want to notify the user in a log that the total has exceeded and request that they reduce the length of the MCP server name in their config.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Pre-submission Checklist
Question Category
Your Question
Hi
I have built an MCP Server with Stdio transport.
I see that clients have length limits on the full tool name as its registered with the client. For example with Claude Desktop the limit is 64 and with cursor limit is 60.
If the full name exceeds 60 then cursor will display an error for that tool.
"Combined server and tool name length(87) excceds 60 characters)"
The problem is that the full tool name is a combination of the Mcp server Name as configured in the mcp.json file + the tool name.
For example
If the configuration of mcp.json is
{
"mcpServers": {
"My MCP Server": {
"command": "node",
"args": ["C:\Dev_Env\mcp\main.js"],
"env":{
"LOG_LEVEL" : "debug"
}
}
}
}
and the tool name is getFiles
server.registerTool('getFiles', ...
The full name of the tool as registered with the MCP client will be "My MCP Server: getFiles"
Problem: I want to log an error and throw an exception , when I register all my tools , if one of the tools total length exceeds 60 , HOWEVER
I cant find away to know what the MCP Server Name is in my code. My mcp server config file , is configured by a customer so I dont know what property name customer will give the server in advance.
Question: How can I discover this name in my mcp server code. how can I calculate the total length of the full tool name as registered with the client. I want to notify the user in a log that the total has exceeded and request that they reduce the length of the MCP server name in their config.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions