HuggingFaceDoc / README.md
ABDALLALSWAITI's picture
Update README.md
64dbf78 verified

A newer version of the Gradio SDK is available: 5.34.2

Upgrade
metadata
title: Hugging Face Information Server
emoji: πŸ“š
colorFrom: green
colorTo: blue
sdk: gradio
sdk_version: 5.33.1
app_file: app.py
pinned: false
license: apache-2.0
short_description: A research assistant for the Hugging Face ecosystem.
tags:
  - mcp-server-track

Hugging Face Information Server πŸ“š

License

The Hugging Face Information Server is a research assistant designed to accelerate development and learning within the AI ecosystem. It acts as an intelligent bridge to the vast resources on Hugging Face, transforming simple queries into structured, actionable intelligence.

Instead of just returning links, this tool provides comprehensive, formatted summaries directly, allowing developers and researchers to find practical answers without leaving their workflow.

πŸš€ Demo Video


Key Features

  • Comprehensive Documentation Search: Delivers structured summaries of official documentation.
  • In-Depth Model & Dataset Analysis: Provides rich profiles of models and datasets with code snippets.
  • Task-Oriented Model Discovery: Helps you find the right tool for the job by searching for models based on a task.
  • Live & Relevant Data: Utilizes live API calls and intelligent web scraping to ensure information is always up-to-date.

How to Use the Web Interface

The user interface is organized into clear tabs for different functions:

  1. Select a tab at the top (e.g., "Model Information", "Documentation Search").
  2. Enter your query into the textbox.
  3. Click the button to get a detailed, formatted response.

Integrating with MCP Clients

This application is a fully compliant Model Context Protocol (MCP) server, allowing AI agents and other clients to use its functions as tools.

Connection Endpoint

The server's public endpoint is: https://agents-mcp-hackathon-huggingfacedoc.hf.space/gradio_api/mcp/sse

Method 1: Test with Public Clients

You can test this server immediately using these public MCP Client Spaces. Just paste the server URL above into the client's URL input field.

➑️ Test with Hugging Face Client

A special thank you to Modal Labs for providing credits and resources during the hackathon. You can also test with this client deployed on Modal.

➑️ Test with Modal Client

For those interested, here is a guide on deploying Gradio applications on Modal: How to run Gradio apps on Modal.

Method 2: Integrate with UI Clients (e.g., Cursor IDE)

MCP hosts often use a configuration file, typically named mcp.json, to manage server connections. For a remote server using HTTP+SSE transport, the configuration points to the server's URL. You would create an mcp.json file with the following structure:

{
  "servers": [
    {
      "name": "HF Info Server",
      "transport": {
        "type": "sse",
        "url": "https://agents-mcp-hackathon-huggingfacedoc.hf.space/gradio_api/mcp/sse"
      }
    }
  ]
}

Configuring Cursor IDE

To connect this server in Cursor, you can use the mcp-remote tool, which acts as a bridge.

  1. Open Cursor settings (Ctrl + Shift + J / Cmd + Shift + J).
  2. Go to the MCP tab and click Add new global MCP server.
  3. Paste the appropriate configuration below.

For macOS/Linux:

{
  "mcpServers": {
    "hf-info-server": {
      "command": "npx",
      "args": [
        "-y", 
        "mcp-remote", 
        "https://agents-mcp-hackathon-huggingfacedoc.hf.space/gradio_api/mcp/sse", 
        "--transport", 
        "sse-only"
      ]
    }
  }
}

For Windows:

{
  "mcpServers": {
    "hf-info-server": {
      "command": "cmd",
      "args": [
        "/c", 
        "npx", 
        "-y", 
        "mcp-remote", 
        "https://agents-mcp-hackathon-huggingfacedoc.hf.space/gradio_api/mcp/sse", 
        "--transport", 
        "sse-only"
      ]
    }
  }
}

Method 3: Build a Python Client with smol-agents

You can also run your own agent locally.

1. Setup Your Environment

Create a requirements.txt file:

gradio[mcp]
smolagents[mcp]
smolagents[litellm]

Then, install the dependencies:

python -m venv venv
source venv/bin/activate  # On Windows use `venv\Scripts\activate`
pip install -r requirements.txt

2. Set Your API Key

This client uses an LLM for reasoning. Export your API key as an environment variable. For example, for Google Gemini:

export GOOGLE_API_KEY="YOUR_API_KEY_HERE"

3. Create and Run the Client Script

Save the client code as client_app.py and run it from your terminal:

python client_app.py

Advanced: Using LiteLLMModel Directly

The smol-agents library uses LiteLLMModel to interact with various language models. To use a model like Anthropic's Claude 3.5 Sonnet directly, ensure your API key is set (export ANTHROPIC_API_KEY="YOUR_KEY") and use the following pattern:

from smolagents import LiteLLMModel

messages = [
  {"role": "user", "content": [{"type": "text", "text": "Hello, how are you?"}]}
]

model = LiteLLMModel(
    model_id="anthropic/claude-3-5-sonnet-latest", 
    temperature=0.2, 
    max_tokens=1024
)

response = model(messages)
print(response)

Available Tools

The server exposes the following tools to any connected MCP client:

  • search_documentation(query, max_results)
  • get_model_info(model_name)
  • get_dataset_info(dataset_name)
  • search_models(task, limit)
  • get_transformers_docs(topic)
  • get_trending_models(limit)

References & Further Reading


License

This project is licensed under the Apache 2.0 License.