Skip to content
System One

prasanth263/maza

A local MCP gateway that uses Jev for tool discovery across connected MCP servers, with credential storage, a CLI and a dashboard.

prasanth263/maza on GitHub

Stars
0
Forks
1
Language
JavaScript
License
MIT
Last push
18 Sep 2026

Read from GitHub on . Counts change daily.

How it uses Jev

const key = this.secrets.get(this.config.jev.credential);
if (/placeholder|mock|your.key/i.test(key)) throw new Error('JEV_KEY_PLACEHOLDER');
const started = performance.now();
const res = await this.fetch('https://api.typesafe.ai/v1/systemone', { method:'POST', redirect:'error', headers:{'Content-Type':'application/json', Authorization:`Bearer ${key}`}, body:JSON.stringify(body), signal:AbortSignal.timeout(30000)});
if (!res.ok) throw new Error(`JEV_HTTP_${res.status}`);
const data = await res.json();
const a = data.answers?.route;
const keys = Object.keys(body.questions.route.criteria);
if (!a || !keys.includes(a.choice) || typeof a.confidence !== 'number' || a.confidence < 0 || a.confidence > 1 || !a.probabilities || Object.keys(a.probabilities).length !== keys.length || keys.some(k => !Number.isFinite(a.probabilities[k]) || a.probabilities[k] < 0 || a.probabilities[k] > 1) || Math.abs(Object.values(a.probabilities).reduce((x,y)=>x+y,0)-1) > .02) throw new Error('JEV_INVALID_RESPONSE');
const ranked = entries.map((t,i) => ({tool:t, probability:a.probabilities[`t${i}`]})).sort((x,y)=>y.probability-x.probability);
const maximum = Math.max(...Object.values(a.probabilities));
if (a.probabilities[a.choice] + .0001 < maximum) throw new Error('JEV_INVALID_RESPONSE');
return {ranked, noneProbability:a.probabilities[NONE], confidence:a.confidence, model:data.model, usage:data.usage, duration_ms:performance.now()-started, inputBytes:bytes(body)};

View in src/routing.js

Open on GitHub

More like this

Use cases this is tagged with