docs: restructure into topical sections and add the four most-asked-for pages (#3044)
This commit is contained in:
parent
080f2a869d
commit
220d362112
1 changed files with 2403 additions and 343 deletions
17
docs_src/deploy/tutorial001.py
Normal file
17
docs_src/deploy/tutorial001.py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
from mcp.server import MCPServer
|
||||
from mcp.server.transport_security import TransportSecuritySettings
|
||||
|
||||
mcp = MCPServer("Notes")
|
||||
|
||||
|
||||
@mcp.tool()
|
||||
def add_note(text: str) -> str:
|
||||
"""Save a note."""
|
||||
return f"Saved: {text}"
|
||||
|
||||
|
||||
security = TransportSecuritySettings(
|
||||
allowed_hosts=["mcp.example.com", "mcp.example.com:*"],
|
||||
allowed_origins=["https://app.example.com"],
|
||||
)
|
||||
app = mcp.streamable_http_app(transport_security=security)
|
||||
Loading…
Reference in a new issue