import gradio as gr def letter_counter(word: str, letter: str) -> int: """ Count the number of occurrences of a letter in a word or text. Args: word (str): The input text to search through letter (str): The letter to search for Returns: int: The number of times the letter appears in the text """ word = word.lower() letter = letter.lower() count = word.count(letter) return count #always make sure to use type hints, and provide Args: params and their types, like above demo = gr.Interface( fn=letter_counter, inputs=["textbox", "textbox"], outputs="number", title="Letter Counter", description="Enter text and a letter to count how many times the letter appears in the text" ) if __name__ == "__main__": demo.launch(mcp_server=True) #mcp_server=True to use as a mcp erver instead ##this makes it acccesisble as both a web interface and a MCP Server that can connect to clients #when in mcp_Server, got to: http://127.0.0.1:7860/gradio_api/mcp/schema, to see schema #presumably use the URL as for rmeote sse mcp-server for smolagents??