mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-21 13:04:18 +02:00
adapt to new structure
This commit is contained in:
parent
74c3fdc1e7
commit
dc3630bc93
5 changed files with 125 additions and 7 deletions
|
|
@ -63,3 +63,24 @@ Install a MCP server in the Claude desktop app.
|
|||
Environment variables are preserved once added and only updated if new values
|
||||
are explicitly provided.
|
||||
|
||||
|
||||
### `inspect`
|
||||
|
||||
```python
|
||||
inspect(server_spec: str = typer.Argument(..., help='Python file to inspect, optionally with :object suffix'), output: Annotated[Path, typer.Option('--output', '-o', help='Output file path for the JSON report (default: server-info.json)')] = Path('server-info.json')) -> None
|
||||
```
|
||||
|
||||
|
||||
Inspect a FastMCP server and generate a JSON report.
|
||||
|
||||
This command analyzes a FastMCP server (v1.x or v2.x) and generates
|
||||
a comprehensive JSON report containing information about the server's
|
||||
name, instructions, version, tools, prompts, resources, templates,
|
||||
and capabilities.
|
||||
|
||||
Examples:
|
||||
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
|
||||
|
||||
|
|
|
|||
41
docs/python-sdk/fastmcp-utilities-inspect.mdx
Normal file
41
docs/python-sdk/fastmcp-utilities-inspect.mdx
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
---
|
||||
title: inspect
|
||||
sidebarTitle: inspect
|
||||
---
|
||||
|
||||
# `fastmcp.utilities.inspect`
|
||||
|
||||
|
||||
Utilities for inspecting FastMCP instances.
|
||||
|
||||
## Classes
|
||||
|
||||
### `ToolInfo`
|
||||
|
||||
|
||||
Information about a tool.
|
||||
|
||||
|
||||
### `PromptInfo`
|
||||
|
||||
|
||||
Information about a prompt.
|
||||
|
||||
|
||||
### `ResourceInfo`
|
||||
|
||||
|
||||
Information about a resource.
|
||||
|
||||
|
||||
### `TemplateInfo`
|
||||
|
||||
|
||||
Information about a resource template.
|
||||
|
||||
|
||||
### `FastMCPInfo`
|
||||
|
||||
|
||||
Information extracted from a FastMCP instance.
|
||||
|
||||
42
docs/python-sdk/fastmcp-utilities-tests.mdx
Normal file
42
docs/python-sdk/fastmcp-utilities-tests.mdx
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
---
|
||||
title: tests
|
||||
sidebarTitle: tests
|
||||
---
|
||||
|
||||
# `fastmcp.utilities.tests`
|
||||
|
||||
## Functions
|
||||
|
||||
### `temporary_settings`
|
||||
|
||||
```python
|
||||
temporary_settings(**kwargs: Any)
|
||||
```
|
||||
|
||||
|
||||
Temporarily override ControlFlow setting values.
|
||||
|
||||
**Args:**
|
||||
- `**kwargs`: The settings to override, including nested settings.
|
||||
|
||||
|
||||
### `run_server_in_process`
|
||||
|
||||
```python
|
||||
run_server_in_process(server_fn: Callable[..., None], *args, **kwargs) -> Generator[str, None, None]
|
||||
```
|
||||
|
||||
|
||||
Context manager that runs a FastMCP server in a separate process and
|
||||
returns the server URL. When the context manager is exited, the server process is killed.
|
||||
|
||||
**Args:**
|
||||
- `server_fn`: The function that runs a FastMCP server. FastMCP servers are
|
||||
not pickleable, so we need a function that creates and runs one.
|
||||
- `*args`: Arguments to pass to the server function.
|
||||
- `provide_host_and_port`: Whether to provide the host and port to the server function as kwargs.
|
||||
- `**kwargs`: Keyword arguments to pass to the server function.
|
||||
|
||||
**Returns:**
|
||||
- The server URL.
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue