Spaces:
Runtime error
Runtime error
ryoshimu
commited on
Commit
·
0bbd02b
1
Parent(s):
cb04ff5
commit
Browse files
app.py
CHANGED
|
@@ -174,6 +174,28 @@ with gr.Blocks(title="MCP Server Configurator", theme=gr.themes.Soft()) as demo:
|
|
| 174 |
|
| 175 |
app = mcp.http_app()
|
| 176 |
gr.mount_gradio_app(app, demo, path="/gradio")
|
| 177 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 178 |
if __name__ == "__main__":
|
| 179 |
uvicorn.run("app:app", host="0.0.0.0", port=7860, reload=False)
|
|
|
|
| 174 |
|
| 175 |
app = mcp.http_app()
|
| 176 |
gr.mount_gradio_app(app, demo, path="/gradio")
|
| 177 |
+
def your_function(param1: str, param2: int) -> str:
|
| 178 |
+
"""
|
| 179 |
+
関数の説明をここに書きます。
|
| 180 |
+
|
| 181 |
+
Args:
|
| 182 |
+
param1: パラメータ1の説明
|
| 183 |
+
param2: パラメータ2の説明
|
| 184 |
+
|
| 185 |
+
Returns:
|
| 186 |
+
戻り値の説明
|
| 187 |
+
"""
|
| 188 |
+
# 関数の処理
|
| 189 |
+
return result
|
| 190 |
+
|
| 191 |
+
# インターフェース作成
|
| 192 |
+
demo = gr.Interface(
|
| 193 |
+
fn=your_function,
|
| 194 |
+
inputs=["text", "number"],
|
| 195 |
+
outputs="text"
|
| 196 |
+
)
|
| 197 |
+
|
| 198 |
+
# 重要:mcp_server=True を追加!
|
| 199 |
+
demo.launch(mcp_server=True)
|
| 200 |
if __name__ == "__main__":
|
| 201 |
uvicorn.run("app:app", host="0.0.0.0", port=7860, reload=False)
|