Spaces:
Running
Running
Jeremiah Lowin commited on
Commit ·
9f1bf18
1
Parent(s): 8d034c6
Remove top level env var
Browse files
README.md
CHANGED
|
@@ -51,14 +51,11 @@ That's it! FastMCP handles all the complex protocol details and server managemen
|
|
| 51 |
- [Prompts](#prompts)
|
| 52 |
- [Images](#images)
|
| 53 |
- [Context](#context)
|
| 54 |
-
- [Environment Variables](#environment-variables)
|
| 55 |
-
- [Claude Desktop](#claude-desktop)
|
| 56 |
-
- [Development Mode](#development-mode)
|
| 57 |
- [Deployment](#deployment)
|
| 58 |
- [Development](#development)
|
|
|
|
|
|
|
| 59 |
- [Environment Variables](#environment-variables-1)
|
| 60 |
-
- [Claude Desktop](#claude-desktop-1)
|
| 61 |
-
- [Environment Variables](#environment-variables-2)
|
| 62 |
- [Examples](#examples)
|
| 63 |
- [Echo Server](#echo-server)
|
| 64 |
- [SQLite Explorer](#sqlite-explorer)
|
|
@@ -272,42 +269,6 @@ The Context object provides:
|
|
| 272 |
- Resource access through `read_resource()`
|
| 273 |
- Request metadata via `request_id` and `client_id`
|
| 274 |
|
| 275 |
-
## Environment Variables
|
| 276 |
-
|
| 277 |
-
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:
|
| 278 |
-
|
| 279 |
-
### Claude Desktop
|
| 280 |
-
|
| 281 |
-
When installing a server in Claude Desktop, provide environment variables using the CLI:
|
| 282 |
-
|
| 283 |
-
```bash
|
| 284 |
-
# Single env var
|
| 285 |
-
fastmcp install server.py -e API_KEY=abc123
|
| 286 |
-
|
| 287 |
-
# Multiple env vars
|
| 288 |
-
fastmcp install server.py -e API_KEY=abc123 -e OTHER_VAR=value
|
| 289 |
-
|
| 290 |
-
# Load from .env file
|
| 291 |
-
fastmcp install server.py -f .env
|
| 292 |
-
```
|
| 293 |
-
|
| 294 |
-
Environment variables persist across reinstalls and are only updated when new values are provided:
|
| 295 |
-
|
| 296 |
-
```bash
|
| 297 |
-
# First install
|
| 298 |
-
fastmcp install server.py -e FOO=bar -e BAZ=123
|
| 299 |
-
|
| 300 |
-
# Second install - FOO and BAZ are preserved
|
| 301 |
-
fastmcp install server.py -e NEW=value
|
| 302 |
-
|
| 303 |
-
# Third install - FOO gets new value, others preserved
|
| 304 |
-
fastmcp install server.py -e FOO=newvalue
|
| 305 |
-
```
|
| 306 |
-
|
| 307 |
-
### Development Mode
|
| 308 |
-
|
| 309 |
-
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)).
|
| 310 |
-
|
| 311 |
## Deployment
|
| 312 |
|
| 313 |
The FastMCP CLI helps you develop and deploy MCP servers.
|
|
|
|
| 51 |
- [Prompts](#prompts)
|
| 52 |
- [Images](#images)
|
| 53 |
- [Context](#context)
|
|
|
|
|
|
|
|
|
|
| 54 |
- [Deployment](#deployment)
|
| 55 |
- [Development](#development)
|
| 56 |
+
- [Environment Variables](#environment-variables)
|
| 57 |
+
- [Claude Desktop](#claude-desktop)
|
| 58 |
- [Environment Variables](#environment-variables-1)
|
|
|
|
|
|
|
| 59 |
- [Examples](#examples)
|
| 60 |
- [Echo Server](#echo-server)
|
| 61 |
- [SQLite Explorer](#sqlite-explorer)
|
|
|
|
| 269 |
- Resource access through `read_resource()`
|
| 270 |
- Request metadata via `request_id` and `client_id`
|
| 271 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 272 |
## Deployment
|
| 273 |
|
| 274 |
The FastMCP CLI helps you develop and deploy MCP servers.
|