[BUG] MCP prompt not working with title
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When using a MCP with prompts, I can see the list of prompts when I type / .
The MCP prompt also has a title and Claude code show it correctly. However, when I select the prompt (which has a blank space on it), then Claude code returns the error "unknown slash command". The title should be used to display only, but it seems that Claude code is sending the title rather than the name. Not sure if the issue is due to a blank space in the title or Claude code sending the title rather than the name.
What Should Happen?
Claude should be able to invoke the slash command when titles are specified in prompts
Error Messages/Logs
Unknown slash command: spec-workflow:Create
Steps to Reproduce
Add this MCP server : https://github.com/Pimzino/spec-workflow-mcp
Try to use any of the prompts this MCP server provide
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
1.0.96
Platform
AWS Bedrock
Operating System
Other Linux
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
9 Comments
I have the same problem. I created an mcp server and added the same mcp server in VSCode in Copilot and it works fine. Claude Code lists the slash commands from the mcp server prompts, but when I try to run them, I get “Unknown slash command”.
All of my commands had mandatory and optional arguments based on the TypeScript mcp SDK docs
The same happens for me. I found out that the title is not allowed to contain white spaces:
I'm using @modelcontextprotocol/sdk@1.18.0
Example code:
https://github.com/vpursuit/swipl-mcp-server/blob/40f1a152e05d279c56bf8975a2ccee14c3430777/src/prompts.ts#L127
This _fails_:
This _works_:
The working slash command is:
/swipl-mcp-server:prolog_quick_reference
I guess claude shall not use property 'title', but 'name' to create the slash-command.
will try it later today. Thanks!
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
Additional reproduction case
I'm experiencing the same issue with MCP prompts. When typing a slash command like
/airis:agent, the autocomplete shows:Problem: Pressing Enter does nothing. The command cannot be selected.
Workaround: Pressing Backspace to remove the trailing space, then Enter works.
Root cause analysis
Looking at the minified
cli.js, I found the issue:The
(MCP)suffix contains a space, which breaks command parsing when the user selects from autocomplete.Suggested fix
When matching/executing the slash command, use the
namefield directly instead ofuserFacingName(). TheuserFacingName()should only be used for display purposes.Something like:
This would also fix Issue #5597 (MCP prompts with optional arguments require input to invoke).
Simpler fix option: Remove the space before
(MCP)or change the separator:The space before
(MCP)is what breaks command parsing during autocomplete selection.This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.