OSS License Auditor
# ๐ OSS License Auditor
> MCP server that audits open-source package licenses against corporate policy โ detects viral (GPL, AGPL, SSPL) and unknown licenses before they enter the codebase. Built with [Vurb.ts](https://github.com/vinkius-labs/vurb.ts).
[](https://www.typescriptlang.org/)
[](https://github.com/vinkius-labs/vurb.ts)
[](LICENSE)
## Why This Exists
A single GPL or AGPL dependency can legally contaminate your entire codebase, forcing you to open-source your proprietary code. Most developers don't check licenses before running `npm install`.
This MCP server gives any LLM client a **deterministic license firewall** โ call `license.audit` before adding any dependency. The classification is SPDX-based lookup (no regex, no hallucination), resolved live from the npm registry.
<img width="887" height="633" alt="image" src="https://github.com/user-attachments/assets/3fe9cd75-6996-4a1f-94d3-c3a914e0d654" />
## Architecture
```
Agent reads package.json
โ
Sends dependencies to MCP
โ
MCP fetches license metadata from npm registry (parallel, 8s timeout)
โ
Normalises SPDX โ classifies into 5 categories โ applies corporate policy
โ
Returns audit report: BLOCKED โ / WARNING โ ๏ธ / ALLOWED โ
โ
Agent presents verdict with Mermaid distribution chart
```
**Deterministic core โ live data:** The classification logic is a pure SPDX lookup table (no AI, no drift). The only network call is to the npm registry for license metadata.
## License Categories
| Category | Examples | Verdict |
|---|---|---|
| **Permissive** | MIT, ISC, Apache-2.0, BSD | โ
Allowed |
| **Public Domain** | Unlicense, CC0-1.0, WTFPL | โ
Allowed |
| **Weak Copyleft** | LGPL, MPL-2.0, EPL | โ ๏ธ Warning โ legal review needed |
| **Strong Copyleft** | GPL-2.0, GPL-3.0 | โ Blocked โ viral, incompatible with proprietary code |
| **Network Copyleft** | AGPL-3.0, SSPL, EUPL | โ Blocked โ strongest viral, applies over network use |
| **Unknown** | Unrecognised SPDX | โ ๏ธ Warning โ manual review required |
## Tools
| Tool | Verb | Description |
|---|---|---|
| `license.audit` | `query` | Audit all deps from a package.json against corporate policy |
| `license.check` | `query` | Check a single package before `npm install` |
| `license.policy` | `query` | List the full corporate license policy (cached) |
| `license.tree` | `query` | Direct + first-level transitive deps with license annotations |
## Usage Examples
### โ Example 1 โ Detecting a Viral Dependency
> **User:** "Audit the dependencies of my project before we ship."
The LLM reads `package.json` and calls `license.audit`:
```json
{
"dependencies": "{\"express\":\"^4.18.0\",\"lodash\":\"^4.17.21\",\"@ffmpeg-installer/ffmpeg\":\"^1.1.0\"}"
}
```
**Result:**
```
total_packages: 3
allowed_count: 2
blocked_count: 1
@ffmpeg-installer/ffmpeg โ GPL-2.0-only
โ BLOCKED: strong copyleft โ requires derivative works to be
distributed under the same license. Incompatible with proprietary software.
```
The Presenter renders a Mermaid pie chart and urgently suggests removing or replacing the blocked package.
---
### โ
Example 2 โ Checking Before Installing
> **User:** "Is it safe to add `sequelize` to our project?"
The LLM calls `license.check`:
```json
{ "package": "sequelize" }
```
**Result:**
```
sequelize@6.x โ MIT
โ
ALLOWED: permissive โ safe for commercial use.
```
---
### โ ๏ธ Example 3 โ Scanning a Mixed Project
> **User:** "Audit all deps including devDependencies."
```json
{
"dependencies": "{\"react\":\"^18.0.0\",\"axios\":\"^1.6.0\"}",
"dev_dependencies": "{\"vitest\":\"^1.0.0\",\"webpack\":\"^5.0.0\"}"
}
```
**Result:**
```
total_packages: 4
allowed_count: 4 โ
No issues โ all permissive
```
---
### ๐ Example 4 โ Tracing a Transitive License
> **User:** "Show me the full license tree including transitive deps."
The LLM calls `license.tree` โ resolves each direct dep's own dependencies (one level deep) and annotates all with their license verdict.
## Deploy
### Vinkius Cloud โ One Command โก
The fastest path to production. [`vurb deploy`](https://vurb.vinkius.com/quickstart) publishes your server to [Vinkius Cloud](https://vinkius.com)'s global edge โ zero infrastructure, built-in DLP, kill switch, audit logging, and a managed MCP token:
```bash
npm install
vurb deploy
```
No Dockerfile, no CI/CD pipeline, no servers to manage. You get a connection token that works with **any MCP client** โ Cursor, Claude Desktop, Claude Code, Windsurf, Cline, VS Code + Copilot.
```bash
# Deploy with a custom name
vurb deploy --name oss-license-auditor
```
> **๐ก Tip:** Install the [Vinkius extension](https://marketplace.visualstudio.com/items?itemName=vinkius.cloud-extension) to manage your deployed server directly from VS Code, Cursor, or Windsurf โ live connections, requests, P95 latency, token management, tool toggling, logs, and deployment history.
### Connect Your MCP Client
After deploying, share the managed token with any MCP-compatible client:
#### Claude Desktop / Cursor / Windsurf
```json
{
"mcpServers": {
"oss-license-auditor": {
"url": "https://edge.vinkius.com/your-token/mcp"
}
}
}
```
### Self-Hosted Alternatives
The same `ToolRegistry` runs anywhere โ no code changes required:
| Platform | Adapter |
|---|---|
| Vercel Edge Functions | `@vurb/vercel` |
| Cloudflare Workers | `@vurb/cloudflare` |
| Any Node.js server | Stdio / HTTP+SSE transport |
Full deployment guides: [Production Server](https://vurb.vinkius.com/cookbook/production-server) ยท [Vercel Adapter](https://vurb.vinkius.com/vercel-adapter) ยท [Cloudflare Adapter](https://vurb.vinkius.com/cloudflare-adapter)
### Running Locally via stdio
If you prefer to run the server locally and connect via **stdio** โ the native MCP transport used by Claude Desktop, Cursor, and Windsurf:
```bash
# 1. Install dependencies
npm install
# 2. Build
npm run build
# 3. Test it directly (optional)
node dist/server.js
```
Then add it to your MCP client config (e.g. `claude_desktop_config.json`):
```json
{
"mcpServers": {
"oss-license-auditor": {
"command": "node",
"args": ["/absolute/path/to/oss-license-auditor/dist/server.js"]
}
}
}
```
Or run without cloning via `npx` (after the package is published):
```json
{
"mcpServers": {
"oss-license-auditor": {
"command": "npx",
"args": ["-y", "@vinkius/oss-license-auditor"]
}
}
}
```
> **Note:** The classification logic is fully offline โ only the npm registry fetch requires network. The SPDX lookup table and policy engine have no external dependencies.
## Development
```bash
# Install dependencies
npm install
# Development server with HMR
vurb dev
# Type-check
npm run typecheck
# Run tests
npm test
```
### Project Structure
```
src/
โโโ data/ โ License policy and SPDX classification
โ โโโ types.ts
โ โโโ license-policy.ts 47 SPDX identifiers + alias normalization + OR/AND expressions
โโโ engine/ โ npm registry resolution and audit logic
โ โโโ npm-registry.ts Batch fetch, 10 concurrent, 8s timeout, graceful fallback
โ โโโ audit-engine.ts fetch โ classify โ apply policy โ build report
โโโ models/ M โ defineModel()
โ โโโ index.ts
โโโ views/ V โ definePresenter()
โ โโโ index.ts
โโโ agents/ A โ Tool definitions
โ โโโ license/
โ โโโ audit.tool.ts
โ โโโ check.tool.ts
โ โโโ policy.tool.ts
โ โโโ tree.tool.ts
โโโ vurb.ts Shared Vurb instance
โโโ server.ts Bootstrap
```
## Built with Vurb.ts
| Feature | Usage |
|---|---|
| `defineModel()` | Domain models with guidance labels |
| `definePresenter()` | Dynamic rules based on blocked count, Mermaid charts, suggestActions |
| `f.query()` | All tools are read-only โ no state mutation |
| `.concurrency()` | 5 active / 20 queued for audit, 3/10 for tree |
| `.egress()` | 2MB guard on audit, 4MB on tree |
| `.stale()` | Real-time โ npm registry data must not be cached |
| `.cached()` | Static policy rules for `license.policy` |
| `f.error()` | Self-healing errors with recovery suggestions |
| `.instructions()` | AI-first guidance: "call BEFORE npm install" |
| `agentLimit` | Results truncated at 50 with pagination guidance |
| Explicit tool imports | V8-safe bootstrap โ no filesystem access at runtime |
[Get started with Vurb.ts โ](https://github.com/vinkius-labs/vurb.ts) ยท [Documentation โ](https://vurb.vinkius.com)
## License
Apache 2.0 โ See [LICENSE](LICENSE) for details.
TDQS
Scored across 4 tools
Each tool maps to a distinct scope: batch audit of a package.json, single-package check, static policy reference, and a one-level transitive dependency tree. The only real overlap is audit vs. license_tree, but the descriptions explicitly steer users (tree = transitive tracing, audit = fast summary), which resolves most confusion.
All four tools use a uniform snake_case `license_<noun/verb>` pattern (audit, check, policy, tree) with no style deviations. Minor cosmetic issue: descriptions refer to tools as `license.check`/`license.audit` with dots, which doesn't match the actual underscore names, but the naming convention itself is consistent.
Four tools is well-scoped for a narrow license-auditing domain, and each one covers a genuinely different need (bulk audit, pre-install check, policy lookup, transitive tracing). No filler or redundant tools.
The surface covers the core lifecycle: check a candidate package, audit a whole manifest, inspect transitive origins, and reference the policy that drives verdicts. Gaps are minor โ the policy is read-only with no way to override/configure it, there's no remediation suggestion tool (e.g. finding an allowed alternative) and it's npm-only, but agents can work around these via the existing tools.