Yoon-gu Hwang commited on
Commit
da2de7a
·
1 Parent(s): 83b056a
Files changed (4) hide show
  1. .python-version +1 -0
  2. app.py +28 -0
  3. pyproject.toml +9 -0
  4. uv.lock +0 -0
.python-version ADDED
@@ -0,0 +1 @@
 
 
1
+ 3.13
app.py ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ def letter_counter(word, letter):
4
+ """
5
+ Count the number of occurrences of a letter in a word or text.
6
+
7
+ Args:
8
+ word (str): The input text to search through
9
+ letter (str): The letter to search for
10
+
11
+ Returns:
12
+ str: A message indicating how many times the letter appears
13
+ """
14
+ word = word.lower()
15
+ letter = letter.lower()
16
+ count = word.count(letter)
17
+ return count
18
+
19
+ demo = gr.Interface(
20
+ fn=letter_counter,
21
+ inputs=[gr.Textbox("strawberry"), gr.Textbox("r")],
22
+ outputs=[gr.Number()],
23
+ title="Letter Counter",
24
+ description="Enter text and a letter to count how many times the letter appears in the text."
25
+ )
26
+
27
+ if __name__ == "__main__":
28
+ demo.launch(mcp_server=True)
pyproject.toml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ [project]
2
+ name = "mcp-101"
3
+ version = "0.1.0"
4
+ description = "Add your description here"
5
+ readme = "README.md"
6
+ requires-python = ">=3.13"
7
+ dependencies = [
8
+ "gradio[mcp]==5.37",
9
+ ]
uv.lock ADDED
The diff for this file is too large to render. See raw diff