Spaces:
Runtime error
Runtime error
Commit
·
79ebaec
1
Parent(s):
9a9e1bd
added
Browse files
app.py
CHANGED
@@ -3,9 +3,13 @@ import gradio as gr
|
|
3 |
from mcp.client.stdio import StdioServerParameters
|
4 |
from smolagents import InferenceClientModel, CodeAgent, ToolCollection
|
5 |
from smolagents.mcp_client import MCPClient
|
|
|
|
|
6 |
try:
|
7 |
mcp_client = MCPClient(
|
8 |
-
|
|
|
|
|
9 |
)
|
10 |
tools = mcp_client.get_tools()
|
11 |
|
@@ -18,7 +22,6 @@ try:
|
|
18 |
examples=["Prime factorization of 68"],
|
19 |
title="Agent with MCP Tools",
|
20 |
description="This is a simple agent that uses MCP tools to answer questions.",
|
21 |
-
# messages=[],
|
22 |
)
|
23 |
|
24 |
demo.launch()
|
|
|
3 |
from mcp.client.stdio import StdioServerParameters
|
4 |
from smolagents import InferenceClientModel, CodeAgent, ToolCollection
|
5 |
from smolagents.mcp_client import MCPClient
|
6 |
+
|
7 |
+
|
8 |
try:
|
9 |
mcp_client = MCPClient(
|
10 |
+
## Try this working example on the hub:
|
11 |
+
{"url": "https://slimanemakh-mcp-server.hf.space/gradio_api/mcp/sse"}
|
12 |
+
# {"url": "http://localhost:7860/gradio_api/mcp/sse"}
|
13 |
)
|
14 |
tools = mcp_client.get_tools()
|
15 |
|
|
|
22 |
examples=["Prime factorization of 68"],
|
23 |
title="Agent with MCP Tools",
|
24 |
description="This is a simple agent that uses MCP tools to answer questions.",
|
|
|
25 |
)
|
26 |
|
27 |
demo.launch()
|