Repository avatar
Search & Data Extraction
v0.1.0
active

facadec

io.github.L00PLeGeNd/facadec

Compile fat MCP tool catalogs into search_tools, describe_tool, and call_tool.

Documentation

facadec

CI npm Playground MCP Registry Glama

Facade Compiler for MCP

Turn a fat MCP tool catalog into three host-facing tools:

search_tools · describe_tool · call_tool

Live playground · npm · Tester feedback · Security

facadec playground

Official upstreams: filesystem + memory + everything → host still sees 3 tools


Why it exists

MCP makes wiring servers easy. It also dumps every tool schema into the prompt.

PainWhat happens
Token bloatDozens of schemas before the task starts
Sibling confusionsearch_issues vs search_code vs search_docs
Fragile selectionDemos pass; real catalogs miss

facadec treats that as a compiler + runtime problem: shrink what the model sees, keep upstream tools reachable, measure the cost.


Install

npm i -g facadec
facadec --help

From source:

git clone https://github.com/L00PLeGeNd/facadec.git
cd facadec
npm install
npm run build
npm run quickstart

Local playground (this web page)

npm install
npm run web:dev

Opens http://127.0.0.1:5173/.
Production-style preview: npm run web:build && npm run web:preview.


60-second Cursor path

  1. npm i -g facadec
  2. Copy examples/mcp.cursor.npm.json (or mcp.cursor.real.json for official multi-server)
  3. Fix the absolute config path
  4. Restart MCP → host lists exactly three tools
  5. Ask the agent to search, describe, then call

Handshake without the Cursor UI:

npm run verify:cursor

Measured compare

Synthetic 220 tools · 12 tasks · 3 runs · tokenizer gpt-tokenizer/cl100k_base

Full-path tokens = exposure + discovery + describe + call.

ArmHitTokens (mean)Exec success
Raw MCP100%~13 411100%
Lazy loading100%~404100%
facadec rules100%~649100%
facadec hybrid100%~711100%
npm run benchmark:compare

Report: bench/results/comparison-latest.md


How it works

upstream MCP / mocks
        │
        ▼
    collect → catalog
        │
        ▼
normalize → validate → analyze → select
  → rewrite → dedupe → consolidate → generate
        │
        ▼
search_tools / describe_tool / call_tool
        │
        ▼
  Cursor / any MCP host

Default retrieval is hybrid (BM25 recall + rules/schema rerank). Runtime keeps per-search surfaces, schema validation, timeouts, and permission gates.


Examples

ModeCommand
Offline mocknpm run serve
Live echonpm run serve:live
Echo + notesnpm run serve:multi
Real official MCPsnpm run collect:real then npm run serve:real

Real config wires @modelcontextprotocol/server-filesystem, server-memory, and server-everything behind one facade. Details: examples/README.md.


CLI

facadec collect        --config <path> [--live]
facadec compile        --config <path> --query <text> [--limit <n>] [--live]
facadec serve          --config <path> [--demo <query>] [--jsonl] [--live]
facadec benchmark      --config <path> --tasks <path>
facadec compare        (--config … --tasks … | --synthetic [n]) [--runs <n>] [--out <path>]
facadec retrieve-eval  [--tools <n>]

Not another router

Routers stop at retrieval. facadec also:

  • rewrites and dedupes tools
  • emits a stable three-tool facade
  • validates calls and gates dangerous names
  • publishes raw / lazy / facade cost compares

If you only have a handful of tiny tools, skip it. If the catalog is growing faster than the context window, this is the layer.


Looking for testers

Need 5–10 install → wire → real-task reports.


Status

0.2.0 — prove discovery, execution, and evaluation. Not an agent framework.

MIT · Changelog · Compatibility · Security

NPM
facadec
Install Command
npm install facadec