feat: introduce fastmcp.json configuration system (#1517)

This commit is contained in:
Jeremiah Lowin 2025-08-19 16:06:04 -04:00 committed by GitHub
commit 2d3d5392f1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
40 changed files with 3917 additions and 108 deletions

View file

@ -81,17 +81,22 @@ fastmcp install claude-code server.py --with-requirements requirements.txt
fastmcp install claude-code server.py --with-editable ./my-local-package
```
Alternatively, you can specify dependencies directly in your server code:
Alternatively, you can use a `fastmcp.json` configuration file (recommended):
```python server.py
from fastmcp import FastMCP
mcp = FastMCP(
name="Dice Roller",
dependencies=["pandas", "requests"]
)
```json fastmcp.json
{
"$schema": "https://gofastmcp.com/schemas/fastmcp_config/v1.json",
"entrypoint": {
"file": "server.py",
"object": "mcp"
},
"environment": {
"dependencies": ["pandas", "requests"]
}
}
```
#### Python Version and Project Configuration
Control the Python environment for your server with these options: