Skip to content

Issue #11 - [BUG] Environment variable values containing '=' are truncated when configuring local MCPs #22

@rogelio-cmj

Description

@rogelio-cmj

Motivation

When configuring local Model Context Protocol (MCP) servers, users need to provide environment variables that may contain sensitive credentials like API keys. Some services, particularly Atlassian, generate API keys that include the '=' character as part of the key value. Currently, the environment variable parser incorrectly handles these cases, truncating the value at the first '=' character after the initial key-value separator. This prevents users from successfully authenticating with services that use '=' in their credentials, making certain MCP integrations completely unusable.

Current Behavior

The environment variable parser uses split('=') to separate keys from values, which splits on every occurrence of the '=' character in the line. When an environment variable value contains '=' (such as API_KEY=abc123=def456), the parser only captures the portion before the second '=' character, effectively truncating the value.

Reproduction Steps:

  1. Navigate to the MCP settings configuration in the application
  2. Add a local MCP server configuration
  3. In the environment variables section, enter a variable with '=' in its value, for example: ATLASSIAN_API_KEY=dGVzdDEyMzQ1Njc4OTA=
  4. Save the configuration
  5. Observe: The stored value is truncated to dGVzdDEyMzQ1Njc4OTA (the part after the second '=' is removed)

Expected Behavior

The environment variable parser should correctly handle '=' characters within values, treating only the first '=' as the delimiter between key and value. All subsequent '=' characters should be preserved as part of the value.

Acceptance Criteria:

  • Environment variables with '=' in their values are parsed correctly, preserving the entire value after the first '='

Steps To Test

  1. Open the MCP settings configuration
  2. Add the following environment variable
    • API_KEY=abc123=def456=ghi789
  3. Save and verify value is stored correctly

Submission

Download https://cap.so/ to record your screen (use Studio mode). Export as an mp4, and drag and drop into an issue comment below.

Guide to submitting pull requests: https://hackmd.io/@timothy1ee/Hky8kV3hlx

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