[BUG] SDK doesn't read project level MCPs or Slash Commands for new queries
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?
I have project level MCPs defined in my .mcp.json file and a few slash commands added under my projects .claude/commands directory. Upon launching the Claude Agent SDK from that directory, Claude doesn't seem to have access to either the MCP servers or slash commands defined in these project-level files.
This can be verified by calling the supportedCommands() and mcpServerStatus() callbacks after launching the SDK. They don't return project-level MCPs/commands.
Note: These methods DO however return user-level MCPs and Slash Commands under the same situation.
What Should Happen?
The Claude Agent SDK (just as the CLI) should read from the .mcp.json file and .claude/commands directory in my current working directory upon startup.
Error Messages/Logs
Steps to Reproduce
- Create a .mcp.json file in your current working directory.
- Create a command under
.claude/commandsin your current working directory. - Run the query() function with an AsyncIterable prompt in the Claude Agent SDK.
- Call the
mcpServerStatus()andsupportedCommandscallbacks - Verify that the results do not contain project level MCPs and slash commands
Claude Model
None
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.0.76
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Non-interactive/CI environment
Additional Information
A similar issue was opened earlier this month but the issue does not seem to have been resolved.
Previous Issue: https://github.com/anthropics/claude-code/issues/13107
This issue has 10 comments on GitHub. Read the full discussion on GitHub ↗