# n2-QLN

A semantic tool router for MCP that lets an AI model call one small router tool instead of loading a thousand separate tool definitions into its context, indexing every real tool in a local database and searching it at request time.

n2-QLN indexes every connected tool in its own SQLite engine and exposes only one tool, n2_qln_call, to the model, so a request that would otherwise cost roughly 50,000 tokens of tool definitions costs about 200 instead; the model searches for the right tool and QLN executes it with an automatic fallback if the chosen tool fails. Search runs in three stages, a fast trigger match, BM25 keyword search, and semantic vector search using optional Ollama embeddings, and curated boost keywords carry double weight in the BM25 stage for precision.

An MCP auto-discovery feature scans connected external MCP servers and indexes their tools automatically, turning n2-QLN into a hub for a whole collection of servers, and a circuit breaker automatically disables a tool that fails three times in a row and self-recovers after a timeout. Provider manifests under a providers folder are hot-reloaded and re-indexed on edit, tool names are enforced against a verb-target naming convention with a minimum description length, and usage counts and success rates feed back into the router's own ranking over time.

It is written in TypeScript, uses SQLite through the sql.js WebAssembly build with no native dependencies, installs with npm, and its documentation is offered in Korean.

Website: https://nton2.com
