"""MCP Server using FastMCP - Main entry point"""
from fastmcp import FastMCP
from typing import Any
# Initialize the MCP server
mcp = FastMCP("mcp-server-fastmcp")
@mcp.tool()
def get_greeting(name: str) -> str:
"""
Get a greeting message.
Args:
name: The name to greet
Returns:
A greeting message
"""
return f"Hello, {name}! Welcome to the MCP Server."
@mcp.tool()
def calculate_sum(a: float, b: float) -> float:
"""
Calculate the sum of two numbers.
Args:
a: First number
b: Second number
Returns:
The sum of a and b
"""
return a + b
@mcp.tool()
def get_server_info() -> dict[str, Any]:
"""
Get information about the MCP server.
Returns:
A dictionary containing server information
"""
return {
"name": "MCP Server FastMCP",
"version": "0.1.0",
"description": "A basic MCP server using FastMCP for integration with Cline",
"available_tools": [
"get_greeting",
"calculate_sum",
"get_server_info"
]
}
if __name__ == "__main__":
# Run the server
mcp.run()