Skip to main content
Glama
README.md
# Universal Data Refinery — MCP Server

<p align="center">
  <img src="assets/logo.png" alt="Universal Data Refinery Logo" width="620" />
</p>

<p align="center">
  <strong>High-Performance Edge-Native Machine Intelligence Refinery for AI Agents</strong><br>
  Built on Cloudflare Workers AI, D1 SQL, Vectorize, and the Model Context Protocol (MCP).
</p>

<p align="center">
  <a href="https://glama.ai/mcp/servers/juanquy/AI-data-refinery"><img src="https://glama.ai/mcp/servers/juanquy/AI-data-refinery/badges/score.svg" alt="juanquy/AI-data-refinery MCP server" /></a>
</p>

<p align="center">
  [![juanquy/AI-data-refinery MCP server](https://glama.ai/mcp/servers/juanquy/AI-data-refinery/badges/score.svg)](https://glama.ai/mcp/servers/juanquy/AI-data-refinery)
</p>

---

## 🌟 Overview

In the **Agent Internet**, AI models and autonomous agents (Claude Desktop, Cursor, Windsurf, OpenAI Agents, custom bots) need **clean, structured, real-time, deterministic data**. Raw web scraping is noisy, token-expensive, and prone to hallucinations.

The **Universal Data Refinery (UDR)** transforms fragmented web documentation, B2B SaaS pricing pages, municipal codes, and release logs into strict, schema-validated JSON with **automatic semantic diffing** and **sub-second edge retrieval**.

This repository provides the official **Model Context Protocol (MCP) Client Wrapper** that connects any MCP-compatible AI agent to the Universal Data Refinery Cloud API.

---

## 🚀 Built-in Refined Domains

### 1. 📦 Developer Ecosystem & Breaking Changes
* **Extracts**: Affected symbols, removal vs deprecation status, signature changes, and exact code migration snippets.
* **Solves**: AI coding assistant hallucinations regarding outdated syntax and breaking SDK upgrades.

### 2. 💰 B2B SaaS, Cloud & API Pricing Matrices
* **Extracts**: Normalized monthly/annual pricing, included quotas, usage-based rates, contract caveats, and overage fees.
* **Solves**: Autonomous procurement and cost-estimation calculations for AI agents.

### 3. 🏛️ Localized Regulatory & Compliance Intelligence
* **Extracts**: Municipal ordinances, short-term rental permits, zoning rules, mandatory deadlines, and penalties.
* **Solves**: Legal and business compliance research with structured provenance.

### 4. 🌐 Universal On-Demand Web Refinery
* **Extracts**: Feed any URL + target schema on the fly for deterministic extraction, validation, semantic diffing, and versioning.

---

## 🤖 Connecting AI Agents via MCP

### Option A: Direct Streamable HTTP / Remote MCP
Connect directly to the hosted edge MCP endpoint in your `claude_desktop_config.json` or `.cursor/mcp.json`:

```json
{
  "mcpServers": {
    "universal-data-refinery": {
      "url": "https://api.udr.io/mcp",
      "headers": {
        "Authorization": "Bearer ref_your_api_key"
      }
    }
  }
}
```

### Option B: Local Stdio Client Wrapper (`npx`)
Run the local stdio wrapper using `npx`:

```json
{
  "mcpServers": {
    "universal-data-refinery": {
      "command": "npx",
      "args": ["-y", "@udr/mcp-server"],
      "env": {
        "UDR_API_KEY": "ref_your_api_key",
        "UDR_API_URL": "https://api.udr.io"
      }
    }
  }
}
```

---

## 🛠️ Exposed MCP Tools

| Tool Name | Description |
| :--- | :--- |
| `refine_url` | Fetch and refine a noisy web URL into strict, schema-validated structured data with semantic diffing. |
| `get_entity` | Retrieve a refined structured entity and its metadata by entity ID or canonical URL. |
| `list_corpus` | List refined entities in the corpus filtered by vertical (`dev`, `pricing`, `regulatory`). |
| `search` | Semantic vector and keyword search across the Universal Data Refinery corpus. |
| `list_versions` | List all historical versions and content hashes for a refined entity. |
| `get_diff` | Compute or retrieve the semantic diff between two versions of a refined entity. |
| `list_changes` | Stream real-time breaking changes, pricing updates, and regulatory compliance deltas. |

---

## 💻 Building from Source

```bash
npm install
npm run build
npm start
```

---

## 📜 License
Business Source License 1.1 (`BUSL-1.1`). See [LICENSE](LICENSE).

TDQS

B3.2/5.0

Scored across 7 tools

Disambiguation4/5

Most tools have clearly distinct purposes: refinement/ingestion, entity retrieval, corpus listing, search, version history, diffs, and change monitoring. The main overlap is between list_corpus and search, which both return entities from the corpus, though one is filtered listing and the other is semantic/keyword search.

Naming Consistency4/5

Six of seven tools follow a clear verb_noun snake_case convention (refine_url, get_entity, list_corpus, list_versions, get_diff, list_changes). The lone bare verb 'search' is a minor deviation but still readable and predictable in context.

Tool Count5/5

Seven tools is well-scoped for a structured data refinery: ingestion, retrieval, listing, search, versioning, diffing, and change monitoring each earn a distinct place. There is no obvious bloat or missing operational category.

Completeness4/5

The surface covers the core lifecycle: refine/ingest, retrieve, list/search, inspect versions, compute diffs, and monitor changes. Minor gaps exist around explicit deletion, schema management, or batch refinement, but the main workflows appear complete and agents can work around these omissions.