@usex/mikrotik-mcp 3.58.0 → 3.59.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/cli.js +31 -3
  2. package/dist/index.d.ts +5 -0
  3. package/dist/index.js +1 -1
  4. package/dist/shared/{cli-zq0rg72c.js → cli-2dyvnv9v.js} +1 -1
  5. package/dist/shared/{cli-r5p22dag.js → cli-jq168zrj.js} +7 -5
  6. package/dist/shared/{library-41tn0b6b.js → library-0zd2tej9.js} +1 -1
  7. package/dist/shared/{library-84jwmz7a.js → library-21t1cncr.js} +7 -5
  8. package/dist/ui/aaa.html +1 -1
  9. package/dist/ui/connected-devices.html +1 -1
  10. package/dist/ui/dashboard.html +1 -1
  11. package/dist/ui/firewall-audit.html +1 -1
  12. package/dist/ui/firewall.html +1 -1
  13. package/dist/ui/interfaces.html +1 -1
  14. package/dist/ui/observability.html +1 -1
  15. package/dist/ui/records.html +1 -1
  16. package/package.json +1 -1
  17. package/schemas/README.md +5 -5
  18. package/schemas/config.schema.json +47 -10
  19. package/schemas/tool-catalog.json +2941 -736
  20. package/schemas/tools/check_server_pulse.json +12 -0
  21. package/schemas/tools/config_check_drift.json +5 -1
  22. package/schemas/tools/config_reconcile.json +3 -1
  23. package/schemas/tools/config_set_baseline.json +4 -1
  24. package/schemas/tools/correlate_events.json +4 -1
  25. package/schemas/tools/diagnose.json +3 -1
  26. package/schemas/tools/get_filter_rule.json +1 -1
  27. package/schemas/tools/memory_add_observations.json +7 -2
  28. package/schemas/tools/memory_create_entities.json +7 -2
  29. package/schemas/tools/memory_create_relations.json +8 -2
  30. package/schemas/tools/memory_delete_entities.json +3 -1
  31. package/schemas/tools/memory_delete_observations.json +7 -2
  32. package/schemas/tools/memory_delete_relations.json +8 -2
  33. package/schemas/tools/memory_open_nodes.json +3 -1
  34. package/schemas/tools/memory_search_nodes.json +3 -1
  35. package/schemas/tools/suggest_fix.json +3 -1
  36. package/schemas/tools/trace_path.json +5 -1
@@ -117,7 +117,7 @@ Boolean requesting whether a visible border and background is provided by the ho
117
117
  - "model": Tool visible to and callable by the agent
118
118
  - "app": Tool callable by the app from this server only`),csp:Jf().optional(),permissions:Jf().optional()}),I({mimeTypes:F(j()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),I({method:V(`ui/download-file`),params:I({contents:F(R([r_,i_])).describe(`Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.`)})}),I({method:V(`ui/message`),params:I({role:V(`user`).describe(`Message role, currently only "user" is supported.`),content:F(a_).describe(`Message content blocks (text, image, etc.).`)})}),I({method:V(`ui/notifications/sandbox-resource-ready`),params:I({html:j().describe(`HTML content to load into the inner iframe.`),sandbox:j().optional().describe(`Optional override for the inner iframe's sandbox attribute.`),csp:yv.optional().describe(`CSP configuration from resource metadata.`),permissions:bv.optional().describe(`Sandbox permissions from resource metadata.`)})});var Mv=I({method:V(`ui/notifications/tool-result`),params:m_.describe(`Standard MCP tool execution result.`)}),Nv=I({toolInfo:I({id:Ph.optional().describe(`JSON-RPC id of the tools/call request.`),tool:d_.describe(`Tool definition including name, inputSchema, etc.`)}).optional().describe(`Metadata of the tool call that instantiated this App.`),theme:pv.optional().describe(`Current color theme preference.`),styles:Tv.optional().describe(`Style configuration for theming the app.`),displayMode:mv.optional().describe(`How the UI is currently displayed.`),availableDisplayModes:F(mv).optional().describe(`Display modes the host supports.`),containerDimensions:R([I({height:M().describe(`Fixed container height in pixels.`)}),I({maxHeight:R([M(),Gf()]).optional().describe(`Maximum container height in pixels.`)})]).and(R([I({width:M().describe(`Fixed container width in pixels.`)}),I({maxWidth:R([M(),Gf()]).optional().describe(`Maximum container width in pixels.`)})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
119
119
  container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:j().optional().describe(`User's language and region preference in BCP 47 format.`),timeZone:j().optional().describe(`User's timezone in IANA format.`),userAgent:j().optional().describe(`Host application identifier.`),platform:R([V(`web`),V(`desktop`),V(`mobile`)]).optional().describe(`Platform type for responsive design decisions.`),deviceCapabilities:I({touch:N().optional().describe(`Whether the device supports touch input.`),hover:N().optional().describe(`Whether the device supports hover interactions.`)}).optional().describe(`Device input capabilities.`),safeAreaInsets:I({top:M().describe(`Top safe area inset in pixels.`),right:M().describe(`Right safe area inset in pixels.`),bottom:M().describe(`Bottom safe area inset in pixels.`),left:M().describe(`Left safe area inset in pixels.`)}).optional().describe(`Mobile safe area boundaries in pixels.`)}).passthrough(),Pv=I({method:V(`ui/notifications/host-context-changed`),params:Nv.describe(`Partial context update containing only changed fields.`)});I({method:V(`ui/update-model-context`),params:I({content:F(a_).optional().describe(`Context content blocks (text, image, etc.).`),structuredContent:z(j(),P().describe(`Structured content for machine-readable context data.`)).optional().describe(`Structured content for machine-readable context data.`)})}),I({method:V(`ui/initialize`),params:I({appInfo:Yh.describe(`App identification (name and version).`),appCapabilities:kv.describe(`Features and capabilities this app provides.`),protocolVersion:j().describe(`Protocol version this app supports.`)})});var Fv=I({protocolVersion:j().describe(`Negotiated protocol version string (e.g., "2025-11-21").`),hostInfo:Yh.describe(`Host application identification and version.`),hostCapabilities:Ov.describe(`Features and capabilities provided by the host.`),hostContext:Nv.describe(`Rich context about the host environment.`)}).passthrough(),Iv={target:`draft-2020-12`};async function Lv(e,t){let n=e[`~standard`];if(n.jsonSchema)return n.jsonSchema[t](Iv);if(n.vendor===`zod`){let{z:n}=await lv(async()=>{let{z:e}=await Promise.resolve().then(()=>(Ch(),xh));return{z:e}},void 0,import.meta.url);return n.toJSONSchema(e,{io:t})}throw Error(`Schema (vendor: ${n.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function Rv(e,t,n=``){let r=await e[`~standard`].validate(t);if(r.issues){let e=r.issues.map(e=>{let t=e.path?.map(e=>typeof e==`object`?e.key:e).join(`.`);return t?`${t}: ${e.message}`:e.message}).join(`; `);throw Error(n+e)}return r.value}function zv(){let e=document.documentElement.getAttribute(`data-theme`);return e===`dark`||e===`light`?e:document.documentElement.classList.contains(`dark`)?`dark`:`light`}function Bv(e){let t=document.documentElement;t.setAttribute(`data-theme`,e),t.style.colorScheme=e}function Vv(e,t=document.documentElement){for(let[n,r]of Object.entries(e))r!==void 0&&t.style.setProperty(n,r)}function Hv(e){if(document.getElementById(`__mcp-host-fonts`))return;let t=document.createElement(`style`);t.id=`__mcp-host-fonts`,t.textContent=e,document.head.appendChild(t)}var Uv=class e extends uv{_appInfo;_capabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_assertInitialized(e){if(this._initializedSent)return;let t=`[ext-apps] App.${e}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(t);console.warn(`${t}. This will throw in a future release.`)}eventSchemas={toolinput:xv,toolinputpartial:Sv,toolresult:Mv,toolcancelled:Cv,hostcontextchanged:Pv};static ONE_SHOT_EVENTS=new Set([`toolinput`,`toolinputpartial`,`toolresult`,`toolcancelled`]);_everHadListener=new Set;_assertHandlerTiming(t){if(!e.ONE_SHOT_EVENTS.has(t)||this._everHadListener.has(t)||(this._everHadListener.add(t),!this._initializedSent))return;let n=`[ext-apps] "${String(t)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(n);console.warn(n)}setEventHandler(e,t){t&&this._assertHandlerTiming(e),super.setEventHandler(e,t)}addEventListener(e,t){this._assertHandlerTiming(e),super.addEventListener(e,t)}onEventDispatch(e,t){e===`hostcontextchanged`&&(this._hostContext={...this._hostContext,...t})}constructor(e,t={},n={autoResize:!0}){super(n),this._appInfo=e,this._capabilities=t,this.options=n,n.allowUnsafeEval||a({jitless:!0}),this.setRequestHandler(ag,e=>(console.log(`Received ping:`,e.params),{})),this.setEventHandler(`hostcontextchanged`,void 0)}registerCapabilities(e){if(this.transport)throw Error(`Cannot register capabilities after transport is established`);this._capabilities=av(this._capabilities,e)}registerTool(e,t,n){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let r=this,i=()=>{r._initializedSent&&r._capabilities.tools?.listChanged&&r.sendToolListChanged()},a=t.inputSchema!==void 0,o={title:t.title,description:t.description,inputSchema:t.inputSchema,outputSchema:t.outputSchema,annotations:t.annotations,_meta:t._meta,enabled:!0,enable(){this.enabled=!0,i()},disable(){this.enabled=!1,i()},update(e){Object.assign(this,e),i()},remove(){r._registeredTools[e]===o&&(delete r._registeredTools[e],i())},handler:async(t,r)=>{if(!o.enabled)throw Error(`Tool ${e} is disabled`);let i;if(a){let a=o.inputSchema;i=await n(a?await Rv(a,t??{},`Invalid input for tool ${e}: `):t??{},r)}else i=await n(r);return o.outputSchema&&!i.isError&&(i.structuredContent=await Rv(o.outputSchema,i.structuredContent,`Invalid output for tool ${e}: `)),i}};return this._registeredTools[e]=o,!this._capabilities.tools&&!this.transport&&this.registerCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),i(),o}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(e,t)=>{let n=this._registeredTools[e.name];if(!n)throw Error(`Tool ${e.name} not found`);return n.handler(e.arguments,t)},this.onlisttools=async(e,t)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([e,t])=>t.enabled).map(async([e,t])=>{let n={name:e,title:t.title,description:t.description,inputSchema:t.inputSchema?await Lv(t.inputSchema,`input`):{type:`object`,properties:{}}};return t.outputSchema&&(n.outputSchema=await Lv(t.outputSchema,`output`)),t.annotations&&(n.annotations=t.annotations),t._meta&&(n._meta=t._meta),n}))}))}async sendToolListChanged(e={}){this._assertInitialized(`sendToolListChanged`),await this.notification({method:`notifications/tools/list_changed`,params:e})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler(`toolinput`)}set ontoolinput(e){this.setEventHandler(`toolinput`,e)}get ontoolinputpartial(){return this.getEventHandler(`toolinputpartial`)}set ontoolinputpartial(e){this.setEventHandler(`toolinputpartial`,e)}get ontoolresult(){return this.getEventHandler(`toolresult`)}set ontoolresult(e){this.setEventHandler(`toolresult`,e)}get ontoolcancelled(){return this.getEventHandler(`toolcancelled`)}set ontoolcancelled(e){this.setEventHandler(`toolcancelled`,e)}get onhostcontextchanged(){return this.getEventHandler(`hostcontextchanged`)}set onhostcontextchanged(e){this.setEventHandler(`hostcontextchanged`,e)}_onteardown;get onteardown(){return this._onteardown}set onteardown(e){this.warnIfRequestHandlerReplaced(`onteardown`,this._onteardown,e),this._onteardown=e,this.replaceRequestHandler(Ev,(e,t)=>{if(!this._onteardown)throw Error(`No onteardown handler set`);return this._onteardown(e.params,t)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced(`oncalltool`,this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(g_,(e,t)=>{if(!this._oncalltool)throw Error(`No oncalltool handler set`);return this._oncalltool(e.params,t)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(e){this.warnIfRequestHandlerReplaced(`onlisttools`,this._onlisttools,e),this._onlisttools=e,this.replaceRequestHandler(f_,(e,t)=>{if(!this._onlisttools)throw Error(`No onlisttools handler set`);return this._onlisttools(e.params,t)})}assertCapabilityForMethod(e){switch(e){case`sampling/createMessage`:if(!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${e})`);break}}assertRequestHandlerCapability(e){switch(e){case`tools/call`:case`tools/list`:if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${e})`);return;case`ping`:case`ui/resource-teardown`:return;default:throw Error(`No handler for method ${e} registered`)}}assertNotificationCapability(e){}assertTaskCapability(e){throw Error(`Tasks are not supported in MCP Apps`)}assertTaskHandlerCapability(e){throw Error(`Task handlers are not supported in MCP Apps`)}async callServerTool(e,t){if(this._assertInitialized(`callServerTool`),typeof e==`string`)throw Error(`callServerTool() expects an object as its first argument, but received a string ("${e}"). Did you mean: callServerTool({ name: "${e}", arguments: { ... } })?`);return await this.request({method:`tools/call`,params:e},m_,{onprogress:()=>{},resetTimeoutOnProgress:!0,...t})}async readServerResource(e,t){return this._assertInitialized(`readServerResource`),await this.request({method:`resources/read`,params:e},zg,t)}async listServerResources(e,t){return this._assertInitialized(`listServerResources`),await this.request({method:`resources/list`,params:e},Ng,t)}async createSamplingMessage(e,t){this._assertInitialized(`createSamplingMessage`);let n=e.tools?M_:j_;return await this.request({method:`sampling/createMessage`,params:e},n,t)}sendMessage(e,t){return this._assertInitialized(`sendMessage`),this.request({method:`ui/message`,params:e},vv,t)}sendLog(e){return this.notification({method:`notifications/message`,params:e})}updateModelContext(e,t){return this._assertInitialized(`updateModelContext`),this.request({method:`ui/update-model-context`,params:e},Wh,t)}openLink(e,t){return this._assertInitialized(`openLink`),this.request({method:`ui/open-link`,params:e},gv,t)}sendOpenLink=this.openLink;downloadFile(e,t){return this._assertInitialized(`downloadFile`),this.request({method:`ui/download-file`,params:e},_v,t)}requestTeardown(e={}){return this.notification({method:`ui/notifications/request-teardown`,params:e})}requestDisplayMode(e,t){return this._assertInitialized(`requestDisplayMode`),this.request({method:`ui/request-display-mode`,params:e},Av,t)}sendSizeChanged(e){return this.notification({method:`ui/notifications/size-changed`,params:e})}setupSizeChangedNotifications(){let e=!1,t=0,n=0,r=()=>{e||(e=!0,requestAnimationFrame(()=>{e=!1;let r=document.documentElement,i=r.style.height;r.style.height=`max-content`;let a=Math.ceil(r.getBoundingClientRect().height);r.style.height=i;let o=Math.ceil(window.innerWidth);(o!==t||a!==n)&&(t=o,n=a,this.sendSizeChanged({width:o,height:a}))}))};r();let i=new ResizeObserver(r);return i.observe(document.documentElement),i.observe(document.body),()=>i.disconnect()}async connect(e=new fv(window.parent,window.parent),t){if(this.transport)throw Error(`App is already connected. Call close() before connecting again.`);this._initializedSent=!1,await super.connect(e);try{let e=await this.request({method:`ui/initialize`,params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:dv}},Fv,t);if(e===void 0)throw Error(`Server sent invalid initialize result: ${e}`);this._hostCapabilities=e.hostCapabilities,this._hostInfo=e.hostInfo,this._hostContext=e.hostContext,await this.notification({method:`ui/notifications/initialized`}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(e){throw this.close(),e}}};function $(e,t={},...n){let r=document.createElement(e);for(let[e,n]of Object.entries(t))e===`class`?r.className=n:r.setAttribute(e,n);for(let e of n.flat())e===!1||e==null||r.append(e instanceof Node?e:document.createTextNode(String(e)));return r}function Wv(e,t,n={}){let r=$(`button`,{class:`btn${n.class?` ${n.class}`:``}`,...n.title?{title:n.title}:{}});return r.textContent=e,n.disabled&&(r.disabled=!0),r.addEventListener(`click`,t),r}async function Gv(e){try{await navigator.clipboard.writeText(e)}catch{let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.append(t),t.select();try{document.execCommand(`copy`)}finally{t.remove()}}}function Kv(e,t,n=`text/plain`){let r=new Blob([t],{type:`${n};charset=utf-8`}),i=URL.createObjectURL(r),a=$(`a`,{href:i,download:e});document.body.append(a),a.click(),a.remove(),URL.revokeObjectURL(i)}function qv(e,t){let n=e=>/[",\n]/.test(e)?`"${e.replace(/"/g,`""`)}"`:e;return`${e.map(n).join(`,`)}\n${t.map(t=>e.map(e=>n(t[e]??``)).join(`,`)).join(`
120
- `)}\n`}function Jv(e){e.onhostcontextchanged=e=>{if(e.theme&&Bv(e.theme),e.styles?.variables&&Vv(e.styles.variables),e.styles?.css?.fonts&&Hv(e.styles.css.fonts),e.safeAreaInsets){let{top:t,right:n,bottom:r,left:i}=e.safeAreaInsets;document.body.style.padding=`${t+16}px ${n+16}px ${r+16}px ${i+16}px`}},Bv(zv())}var Yv=document.getElementById(`app`),Xv=null,Zv=``,Qv=null,$v=1,ey=new Set,ty=null,ny=!1,ry=0,iy=null,ay={};function oy(e){let t=[`#`,`flags`].filter(t=>e.columns.includes(t));return[...t,...e.columns.filter(e=>!t.includes(e))]}function sy(e){let t=Zv.trim().toLowerCase(),n=e.rows;if(t&&(n=n.filter(e=>Object.values(e).some(e=>e.toLowerCase().includes(t)))),ey.size&&(n=n.filter(e=>{let t=e.flags??``;return[...ey].every(e=>t.includes(e))})),Qv){let e=Qv;n=[...n].sort((t,n)=>{let r=t[e]??``,i=n[e]??``,a=Number(r),o=Number(i);return(r!==``&&i!==``&&!Number.isNaN(a)&&!Number.isNaN(o)?a-o:r.localeCompare(i))*$v})}return n}function cy(e){let t=new Set;for(let n of e.rows)for(let e of n.flags??``)t.add(e);return[...t].sort()}function ly(e){return Object.entries(e).filter(([e])=>e!==`#`&&e!==`flags`).map(([e,t])=>/\s/.test(t)?`${e}="${t}"`:`${e}=${t}`).join(` `)}function uy(e){let t=cy(e);return t.length?$(`div`,{class:`toolbar`},...t.map(t=>{let n=e.flags[t]??t,r=ey.has(t);return Wv(`${t} · ${n}`,()=>{r?ey.delete(t):ey.add(t),yy()},{class:r?`is-active`:``,title:`Filter rows flagged "${n}"`})})):!1}function dy(e){let t=$(`th`,e===`#`?{class:`col-num`}:{},e);return Qv===e&&t.append($(`span`,{class:`arrow`},$v===1?`▲`:`▼`)),t.addEventListener(`click`,()=>{Qv===e?$v=$v===1?-1:1:(Qv=e,$v=1),yy()}),t}function fy(e,t){let n=oy(e),r=$(`thead`,{},$(`tr`,{},...n.map(dy))),i=$(`tbody`);return t.forEach(t=>{let r=$(`tr`,(t.flags??``).includes(`X`)?{class:`is-disabled`}:{});for(let e of n)r.append($(`td`,e===`#`?{class:`col-num`}:{},t[e]??`—`));r.addEventListener(`click`,()=>{ty=e.rows.indexOf(t),yy()}),i.append(r)}),$(`div`,{class:`tablewrap`},$(`table`,{class:`tbl`},r,i))}function py(e){let t=$(`div`,{class:`kv__body`});for(let[n,r]of Object.entries(e))t.append($(`div`,{class:`kv__k`},n),$(`div`,{class:`kv__v`},r||`—`));return t}function my(e){if(ty==null||!e.rows[ty])return!1;let t=e.rows[ty],n=t.name??t[`#`]??`record`;return $(`div`,{class:`drawer`},$(`div`,{class:`drawer__hd`},$(`span`,{},`Row `),$(`b`,{},String(n)),$(`span`,{class:`hd__spacer`}),Wv(`Copy as CLI`,()=>void Gv(ly(t)),{title:`Copy key=value pairs`}),Wv(`Close`,()=>{ty=null,yy()})),py(t))}function hy(e,t){let n=$(`input`,{class:`search`,type:`search`,placeholder:`Search ${e.count} row${e.count===1?``:`s`}…`,value:Zv});n.addEventListener(`input`,()=>{Zv=n.value,ty=null,_y()});let r=$(`select`,{class:`btn`,title:`Auto-refresh interval`});for(let[e,t]of[[`Auto: off`,`0`],[`Auto: 5s`,`5000`],[`Auto: 15s`,`15000`],[`Auto: 60s`,`60000`]]){let n=$(`option`,{value:t},e);Number(t)===ry&&(n.selected=!0),r.append(n)}r.addEventListener(`change`,()=>Cy(Number(r.value)));let i=()=>sy(e),a=oy(e);return $(`div`,{class:`toolbar`},$(`div`,{class:`grow`},n),Wv(ny?`Refreshing…`:`↻ Refresh`,Sy,{disabled:ny}),r,Wv(`CSV`,()=>Kv(`${e.tool}.csv`,qv(a,i()),`text/csv`),{title:`Export visible rows as CSV`}),Wv(`JSON`,()=>Kv(`${e.tool}.json`,JSON.stringify(i(),null,2),`application/json`),{title:`Export visible rows as JSON`}),Wv(`Copy`,()=>void Gv(JSON.stringify(i(),null,2)),{title:`Copy visible rows as JSON`}),$(`span`,{class:`pill count-pill`},`showing `,$(`b`,{},`${t}/${e.count}`)))}function gy(e){return $(`header`,{class:`hd`},$(`span`,{class:`hd__dot`}),$(`div`,{},$(`h1`,{class:`hd__title`},e.title),$(`p`,{class:`hd__sub`},e.tool)),$(`span`,{class:`hd__spacer`}))}function _y(){if(!Xv)return;let e=document.getElementById(`results`);if(!e){yy();return}e.replaceChildren(vy(Xv));let t=document.querySelector(`.count-pill b`);t&&(t.textContent=`${sy(Xv).length}/${Xv.count}`)}function vy(e){let t=sy(e);return e.rows.length===0?e.raw?$(`pre`,{class:`raw`},e.raw):$(`div`,{class:`empty`},`No records returned.`):e.kind===`record`&&e.rows.length===1?py(e.rows[0]):t.length===0?$(`div`,{class:`empty`},`No rows match the current filter.`):fy(e,t)}function yy(){if(!Xv){Yv.replaceChildren($(`div`,{class:`skeleton`},`Waiting for data…`));return}let e=Xv,t=sy(e).length,n=e.kind===`list`&&e.rows.length>0,r=[gy(e),n&&hy(e,t),n&&uy(e),$(`div`,{id:`results`},vy(e)),my(e),$(`footer`,{class:`foot`},$(`span`,{},`format: ${e.format}`),$(`span`,{class:`grow`}),$(`span`,{},`updated ${new Date(e.generatedAt).toLocaleTimeString()}`))];Yv.replaceChildren(...r.filter(Boolean))}var by=new Uv({name:`mikrotik-records`,version:`1.0.0`});function xy(e){e&&typeof e==`object`&&e.__mikrotikView===`records`&&(Xv=e,ty=null,yy())}async function Sy(){if(!(ny||!Xv)){ny=!0,yy();try{xy((await by.callServerTool({name:Xv.tool,arguments:ay})).structuredContent)}catch(e){console.error(`[records] refresh failed`,e)}finally{ny=!1,yy()}}}function Cy(e){ry=e,iy&&=(clearInterval(iy),null),e>0&&(iy=setInterval(()=>void Sy(),e)),yy()}by.ontoolresult=e=>{console.debug(`[records] ontoolresult fired`,e),xy(e.structuredContent)},by.ontoolinput=e=>{e&&typeof e==`object`&&`arguments`in e&&(ay=e.arguments??{}),Xv||yy()},Jv(by),by.onteardown=async()=>(iy&&clearInterval(iy),{}),yy(),by.connect().then(()=>console.debug(`[records] connect OK`,{hostCaps:by.getHostCapabilities()})).catch(e=>console.error(`[records] connect failed`,e));
120
+ `)}\n`}function Jv(e){e.onhostcontextchanged=e=>{if(e.theme&&Bv(e.theme),e.styles?.variables&&Vv(e.styles.variables),e.styles?.css?.fonts&&Hv(e.styles.css.fonts),e.safeAreaInsets){let{top:t,right:n,bottom:r,left:i}=e.safeAreaInsets;document.body.style.padding=`${t+16}px ${n+16}px ${r+16}px ${i+16}px`}},Bv(zv())}var Yv=1e4;async function Xv(e,t,n){try{return await e.connect(void 0,{timeout:Yv}),console.warn(`[${t}] connected`,{host:e.getHostVersion(),caps:e.getHostCapabilities()}),!0}catch(e){console.error(`[${t}] connect failed`,e);let r=e instanceof Error&&/timed?\s*out/i.test(e.message)?`The MCP App host did not respond — make sure your client supports MCP Apps (ext-apps).`:`Connection failed: ${e instanceof Error?e.message:String(e)}`;return n.replaceChildren($(`div`,{class:`skeleton`},r)),!1}}var Zv=document.getElementById(`app`),Qv=null,$v=``,ey=null,ty=1,ny=new Set,ry=null,iy=!1,ay=0,oy=null,sy={};function cy(e){let t=[`#`,`flags`].filter(t=>e.columns.includes(t));return[...t,...e.columns.filter(e=>!t.includes(e))]}function ly(e){let t=$v.trim().toLowerCase(),n=e.rows;if(t&&(n=n.filter(e=>Object.values(e).some(e=>e.toLowerCase().includes(t)))),ny.size&&(n=n.filter(e=>{let t=e.flags??``;return[...ny].every(e=>t.includes(e))})),ey){let e=ey;n=[...n].sort((t,n)=>{let r=t[e]??``,i=n[e]??``,a=Number(r),o=Number(i);return(r!==``&&i!==``&&!Number.isNaN(a)&&!Number.isNaN(o)?a-o:r.localeCompare(i))*ty})}return n}function uy(e){let t=new Set;for(let n of e.rows)for(let e of n.flags??``)t.add(e);return[...t].sort()}function dy(e){return Object.entries(e).filter(([e])=>e!==`#`&&e!==`flags`).map(([e,t])=>/\s/.test(t)?`${e}="${t}"`:`${e}=${t}`).join(` `)}function fy(e){let t=uy(e);return t.length?$(`div`,{class:`toolbar`},...t.map(t=>{let n=e.flags[t]??t,r=ny.has(t);return Wv(`${t} · ${n}`,()=>{r?ny.delete(t):ny.add(t),xy()},{class:r?`is-active`:``,title:`Filter rows flagged "${n}"`})})):!1}function py(e){let t=$(`th`,e===`#`?{class:`col-num`}:{},e);return ey===e&&t.append($(`span`,{class:`arrow`},ty===1?`▲`:`▼`)),t.addEventListener(`click`,()=>{ey===e?ty=ty===1?-1:1:(ey=e,ty=1),xy()}),t}function my(e,t){let n=cy(e),r=$(`thead`,{},$(`tr`,{},...n.map(py))),i=$(`tbody`);return t.forEach(t=>{let r=$(`tr`,(t.flags??``).includes(`X`)?{class:`is-disabled`}:{});for(let e of n)r.append($(`td`,e===`#`?{class:`col-num`}:{},t[e]??`—`));r.addEventListener(`click`,()=>{ry=e.rows.indexOf(t),xy()}),i.append(r)}),$(`div`,{class:`tablewrap`},$(`table`,{class:`tbl`},r,i))}function hy(e){let t=$(`div`,{class:`kv__body`});for(let[n,r]of Object.entries(e))t.append($(`div`,{class:`kv__k`},n),$(`div`,{class:`kv__v`},r||`—`));return t}function gy(e){if(ry==null||!e.rows[ry])return!1;let t=e.rows[ry],n=t.name??t[`#`]??`record`;return $(`div`,{class:`drawer`},$(`div`,{class:`drawer__hd`},$(`span`,{},`Row `),$(`b`,{},String(n)),$(`span`,{class:`hd__spacer`}),Wv(`Copy as CLI`,()=>void Gv(dy(t)),{title:`Copy key=value pairs`}),Wv(`Close`,()=>{ry=null,xy()})),hy(t))}function _y(e,t){let n=$(`input`,{class:`search`,type:`search`,placeholder:`Search ${e.count} row${e.count===1?``:`s`}…`,value:$v});n.addEventListener(`input`,()=>{$v=n.value,ry=null,yy()});let r=$(`select`,{class:`btn`,title:`Auto-refresh interval`});for(let[e,t]of[[`Auto: off`,`0`],[`Auto: 5s`,`5000`],[`Auto: 15s`,`15000`],[`Auto: 60s`,`60000`]]){let n=$(`option`,{value:t},e);Number(t)===ay&&(n.selected=!0),r.append(n)}r.addEventListener(`change`,()=>Ty(Number(r.value)));let i=()=>ly(e),a=cy(e);return $(`div`,{class:`toolbar`},$(`div`,{class:`grow`},n),Wv(iy?`Refreshing…`:`↻ Refresh`,wy,{disabled:iy}),r,Wv(`CSV`,()=>Kv(`${e.tool}.csv`,qv(a,i()),`text/csv`),{title:`Export visible rows as CSV`}),Wv(`JSON`,()=>Kv(`${e.tool}.json`,JSON.stringify(i(),null,2),`application/json`),{title:`Export visible rows as JSON`}),Wv(`Copy`,()=>void Gv(JSON.stringify(i(),null,2)),{title:`Copy visible rows as JSON`}),$(`span`,{class:`pill count-pill`},`showing `,$(`b`,{},`${t}/${e.count}`)))}function vy(e){return $(`header`,{class:`hd`},$(`span`,{class:`hd__dot`}),$(`div`,{},$(`h1`,{class:`hd__title`},e.title),$(`p`,{class:`hd__sub`},e.tool)),$(`span`,{class:`hd__spacer`}))}function yy(){if(!Qv)return;let e=document.getElementById(`results`);if(!e){xy();return}e.replaceChildren(by(Qv));let t=document.querySelector(`.count-pill b`);t&&(t.textContent=`${ly(Qv).length}/${Qv.count}`)}function by(e){let t=ly(e);return e.rows.length===0?e.raw?$(`pre`,{class:`raw`},e.raw):$(`div`,{class:`empty`},`No records returned.`):e.kind===`record`&&e.rows.length===1?hy(e.rows[0]):t.length===0?$(`div`,{class:`empty`},`No rows match the current filter.`):my(e,t)}function xy(){if(!Qv){Zv.replaceChildren($(`div`,{class:`skeleton`},`Waiting for data…`));return}let e=Qv,t=ly(e).length,n=e.kind===`list`&&e.rows.length>0,r=[vy(e),n&&_y(e,t),n&&fy(e),$(`div`,{id:`results`},by(e)),gy(e),$(`footer`,{class:`foot`},$(`span`,{},`format: ${e.format}`),$(`span`,{class:`grow`}),$(`span`,{},`updated ${new Date(e.generatedAt).toLocaleTimeString()}`))];Zv.replaceChildren(...r.filter(Boolean))}var Sy=new Uv({name:`mikrotik-records`,version:`1.0.0`});function Cy(e){e&&typeof e==`object`&&e.__mikrotikView===`records`&&(Qv=e,ry=null,xy())}async function wy(){if(!(iy||!Qv)){iy=!0,xy();try{Cy((await Sy.callServerTool({name:Qv.tool,arguments:sy})).structuredContent)}catch(e){console.error(`[records] refresh failed`,e)}finally{iy=!1,xy()}}}function Ty(e){ay=e,oy&&=(clearInterval(oy),null),e>0&&(oy=setInterval(()=>void wy(),e)),xy()}Sy.ontoolresult=e=>{console.warn(`[records] ontoolresult`,e),Cy(e.structuredContent)},Sy.ontoolinput=e=>{e&&typeof e==`object`&&`arguments`in e&&(sy=e.arguments??{}),Qv||xy()},Jv(Sy),Sy.onteardown=async()=>(oy&&clearInterval(oy),{}),xy(),Xv(Sy,`records`,Zv);
121
121
  </script>
122
122
  <style>
123
123
  :root{--mt-bg:var(--color-background-primary,#0b0d10);--mt-surface:var(--color-background-secondary,#14171c);--mt-surface-2:var(--color-background-tertiary,#1b1f26);--mt-border:var(--color-border-primary,#262b33);--mt-text:var(--color-text-primary,#e8eaed);--mt-text-dim:var(--color-text-secondary,#9aa3af);--mt-text-faint:var(--color-text-tertiary,#6b7280);--mt-accent:var(--color-accent-primary,#6ea8fe);--mt-good:#34d399;--mt-warn:#fbbf24;--mt-bad:#f87171;--mt-radius:var(--border-radius-md,14px);--mt-radius-sm:var(--border-radius-sm,9px);--mt-mono:var(--font-mono,ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace);--mt-sans:var(--font-sans,system-ui, -apple-system, "Segoe UI", sans-serif);--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light dark}@media (prefers-color-scheme:dark){:root{--lightningcss-light: ;--lightningcss-dark:initial}}*{box-sizing:border-box}body{background:var(--mt-bg);color:var(--mt-text);font-family:var(--mt-sans);-webkit-font-smoothing:antialiased;margin:0;padding:16px;font-size:13px;line-height:1.5}.app{gap:14px;max-width:960px;margin:0 auto;display:grid}.hd{flex-wrap:wrap;align-items:center;gap:12px;display:flex}.hd__dot{background:var(--mt-good);width:9px;height:9px;box-shadow:0 0 0 4px color-mix(in srgb, var(--mt-good) 22%, transparent);border-radius:50%}.hd__title{letter-spacing:-.01em;margin:0;font-size:17px;font-weight:650}.hd__sub{color:var(--mt-text-dim);font-family:var(--mt-mono);margin:0;font-size:12px}.hd__spacer{flex:1}.pill{border:1px solid var(--mt-border);background:var(--mt-surface);color:var(--mt-text-dim);font-family:var(--mt-mono);border-radius:999px;align-items:center;gap:6px;padding:3px 9px;font-size:11px;display:inline-flex}.pill b{color:var(--mt-text);font-weight:600}.grid{grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;display:grid}.card{background:linear-gradient(180deg, var(--mt-surface), var(--mt-surface-2));border:1px solid var(--mt-border);border-radius:var(--mt-radius);padding:14px}.card__label{color:var(--mt-text-dim);text-transform:uppercase;letter-spacing:.06em;margin:0 0 8px;font-size:11px}.card__value{font-family:var(--mt-mono);letter-spacing:-.01em;font-size:20px;font-weight:600}.toolbar{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.toolbar .grow{flex:1;min-width:140px}.search{appearance:none;border:1px solid var(--mt-border);background:var(--mt-surface);width:100%;color:var(--mt-text);font:inherit;border-radius:var(--mt-radius-sm);padding:7px 11px;font-size:13px}.search:focus{border-color:var(--mt-accent);outline:none}.search::placeholder{color:var(--mt-text-faint)}.btn{appearance:none;border:1px solid var(--mt-border);background:var(--mt-surface);color:var(--mt-text);font:inherit;border-radius:var(--mt-radius-sm);cursor:pointer;white-space:nowrap;padding:6px 11px;font-size:12px;transition:border-color .15s,background .15s}.btn:hover{border-color:var(--mt-accent);background:var(--mt-surface-2)}.btn:disabled{opacity:.5;cursor:default}.btn.is-active{border-color:var(--mt-accent);color:var(--mt-accent)}.chip{border:1px solid var(--mt-border);background:var(--mt-surface);color:var(--mt-text-dim);font-family:var(--mt-mono);border-radius:999px;align-items:center;gap:4px;padding:1px 7px;font-size:11px;display:inline-flex}.chip.is-good{color:var(--mt-good);border-color:color-mix(in srgb, var(--mt-good) 45%, var(--mt-border))}.chip.is-warn{color:var(--mt-warn);border-color:color-mix(in srgb, var(--mt-warn) 45%, var(--mt-border))}.chip.is-bad{color:var(--mt-bad);border-color:color-mix(in srgb, var(--mt-bad) 45%, var(--mt-border))}.tablewrap{border:1px solid var(--mt-border);border-radius:var(--mt-radius);max-height:70vh;overflow:auto}table.tbl{border-collapse:collapse;width:100%;font-size:12px}table.tbl th,table.tbl td{text-align:left;border-bottom:1px solid color-mix(in srgb, var(--mt-border) 55%, transparent);white-space:nowrap;font-family:var(--mt-mono);padding:7px 12px}table.tbl thead th{z-index:1;background:var(--mt-surface-2);color:var(--mt-text-dim);cursor:pointer;-webkit-user-select:none;user-select:none;font-weight:600;position:sticky;top:0}table.tbl thead th:hover{color:var(--mt-text)}table.tbl thead th .arrow{color:var(--mt-accent);margin-left:4px}table.tbl tbody tr{cursor:pointer}table.tbl tbody tr:hover{background:color-mix(in srgb, var(--mt-accent) 8%, transparent)}table.tbl tbody tr.is-disabled td,table.tbl td.col-num{color:var(--mt-text-faint)}.kv__body{border:1px solid var(--mt-border);border-radius:var(--mt-radius);grid-template-columns:minmax(120px,.4fr) 1fr;display:grid;overflow:hidden}.kv__body>div{border-bottom:1px solid color-mix(in srgb, var(--mt-border) 55%, transparent);overflow-wrap:anywhere;min-width:0;font-size:12px;font-family:var(--mt-mono);padding:7px 14px}.kv__k{color:var(--mt-text-dim);background:color-mix(in srgb, var(--mt-surface) 60%, transparent)}.kv__v{color:var(--mt-text)}.drawer{border:1px solid var(--mt-accent);border-radius:var(--mt-radius);background:var(--mt-surface);gap:10px;padding:12px;display:grid}.drawer__hd{align-items:center;gap:8px;display:flex}.drawer__hd b{font-family:var(--mt-mono)}pre.raw{border:1px solid var(--mt-border);border-radius:var(--mt-radius);background:var(--mt-surface);color:var(--mt-text);font-family:var(--mt-mono);white-space:pre;max-height:70vh;margin:0;padding:14px;font-size:12px;overflow:auto}.foot{color:var(--mt-text-faint);font-size:11px;font-family:var(--mt-mono);flex-wrap:wrap;align-items:center;gap:10px;display:flex}.foot .grow{flex:1}.skeleton,.empty{color:var(--mt-text-faint);text-align:center;padding:40px 0}.count-pill b{color:var(--mt-accent)}table.tbl td.col-num,table.tbl th.col-num{width:1%}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usex/mikrotik-mcp",
3
- "version": "3.58.0",
3
+ "version": "3.59.0",
4
4
  "description": "MCP server for MikroTik RouterOS — 660+ tools over SSH for firewall, NAT, routing, DHCP, DNS, WireGuard, wireless, QoS and more.",
5
5
  "keywords": [
6
6
  "ai",
package/schemas/README.md CHANGED
@@ -4,11 +4,11 @@ Machine-readable JSON Schemas for `@usex/mikrotik-mcp`, **generated** from the
4
4
  TypeScript source by `scripts/gen-schemas.ts` (`bun run gen:schemas`). Do not
5
5
  edit by hand — regenerate instead.
6
6
 
7
- | File | Contents |
8
- | -------------------- | ------------------------------------------------------------------------------------------ |
9
- | `config.schema.json` | The runtime configuration object (env vars / CLI flags). |
10
- | `tool-catalog.json` | Every one of the 793 tools: `name`, `risk`, `title`, `description`, and input JSON Schema. |
11
- | `tools/<name>.json` | The input JSON Schema for a single tool. |
7
+ | File | Contents |
8
+ |------|----------|
9
+ | `config.schema.json` | The runtime configuration object (env vars / CLI flags). |
10
+ | `tool-catalog.json` | Every one of the 794 tools: `name`, `risk`, `title`, `description`, and input JSON Schema. |
11
+ | `tools/<name>.json` | The input JSON Schema for a single tool. |
12
12
 
13
13
  `risk` is derived from the MCP tool annotations:
14
14
  `read` · `write` · `write-idempotent` · `destructive` · `dangerous`.
@@ -90,7 +90,11 @@
90
90
  "maximum": 9007199254740991
91
91
  }
92
92
  },
93
- "required": ["host", "port", "username"],
93
+ "required": [
94
+ "host",
95
+ "port",
96
+ "username"
97
+ ],
94
98
  "additionalProperties": false
95
99
  },
96
100
  "mac": {
@@ -109,9 +113,18 @@
109
113
  },
110
114
  "description": {
111
115
  "type": "string"
116
+ },
117
+ "disabled": {
118
+ "type": "boolean"
112
119
  }
113
120
  },
114
- "required": ["host", "username", "password", "port", "timeoutMs"],
121
+ "required": [
122
+ "host",
123
+ "username",
124
+ "password",
125
+ "port",
126
+ "timeoutMs"
127
+ ],
115
128
  "additionalProperties": false
116
129
  }
117
130
  },
@@ -128,14 +141,18 @@
128
141
  "allowedOrigins": "",
129
142
  "corsOrigins": "",
130
143
  "toolPageSize": 0,
131
- "appViews": true
144
+ "appViews": false
132
145
  },
133
146
  "type": "object",
134
147
  "properties": {
135
148
  "transport": {
136
149
  "default": "stdio",
137
150
  "type": "string",
138
- "enum": ["stdio", "sse", "streamable-http"]
151
+ "enum": [
152
+ "stdio",
153
+ "sse",
154
+ "streamable-http"
155
+ ]
139
156
  },
140
157
  "host": {
141
158
  "default": "0.0.0.0",
@@ -166,7 +183,7 @@
166
183
  "maximum": 9007199254740991
167
184
  },
168
185
  "appViews": {
169
- "default": true,
186
+ "default": false,
170
187
  "type": "boolean"
171
188
  }
172
189
  },
@@ -214,7 +231,10 @@
214
231
  "maximum": 9007199254740991
215
232
  }
216
233
  },
217
- "required": ["prefix", "presignExpiresIn"],
234
+ "required": [
235
+ "prefix",
236
+ "presignExpiresIn"
237
+ ],
218
238
  "additionalProperties": false
219
239
  },
220
240
  "dashboard": {
@@ -309,7 +329,11 @@
309
329
  "maximum": 9007199254740991
310
330
  }
311
331
  },
312
- "required": ["keepAlive", "keepAliveInterval", "idleTimeout"],
332
+ "required": [
333
+ "keepAlive",
334
+ "keepAliveInterval",
335
+ "idleTimeout"
336
+ ],
313
337
  "additionalProperties": false
314
338
  },
315
339
  "readOnly": {
@@ -354,7 +378,12 @@
354
378
  }
355
379
  }
356
380
  },
357
- "required": ["enabledModules", "disabledModules", "enabledGroups", "disabledGroups"],
381
+ "required": [
382
+ "enabledModules",
383
+ "disabledModules",
384
+ "enabledGroups",
385
+ "disabledGroups"
386
+ ],
358
387
  "additionalProperties": false
359
388
  },
360
389
  "memory": {
@@ -373,11 +402,18 @@
373
402
  "type": "string"
374
403
  }
375
404
  },
376
- "required": ["enabled", "dbPath"],
405
+ "required": [
406
+ "enabled",
407
+ "dbPath"
408
+ ],
377
409
  "additionalProperties": false
378
410
  },
379
411
  "backupDir": {
380
412
  "type": "string"
413
+ },
414
+ "disableUpdateCheck": {
415
+ "default": false,
416
+ "type": "boolean"
381
417
  }
382
418
  },
383
419
  "required": [
@@ -388,7 +424,8 @@
388
424
  "ssh",
389
425
  "readOnly",
390
426
  "tools",
391
- "memory"
427
+ "memory",
428
+ "disableUpdateCheck"
392
429
  ],
393
430
  "additionalProperties": false
394
431
  }