@@ -155,29 +155,60 @@ Packages can declare `user_config` in their manifest for values like API keys:
155155
156156When ` mpak run ` executes, it substitutes ` ${user_config.*} ` placeholders with actual values.
157157
158- ### Value Resolution Priority
158+ ### Two Ways to Provide Config
159159
160- 1 . ** Stored config** : ` ~/.mpak/config.json ` (set via ` mpak config set ` )
161- 2 . ** Environment variable** : ` MPAK_CONFIG_<KEY> ` (e.g., ` MPAK_CONFIG_API_KEY ` )
162- 3 . ** Default value** : From manifest's ` user_config.*.default `
163- 4 . ** Interactive prompt** : If terminal is interactive and value is required
160+ #### Option 1: mpak config (recommended for CLI use)
164161
165- ### Examples
162+ Use ` mpak config set ` with keys matching the manifest's ` user_config ` field names (not the env var names):
166163
167164``` bash
168- # Pre-configure a package
165+ # Key is "api_key" (from manifest.user_config.api_key), NOT "IPINFO_API_TOKEN"
169166mpak config set @nimblebraininc/ipinfo api_key=your_token
170167
171168# Run uses stored config automatically
172169mpak run @nimblebraininc/ipinfo
173170
174- # Or use environment variable
175- MPAK_CONFIG_API_KEY=your_token mpak run @nimblebraininc/ipinfo
176-
177171# View stored config (values masked)
178172mpak config get @nimblebraininc/ipinfo
179173```
180174
175+ #### Option 2: Claude Desktop config (recommended for Claude Desktop)
176+
177+ Set the actual environment variable directly in your Claude Desktop config:
178+
179+ ``` json
180+ {
181+ "mcpServers" : {
182+ "ipinfo" : {
183+ "command" : " mpak" ,
184+ "args" : [" run" , " @nimblebraininc/ipinfo" ],
185+ "env" : {
186+ "IPINFO_API_TOKEN" : " your_token"
187+ }
188+ }
189+ }
190+ }
191+ ```
192+
193+ This bypasses user_config substitution entirely since the env var is already set.
194+
195+ ### Value Resolution Priority
196+
197+ 1 . ** Process environment** : Env vars set by parent (e.g., Claude Desktop config)
198+ 2 . ** Stored config** : ` ~/.mpak/config.json ` (set via ` mpak config set ` )
199+ 3 . ** Default value** : From manifest's ` user_config.*.default `
200+ 4 . ** Interactive prompt** : If terminal is interactive and value is required
201+
202+ ### Important: Config Key Names
203+
204+ The ` mpak config set ` key must match the ` user_config ` field name in the manifest:
205+
206+ ```
207+ manifest.user_config.api_key → mpak config set ... api_key=xxx → env IPINFO_API_TOKEN
208+ ^^^^^^^ ^^^^^^^
209+ Field name = config key (NOT the env var name)
210+ ```
211+
181212## Design Decisions
182213
1832141 . ** Standalone** : No shared dependencies with server/client. Types generated from OpenAPI.
0 commit comments