Buckets:

rtrm's picture
download
raw
19 kB
<meta charset="utf-8" /><meta name="hf:doc:metadata" content="{&quot;title&quot;:&quot;Hugging Face MCP Server&quot;,&quot;local&quot;:&quot;hugging-face-mcp-server&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;What you can do&quot;,&quot;local&quot;:&quot;what-you-can-do&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Built-in tools&quot;,&quot;local&quot;:&quot;built-in-tools&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Get started&quot;,&quot;local&quot;:&quot;get-started&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Using the server&quot;,&quot;local&quot;:&quot;using-the-server&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Add community tools (Spaces)&quot;,&quot;local&quot;:&quot;add-community-tools-spaces&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Learn more&quot;,&quot;local&quot;:&quot;learn-more&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2}],&quot;depth&quot;:1}">
<link href="/docs/101-course/pr_4/en/_app/immutable/assets/0.e3b0c442.css" rel="modulepreload">
<link rel="modulepreload" href="/docs/101-course/pr_4/en/_app/immutable/entry/start.b6742992.js">
<link rel="modulepreload" href="/docs/101-course/pr_4/en/_app/immutable/chunks/scheduler.1d51f4c0.js">
<link rel="modulepreload" href="/docs/101-course/pr_4/en/_app/immutable/chunks/singletons.023d1c68.js">
<link rel="modulepreload" href="/docs/101-course/pr_4/en/_app/immutable/chunks/index.fa8592cf.js">
<link rel="modulepreload" href="/docs/101-course/pr_4/en/_app/immutable/chunks/paths.daa2f795.js">
<link rel="modulepreload" href="/docs/101-course/pr_4/en/_app/immutable/entry/app.8b986792.js">
<link rel="modulepreload" href="/docs/101-course/pr_4/en/_app/immutable/chunks/index.fda43871.js">
<link rel="modulepreload" href="/docs/101-course/pr_4/en/_app/immutable/nodes/0.b5fb3b56.js">
<link rel="modulepreload" href="/docs/101-course/pr_4/en/_app/immutable/chunks/each.e59479a4.js">
<link rel="modulepreload" href="/docs/101-course/pr_4/en/_app/immutable/nodes/7.030f100f.js">
<link rel="modulepreload" href="/docs/101-course/pr_4/en/_app/immutable/chunks/Tip.e808fe4c.js">
<link rel="modulepreload" href="/docs/101-course/pr_4/en/_app/immutable/chunks/getInferenceSnippets.58a43ad0.js"><!-- HEAD_svelte-u9bgzb_START --><meta name="hf:doc:metadata" content="{&quot;title&quot;:&quot;Hugging Face MCP Server&quot;,&quot;local&quot;:&quot;hugging-face-mcp-server&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;What you can do&quot;,&quot;local&quot;:&quot;what-you-can-do&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Built-in tools&quot;,&quot;local&quot;:&quot;built-in-tools&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Get started&quot;,&quot;local&quot;:&quot;get-started&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Using the server&quot;,&quot;local&quot;:&quot;using-the-server&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Add community tools (Spaces)&quot;,&quot;local&quot;:&quot;add-community-tools-spaces&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Learn more&quot;,&quot;local&quot;:&quot;learn-more&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2}],&quot;depth&quot;:1}"><!-- HEAD_svelte-u9bgzb_END --> <p></p> <h1 class="relative group"><a id="hugging-face-mcp-server" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#hugging-face-mcp-server"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Hugging Face MCP Server</span></h1> <p data-svelte-h="svelte-1mpnpua">The Hugging Face MCP (Model Context Protocol) Server connects your MCP-compatible AI assistant (such as VS Code, Cursor, Zed, or Claude Desktop) directly to the Hugging Face Hub. MCP is a protocol that allows AI assistants to use external tools and data sources as if they were built-in features.</p> <div class="course-tip course-tip-orange bg-gradient-to-br dark:bg-gradient-to-r before:border-orange-500 dark:before:border-orange-800 from-orange-50 dark:from-gray-900 to-white dark:to-gray-950 border border-orange-50 text-orange-700 dark:text-gray-400"><p data-svelte-h="svelte-rz93wm">This section covers advanced integration features. If you’re new to AI development, you can skip this section and come back to it later as you become more comfortable with the basics.</p></div> <p data-svelte-h="svelte-db20a2">Once connected, your assistant can search and explore Hub resources and use community tools, all from within your editor, chat application, or command line interface.</p> <div class="course-tip bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400"><p data-svelte-h="svelte-1o90emi">The main advantage of the Hugging Face MCP Server is that it provides built-in tools for the Hub as well as community tools based on Gradio Spaces. As we start to build our own MCP servers, we’ll see that we can use the Hugging Face MCP Server as a reference for our own implementations.</p></div> <h2 class="relative group"><a id="what-you-can-do" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#what-you-can-do"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>What you can do</span></h2> <p data-svelte-h="svelte-17ju0pb">The MCP Server enables three primary types of interactions with the Hugging Face ecosystem. You can search and explore Hub resources including models, datasets, Spaces, and research papers. You can run community tools through MCP-compatible Gradio applications hosted on <a href="https://hf.co/spaces" rel="nofollow">Spaces</a>. Finally, you can bring results back into your assistant with complete metadata, direct links, and contextual information.</p> <h2 class="relative group"><a id="built-in-tools" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#built-in-tools"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Built-in tools</span></h2> <p data-svelte-h="svelte-tssq1z">The server provides carefully curated tools that work seamlessly across all supported clients. These include comprehensive models search and exploration capabilities, allowing you to filter by task type, library compatibility, download counts, and community likes. Dataset search and exploration tools let you filter by tags, size categories, and data modality. Spaces semantic search helps you find applications by specific capabilities like text-to-speech, automatic speech recognition, or optical character recognition. Additionally, papers semantic search enables you to discover relevant research published on the Hub.</p> <h2 class="relative group"><a id="get-started" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#get-started"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Get started</span></h2> <p data-svelte-h="svelte-1prm1ag">Getting started with the Hugging Face MCP Server requires three straightforward steps. Note that you’ll need to have an MCP-compatible client installed first.</p> <p data-svelte-h="svelte-1y4mw2">First, open your MCP settings by visiting <a href="https://huggingface.co/settings/mcp" rel="nofollow">https://huggingface.co/settings/mcp</a> while logged into your Hugging Face account.</p> <p data-svelte-h="svelte-ohaq12">Next, select your MCP-compatible client from the available options, such as VS Code, Cursor, Zed, or Claude Desktop. The settings page will display client-specific instructions along with a ready-to-copy configuration snippet tailored to your chosen client.</p> <p data-svelte-h="svelte-1nk919n">Finally, copy the configuration snippet into your client’s MCP configuration file, save the changes, and restart or reload your client application. You should see “Hugging Face” or a similar indicator listed as a connected MCP server within your client interface.</p> <div class="course-tip bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400"><p data-svelte-h="svelte-x8ha3g">The settings page generates the exact configuration your client expects. Use it rather than writing config by hand.</p></div> <p data-svelte-h="svelte-7ocor3"><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hf-mcp-settings.png" alt="MCP Settings Example"></p> <h2 class="relative group"><a id="using-the-server" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#using-the-server"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Using the server</span></h2> <p data-svelte-h="svelte-1qok1nj">After connecting the server to your assistant, you can leverage Hugging Face tools through natural language requests. Here are some example prompts that demonstrate the server’s capabilities:</p> <ul data-svelte-h="svelte-bkjf1q"><li>“Search Hugging Face models for Qwen 3 quantizations.”</li> <li>“Find a Space that can transcribe audio files.”</li> <li>“Show datasets about weather time‑series.”</li> <li>“Create a 1024 × 1024 image of a cat in Ghibli style.”</li></ul> <p data-svelte-h="svelte-13bjcij">Your assistant will call the appropriate MCP tools exposed by the Hugging Face MCP Server, including those provided by community Spaces, and return comprehensive results including titles, authors, download statistics, community feedback, and direct links. You can then open resources directly on the Hub or continue exploring related content within the same conversation.</p> <p data-svelte-h="svelte-o8wy8l"><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hf-mcp-vscode.png" alt="HF MCP with Spaces in VS Code"></p> <h2 class="relative group"><a id="add-community-tools-spaces" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#add-community-tools-spaces"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Add community tools (Spaces)</span></h2> <p data-svelte-h="svelte-vmy6oh">You can extend your MCP setup by incorporating community-built Gradio Spaces that support the MCP protocol.</p> <p data-svelte-h="svelte-wchrlj">To discover available tools, explore Spaces with MCP support at <a href="https://huggingface.co/spaces?search=mcp" rel="nofollow">this search page</a>. When you find useful tools, add them to your configuration through your MCP settings on Hugging Face at <a href="https://huggingface.co/settings/mcp" rel="nofollow">this settings page</a>.</p> <p data-svelte-h="svelte-199k8vw">Gradio applications that support MCP automatically expose their functions as tools, complete with parameter descriptions and usage instructions. This allows your assistant to call them directly as if they were native features. Remember to restart or refresh your client application after adding new tools so it can discover and integrate the newly available capabilities.</p> <h2 class="relative group"><a id="learn-more" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#learn-more"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Learn more</span></h2> <p data-svelte-h="svelte-1iufb3b">For additional information and resources about the Hugging Face MCP Server:</p> <ul data-svelte-h="svelte-1uoowmn"><li>Settings and client setup: <a href="https://huggingface.co/settings/mcp" rel="nofollow">https://huggingface.co/settings/mcp</a></li> <li>Changelog announcement: <a href="https://huggingface.co/changelog/hf-mcp-server" rel="nofollow">https://huggingface.co/changelog/hf-mcp-server</a></li> <li>HF MCP Server documentation: <a href="https://huggingface.co/docs/hub/en/hf-mcp-server" rel="nofollow">https://huggingface.co/docs/hub/en/hf-mcp-server</a></li> <li>Building your own MCP server with Gradio and Hub tools: <a href="https://huggingface.co/docs/hub/main/agents" rel="nofollow">https://huggingface.co/docs/hub/main/agents</a></li></ul> <a class="!text-gray-400 !no-underline text-sm flex items-center not-prose mt-4" href="https://github.com/huggingface/101-course/blob/main/chapters/en/chapter1/5.mdx" target="_blank"><span data-svelte-h="svelte-1kd6by1">&lt;</span> <span data-svelte-h="svelte-x0xyl0">&gt;</span> <span data-svelte-h="svelte-1dajgef"><span class="underline ml-1.5">Update</span> on GitHub</span></a> <p></p>
<script>
{
__sveltekit_kib1ob = {
assets: "/docs/101-course/pr_4/en",
base: "/docs/101-course/pr_4/en",
env: {}
};
const element = document.currentScript.parentElement;
const data = [null,null];
Promise.all([
import("/docs/101-course/pr_4/en/_app/immutable/entry/start.b6742992.js"),
import("/docs/101-course/pr_4/en/_app/immutable/entry/app.8b986792.js")
]).then(([kit, app]) => {
kit.start(app, element, {
node_ids: [0, 7],
data,
form: null,
error: null
});
});
}
</script>

Xet Storage Details

Size:
19 kB
·
Xet hash:
b9d99200c2ee7dbe56abd0ce917d5d8c71282ad61a83a1628475c4556b55959a

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.