Building the Hugging Face MCP Server
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.
Related posts
- Is MCP good yet?
Neon mediumAdept
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. Agents pick MCP even where Neon's own skills recommend the CLI, likely because harnesses surface MCP tools to the model automatically. Neon added support for the stateless MCP 2026-07-28 spec, which drops the initialize handshake and Mcp-Session-Id in favor of per-request _meta and Mcp-Method/Mcp-Name headers, so any instance behind a round-robin load balancer can serve any request. That let Neon retire its SSE endpoints and remove Redis-backed session handling, while still accepting the old handshake because most clients (Claude Code excepted) don't use the new spec by default yet.
- How to Build an MCP Server with Gradio
Hugging Face mediumAdeptGradio 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. The server is exposed over SSE at /gradio_api/mcp/sse. Claude Desktop, which lacks SSE support, can reach it through mcp-remote via npx. Newer features include decorators for MCP resources and prompts, MCP-only functions via gr.api(), automatic file and base64 conversion, per-tool latency and success metrics, and free hosting on Hugging Face Spaces with bearer-token auth for private Spaces.
- Five Big Improvements to Gradio MCP Servers
Hugging Face mediumAdeptGradio 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. Short code examples cover the OpenAPI loader, header-based auth and custom descriptions.
- What’s MCP all about? Comparing MCP with LLM function calling
Neon mediumAdept
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. A Home Assistant light-control function is implemented both ways. The first version uses OpenAI tool definitions in JSON, with the app parsing tool_calls and executing them itself. The second is an MCP server built with the TypeScript SDK, a Zod schema and stdio transport, registered in Cursor. The takeaway is that function calling leaves discovery and execution to each app, while MCP standardizes them so tools can be reused across agents like Cursor, Windsurf and Claude Desktop.
- MCP in LangChain: Stateless Protocol, Elicitation, and More!
LangChain mediumAdeptLangChain has moved MCP support into the main package as `langchain.mcp`, rebuilt on FastMCP to match the July 2026 stateless MCP spec, which drops sessions so remote servers no longer need sticky routing or a shared session store. `MultiServerMCPClient` is replaced by a single `MCPAdapter`. FastMCP negotiates per connection between the new protocol and the legacy handshake, and a `ClientGroup` gives each server its own era, auth and server-prefixed tool names. Mid-call elicitation surfaces as a LangGraph interrupt that resumes via a checkpointer, and tool lists can be cached client-side according to server-provided TTLs. The namespace is in beta (Python first, TypeScript to follow) and requires `langchain[mcp]>=1.4.0`.