Skip to content

Commit 9c5c4f5

Browse files
authored
Consolidate server loading logic into FileSystemSource (#1614)
1 parent 85cc51f commit 9c5c4f5

File tree

20 files changed

+1117
-520
lines changed

20 files changed

+1117
-520
lines changed

docs/deployment/server-configuration.mdx

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -304,23 +304,48 @@ fastmcp run prod.fastmcp.json
304304

305305
# Skip environment setup when already in a uv environment
306306
fastmcp run fastmcp.json --skip-env
307+
308+
# Skip source preparation when source is already prepared
309+
fastmcp run fastmcp.json --skip-source
310+
311+
# Skip both environment and source preparation
312+
fastmcp run fastmcp.json --skip-env --skip-source
307313
```
308314

309-
### Environment Setup Control
315+
### Using an Existing Environment
310316

311-
By default, FastMCP uses `uv` to create an isolated environment based on your configuration. The `--skip-env` flag allows you to skip this automatic environment setup:
317+
By default, FastMCP creates an isolated environment with `uv` based on your configuration. When you already have a suitable Python environment, use the `--skip-env` flag to skip environment creation:
312318

313319
```bash
314320
fastmcp run fastmcp.json --skip-env
315321
```
316322

317-
**When to use `--skip-env`:**
318-
- You're already in an activated virtual environment with all dependencies installed
319-
- You're inside a Docker container with pre-installed dependencies
320-
- You're in a uv-managed environment and want to prevent infinite recursion
321-
- You want to test the server without environment setup for debugging purposes
323+
**When you already have an environment:**
324+
- You're in an activated virtual environment with all dependencies installed
325+
- You're inside a Docker container with pre-installed dependencies
326+
- You're in a CI/CD pipeline that pre-builds the environment
327+
- You're using a system-wide installation with all required packages
328+
- You're in a uv-managed environment (prevents infinite recursion)
329+
330+
This flag tells FastMCP: "I already have everything installed, just run the server."
331+
332+
### Using an Existing Source
333+
334+
When working with source types that require preparation (future support for git repositories or cloud sources), use the `--skip-source` flag when you already have the source code available:
335+
336+
```bash
337+
fastmcp run fastmcp.json --skip-source
338+
```
339+
340+
**When you already have the source:**
341+
- You've previously cloned a git repository and don't need to re-fetch
342+
- You have a cached copy of a cloud-hosted server
343+
- You're in a CI/CD pipeline where source checkout is a separate step
344+
- You're iterating locally on already-downloaded code
345+
346+
This flag tells FastMCP: "I already have the source code, skip any download/clone steps."
322347

323-
This flag is particularly useful in CI/CD pipelines, Docker containers, or when you're managing the Python environment yourself.
348+
Note: For filesystem sources (local Python files), this flag has no effect since they don't require preparation.
324349

325350
The configuration file works with all FastMCP commands:
326351
- **`run`** - Start the server in production mode

0 commit comments

Comments
 (0)