mcp4bibframe-docs / README.md
RDF Validation Deployment
Fix HuggingFace Spaces configuration in README.md - 2025-10-04 15:16:48
06231f2

A newer version of the Gradio SDK is available: 6.1.0

Upgrade
metadata
title: BIBFRAME Ontology Documentation MCP Server
emoji: πŸ“š
colorFrom: blue
colorTo: green
sdk: gradio
sdk_version: 5.0.0
app_file: app.py
pinned: false

πŸ“š BIBFRAME Ontology Documentation MCP Server

A Model Context Protocol (MCP) server that provides BIBFRAME ontology documentation for LLMs like Claude. Built with Gradio, this server dynamically loads from the official BIBFRAME ontology at id.loc.gov.

🌐 Live Server

Deployed at: https://jimfhahn-mcp4bibframe-docs.hf.space
MCP Endpoint: https://jimfhahn-mcp4bibframe-docs.hf.space/gradio_api/mcp/

✨ Features

  • βœ… MCP Server: Full MCP protocol support for LLM integration
  • πŸ“š Live Ontology Data: Loads from official BIBFRAME ontology
  • πŸ” Four MCP Tools:
    • get_property_info - Detailed property information with examples
    • get_class_info - Class documentation with applicable properties
    • search_ontology - Search for properties or classes
    • get_property_usage - Context-specific usage information
  • 🌐 Web UI: Interactive Gradio interface for testing
  • ☁️ Deployed on HF Spaces: Hosted for free on Hugging Face

πŸš€ Quick Start with Claude Desktop

Add this to your Claude Desktop configuration:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "bibframe-docs": {
      "url": "https://jimfhahn-mcp4bibframe-docs.hf.space/gradio_api/mcp/"
    }
  }
}

For a hosted version on Hugging Face Spaces:

{
  "mcpServers": {
    "bibframe-docs": {
      "url": "https://YOUR-USERNAME-mcp4bibframe-docs.hf.space/gradio_api/mcp/sse"
    }
  }
}

Note: Claude Desktop currently requires the mcp-remote bridge for SSE servers:

{
  "mcpServers": {
    "bibframe-docs": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "http://localhost:7860/gradio_api/mcp/sse"
      ]
    }
  }
}

Deploying to Hugging Face Spaces

  1. Create a new Space on Hugging Face
  2. Choose "Gradio" as the SDK
  3. Push this repository to your Space
  4. The MCP server will be available at: https://YOUR-USERNAME-SPACE-NAME.hf.space/gradio_api/mcp/sse

Private Spaces

For private Spaces, add your Hugging Face token:

{
  "mcpServers": {
    "bibframe-docs": {
      "url": "https://YOUR-SPACE.hf.space/gradio_api/mcp/sse",
      "headers": {
        "Authorization": "Bearer YOUR-HF-TOKEN"
      }
    }
  }
}

MCP Tools Reference

get_property_info

Get detailed information about a BIBFRAME property from the official ontology.

Args:
    property_uri (str): Full URI or short name (e.g., "bf:assigner" or "assigner")

Returns:
    JSON with property information, domain, range, examples, and usage guidance

get_class_info

Get detailed information about a BIBFRAME class from the official ontology.

Args:
    class_name (str): Class name (e.g., "Work", "bf:Work", or full URI)

Returns:
    JSON with class information and applicable properties

search_ontology

Search the BIBFRAME ontology for properties or classes matching a term.

Args:
    search_term (str): Term to search for
    search_type (str): Type of search - "properties", "classes", or "all"

Returns:
    JSON with matching properties and/or classes

get_property_usage

Get usage information for a property, optionally in the context of a specific class.

Args:
    property_name (str): Property name (e.g., "assigner" or "bf:assigner")
    class_name (str): Optional class context (e.g., "AdminMetadata")

Returns:
    JSON with usage information and examples

Testing with MCP Inspector

# Install MCP Inspector
npm install -g @modelcontextprotocol/inspector

# Test your server
npx @modelcontextprotocol/inspector http://localhost:7860/gradio_api/mcp/sse

Data Sources

Related Projects

License

MIT License - See LICENSE file for details

Contributing

Contributions welcome! Please open an issue or PR on GitHub.