Skip to content

Claude Desktop: substitute user_config options with no value #250

@pl4nty

Description

@pl4nty

Describe the bug
In Claude Desktop, user_config options are only substituted if they have a value (user-provided or via default). If a value isn't provided, the raw string is passed to the server, potentially causing parser errors.

To Reproduce
Steps to reproduce the behavior:

  1. Create a manifest with user_config, like
{
  "server": {
    "mcp_config": {
      ...
      "env": {
        "AZURE_TENANT_ID": "${user_config.azure_tenant_id}",
      }
    }
  },
  "user_config": {
    "azure_tenant_id": {
      "type": "string",
      "title": "Entra Tenant ID",
      "description": "Entra tenant ID. Use this to authenticate against a specific tenant. Example: 00000000-0000-0000-0000-000000000000"
    }
  }
}
  1. Start the server without filling azure_tenant_id
  2. Observe the server crash, when it attempts to parse the string ${user_config.azure_tenant_id} as a guid

Expected behavior
The server starts with AZURE_TENANT_ID="" or (ideally) no AZURE_TENANT_ID at all.

Additional context
Came up in microsoft/mcp#2618 and microsoft/fabric-rti-mcp#172. Workaround is setting "default": ""

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions