Skip to content

Add --headerFile option for loading headers from a file #80

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rkophs
Copy link

@rkophs rkophs commented May 15, 2025

Motivation

The addition of a file-based approach for header configuration addresses several important needs:

  1. Configuration Management: Easier maintain and update headers in a standalone file rather than having them embedded in MCP configuration settings in tools like Cursor or Claude.

  2. Security Improvements: No longer need to store sensitive authorization tokens directly in MCP configuration settings, which are often stored in easily accessible JSON files.

  3. Process Privacy: Sensitive headers loaded from files don't appear in process listings (ps) or other process information files, preventing accidental exposure of sensitive credentials that might occur when headers are passed as command-line arguments or environment variables.

Changes

  • Add support for reading a set of headers from a file via --headerFile option.

Example header files:

# Headers for MCP Remote
Authorization:Bearer my-token
X-Custom-Header:custom-value

X-Another-Custom-Header:another-custom-value

Copy link

pkg-pr-new bot commented May 16, 2025

Open in StackBlitz

npx https://pkg.pr.new/mcp-remote@80

commit: 8d17ebc

@geelen
Copy link
Owner

geelen commented May 16, 2025

Great idea! Would be a better workaround for that long-standing Cursor bug too.

Kinda feel like the format of the header file should be something standard, like a .env style. Unless this kind of file (:-delimited, # for comments) is actually some format I'm not familiar with? If so, make a reference in the Readme to what kind of file it is, and ideally bring in a library from NPM to parse it.

Wdyt?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants