# Secure secret handing for MCPs

**URL:** <https://forum.cursor.com/t/secure-secret-handing-for-mcps/155638>\
**Category:** Help\
**Tags:** mcp, security\
**Created:** [March 23, 2026, 1:58pm UTC](https://forum.cursor.com/t/secure-secret-handing-for-mcps/155638 "2026-03-23T13:58:09Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![mohitjain](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/mohitjain/32/100229_2.png) [@mohitjain](https://forum.cursor.com/u/mohitjain)\
**Post date:** [March 24, 2026, 8:04am UTC](https://forum.cursor.com/t/secure-secret-handing-for-mcps/155638/4 "2026-03-24T08:04:27Z")

</div>

Hi @Piotr_Olchawa,

The `inputs` feature from VS Code’s `launch.json`/`tasks.json` isn’t supported in Cursor’s `mcp.json` format. Specifically, if you add an `inputs` array to `mcp.json`, it won’t cause an error, but it will be silently ignored – the parser only reads `mcpServers` and discards everything else. Similarly, `${input:...}` variable references in your server config values won’t be resolved.

For your use case (keeping a GitHub PAT out of plaintext config), here are two approaches that work today:

Option 1: Environment variable interpolation (recommended)

Store your token in an environment variable and reference it in your config:

```auto
{
"mcpServers": {
"github": {

"url": "https://api.githubcopilot.com/mcp/",

"headers": {
"Authorization": "Bearer ${env:GITHUB_TOKEN}"
}
}
}
}

```

Then set `GITHUB_TOKEN` in your shell profile (`.zshrc`, `.bashrc`, etc.) or use a secrets manager to inject it into your environment. This keeps the token out of version-controlled files. Cursor resolves `${env:...}` variables at startup.

More details: [Config Interpolation](https://cursor.com/docs/mcp#config-interpolation)

Option 2: OAuth authentication

If you’d prefer not to manage a PAT at all, Cursor supports OAuth for remote MCP servers. If the GitHub MCP remote server supports the MCP OAuth flow, you can configure it with just the URL and let Cursor handle the authentication interactively. You may need to register a GitHub OAuth App and provide the `CLIENT_ID` (which is public, not a secret) in the config:

```auto
{
"mcpServers": {
"github": {
"url": "https://api.githubcopilot.com/mcp/", 
"auth": {
"CLIENT_ID": "your_github_oauth_app_client_id"
}
}
}
}

```

For STDIO-based servers, there’s also the `envFile` option, which loads environment variables from a `.env` file:

```auto
{
"mcpServers": {
"my-server": {
"command": "my-mcp-server",
"envFile": "${workspaceFolder}/.env"
}
}
}

```

Just make sure to add `.env` to your `.gitignore`.

---

_[View the full topic](https://forum.cursor.com/t/secure-secret-handing-for-mcps/155638)._
