mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-22 21:44:18 +02:00
chore: Update SDK documentation (#3116)
Co-authored-by: marvin-context-protocol[bot] <225465937+marvin-context-protocol[bot]@users.noreply.github.com>
This commit is contained in:
parent
81a7c83c67
commit
a1cf2aff6e
11 changed files with 261 additions and 154 deletions
|
|
@ -6,7 +6,7 @@ sidebarTitle: generate
|
|||
# `fastmcp.cli.generate`
|
||||
|
||||
|
||||
Generate a standalone CLI script from an MCP server's capabilities.
|
||||
Generate a standalone CLI script and agent skill from an MCP server.
|
||||
|
||||
## Functions
|
||||
|
||||
|
|
@ -33,7 +33,17 @@ generate_cli_script(server_name: str, server_spec: str, transport_code: str, ext
|
|||
Generate the full CLI script source code.
|
||||
|
||||
|
||||
### `generate_cli_command` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/generate.py#L526" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
|
||||
### `generate_skill_content` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/generate.py#L621" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
|
||||
|
||||
```python
|
||||
generate_skill_content(server_name: str, cli_filename: str, tools: list[mcp.types.Tool]) -> str
|
||||
```
|
||||
|
||||
|
||||
Generate a SKILL.md file for a generated CLI script.
|
||||
|
||||
|
||||
### `generate_cli_command` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/generate.py#L672" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
|
||||
|
||||
```python
|
||||
generate_cli_command(server_spec: Annotated[str, cyclopts.Parameter(help='Server URL, Python file, MCPConfig JSON, discovered name, or .js file')], output: Annotated[str, cyclopts.Parameter(help='Output file path (default: cli.py)')] = 'cli.py') -> None
|
||||
|
|
@ -43,7 +53,8 @@ generate_cli_command(server_spec: Annotated[str, cyclopts.Parameter(help='Server
|
|||
Generate a standalone CLI script from an MCP server.
|
||||
|
||||
Connects to the server, reads its tools/resources/prompts, and writes
|
||||
a Python script that can invoke them directly.
|
||||
a Python script that can invoke them directly. Also generates a SKILL.md
|
||||
agent skill file unless --no-skill is passed.
|
||||
|
||||
**Examples:**
|
||||
|
||||
|
|
@ -51,4 +62,5 @@ fastmcp generate-cli weather
|
|||
fastmcp generate-cli weather my_cli.py
|
||||
fastmcp generate-cli http://localhost:8000/mcp
|
||||
fastmcp generate-cli server.py output.py -f
|
||||
fastmcp generate-cli weather --no-skill
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue