mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-20 12:34:17 +02:00
chore: Update SDK documentation (#1616)
Co-authored-by: marvin-context-protocol[bot] <225465937+marvin-context-protocol[bot]@users.noreply.github.com>
This commit is contained in:
parent
d237de2003
commit
85cc51f223
26 changed files with 403 additions and 260 deletions
|
|
@ -10,7 +10,7 @@ FastMCP CLI tools using Cyclopts.
|
|||
|
||||
## Functions
|
||||
|
||||
### `version` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/cli.py#L103" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
|
||||
### `version` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/cli.py#L63" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
|
||||
|
||||
```python
|
||||
version()
|
||||
|
|
@ -20,45 +20,47 @@ version()
|
|||
Display version information and platform details.
|
||||
|
||||
|
||||
### `dev` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/cli.py#L141" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
|
||||
### `dev` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/cli.py#L101" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
|
||||
|
||||
```python
|
||||
dev(server_spec: str) -> None
|
||||
dev(server_spec: str | None = None) -> None
|
||||
```
|
||||
|
||||
|
||||
Run an MCP server with the MCP Inspector for development.
|
||||
|
||||
**Args:**
|
||||
- `server_spec`: Python file to run, optionally with \:object suffix
|
||||
- `server_spec`: Python file to run, optionally with \:object suffix, or None to auto-detect fastmcp.json
|
||||
|
||||
|
||||
### `run` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/cli.py#L286" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
|
||||
### `run` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/cli.py#L319" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
|
||||
|
||||
```python
|
||||
run(server_spec: str, *server_args: str) -> None
|
||||
run(server_spec: str | None = None, *server_args: str) -> None
|
||||
```
|
||||
|
||||
|
||||
Run an MCP server or connect to a remote one.
|
||||
|
||||
The server can be specified in four ways:
|
||||
The server can be specified in several ways:
|
||||
1. Module approach: "server.py" - runs the module directly, looking for an object named 'mcp', 'server', or 'app'
|
||||
2. Import approach: "server.py:app" - imports and runs the specified server object
|
||||
3. URL approach: "http://server-url" - connects to a remote server and creates a proxy
|
||||
4. MCPConfig file: "mcp.json" - runs as a proxy server for the MCP Servers in the MCPConfig file
|
||||
5. FastMCP config: "fastmcp.json" - runs server using FastMCP configuration
|
||||
6. No argument: looks for fastmcp.json in current directory
|
||||
|
||||
Server arguments can be passed after -- :
|
||||
fastmcp run server.py -- --config config.json --debug
|
||||
|
||||
**Args:**
|
||||
- `server_spec`: Python file, object specification (file\:obj), MCPConfig file, or URL
|
||||
- `server_spec`: Python file, object specification (file\:obj), config file, URL, or None to auto-detect
|
||||
|
||||
|
||||
### `inspect` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/cli.py#L439" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
|
||||
### `inspect` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/cli.py#L582" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
|
||||
|
||||
```python
|
||||
inspect(server_spec: str) -> None
|
||||
inspect(server_spec: str | None = None) -> None
|
||||
```
|
||||
|
||||
|
||||
|
|
@ -74,7 +76,9 @@ fastmcp inspect server.py
|
|||
fastmcp inspect server.py -o report.json
|
||||
fastmcp inspect server.py:mcp -o analysis.json
|
||||
fastmcp inspect path/to/server.py:app -o /tmp/server-info.json
|
||||
fastmcp inspect fastmcp.json
|
||||
fastmcp inspect # auto-detect fastmcp.json
|
||||
|
||||
**Args:**
|
||||
- `server_spec`: Python file to inspect, optionally with \:object suffix
|
||||
- `server_spec`: Python file to inspect, optionally with \:object suffix, or fastmcp.json
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue