Skip to content

Avoid storing credentials in mcpproxy.json in plaintext #58

Closed

Description

@technicalpickles

Right now, if you need things like API keys, hostnames, or anything else sensitive, you have to store it in plaintext in the config files. This means you can't easily store mcp_proxy.json in version control.

I'd love to be able to use something like macOS Keychain, 1password, etc. I could imagine having templating in command, env, etc, and expose things that way. I've used keyring-rs bindings for node before. I can't tell if this is golang bindings for it, or just using the same keyring name: https://github.com/zalando/go-keyring

Activity

  1. Dumbris commented on Sep 14, 2025

    @Dumbris
    Member

    Thanks for raising this question - I’ve been thinking about it too.
    The zalando/go-keyring library looks like a good fit for this purpose.

    Rough plan:

    1. Implement support for ${keyring:alias} in the config, using zalando/go-keyring to access OS keychains.
    2. If mcpproxy cannot resolve a reference, display a “Fix secrets” badge in the tray.
    3. Provide users with a way to manage secrets in the keyring. For now, the simplest approach is to add a CLI command:
      mcpproxy secrets add|remove|update

    In the future, I’d like to separate the tray UI app from the core mcpproxy daemon.
    The core could then expose a RESTful API and an embedded Web UI frontend—similar to how Syncthing, Tailscale, or HashiCorp Consul handle it.
    I believe this would create a friendlier user experience.

  2. technicalpickles commented on Sep 22, 2025

    @technicalpickles
    ContributorAuthor

    Another tool in this space I came across is envie https://github.com/ilmari-h/envie

    I don't think it's something that could be used as is, but maybe it's can be taken for inspiration? On one hand, it might be a simpler implementation to handle our own encryption than figuring out cross-platform integration, but on the other hand... it means being on the hook for correctly and securely managing the secrets 😬

  3. changed the title [-]Avoid storing credentials in clear text[/-] [+]Avoid storing credentials in mcpproxy.json in cleartext[/+] on Sep 26, 2025
  4. changed the title [-]Avoid storing credentials in mcpproxy.json in cleartext[/-] [+]Avoid storing credentials in mcpproxy.json in unencrypted[/+] on Sep 26, 2025
  5. changed the title [-]Avoid storing credentials in mcpproxy.json in unencrypted[/-] [+]Avoid storing credentials in mcpproxy.json in plaintext[/+] on Sep 26, 2025
  6. technicalpickles commented on Sep 26, 2025

    @technicalpickles
    ContributorAuthor

    Another pattern I've seen is using docker run --envfile path/to/env.

    This doesn't solve the not storing in clear text, but it would allow keeping mcpproxy.json in version control without credentials in them. I've updated the title/body to reflect that.

  7. algis-dumbris commented on Sep 26, 2025

    @algis-dumbris
    Contributor

    @technicalpickles I have finished refactoring and working on new version with secrets support, based on zalando/go-keyring lib. An environment variable resolver has also been added.

    -> prerelease binaries here

    Example of config

    {
        "name": "everything",
        "protocol": "stdio",
        "command": "npx",
        "args": [
          "@modelcontextprotocol/server-everything"
        ],
        "env": {
          "API_KEY": "${keyring:servers_0_env_everything_api_key}",
          "NODE_ENV": "${env:NODE_ENV}",
          "DEBUG_MODE": "${env:DEBUG_MODE}",
          "TEST_VAR": "${keyring:very-test-var}"
        },
        "enabled": true,
        "quarantined": false,
        "created": "2025-09-20T00:00:00Z",
        "updated": "2025-09-20T00:00:00Z"
      }
    

    Secrets can be added using CLI:

    ~/Library/Application\ Support/mcpproxy/bin/mcpproxy secrets --help
    Store, retrieve, and manage secrets using the operating system's secure keyring (Keychain on macOS, Secret Service on Linux, WinCred on Windows)
    
    Usage:
      mcpproxy secrets [command]
    
    Available Commands:
      del         Delete a secret from the keyring
      get         Retrieve a secret from the keyring
      list        List all stored secrets
      migrate     Migrate plaintext secrets to secure storage
      set         Store a secret in the keyring
    
    Flags:
      -h, --help   help for secrets
    
    Global Flags:
      -c, --config string      Configuration file path
      -d, --data-dir string    Data directory path (default: ~/.mcpproxy)
          --log-dir string     Custom log directory path (overrides standard OS location)
          --log-level string   Log level (trace, debug, info, warn, error) - defaults: server=info, other commands=warn
          --log-to-file        Enable logging to file in standard OS location (default: console only)
    
    Use "mcpproxy secrets [command] --help" for more information about a command.
    

    Or Web UI

    Image Image

    After installing and launching, click "Open Web Control Panel" in tray menu to open Web UI
    This is an early version, so some minor features broken now, and Web UI will be changed

  8. technicalpickles commented on Sep 26, 2025

    @technicalpickles
    ContributorAuthor

    Exciting! That's on the next branch right?

  9. chaleic commented on Nov 9, 2025

    @chaleic

    @algis-dumbris So can you just use env variables with this version? I don't necessarily want to use keychain. I am super excited to try this out. When is this slated to make it into a main release ?

  10. Dumbris commented on Nov 9, 2025

    @Dumbris
    Member

    @chaleic This already works in the current release.

    1. Start the proxy with an env var:

    ENV_TEST_VAR="env var test" mcpproxy serve

    1. Reference that env var in your upstream MCP server config:
    {
      "name": "everything-server",
      "protocol": "stdio",
      "command": "npx",
      "args": [
        "@modelcontextprotocol/server-everything"
      ],
      "env": {
        "VAR": "${env:ENV_TEST_VAR}"
      },
      "enabled": true,
      "quarantined": false
    }
    

    You can use the ${env:…} resolver in both the args and env sections of the config, so you don’t have to store the raw value in the file itself.
    Since you add it to the config, it will also appear in the Web UI on the Secrets page - making it easy to view

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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