Skip to content

Conversation

@merveenoyan
Copy link
Contributor

compiling everything agents and MCP clients, please let me know if I miss something! @aymeric-roucher @abidlabs @julien-c

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@aymeric-roucher
Copy link
Contributor

Thanks a lot @merveenoyan , this will be a great addition! 😃

merveenoyan and others added 5 commits May 7, 2025 11:07
Co-authored-by: Aymeric Roucher <[email protected]>
Co-authored-by: Aymeric Roucher <[email protected]>
Co-authored-by: Aymeric Roucher <[email protected]>
Co-authored-by: Aymeric Roucher <[email protected]>
Copy link
Member

@abidlabs abidlabs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gradio parts looks great @merveenoyan added some suggestions

Copy link
Member

@pcuenca pcuenca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with @abidlabs' suggestions

merveenoyan and others added 8 commits May 7, 2025 15:07
Co-authored-by: Abubakar Abid <[email protected]>
Co-authored-by: Abubakar Abid <[email protected]>
Co-authored-by: Pedro Cuenca <[email protected]>
Co-authored-by: Pedro Cuenca <[email protected]>
Co-authored-by: Pedro Cuenca <[email protected]>
Co-authored-by: Abubakar Abid <[email protected]>
Co-authored-by: Abubakar Abid <[email protected]>
Co-authored-by: Pedro Cuenca <[email protected]>
Copy link
Member

@Vaibhavs10 Vaibhavs10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when finished it'll be cool to write about the Python client too.


demo.launch(mcp_server=True)

The MCP server will be available at `http://your-server:port/gradio_api/mcp/sse` where your application is served. It will have a tool corresponding to each function in your Gradio app, with the tool description automatically generated from the docstrings of your functions.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the deployed space on the hub - it'd be hf.space domain right? - I wonder if we can make it more HF spaces as a MCP server centric.

https://www.gradio.app/guides/using-docs-mcp#installing-in-the-clients

cc: @abidlabs

merveenoyan and others added 2 commits May 7, 2025 16:47
Copy link
Member

@julien-c julien-c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also cc @burtenshaw who's been working on a mcp-course from what i've seen (from random stalking😁)

Comment on lines 66 to 67
- local: agents
title: Agents on Hub
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would put it in Other, maybe between Paper pages and Search:

image

If you want to avoid defining agents yourself, the easiest way to start an agent is through the CLI, using the `smolagent` command.

```python
smolagent "Plan a trip to Tokyo, Kyoto and Osaka between Mar 28 and Apr 7." --model-type "InferenceClientModel" --model-id "Qwen/Qwen2.5-Coder-32B-Instruct" --imports "pandas numpy" --tools "web_search"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we format it on multiple lines? see current rendering: https://moon-ci-docs.huggingface.co/docs/hub/pr_1728/en/agents

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry it was supposed to be bash

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

made a suggestion on above here: #1728 (comment)

Copy link
Member

@Vaibhavs10 Vaibhavs10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Starting to look nice and clean, some more suggestions for readability and more complete snippets

@merveenoyan merveenoyan requested a review from Vaibhavs10 May 13, 2025 12:53
@merveenoyan
Copy link
Contributor Author

@Vaibhavs10 re-ordered from high level to low level, @aymeric-roucher is this ok?


This page compiles all the libraries and tools Hugging Face offers for agentic workflows: huggingface.js mcp-client, Gradio MCP Server and smolagents.

## huggingface.js mcp-client
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit: would prefer putting smolagents above huggingface.js agents, since it has more usage and content.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to me it makes sense to make it high to low level, but I have no strong opinion

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

smolagents seems more high level IMO, this part about huggingface.js sounds like a low level detail
WDYT @Vaibhavs10 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CLI yes, but other than that it's not I think there's more customization

Copy link
Contributor

@aymeric-roucher aymeric-roucher May 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really see the logic in having "one MCP server of a package" listed above "one MCP server of a bigger package" (smolagents has more usage than the agentic part of huggingface.js): for me it would make sense for the bigger one to be listed first

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

personally don't think the order matter much, it's just three options anyway, IMHO having more hub related things up front makes wee bit more sense - we can always change the order later on if it doesn't make sense.

Copy link
Member

@Vaibhavs10 Vaibhavs10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 smol suggestions, otherwise good to ship!

You can get more information about mcp-client [here](https://huggingface.co/docs/huggingface.js/en/mcp-client/README).


## Gradio MCP Server / Tools
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small suggestion, it'd be nice to add a snippet of MCP via a space.

}
```

This is very powerful because it lets the LLM use any Gradio application as a tool. You can find thousands of them on [Spaces](https://huggingface.co/spaces).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can link some docs for people to read more: https://www.gradio.app/guides/building-mcp-server-with-gradio


This page compiles all the libraries and tools Hugging Face offers for agentic workflows: huggingface.js mcp-client, Gradio MCP Server and smolagents.

## huggingface.js mcp-client
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

personally don't think the order matter much, it's just three options anyway, IMHO having more hub related things up front makes wee bit more sense - we can always change the order later on if it doesn't make sense.

@merveenoyan merveenoyan requested a review from Vaibhavs10 May 13, 2025 14:55
@merveenoyan merveenoyan merged commit 010edb4 into main May 13, 2025
2 checks passed
@merveenoyan merveenoyan deleted the add-agents-landing-page branch May 13, 2025 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants