---
title: "Building the Hugging Face MCP Server"
description: "Hugging Face's hosted MCP server at hf.co/mcp runs in production on Streamable HTTP in a stateless, direct-response configuration."
url: "https://swe.quest/articles/building-the-hugging-face-mcp-server-70bae73ac8de2021"
canonical: "https://huggingface.co/blog/building-hf-mcp"
source: "Hugging Face"
published: "2025-07-10"
difficulty: "medium"
kind: "Case study"
reading_minutes: 8
tags: ["ai-agents","api-design","scalability"]
---

# Building the Hugging Face MCP Server

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2025-07-10, 8 min read, Case study. Original: [https://huggingface.co/blog/building-hf-mcp](https://huggingface.co/blog/building-hf-mcp)

## Summary

Hugging Face's hosted MCP server at hf.co/mcp runs in production on Streamable HTTP in a stateless, direct-response configuration. That choice permits simple horizontal scaling, since per-user tool selections and Gradio Spaces are looked up per request from HF\_TOKEN or OAuth credentials. The write-up compares STDIO, deprecated HTTP+SSE, and the Streamable HTTP patterns (direct response, request-scoped streams, server push), including which MCP features each supports and when sessions are needed. It also explains why real-time tool-list-change notifications are impractical for a public server and reports operational findings: VSCode polling the endpoint when served an HTML page, roughly 100 control messages per tool call, and 164 distinct clients in a week, about half connecting via mcp-remote.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [AI agents](https://swe.quest/tags/ai-agents.md) (AI & ML)
- [API design](https://swe.quest/tags/api-design.md) (Backend & APIs)
- [Scaling](https://swe.quest/tags/scalability.md) (Distributed systems)

## Prerequisites

- Model Context Protocol basics
- HTTP and Server-Sent Events

## Keywords

Model Context Protocol, Streamable HTTP, Server-Sent Events, Hugging Face Hub, Gradio, mcp-remote, OAuth

## Related posts

- [Is MCP good yet?](https://swe.quest/articles/is-mcp-good-yet-c41ace4de474f361.md): Neon · 2026-11-04 · Medium · 9 min read · AI agents, API design, Serverless, LLMs
  Neon's remote MCP server now handles more tool calls than its CLI runs commands and has about twice the CLI's daily active users.
- [How to Build an MCP Server with Gradio](https://swe.quest/articles/how-to-build-an-mcp-server-with-gradio-76a4960460af5603.md): Hugging Face · 2025-04-30 · Medium · 10 min read · AI agents, Python, LLMs
  Gradio apps become Model Context Protocol servers by passing mcp\_server=True to launch(), which auto-converts each Python function into an MCP tool, using its docstring and type hints to build the description and input schema.
- [Five Big Improvements to Gradio MCP Servers](https://swe.quest/articles/five-big-improvements-to-gradio-mcp-servers-de0d05a26f23e057.md): Hugging Face · 2025-07-17 · Medium · 4 min read · AI agents, Python, API design, LLMs
  Gradio 5.38.0 adds five features for building MCP servers. A "File Upload" MCP server lets agents send local files to remote Gradio apps, and progress notifications now stream to MCP clients. \`gr.load\_openapi\` turns an OpenAPI spec into an MCP server in one line, \`gr.Header\`-typed arguments extract auth headers and list them in the connection docs, and the \`api\_description\` parameter overrides auto-generated tool descriptions.
- [What’s MCP all about? Comparing MCP with LLM function calling](https://swe.quest/articles/what-s-mcp-all-about-comparing-mcp-with-llm-function-calling-fcce1ee01a7d0aed.md): Neon · 2025-03-12 · Medium · 5 min read · AI agents, LLMs, TypeScript
  The Model Context Protocol (MCP) builds on LLM function calling by moving tool definitions and execution out of individual LLM applications into standalone servers that any MCP-compatible client can discover and invoke.
- [Learnings from building our public MCP server](https://swe.quest/articles/learnings-from-building-our-public-mcp-server-4745c00cbf09b9ab.md): Wealthfront Engineering · 2026-11-02 · Medium · 8 min read · AI agents, Identity & auth, API design, Payments & fintech
  Wealthfront built a public MCP server so users can connect their cash and investing accounts to AI applications, using Streamable HTTP transport with synchronous calls only, all capabilities exposed as tools with per-tool scope enforcement, and OAuth for authentication.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
