London? Recap: Traditional Tool Calling Weather Service {“forecast”:”rainy”} getWeather(“London”) It’s rainy in London Currency Service {“GBP:USD”:”1.36”} getCurrency(“GBP:USD) 1 British Pounds in US Dollars? 1 British Pounds is 1.36 US Dollars How’s the weather in London? Tools: getWeather, getCurrency getWeather(“London”) {“forecast”:”rainy”} It’s rainy in London 1 British Pounds in US Dollars? Tools: getWeather, getCurrency getCurrency(“GBP:USD”) {“GBP:USD”:”1.36”} 1 British Pounds is 1.36 US Dollars
interact with external systems • Each tool defines a specific operation with inputs and outputs • Model-controlled: The model requests tool execution based on context
sum(a: int, b: int) -> int: """Add two numbers together.""" return a + b @mcp.tool() def get_weather(city: str, unit: str = "celsius") -> str: """Get weather for a city.""" # This would normally call a weather API return f"Weather in {city}: 22degrees{unit[0].upper()}"
def review_code(code: str) -> str: return f"Please review this code:\n\n{code}" @mcp.prompt(title="Debug Assistant") def debug_error(error: str) -> list[base.Message]: return [ base.UserMessage("I'm seeing this error:"), base.UserMessage(error), base.AssistantMessage("I'll help debug that. What have you tried so far?"), ]
Cases Tools Model-controlled: Model decides when to call these Allow LLM to interact with external systems Resources App-controlled: App decides when to call these Provide read-only access to data that the AI application can retrieve and provide as context to models Prompts User-controlled: The user decides when to use these Provide reusable prompts for a domain, or showcase how to best use the MCP server
LLM calls through the MCP client on its behalf Shifts the responsibility & cost of LLM calls from the server to the client (each client pays for their own LLM usage)
(ADK) supports MCP tools out of the box Claude Desktop is good in testing stdio based* MCP servers MCP support in different tools *For the rest - www.npmjs.com/package/mcp-remote
Run MCP Server Cloud Run External resources ✅ Deploy your MCP server alongside your AI agents, one product to learn ✅ Scalable: Cloud Run will scale your MCP server automatically based on demand ✅ Centralized server: Share access to a centralized MCP server with team members through IAM privileges, allowing them to connect to it from their local machines instead of all running their own servers locally ✅ Security: Cloud Run provides an easy way to force authenticated requests to your MCP server