Skip to content

Fix KeyError: 'command' in MCP client by supporting nested config structure #172

@belltagy

Description

@belltagy

Description:
Bug Report
Environment:
OS: Windows 10
Python: 3.10
Package: huggingface_hub (MCP implementation)
Issue:
The MCP client fails to connect to stdio servers when the configuration uses a nested config structure in agent.json.
Current (broken) configuration structure:

{
    "servers": [
        {
            "type": "stdio",
            "config": {
                "command": "npx",
                "args": ["@playwright/mcp@latest"]
            }
        }
    ]
}

Workaround:
Flatten the configuration structure:

{
    "servers": [
        {
            "type": "stdio",
            "command": "npx",
            "args": ["@playwright/mcp@latest"]
        }
    ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions