Spaces:
Paused
Paused
Deploy Gradio MCP app
Browse files- app.py +17 -0
- requirements.txt +2 -0
app.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
def my_tool(input_text: str) -> str:
|
| 4 |
+
"""Do something with input.
|
| 5 |
+
|
| 6 |
+
Args:
|
| 7 |
+
input_text: The input
|
| 8 |
+
|
| 9 |
+
Returns:
|
| 10 |
+
The result
|
| 11 |
+
"""
|
| 12 |
+
return f"Processed: {input_text}"
|
| 13 |
+
|
| 14 |
+
demo = gr.Interface(fn=my_tool, inputs="text", outputs="text")
|
| 15 |
+
|
| 16 |
+
if __name__ == "__main__":
|
| 17 |
+
demo.launch(mcp_server=True)
|
requirements.txt
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
gradio>=4.0.0
|
| 2 |
+
requests>=2.28.0
|