mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-23 14:04:18 +02:00
Use ergonomic provider initialization pattern (#2675)
Updates examples and convenience methods to pass providers directly to FastMCP's __init__ instead of calling add_provider() after instantiation.
This commit is contained in:
parent
820b69aa2e
commit
bca310cdde
4 changed files with 7 additions and 20 deletions
|
|
@ -101,10 +101,8 @@ class SQLiteToolProvider(Provider):
|
|||
)
|
||||
|
||||
|
||||
mcp = FastMCP("DynamicToolsServer")
|
||||
|
||||
provider = SQLiteToolProvider(db_path=str(DB_PATH))
|
||||
mcp.add_provider(provider)
|
||||
mcp = FastMCP("DynamicToolsServer", providers=[provider])
|
||||
|
||||
|
||||
@mcp.tool
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue