Jeremiah Lowin commited on
Commit
68ec057
·
unverified ·
2 Parent(s): ee8fcb59f1bf18

Merge pull request #28 from jlowin/env

Browse files
Files changed (1) hide show
  1. README.md +2 -41
README.md CHANGED
@@ -61,14 +61,11 @@ FastMCP handles all the complex protocol details and server management, so you c
61
  - [Prompts](#prompts)
62
  - [Images](#images)
63
  - [Context](#context)
64
- - [Environment Variables](#environment-variables)
65
- - [Claude Desktop](#claude-desktop)
66
- - [Development Mode](#development-mode)
67
  - [Deployment](#deployment)
68
  - [Development](#development)
 
 
69
  - [Environment Variables](#environment-variables-1)
70
- - [Claude Desktop](#claude-desktop-1)
71
- - [Environment Variables](#environment-variables-2)
72
  - [Examples](#examples)
73
  - [Echo Server](#echo-server)
74
  - [SQLite Explorer](#sqlite-explorer)
@@ -282,42 +279,6 @@ The Context object provides:
282
  - Resource access through `read_resource()`
283
  - Request metadata via `request_id` and `client_id`
284
 
285
- ## Environment Variables
286
-
287
- MCP servers run in isolated environments and do not inherit environment variables from your system. Here's how to handle environment variables in different contexts:
288
-
289
- ### Claude Desktop
290
-
291
- When installing a server in Claude Desktop, provide environment variables using the CLI:
292
-
293
- ```bash
294
- # Single env var
295
- fastmcp install server.py -e API_KEY=abc123
296
-
297
- # Multiple env vars
298
- fastmcp install server.py -e API_KEY=abc123 -e OTHER_VAR=value
299
-
300
- # Load from .env file
301
- fastmcp install server.py -f .env
302
- ```
303
-
304
- Environment variables persist across reinstalls and are only updated when new values are provided:
305
-
306
- ```bash
307
- # First install
308
- fastmcp install server.py -e FOO=bar -e BAZ=123
309
-
310
- # Second install - FOO and BAZ are preserved
311
- fastmcp install server.py -e NEW=value
312
-
313
- # Third install - FOO gets new value, others preserved
314
- fastmcp install server.py -e FOO=newvalue
315
- ```
316
-
317
- ### Development Mode
318
-
319
- The MCP Inspector also runs servers in an isolated environment. Environment variables must be set through the Inspector UI and are not inherited from your system. The Inspector does not currently support setting environment variables via command line (see [Issue #94](https://github.com/modelcontextprotocol/inspector/issues/94)).
320
-
321
  ## Deployment
322
 
323
  The FastMCP CLI helps you develop and deploy MCP servers.
 
61
  - [Prompts](#prompts)
62
  - [Images](#images)
63
  - [Context](#context)
 
 
 
64
  - [Deployment](#deployment)
65
  - [Development](#development)
66
+ - [Environment Variables](#environment-variables)
67
+ - [Claude Desktop](#claude-desktop)
68
  - [Environment Variables](#environment-variables-1)
 
 
69
  - [Examples](#examples)
70
  - [Echo Server](#echo-server)
71
  - [SQLite Explorer](#sqlite-explorer)
 
279
  - Resource access through `read_resource()`
280
  - Request metadata via `request_id` and `client_id`
281
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
282
  ## Deployment
283
 
284
  The FastMCP CLI helps you develop and deploy MCP servers.