Spaces:
Sleeping
Sleeping
| title: Mcp4rdf | |
| emoji: π | |
| colorFrom: blue | |
| colorTo: purple | |
| sdk: gradio | |
| sdk_version: 5.33.0 | |
| app_file: app.py | |
| pinned: false | |
| license: cc0-1.0 | |
| tag: "mcp-server-track" | |
| # Mcp4rdf - RDF Validation Server with AI | |
| **Space Link:** [https://huggingface.co/spaces/jimfhahn/mcp4rdf](https://huggingface.co/spaces/jimfhahn/mcp4rdf) | |
| This is a Gradio app that serves as an RDF validation tool and an MCP (Model Context Protocol) server. It allows users to validate RDF/XML content against SHACL schemas, and provides AI-powered suggestions and corrections for validation errors using a Hugging Face Inference Endpoint. | |
| **Track:** MCP Server / Tool | |
| **Tag:** `mcp-server-track` | |
| ## MCP Server in Action | |
| The MCP server can be tested by connecting an MCP client to the Gradio app's API endpoint. | |
| The application is live and can be accessed at the Space Link above. | |
| ## Features: | |
| - Real-time RDF/XML validation against SHACL schemas (Monograph and custom templates). | |
| - AI-powered error suggestions and corrections via a Hugging Face Inference Endpoint. | |
| - Built-in examples for valid, invalid, and BibFrame RDF. | |
| - Auto-validation as you type. | |
| - Easy-to-use Gradio interface. | |
| - Exposes MCP server functionality for clients like Claude Desktop. | |
| ## MCP Server Tools Exposed: | |
| - `validate_rdf_tool`: Validate RDF/XML against SHACL shapes. | |
| - `get_ai_suggestions`: Get AI-powered fix suggestions. | |
| - `get_ai_correction`: Generate corrected RDF/XML. | |
| - `get_rdf_examples`: Retrieve example RDF snippets. | |
| ## Setup and Deployment on Hugging Face Spaces: | |
| 1. **Hugging Face Space:** This application is deployed at [https://huggingface.co/spaces/jimfhahn/mcp4rdf](https://huggingface.co/spaces/jimfhahn/mcp4rdf). | |
| 2. **Inference Endpoint:** The application is configured to use a specific Hugging Face Inference Endpoint for AI features. | |
| 3. **API Key:** To enable AI features, the `HF_API_KEY` (your Hugging Face API token with access to the Inference Endpoint) must be set as a Secret in the Space settings. | |
| * Go to your Space β Settings β Repository secrets. | |
| * Add: `HF_API_KEY` = `your_huggingface_api_key_here`. | |
| 4. **Requirements:** The Space automatically installs dependencies from `requirements.txt`. | |
| ## MCP Connection: | |
| 1. When deployed on Hugging Face Spaces, the MCP server is available at: | |
| `https://jimfhahn-mcp4rdf.hf.space/gradio_api/mcp/sse` (Note: The Space ID `jimfhahn-mcp4rdf` might vary slightly based on HF naming conventions, please verify the exact URL from your Space). | |
| 2. Use this URL in your MCP client's configuration (e.g., Claude Desktop). | |
| ## Acknowledgments: | |
| This application utilizes concepts, code patterns, and profiles inspired by the work of the [Bibframe Interoperability Group (BIG) DCTAP](https://bf-interop.github.io/DCTap/) and [The bf-demo-validation-tool](https://github.com/bf-interop/bf-demo-validation-tool). | |