mcp4bibframe-docs / README.md
RDF Validation Deployment
Fix HuggingFace Spaces configuration in README.md - 2025-10-04 15:16:48
06231f2
|
raw
history blame
4.62 kB
---
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`
```json
{
"mcpServers": {
"bibframe-docs": {
"url": "https://jimfhahn-mcp4bibframe-docs.hf.space/gradio_api/mcp/"
}
}
}
```
For a hosted version on Hugging Face Spaces:
```json
{
"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:
```json
{
"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](https://huggingface.co/spaces)
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:
```json
{
"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
```bash
# Install MCP Inspector
npm install -g @modelcontextprotocol/inspector
# Test your server
npx @modelcontextprotocol/inspector http://localhost:7860/gradio_api/mcp/sse
```
## Data Sources
- [BIBFRAME Ontology](https://id.loc.gov/ontologies/bibframe.html) - Official ontology from Library of Congress
- [LC BIBFRAME Profiles](https://github.com/lcnetdev/bfe-profiles) - Application profiles
- [DCTap Validation](https://github.com/bf-interop/DCTap) - Community validation patterns
## Related Projects
- **For SHACL validation**: [mcp4rdf validator](https://huggingface.co/spaces/jimfhahn/mcp4rdf)
- **BIBFRAME Homepage**: https://www.loc.gov/bibframe/
- **BIBFRAME Documentation**: https://www.loc.gov/bibframe/docs/
## License
MIT License - See LICENSE file for details
## Contributing
Contributions welcome! Please open an issue or PR on GitHub.