mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-21 04:54:17 +02:00
Merge branch 'main' into claude/issue-1647-20250827-0442
This commit is contained in:
commit
87e16a3c2b
2 changed files with 11 additions and 1 deletions
|
|
@ -29,8 +29,9 @@ The choice of importing or mounting depends on your use case and requirements.
|
|||
| **Method** | `FastMCP.import_server(server, prefix=None)` | `FastMCP.mount(server, prefix=None)` |
|
||||
| **Composition Type** | One-time copy (static) | Live link (dynamic) |
|
||||
| **Updates** | Changes to subserver NOT reflected | Changes to subserver immediately reflected |
|
||||
| **Performance** | Fast - no runtime delegation | Slower - affected by slowest mounted server |
|
||||
| **Prefix** | Optional - omit for original names | Optional - omit for original names |
|
||||
| **Best For** | Bundling finalized components | Modular runtime composition |
|
||||
| **Best For** | Bundling finalized components, performance-critical setups | Modular runtime composition |
|
||||
|
||||
### Proxy Servers
|
||||
|
||||
|
|
@ -204,6 +205,9 @@ The same prefixing rules apply as with `import_server` for naming tools, resourc
|
|||
The `prefix` parameter is optional. If omitted, components are mounted without modification.
|
||||
</Tip>
|
||||
|
||||
#### Performance Considerations
|
||||
|
||||
Due to the "live link", operations like `list_tools()` on the parent server will be impacted by the speed of the slowest mounted server. In particular, HTTP-based mounted servers can introduce significant latency (300-400ms vs 1-2ms for local tools), and this slowdown affects the whole server, not just interactions with the HTTP-proxied tools. If performance is important, importing tools via [`import_server()`](#importing-static-composition) may be a more appropriate solution as it copies components once at startup rather than delegating requests at runtime.
|
||||
|
||||
#### Mounting Without Prefixes
|
||||
|
||||
|
|
|
|||
|
|
@ -38,6 +38,12 @@ sequenceDiagram
|
|||
- **Security**: Acts as a controlled gateway to backend servers
|
||||
- **Simplicity**: Single endpoint even if backend location or transport changes
|
||||
|
||||
### Performance Considerations
|
||||
|
||||
When using proxy servers, especially those connecting to HTTP-based backend servers, be aware that latency can be significant. Operations like `list_tools()` may take hundreds of milliseconds compared to 1-2ms for local tools. When mounting proxy servers, this latency affects all operations on the parent server, not just interactions with the proxied tools.
|
||||
|
||||
If low latency is a requirement for your use-case, consider using [`import_server()`](/servers/composition#importing-static-composition) to copy tools at startup rather than proxying them at runtime.
|
||||
|
||||
## Quick Start
|
||||
|
||||
<VersionBadge version="2.10.3" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue