mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-20 04:24:17 +02:00
Remove top level env var
This commit is contained in:
parent
81d5211188
commit
abbbd53539
1 changed files with 2 additions and 41 deletions
43
README.md
43
README.md
|
|
@ -51,14 +51,11 @@ That's it! FastMCP handles all the complex protocol details and server managemen
|
|||
- [Prompts](#prompts)
|
||||
- [Images](#images)
|
||||
- [Context](#context)
|
||||
- [Environment Variables](#environment-variables)
|
||||
- [Claude Desktop](#claude-desktop)
|
||||
- [Development Mode](#development-mode)
|
||||
- [Deployment](#deployment)
|
||||
- [Development](#development)
|
||||
- [Environment Variables](#environment-variables)
|
||||
- [Claude Desktop](#claude-desktop)
|
||||
- [Environment Variables](#environment-variables-1)
|
||||
- [Claude Desktop](#claude-desktop-1)
|
||||
- [Environment Variables](#environment-variables-2)
|
||||
- [Examples](#examples)
|
||||
- [Echo Server](#echo-server)
|
||||
- [SQLite Explorer](#sqlite-explorer)
|
||||
|
|
@ -272,42 +269,6 @@ The Context object provides:
|
|||
- Resource access through `read_resource()`
|
||||
- Request metadata via `request_id` and `client_id`
|
||||
|
||||
## Environment Variables
|
||||
|
||||
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:
|
||||
|
||||
### Claude Desktop
|
||||
|
||||
When installing a server in Claude Desktop, provide environment variables using the CLI:
|
||||
|
||||
```bash
|
||||
# Single env var
|
||||
fastmcp install server.py -e API_KEY=abc123
|
||||
|
||||
# Multiple env vars
|
||||
fastmcp install server.py -e API_KEY=abc123 -e OTHER_VAR=value
|
||||
|
||||
# Load from .env file
|
||||
fastmcp install server.py -f .env
|
||||
```
|
||||
|
||||
Environment variables persist across reinstalls and are only updated when new values are provided:
|
||||
|
||||
```bash
|
||||
# First install
|
||||
fastmcp install server.py -e FOO=bar -e BAZ=123
|
||||
|
||||
# Second install - FOO and BAZ are preserved
|
||||
fastmcp install server.py -e NEW=value
|
||||
|
||||
# Third install - FOO gets new value, others preserved
|
||||
fastmcp install server.py -e FOO=newvalue
|
||||
```
|
||||
|
||||
### Development Mode
|
||||
|
||||
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)).
|
||||
|
||||
## Deployment
|
||||
|
||||
The FastMCP CLI helps you develop and deploy MCP servers.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue