Jarisko commited on
Commit
921ee57
·
1 Parent(s): 7bc5725

back to gradio

Browse files
Files changed (1) hide show
  1. app.py +9 -26
app.py CHANGED
@@ -1,28 +1,5 @@
1
- # import gradio as gr
2
 
3
- # def question(question: str) -> str:
4
- # """
5
- # Answers any question.
6
- # """
7
-
8
- # return "42"
9
-
10
- # app = gr.Interface(
11
- # fn=question,
12
- # inputs="text",
13
- # outputs="text",
14
- # title="Answer any question",
15
- # description="Answer to the Ultimate Question of Life, the Universe, and Everything"
16
- # )
17
-
18
- # app.launch(mcp_server=True, share=True)
19
-
20
- from mcp.server.fastmcp import FastMCP
21
-
22
- mcp = FastMCP("test_mcp_server")
23
-
24
-
25
- @mcp.tool()
26
  def question(question: str) -> str:
27
  """
28
  Answers any question.
@@ -30,6 +7,12 @@ def question(question: str) -> str:
30
 
31
  return "42"
32
 
 
 
 
 
 
 
 
33
 
34
- if __name__ == "__main__":
35
- mcp.run(transport="sse")
 
1
+ import gradio as gr
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  def question(question: str) -> str:
4
  """
5
  Answers any question.
 
7
 
8
  return "42"
9
 
10
+ app = gr.Interface(
11
+ fn=question,
12
+ inputs="text",
13
+ outputs="text",
14
+ title="Answer any question",
15
+ description="Answer to the Ultimate Question of Life, the Universe, and Everything"
16
+ )
17
 
18
+ app.launch(mcp_server=True, share=True)