Spaces:
Running
Running
Goro commited on
Commit ·
59a72ab
1
Parent(s): 3476d1b
Fix doc and example
Browse files
src/fastmcp/contrib/component_manager/README.md
CHANGED
|
@@ -28,7 +28,7 @@ This module is part of the `fastmcp.contrib` package. No separate installation i
|
|
| 28 |
from fastmcp import FastMCP
|
| 29 |
from fastmcp.contrib.component_manager import set_up_component_manager
|
| 30 |
|
| 31 |
-
mcp = FastMCP("Component Manager", instructions="This is a test server with component manager.")
|
| 32 |
set_up_component_manager(server=mcp)
|
| 33 |
```
|
| 34 |
|
|
@@ -95,7 +95,7 @@ set_up_component_manager(server=mcp, path="/admin")
|
|
| 95 |
If your server uses authentication:
|
| 96 |
|
| 97 |
```python
|
| 98 |
-
mcp = FastMCP("Component Manager", instructions="This is a test server with component manager.", auth=auth)
|
| 99 |
set_up_component_manager(server=mcp, required_scopes=["write", "read"])
|
| 100 |
```
|
| 101 |
|
|
@@ -117,10 +117,10 @@ curl -X POST \
|
|
| 117 |
You can also combine different configurations when working with mounted servers — for example, using different scopes:
|
| 118 |
|
| 119 |
```python
|
| 120 |
-
mcp = FastMCP("Component Manager", instructions="This is a test server with component manager.", auth=auth)
|
| 121 |
set_up_component_manager(server=mcp, required_scopes=["mcp:write"])
|
| 122 |
|
| 123 |
-
mounted = FastMCP("Component Manager", instructions="This is a test server with component manager.", auth=auth)
|
| 124 |
set_up_component_manager(server=mounted, required_scopes=["mounted:write"])
|
| 125 |
|
| 126 |
mcp.mount(server=mounted, prefix="mo")
|
|
|
|
| 28 |
from fastmcp import FastMCP
|
| 29 |
from fastmcp.contrib.component_manager import set_up_component_manager
|
| 30 |
|
| 31 |
+
mcp = FastMCP(name="Component Manager", instructions="This is a test server with component manager.")
|
| 32 |
set_up_component_manager(server=mcp)
|
| 33 |
```
|
| 34 |
|
|
|
|
| 95 |
If your server uses authentication:
|
| 96 |
|
| 97 |
```python
|
| 98 |
+
mcp = FastMCP(name="Component Manager", instructions="This is a test server with component manager.", auth=auth)
|
| 99 |
set_up_component_manager(server=mcp, required_scopes=["write", "read"])
|
| 100 |
```
|
| 101 |
|
|
|
|
| 117 |
You can also combine different configurations when working with mounted servers — for example, using different scopes:
|
| 118 |
|
| 119 |
```python
|
| 120 |
+
mcp = FastMCP(name="Component Manager", instructions="This is a test server with component manager.", auth=auth)
|
| 121 |
set_up_component_manager(server=mcp, required_scopes=["mcp:write"])
|
| 122 |
|
| 123 |
+
mounted = FastMCP(name="Component Manager", instructions="This is a test server with component manager.", auth=auth)
|
| 124 |
set_up_component_manager(server=mounted, required_scopes=["mounted:write"])
|
| 125 |
|
| 126 |
mcp.mount(server=mounted, prefix="mo")
|
src/fastmcp/contrib/component_manager/example.py
CHANGED
|
@@ -19,7 +19,7 @@ mcp_token = key_pair.create_token(
|
|
| 19 |
scopes=["mcp:write", "mcp:read"],
|
| 20 |
)
|
| 21 |
mcp = FastMCP(
|
| 22 |
-
"Component Manager",
|
| 23 |
instructions="This is a test server with component manager.",
|
| 24 |
auth=auth,
|
| 25 |
)
|
|
@@ -35,7 +35,7 @@ mounted_token = key_pair.create_token(
|
|
| 35 |
scopes=["mounted:write", "mcp:read"],
|
| 36 |
)
|
| 37 |
mounted = FastMCP(
|
| 38 |
-
"Component Manager",
|
| 39 |
instructions="This is a test server with component manager.",
|
| 40 |
auth=auth,
|
| 41 |
)
|
|
|
|
| 19 |
scopes=["mcp:write", "mcp:read"],
|
| 20 |
)
|
| 21 |
mcp = FastMCP(
|
| 22 |
+
name="Component Manager",
|
| 23 |
instructions="This is a test server with component manager.",
|
| 24 |
auth=auth,
|
| 25 |
)
|
|
|
|
| 35 |
scopes=["mounted:write", "mcp:read"],
|
| 36 |
)
|
| 37 |
mounted = FastMCP(
|
| 38 |
+
name="Component Manager",
|
| 39 |
instructions="This is a test server with component manager.",
|
| 40 |
auth=auth,
|
| 41 |
)
|