Building a Currency Converter MCP Server
Time to begin building your first MCP server! Here, you'll define an MCP server called 'Currency Converter' that consists of a single tool called convert_currency() to convert monetary values between different currencies.
This tool should take amount, from_currency, and to_currency parameters, and return a string containing the amount converted into the desired currency, along with the exchange rate used.
For example, 100 EUR = 88.04 GBP (Rate: 0.8804).
Este exercício faz parte do curso
Introduction to Model Context Protocol (MCP)
Exercício interativo prático
Experimente este exercício completando este código de exemplo.
# Create an MCP server instance
mcp = ____("____")