Skip to content

Commit 79351ed

Browse files
chore: Update SDK documentation (#1767)
Co-authored-by: marvin-context-protocol[bot] <225465937+marvin-context-protocol[bot]@users.noreply.github.com>
1 parent 54b7a3b commit 79351ed

18 files changed

+213
-184
lines changed

docs/docs.json

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
"default": "system",
55
"strict": false
66
},
7-
"interaction": {
8-
"drilldown": false
9-
},
107
"background": {
118
"color": {
129
"dark": "#222831",
@@ -39,6 +36,9 @@
3936
"measurementId": "G-64R5W1TJXG"
4037
}
4138
},
39+
"interaction": {
40+
"drilldown": false
41+
},
4242
"logo": {
4343
"dark": "/assets/brand/logo-wordmark-dark.svg",
4444
"light": "/assets/brand/logo-wordmark.svg"
@@ -118,7 +118,10 @@
118118
{
119119
"group": "Essentials",
120120
"icon": "cube",
121-
"pages": ["clients/client", "clients/transports"]
121+
"pages": [
122+
"clients/client",
123+
"clients/transports"
124+
]
122125
},
123126
{
124127
"group": "Core Operations",
@@ -144,7 +147,10 @@
144147
{
145148
"group": "Authentication",
146149
"icon": "user-shield",
147-
"pages": ["clients/auth/oauth", "clients/auth/bearer"]
150+
"pages": [
151+
"clients/auth/oauth",
152+
"clients/auth/bearer"
153+
]
148154
}
149155
]
150156
},
@@ -222,7 +228,10 @@
222228
"tab": "Documentation"
223229
},
224230
{
225-
"pages": ["updates", "changelog"],
231+
"pages": [
232+
"updates",
233+
"changelog"
234+
],
226235
"tab": "What's New"
227236
},
228237
{
@@ -247,6 +256,7 @@
247256
"python-sdk/fastmcp-cli-install-claude_code",
248257
"python-sdk/fastmcp-cli-install-claude_desktop",
249258
"python-sdk/fastmcp-cli-install-cursor",
259+
"python-sdk/fastmcp-cli-install-gemini_cli",
250260
"python-sdk/fastmcp-cli-install-mcp_json",
251261
"python-sdk/fastmcp-cli-install-shared"
252262
]

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ FastMCP CLI tools using Cyclopts.
1010

1111
## Functions
1212

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

1515
```python
1616
with_argv(args: list[str] | None)
@@ -27,7 +27,7 @@ Args are provided without the script name, so we preserve sys.argv[0]
2727
and replace the rest.
2828

2929

30-
### `version` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/cli.py#L91" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
30+
### `version` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/cli.py#L92" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
3131

3232
```python
3333
version()
@@ -37,7 +37,7 @@ version()
3737
Display version information and platform details.
3838

3939

40-
### `dev` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/cli.py#L129" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
40+
### `dev` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/cli.py#L130" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
4141

4242
```python
4343
dev(server_spec: str | None = None) -> None
@@ -74,7 +74,7 @@ fastmcp run server.py -- --config config.json --debug
7474
- `server_spec`: Python file, object specification (file\:obj), config file, URL, or None to auto-detect
7575

7676

77-
### `inspect` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/cli.py#L524" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
77+
### `inspect` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/cli.py#L541" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
7878

7979
```python
8080
inspect(server_spec: str | None = None) -> None
@@ -105,7 +105,7 @@ fastmcp inspect # auto-detect fastmcp.json
105105
- `server_spec`: Python file to inspect, optionally with \:object suffix, or fastmcp.json
106106

107107

108-
### `prepare` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/cli.py#L765" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
108+
### `prepare` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/cli.py#L782" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
109109

110110
```python
111111
prepare(config_path: Annotated[str | None, cyclopts.Parameter(help='Path to fastmcp.json configuration file')] = None, output_dir: Annotated[str | None, cyclopts.Parameter(help='Directory to create the persistent environment in')] = None, skip_source: Annotated[bool, cyclopts.Parameter(help='Skip source preparation (e.g., git clone)')] = False) -> None

docs/python-sdk/fastmcp-cli-install-claude_code.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Install FastMCP server in Claude Code.
5757
- True if installation was successful, False otherwise
5858

5959

60-
### `claude_code_command` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/install/claude_code.py#L162" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
60+
### `claude_code_command` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/install/claude_code.py#L153" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
6161

6262
```python
6363
claude_code_command(server_spec: str) -> None

docs/python-sdk/fastmcp-cli-install-claude_desktop.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Install FastMCP server in Claude Desktop.
4444
- True if installation was successful, False otherwise
4545

4646

47-
### `claude_desktop_command` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/install/claude_desktop.py#L133" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
47+
### `claude_desktop_command` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/install/claude_desktop.py#L125" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
4848

4949
```python
5050
claude_desktop_command(server_spec: str) -> None

docs/python-sdk/fastmcp-cli-install-cursor.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Install FastMCP server to workspace-specific Cursor configuration.
6868
- True if installation was successful, False otherwise
6969

7070

71-
### `install_cursor` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/install/cursor.py#L157" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
71+
### `install_cursor` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/install/cursor.py#L149" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
7272

7373
```python
7474
install_cursor(file: Path, server_object: str | None, name: str) -> bool
@@ -93,7 +93,7 @@ Install FastMCP server in Cursor.
9393
- True if installation was successful, False otherwise
9494

9595

96-
### `cursor_command` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/install/cursor.py#L250" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
96+
### `cursor_command` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/install/cursor.py#L234" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
9797

9898
```python
9999
cursor_command(server_spec: str) -> None
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
title: gemini_cli
3+
sidebarTitle: gemini_cli
4+
---
5+
6+
# `fastmcp.cli.install.gemini_cli`
7+
8+
9+
Gemini CLI integration for FastMCP install using Cyclopts.
10+
11+
## Functions
12+
13+
### `find_gemini_command` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/install/gemini_cli.py#L20" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
14+
15+
```python
16+
find_gemini_command() -> str | None
17+
```
18+
19+
20+
Find the Gemini CLI command.
21+
22+
23+
### `check_gemini_cli_available` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/install/gemini_cli.py#L64" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
24+
25+
```python
26+
check_gemini_cli_available() -> bool
27+
```
28+
29+
30+
Check if Gemini CLI is available.
31+
32+
33+
### `install_gemini_cli` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/install/gemini_cli.py#L69" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
34+
35+
```python
36+
install_gemini_cli(file: Path, server_object: str | None, name: str) -> bool
37+
```
38+
39+
40+
Install FastMCP server in Gemini CLI.
41+
42+
**Args:**
43+
- `file`: Path to the server file
44+
- `server_object`: Optional server object name (for \:object suffix)
45+
- `name`: Name for the server in Gemini CLI
46+
- `with_editable`: Optional list of directories to install in editable mode
47+
- `with_packages`: Optional list of additional packages to install
48+
- `env_vars`: Optional dictionary of environment variables
49+
- `python_version`: Optional Python version to use
50+
- `with_requirements`: Optional requirements file to install from
51+
- `project`: Optional project directory to run within
52+
53+
**Returns:**
54+
- True if installation was successful, False otherwise
55+
56+
57+
### `gemini_cli_command` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/install/gemini_cli.py#L151" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
58+
59+
```python
60+
gemini_cli_command(server_spec: str) -> None
61+
```
62+
63+
64+
Install an MCP server in Gemini CLI.
65+
66+
**Args:**
67+
- `server_spec`: Python file to install, optionally with \:object suffix
68+

docs/python-sdk/fastmcp-cli-install-mcp_json.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Generate MCP configuration JSON for manual installation.
3535
- True if generation was successful, False otherwise
3636

3737

38-
### `mcp_json_command` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/install/mcp_json.py#L106" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
38+
### `mcp_json_command` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/install/mcp_json.py#L98" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
3939

4040
```python
4141
mcp_json_command(server_spec: str) -> None

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

Lines changed: 6 additions & 34 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#L28" 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,35 +20,7 @@ is_url(path: str) -> bool
2020
Check if a string is a URL.
2121

2222

23-
### `run_with_uv` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/run.py#L34" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
24-
25-
```python
26-
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, editable: str | list[str] | None = None) -> None
27-
```
28-
29-
30-
Run a MCP server using uv run subprocess.
31-
32-
This function is called when we need to set up a Python environment with specific
33-
dependencies before running the server. The config parsing and merging should already
34-
be done by the caller.
35-
36-
**Args:**
37-
- `server_spec`: Python file, object specification (file\:obj), config file, or URL
38-
- `python_version`: Python version to use (e.g. "3.10")
39-
- `with_packages`: Additional packages to install
40-
- `with_requirements`: Requirements file to use
41-
- `project`: Run the command within the given project directory
42-
- `transport`: Transport protocol to use
43-
- `host`: Host to bind to when using http transport
44-
- `port`: Port to bind to when using http transport
45-
- `path`: Path to bind to when using http transport
46-
- `log_level`: Log level
47-
- `show_banner`: Whether to show the server banner
48-
- `editable`: Editable package paths
49-
50-
51-
### `create_client_server` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/run.py#L115" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
23+
### `create_client_server` <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>
5224

5325
```python
5426
create_client_server(url: str) -> Any
@@ -64,7 +36,7 @@ Create a FastMCP server from a client URL.
6436
- A FastMCP server instance
6537

6638

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

6941
```python
7042
create_mcp_config_server(mcp_config_path: Path) -> FastMCP[None]
@@ -74,7 +46,7 @@ create_mcp_config_server(mcp_config_path: Path) -> FastMCP[None]
7446
Create a FastMCP server from a MCPConfig.
7547

7648

77-
### `load_mcp_server_config` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/run.py#L146" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
49+
### `load_mcp_server_config` <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>
7850

7951
```python
8052
load_mcp_server_config(config_path: Path) -> MCPServerConfig
@@ -90,7 +62,7 @@ Load a FastMCP configuration from a fastmcp.json file.
9062
- MCPServerConfig object
9163

9264

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

9567
```python
9668
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, skip_source: bool = False) -> None
@@ -112,7 +84,7 @@ Run a MCP server or connect to a remote one.
11284
- `skip_source`: Whether to skip source preparation step
11385

11486

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

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

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ containing the prompt messages and any additional metadata.
374374
#### `complete_mcp` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/client/client.py#L744" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
375375

376376
```python
377-
complete_mcp(self, ref: mcp.types.ResourceReference | mcp.types.PromptReference, argument: dict[str, str]) -> mcp.types.CompleteResult
377+
complete_mcp(self, ref: mcp.types.ResourceTemplateReference | mcp.types.PromptReference, argument: dict[str, str]) -> mcp.types.CompleteResult
378378
```
379379

380380
Send a completion request and return the complete MCP protocol result.
@@ -394,7 +394,7 @@ containing the completion and any additional metadata.
394394
#### `complete` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/client/client.py#L767" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
395395

396396
```python
397-
complete(self, ref: mcp.types.ResourceReference | mcp.types.PromptReference, argument: dict[str, str]) -> mcp.types.Completion
397+
complete(self, ref: mcp.types.ResourceTemplateReference | mcp.types.PromptReference, argument: dict[str, str]) -> mcp.types.Completion
398398
```
399399

400400
Send a completion request to the server.

docs/python-sdk/fastmcp-prompts-prompt.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ to_mcp_prompt(self, **overrides: Any) -> MCPPrompt
5757
Convert the prompt to an MCP prompt.
5858

5959

60-
#### `from_function` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/prompts/prompt.py#L113" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
60+
#### `from_function` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/prompts/prompt.py#L115" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
6161

6262
```python
6363
from_function(fn: Callable[..., PromptResult | Awaitable[PromptResult]], name: str | None = None, title: str | None = None, description: str | None = None, tags: set[str] | None = None, enabled: bool | None = None, meta: dict[str, Any] | None = None) -> FunctionPrompt
@@ -72,7 +72,7 @@ The function can return:
7272
- A sequence of any of the above
7373

7474

75-
#### `render` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/prompts/prompt.py#L141" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
75+
#### `render` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/prompts/prompt.py#L143" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
7676

7777
```python
7878
render(self, arguments: dict[str, Any] | None = None) -> list[PromptMessage]
@@ -81,15 +81,15 @@ render(self, arguments: dict[str, Any] | None = None) -> list[PromptMessage]
8181
Render the prompt with arguments.
8282

8383

84-
### `FunctionPrompt` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/prompts/prompt.py#L149" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
84+
### `FunctionPrompt` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/prompts/prompt.py#L151" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
8585

8686

8787
A prompt that is a function.
8888

8989

9090
**Methods:**
9191

92-
#### `from_function` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/prompts/prompt.py#L155" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
92+
#### `from_function` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/prompts/prompt.py#L157" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
9393

9494
```python
9595
from_function(cls, fn: Callable[..., PromptResult | Awaitable[PromptResult]], name: str | None = None, title: str | None = None, description: str | None = None, tags: set[str] | None = None, enabled: bool | None = None, meta: dict[str, Any] | None = None) -> FunctionPrompt
@@ -104,7 +104,7 @@ The function can return:
104104
- A sequence of any of the above
105105

106106

107-
#### `render` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/prompts/prompt.py#L315" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
107+
#### `render` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/prompts/prompt.py#L317" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
108108

109109
```python
110110
render(self, arguments: dict[str, Any] | None = None) -> list[PromptMessage]

0 commit comments

Comments
 (0)