# Use environment variables in remote MCP server config

**URL:** <https://forum.cursor.com/t/use-environment-variables-in-remote-mcp-server-config/128956>\
**Category:** Help\
**Created:** [August 12, 2025, 11:22pm UTC](https://forum.cursor.com/t/use-environment-variables-in-remote-mcp-server-config/128956 "2025-08-12T23:22:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![al2co33](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@al2co33](https://forum.cursor.com/u/al2co33)\
**Post date:** [August 12, 2025, 11:22pm UTC](https://forum.cursor.com/t/use-environment-variables-in-remote-mcp-server-config/128956/1 "2025-08-12T23:22:02Z")

</div>

For example, Github config requires a personal token:

```auto
{
  "mcpServers": {
    "github": {
      "url": "https://api.githubcopilot.com/mcp/",
      "headers": {
        "Authorization": "Bearer YOUR_GITHUB_PAT"
      }
    }
  }
}

```

How to pass it as an env var? Previously I can wrap it in a script and export the env var manually, but with this new config, this approach doesn’t work anymore.

---

<div class="post-metadata">

**Author:** ![al2co33](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@al2co33](https://forum.cursor.com/u/al2co33)\
**Post date:** [August 15, 2025, 7:43pm UTC](https://forum.cursor.com/t/use-environment-variables-in-remote-mcp-server-config/128956/2 "2025-08-15T19:43:28Z")

</div>

Does anyone have some ideas on this?
