Skip to content

Commit 3b623d0

Browse files
authored
Adding installation instructions for env var usage (#30)
1 parent b2fe478 commit 3b623d0

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,29 @@ Then, configure your server definition to reference your local clone. For exampl
122122
}
123123
```
124124

125+
### Installation steps using environment variables
126+
127+
Some AI clients allow for accessing environment variables within MCP configurations. In AI clients where this is supported, you can configure your MCP server to read from an environment variable like `MCP_LD_TOKEN` as follows:
128+
129+
```json
130+
{
131+
"mcpServers": {
132+
"launchdarkly": {
133+
"command": "npx",
134+
"args": [
135+
"-y", "--package", "@launchdarkly/mcp-server", "--", "mcp", "start",
136+
"--api-key", "$LD_ACCESS_TOKEN"
137+
],
138+
"env": {
139+
"LD_ACCESS_TOKEN": "MCP_LD_TOKEN"
140+
}
141+
}
142+
}
143+
}
144+
```
145+
146+
This won't work in AI clients (such as Cursor) which don't support accessing environment variables directly within MCP configurations. As a workaround, you can invoke a local script from your MCP configuration. See [here](https://github.com/launchdarkly/mcp-server/issues/26#issuecomment-3064419507) for an example.
147+
125148
<!-- Start Requirements [requirements] -->
126149
## Requirements
127150

0 commit comments

Comments
 (0)