refactor: Update FastMCP examples to use new import path
Update all FastMCP examples to use mcp.server.fastmcp instead of fastmcp. Add tests to verify example servers work correctly. Changes: - Update import paths in all example files - Create test_examples.py to verify functionality - Fix test assertions to match actual response format
This commit is contained in:
parent
fe75f43ee6
commit
15cd7df87f
1 changed files with 613 additions and 0 deletions
15
examples/fastmcp/simple_echo.py
Normal file
15
examples/fastmcp/simple_echo.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
"""
|
||||
FastMCP Echo Server
|
||||
"""
|
||||
|
||||
from mcp.server.fastmcp import FastMCP
|
||||
|
||||
|
||||
# Create server
|
||||
mcp = FastMCP("Echo Server")
|
||||
|
||||
|
||||
@mcp.tool()
|
||||
def echo(text: str) -> str:
|
||||
"""Echo the input text"""
|
||||
return text
|
||||
Loading…
Reference in a new issue