Skip to content

Commit 9b7bbd2

Browse files
jlowinzzstoatzz
andauthored
Update static checks (#1448)
Co-authored-by: nate nowack <thrast36@gmail.com>
1 parent dd34846 commit 9b7bbd2

24 files changed

+409
-328
lines changed

.github/workflows/run-static.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,29 @@ jobs:
4242
python-version: "3.12"
4343
- name: Install dependencies
4444
run: uv sync --dev
45+
- name: Install just
46+
uses: extractions/setup-just@v3
47+
- name: Check lockfile is up to date
48+
run: |
49+
if ! uv lock --check; then
50+
echo "❌ Lockfile is out of date!"
51+
echo "To update the lockfile, run 'uv lock'."
52+
exit 1
53+
fi
54+
echo "✅ Lockfile is up to date"
4555
- name: Run pre-commit
4656
uses: pre-commit/action@v3.0.1
4757
env:
4858
SKIP: no-commit-to-branch
59+
- name: Check SDK documentation is up to date
60+
run: |
61+
just api-ref-all > /dev/null 2>&1
62+
if ! git diff --quiet docs/python-sdk/ docs/docs.json; then
63+
echo "❌ SDK documentation is out of date!"
64+
echo "Files that were updated:"
65+
git diff --name-only docs/python-sdk/ docs/docs.json
66+
echo ""
67+
echo "Run 'just api-ref-all' and commit the changes."
68+
exit 1
69+
fi
70+
echo "✅ SDK documentation is up to date"

.github/workflows/run-tests.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ jobs:
4444
python-version: ${{ matrix.python-version }}
4545

4646
- name: Install FastMCP
47-
run: uv sync --locked
47+
# run with frozen to use the current lockfile; static checks will determine if it needs updating
48+
run: uv sync --frozen
4849

4950
- name: Run tests (excluding integration and client_process)
5051
run: uv run pytest tests -m "not integration and not client_process"
@@ -68,7 +69,8 @@ jobs:
6869
python-version: "3.10"
6970

7071
- name: Install FastMCP
71-
run: uv sync --locked
72+
# run with frozen to use the current lockfile; static checks will determine if it needs updating
73+
run: uv sync --frozen
7274

7375
- name: Run integration tests
7476
run: uv run pytest tests -m "integration"

docs/docs.json

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@
6565
{
6666
"group": "Essentials",
6767
"icon": "cube",
68-
"pages": ["servers/server", "deployment/running-server"]
68+
"pages": [
69+
"servers/server",
70+
"deployment/running-server"
71+
]
6972
},
7073
{
7174
"group": "Core Components",
@@ -108,7 +111,10 @@
108111
{
109112
"group": "Essentials",
110113
"icon": "cube",
111-
"pages": ["clients/client", "clients/transports"]
114+
"pages": [
115+
"clients/client",
116+
"clients/transports"
117+
]
112118
},
113119
{
114120
"group": "Core Operations",
@@ -134,7 +140,10 @@
134140
{
135141
"group": "Authentication",
136142
"icon": "user-shield",
137-
"pages": ["clients/auth/oauth", "clients/auth/bearer"]
143+
"pages": [
144+
"clients/auth/oauth",
145+
"clients/auth/bearer"
146+
]
138147
}
139148
]
140149
},
@@ -180,12 +189,17 @@
180189
},
181190
{
182191
"anchor": "What's New",
183-
"pages": ["updates", "changelog"]
192+
"pages": [
193+
"updates",
194+
"changelog"
195+
]
184196
},
185197
{
186198
"anchor": "Community",
187199
"icon": "users",
188-
"pages": ["community/showcase"]
200+
"pages": [
201+
"community/showcase"
202+
]
189203
}
190204
]
191205
},

docs/python-sdk/fastmcp-cli-run.mdx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ FastMCP run command implementation with enhanced type hints.
1010

1111
## Functions
1212

13-
### `is_url` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/run.py#L24" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
13+
### `is_url` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/run.py#L25" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
1414

1515
```python
1616
is_url(path: str) -> bool
@@ -20,7 +20,7 @@ is_url(path: str) -> bool
2020
Check if a string is a URL.
2121

2222

23-
### `parse_file_path` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/run.py#L30" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
23+
### `parse_file_path` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/run.py#L31" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
2424

2525
```python
2626
parse_file_path(server_spec: str) -> tuple[Path, str | None]
@@ -36,24 +36,24 @@ Parse a file path that may include a server object specification.
3636
- Tuple of (file_path, server_object)
3737

3838

39-
### `import_server` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/run.py#L61" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
39+
### `import_server` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/run.py#L62" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
4040

4141
```python
42-
import_server(file: Path, server_object: str | None = None) -> Any
42+
import_server(file: Path, server_or_factory: str | None = None) -> Any
4343
```
4444

4545

4646
Import a MCP server from a file.
4747

4848
**Args:**
4949
- `file`: Path to the file
50-
- `server_object`: Optional object name in format "module\:object" or just "object"
50+
- `server_or_factory`: Optional object name in format "module\:object" or just "object"
5151

5252
**Returns:**
53-
- The server object
53+
- The server object (or result of calling a factory function)
5454

5555

56-
### `run_with_uv` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/run.py#L131" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
56+
### `run_with_uv` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/run.py#L179" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
5757

5858
```python
5959
run_with_uv(server_spec: str, python_version: str | None = None, with_packages: list[str] | None = None, with_requirements: Path | None = None, project: Path | None = None, transport: TransportType | None = None, host: str | None = None, port: int | None = None, path: str | None = None, log_level: LogLevelType | None = None, show_banner: bool = True) -> None
@@ -76,7 +76,7 @@ Run a MCP server using uv run subprocess.
7676
- `show_banner`: Whether to show the server banner
7777

7878

79-
### `create_client_server` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/run.py#L209" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
79+
### `create_client_server` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/run.py#L257" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
8080

8181
```python
8282
create_client_server(url: str) -> Any
@@ -92,7 +92,7 @@ Create a FastMCP server from a client URL.
9292
- A FastMCP server instance
9393

9494

95-
### `create_mcp_config_server` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/run.py#L229" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
95+
### `create_mcp_config_server` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/run.py#L277" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
9696

9797
```python
9898
create_mcp_config_server(mcp_config_path: Path) -> FastMCP[None]
@@ -102,25 +102,25 @@ create_mcp_config_server(mcp_config_path: Path) -> FastMCP[None]
102102
Create a FastMCP server from a MCPConfig.
103103

104104

105-
### `import_server_with_args` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/run.py#L240" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
105+
### `import_server_with_args` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/run.py#L288" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
106106

107107
```python
108-
import_server_with_args(file: Path, server_object: str | None = None, server_args: list[str] | None = None) -> Any
108+
import_server_with_args(file: Path, server_or_factory: str | None = None, server_args: list[str] | None = None) -> Any
109109
```
110110

111111

112112
Import a server with optional command line arguments.
113113

114114
**Args:**
115115
- `file`: Path to the server file
116-
- `server_object`: Optional server object name
116+
- `server_or_factory`: Optional server object or factory function name
117117
- `server_args`: Optional command line arguments to inject
118118

119119
**Returns:**
120120
- The imported server object
121121

122122

123-
### `run_command` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/run.py#L264" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
123+
### `run_command` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/run.py#L314" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
124124

125125
```python
126126
run_command(server_spec: str, transport: TransportType | None = None, host: str | None = None, port: int | None = None, path: str | None = None, log_level: LogLevelType | None = None, server_args: list[str] | None = None, show_banner: bool = True, use_direct_import: bool = False) -> None
@@ -141,7 +141,7 @@ Run a MCP server or connect to a remote one.
141141
- `use_direct_import`: Whether to use direct import instead of subprocess
142142

143143

144-
### `run_v1_server` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/run.py#L329" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
144+
### `run_v1_server` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/run.py#L379" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
145145

146146
```python
147147
run_v1_server(server: FastMCP1x, host: str | None = None, port: int | None = None, transport: TransportType | None = None) -> None

docs/python-sdk/fastmcp-client-logging.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ sidebarTitle: logging
1313
default_log_handler(message: LogMessage) -> None
1414
```
1515

16-
### `create_log_callback` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/client/logging.py#L19" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
16+
17+
Default handler that properly routes server log messages to appropriate log levels.
18+
19+
20+
### `create_log_callback` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/client/logging.py#L43" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
1721

1822
```python
1923
create_log_callback(handler: LogHandler | None = None) -> LoggingFnT

0 commit comments

Comments
 (0)