Skip to main content
Glama
README.md
<h1 align="center">πŸ” Disvr</h1>

<p align="center">
  <strong>Spend Intelligence for AI Agents β€” the "Yelp for the Agent Economy"</strong>
</p>

<p align="center">
  <a href="https://www.disvr.top"><img src="https://img.shields.io/badge/Live-www.disvr.top-00d4aa?style=for-the-badge" alt="Live Site"></a>
  <a href="https://api.disvr.top/health"><img src="https://img.shields.io/badge/API-Online-62fae3?style=for-the-badge" alt="API Status"></a>
  <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg?style=for-the-badge" alt="MIT License"></a>
</p>

<p align="center">
  <a href="#why-disvr">Why Disvr</a> Β· <a href="#quick-start">Quick Start</a> Β· <a href="#api-reference">API</a> Β· <a href="#architecture">Architecture</a> Β· <a href="https://www.disvr.top/explorer">Live Demo</a> Β· <a href="docs/README_zh.md">δΈ­ζ–‡ζ–‡ζ‘£</a>
</p>

---

## Why Disvr?

The AI Agent ecosystem is exploding. Payment protocols (Stripe MPP, OpenAI ACP, x402) solve **how to pay**. Directories (Smithery, Composio) solve **what exists**.

But nobody solves the most critical question: **which tool is actually worth using?**

> πŸ€– "Translate a Chinese legal contract to Thai" β†’ 50 translation services on Smithery. **Which one has the best cost/quality ratio?**
>
> πŸ€– "Scrape product prices from e-commerce sites" β†’ 30 scraping tools. **Which one has the highest success rate and lowest latency?**
>
> πŸ€– "Generate a product image" β†’ 20 image generation services. **Which one is cheapest while still being good enough?**

Right now, agents pick blindly. Wrong picks mean wasted money, wasted time, and failed tasks.

**Disvr fixes this.**

Instead of returning a list, Disvr returns a **ranked recommendation** β€” based on a 4-dimensional value score:

| Dimension | Weight | What it measures |
|-----------|--------|-----------------|
| 🎯 Semantic Match | 0.30 | How well the service matches the need |
| ⭐ Quality | 0.25 | Historical success rate, reputation |
| πŸ’° Cost Efficiency | 0.25 | Cost per call, value for money |
| πŸ”’ Reliability | 0.20 | Latency, retry rate, uptime |

**Your agent stops guessing and starts choosing the best tool for the job.**

---

## βœ… Before You Start

| | |
|---|---|
| πŸ’° **Free to use** | Free tier: 1,000 queries/day, no credit card required |
| πŸ”Œ **MCP Native** | One-line config for Claude Code, Cursor, or any MCP client |
| πŸ”„ **Closed-Loop Feedback** | Agents report call results β†’ rankings get smarter over time |
| ☁️ **Global Edge** | Deployed on Cloudflare Workers, low latency worldwide |
| πŸ“‘ **Real-time Data** | Hourly crawls from Smithery keep service data fresh |

---

## Quick Start

### Option 1: MCP Server (Recommended)

Add one line to your `.mcp.json`:

```json
{
  "mcpServers": {
    "disvr": {
      "type": "url",
      "url": "https://api.disvr.top/mcp"
    }
  }
}
```

Restart Claude Code / Cursor β€” your agent now has the `discover_services` tool.

Try telling your agent:

- **"Find the best tool to translate Chinese legal documents to Thai"**
- **"Recommend the cheapest web scraping service with high success rate"**
- **"Which image generation API has the best price/quality ratio?"**

### Option 2: REST API

```bash
curl -X POST https://api.disvr.top/discover \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"need": "translate Chinese legal contract to Thai"}'
```

Returns Top 3 recommendations ranked by value_score:

```json
{
  "recommendations": [
    {
      "service": "deepl-mcp-server",
      "platform": "smithery",
      "match_confidence": 0.92,
      "reputation": 4.2,
      "price_usd": 0.002,
      "reason": "Best cost/quality ratio for legal document translation"
    }
  ]
}
```

---

## Live Demo

| Page | Link | Description |
|------|------|-------------|
| 🏠 **Home** | [www.disvr.top](https://www.disvr.top) | Product overview |
| πŸ” **Explorer** | [www.disvr.top/explorer](https://www.disvr.top/explorer) | Interactive query playground β€” try the API live |
| πŸ“‹ **Registry** | [www.disvr.top/registry](https://www.disvr.top/registry) | Browse all indexed services |
| πŸ“Š **Analytics** | [www.disvr.top/analytics](https://www.disvr.top/analytics) | System architecture & scoring visualization |

---

## API Reference

### `POST /discover` β€” Service Discovery

Describe what your agent needs, get back Top 3 ranked recommendations.

```
POST https://api.disvr.top/discover
Authorization: Bearer <api-key>
Content-Type: application/json

{
  "need": "scrape product prices from e-commerce websites",
  "max_price_per_call": 0.01,
  "max_latency_ms": 5000,
  "min_reputation": 3.0
}
```

| Parameter | Required | Description |
|-----------|----------|-------------|
| `need` | βœ… | What you need (β‰₯5 chars) |
| `max_price_per_call` | ❌ | Max price per call (USD) |
| `max_latency_ms` | ❌ | Max acceptable latency (ms) |
| `min_reputation` | ❌ | Min reputation score (0-5) |

### `POST /report` β€” Feedback Loop

Report call results after using a tool β€” closes the feedback loop and improves rankings.

```
POST https://api.disvr.top/report
Authorization: Bearer <api-key>
Content-Type: application/json

{
  "service_id": "deepl-mcp-server",
  "query_id": "q_abc123",
  "success": true,
  "latency_ms": 1200,
  "cost_usd": 0.002
}
```

### `GET /health` β€” Health Check

```bash
curl https://api.disvr.top/health
# {"status": "ok", "services_indexed": 330}
```

### MCP Tools

Tools exposed via the MCP Server:

| Tool | Description |
|------|-------------|
| `discover_services` | Semantic search + 4-dim value ranking |
| `list_service_count` | Total number of indexed services |
| `report_call_result` | Report call results (feedback loop) |

---

## SDK

TypeScript/JavaScript SDK with full type safety:

```bash
npm install @sylar_yan/disvr
```

```typescript
import { Disvr } from "@sylar_yan/disvr";

const client = new Disvr("dsvr_your_api_key");

const result = await client.discover({
  need: "translate Chinese legal contract to Thai",
  max_latency_ms: 3000,
  min_reputation: 3.5,
});

console.log(result.recommendations);
```

- [npm](https://www.npmjs.com/package/@sylar_yan/disvr)
- [GitHub](https://github.com/Svanik-yan/disvr)

---

## Architecture

```
Agent Query ("I need X")
       β”‚
       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Disvr API (Cloudflare Workers + Hono)  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                         β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚ Embed    │───▢│ CF Vectorize     β”‚   β”‚
β”‚  β”‚ (OpenAI) β”‚    β”‚ (1536-dim cosine)β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                           β”‚             β”‚
β”‚         β”Œβ”€β”€β”€β”€β”€β”€β”€ 50 candidates ──────┐  β”‚
β”‚         β–Ό                            β”‚  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚  β”‚
β”‚  β”‚ D1 Database  β”‚   β”‚ FTS5       β”‚   β”‚  β”‚
β”‚  β”‚ (services,   β”‚   β”‚ (fallback) β”‚   β”‚  β”‚
β”‚  β”‚  call_reports)β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜                    β”‚  β”‚
β”‚         β”‚                            β”‚  β”‚
β”‚         β–Ό                            β”‚  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚  β”‚
β”‚  β”‚ 4-Dim Value Ranking          β”‚    β”‚  β”‚
β”‚  β”‚ semantic Γ— 0.30              β”‚    β”‚  β”‚
β”‚  β”‚ quality  Γ— 0.25              β”‚    β”‚  β”‚
β”‚  β”‚ cost_eff Γ— 0.25              β”‚    β”‚  β”‚
β”‚  β”‚ reliable Γ— 0.20              β”‚    β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚  β”‚
β”‚             β–Ό                        β”‚  β”‚
β”‚        Top 3 Recommendations         β”‚  β”‚
β”‚                                      β”‚  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€  β”‚
β”‚  MCP Server (Streamable HTTP)        β”‚  β”‚
β”‚  via CF Agents SDK + Durable Objects β”‚  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
                                          β”‚
       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       β–Ό
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚ Cron Trigger β”‚  ← Hourly: crawl (Smithery + GitHub + MCP Registry)
  β”‚ (4-phase)    β”‚     β†’ enrich GitHub Stars β†’ health checks
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β†’ aggregate daily stats
       β”‚
  β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚ POST /report    β”‚  ← Agent feedback
  β”‚ refreshStats()  β”‚     success_rate, latency β†’ ranking improvement
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
```

### Tech Stack

| Component | Technology |
|-----------|-----------|
| Runtime | Cloudflare Workers |
| Framework | Hono |
| Database | Cloudflare D1 (SQLite) |
| Vector Search | CF Vectorize (1536-dim, cosine) |
| Text Search | FTS5 (OR + prefix, fallback path) |
| Embedding | OpenAI text-embedding-3-small |
| MCP Server | CF Agents SDK (McpAgent + Durable Objects) |
| Data Sources | Smithery, GitHub awesome-mcp, MCP Official Registry (~2000 services) |
| Cron | CF Cron Trigger (hourly) |
| Language | TypeScript |

---

## Project Structure

```
disvr/
β”œβ”€β”€ wrangler.toml           # CF Workers config
β”œβ”€β”€ schema.sql              # D1 database schema
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ index.ts            # Hono entry + REST routes
β”‚   β”œβ”€β”€ discover.ts         # Core: semantic search + 4-dim ranking
β”‚   β”œβ”€β”€ db.ts               # D1 CRUD + feedback stats
β”‚   β”œβ”€β”€ crawl.ts            # Multi-source crawlers + embedAndIndex
β”‚   β”œβ”€β”€ mcp.ts              # MCP Server (Streamable HTTP)
β”‚   β”œβ”€β”€ types.ts            # TypeScript type definitions
β”‚   β”œβ”€β”€ landing.ts          # Landing page HTML
β”‚   └── pages/
β”‚       β”œβ”€β”€ registry.ts     # Provider Registry page
β”‚       β”œβ”€β”€ explorer.ts     # Agent Query Explorer page
β”‚       └── analytics.ts    # Analytics Dashboard page
β”œβ”€β”€ test/
β”‚   β”œβ”€β”€ types.test.ts       # Type conversion tests
β”‚   β”œβ”€β”€ discover.test.ts    # Matching engine tests
β”‚   β”œβ”€β”€ db.test.ts          # D1 operations tests
β”‚   β”œβ”€β”€ api.test.ts         # REST API integration tests
β”‚   └── crawl.test.ts       # Crawler tests
└── .mcp.json               # MCP config example
```

---

## Local Development

```bash
# Prerequisites: Node.js 22+
nvm use 22

# Install dependencies
npm install

# Local dev server
npx wrangler dev

# Run tests
npx vitest run

# Deploy
npx wrangler deploy
```

### Environment Variables

```bash
# Set OpenAI API Key (for embeddings)
wrangler secret put OPENAI_API_KEY
```

### Database Setup

```bash
# Create D1 database
wrangler d1 create disvr-db

# Run schema
wrangler d1 execute disvr-db --file=./schema.sql

# Create Vectorize index
wrangler vectorize create disvr-mcp-index --dimensions=1536 --metric=cosine
```

---

## Design Philosophy

### Spend Intelligence, Not Just Search

Disvr is not a directory. It's not a marketplace. It's a **decision layer**.

Traditional directories return a list and let you pick. Disvr returns a **recommendation** and tells you:
- **Why** this tool is worth using
- **How** its cost/quality ratio compares
- **What** makes it better than alternatives

### Closed-Loop Feedback is the Moat

Every time an agent reports a call result (success/failure, latency, cost), it feeds back into the ranking algorithm. More usage β†’ smarter recommendations. This isn't a static database β€” it's a **living intelligence system**.

### Dual-Path Search Guarantees Recall

- **Primary**: OpenAI embedding β†’ CF Vectorize vector search (semantic matching)
- **Fallback**: FTS5 full-text search (OR + prefix wildcards)
- Automatically degrades when embedding fails or vector search returns empty β€” always returns results

---

## Roadmap

- [x] Core API (discover + report + health)
- [x] MCP Server (Streamable HTTP)
- [x] Smithery crawler (330+ services)
- [x] GitHub awesome-mcp crawler + Stars enrichment
- [x] MCP Official Registry crawler (1000+ services)
- [x] Landing page + 4 frontend pages
- [x] Custom domains (www.disvr.top + api.disvr.top)
- [x] npm SDK (@sylar_yan/disvr)
- [x] 90 unit tests (types, discover, db, api, crawl)
- [x] Request logging + Analytics API
- [x] Daily stats cron aggregation
- [x] Health checks + multi-signal reputation scoring
- [x] User registration + API key management UI
- [ ] Agent integration verification (MCP real-world testing)
- [ ] Cost tracking dashboard
- [ ] Payment protocol integration (Stripe MPP / x402)

---

## Contributing

PRs and Issues are welcome!

- πŸ› Bug reports β†’ [GitHub Issues](https://github.com/Svanik-yan/disvr/issues)
- πŸ’‘ Feature requests β†’ [GitHub Issues](https://github.com/Svanik-yan/disvr/issues)
- πŸ”§ Code contributions β†’ Fork & PR

---

## Acknowledgments

- [Cloudflare Workers](https://workers.cloudflare.com/) β€” Global edge compute
- [Hono](https://hono.dev/) β€” Lightweight web framework
- [Smithery](https://smithery.ai/) β€” MCP service registry
- [OpenAI](https://openai.com/) β€” text-embedding-3-small
- [CF Agents SDK](https://developers.cloudflare.com/agents/) β€” MCP Server implementation

---

## License

[MIT](LICENSE)

---

<p align="center">
  <strong>Stop guessing. Start discovering.</strong>
  <br/>
  <a href="https://www.disvr.top">www.disvr.top</a> Β· <a href="https://api.disvr.top/mcp">MCP Server</a> Β· <a href="https://api.disvr.top/health">API Status</a>
</p>