Skip to content

Please allow passing a json file for the mcp-config like the standard command #95

@gerrywastaken

Description

@gerrywastaken

The CLI tool allows you to provide a JSON file supplying the config within the command
https://docs.anthropic.com/en/docs/claude-code/sdk#mcp-configuration

claude -p 'yo' --mcp-config mcp-servers.json

However, this SDK builds and supplies the entire mcp config via the command line directly, including any auth keys that need to be there:

claude -p 'yo' --mcp-config '{"mcpServers": {"github": {"command": "npx", "args": ["-y", "@modelcontextprotocol/server-github"], "env": {"GITHUB_TOKEN": "Your super secret token"}}}}'

I know you are currently not including the generated command in the debug output, but I think you should as it greatly helps with understanding errors. But having mcp-config json in the command makes this not possible without exposing tokens.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions