Skip to content

Commit 1c84a41

Browse files
committed
docs: add Hugging Bay MCP catalog example
1 parent 619d746 commit 1c84a41

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

‎docs/src/content/docs/framework/module_guides/mcp/llamaindex_mcp.md‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,27 @@ http_client = BasicMCPClient("https://example.com/mcp")
5858
# Local process
5959
local_client = BasicMCPClient("python", args=["server.py"])
6060
```
61+
62+
## Find a model with Hugging Bay
63+
64+
[Hugging Bay](https://huggingbay.xyz/skills/hugging-bay/SKILL.md) exposes public catalog reads through its Streamable HTTP MCP endpoint at `https://huggingbay.xyz/api/mcp`. This example selects only `find_runnable` before calling it, so the agent cannot access the profile's public write tools:
65+
66+
```python
67+
from llama_index.tools.mcp import BasicMCPClient, McpToolSpec
68+
69+
70+
async def find_a_model():
71+
client = BasicMCPClient("https://huggingbay.xyz/api/mcp")
72+
spec = McpToolSpec(
73+
client=client,
74+
allowed_tools=["find_runnable"],
75+
include_resources=False,
76+
)
77+
tools = await spec.to_tool_list_async()
78+
find_runnable = next(
79+
tool for tool in tools if tool.metadata.name == "find_runnable"
80+
)
81+
return await find_runnable.acall(task="chat", hardware="8gb-laptop")
82+
```
83+
84+
`find_runnable` returns a fit estimate, not a measured run. For Hugging Face downloads from repositories currently mirrored by Hugging Bay, set `HF_ENDPOINT=https://hf.huggingbay.xyz` in the client's environment. The mirror serves hosted files; it does not run inference.

0 commit comments

Comments
 (0)