From 97802fd074f9fb71ea2134def35a1bdfed6a0120 Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Sun, 12 Apr 2026 22:50:11 +0900 Subject: [PATCH] Remove McpToolsList and stub JsonRpc2 tools Replace the previous in-file handling of JSON-RPC tools methods with a NotImplementedException and remove the ResolveToolsCall helper. Also delete the large McpToolsList.json resource that previously provided the tools manifest. This stubs out the tools/list and tools/call behavior so the tooling manifest and handler can be reworked or moved elsewhere in a follow-up change. --- .../ApiEndpoints/JsonRpc2.cs | 35 +- .../WelsonJS.Launcher/McpToolsList.json | 704 ------------------ 2 files changed, 2 insertions(+), 737 deletions(-) delete mode 100644 WelsonJS.Augmented/WelsonJS.Launcher/McpToolsList.json diff --git a/WelsonJS.Augmented/WelsonJS.Launcher/ApiEndpoints/JsonRpc2.cs b/WelsonJS.Augmented/WelsonJS.Launcher/ApiEndpoints/JsonRpc2.cs index a410c68..3e30b2f 100644 --- a/WelsonJS.Augmented/WelsonJS.Launcher/ApiEndpoints/JsonRpc2.cs +++ b/WelsonJS.Augmented/WelsonJS.Launcher/ApiEndpoints/JsonRpc2.cs @@ -76,41 +76,10 @@ namespace WelsonJS.Launcher.ApiEndpoints body, async (method, ser, id, ct) => { - switch (method) - { - case "tools/list": - await Server.ServeResource(context, ResourceServer.GetResource("McpToolsList.json"), "application/json"); - break; - - case "tools/call": - await ResolveToolsCall(ser, id); - break; - } - - return string.Empty; + throw new NotImplementedException(); }, cts.Token); } } - - private async Task ResolveToolsCall(JsSerializer ser, int id) - { - var toolsName = ser.ExtractFrom(id, "params", "method")?.Trim(); - - switch (toolsName) - { - case "run_jsrt_script": - { - var script = ser.ExtractFrom(id, "params", "arguments", "script")?.Trim(); - - // todo - } - break; - - default: - _logger.Warn($"[JsonRpc2] Unknown tools method: {toolsName}"); - break; - } - } } -} +} \ No newline at end of file diff --git a/WelsonJS.Augmented/WelsonJS.Launcher/McpToolsList.json b/WelsonJS.Augmented/WelsonJS.Launcher/McpToolsList.json deleted file mode 100644 index c197e33..0000000 --- a/WelsonJS.Augmented/WelsonJS.Launcher/McpToolsList.json +++ /dev/null @@ -1,704 +0,0 @@ -{ - "id": 1, - "jsonrpc": "2.0", - "result": { - "runtime": { - "platform": "Windows WSH JsRT (Microsoft JavaScript Runtime)", - "language": "ES3 base + core-js ES5 polyfills", - "moduleSystem": "CommonJS-like require() available in WelsonJS" - }, - "scriptContract": { - "requiredEntryPoint": "function main(args) { /* ... */ }; exports.main = main;", - "notes": [ - "All executable script outputs must export a main function.", - "Write using ES3 syntax by default, and extend only within the ES5 polyfill scope if necessary." - ] - }, - "tools": [ - { - "name": "run_jsrt_script", - "title": "Run WelsonJS JSRT Script", - "description": "Execute JavaScript on WelsonJS/WSH JsRT. Use ES3-compatible syntax with WelsonJS-provided ES5 polyfills. require() can load modules under lib/. The script must export main: function main(args) { ... }; exports.main = main;", - "inputSchema": { - "type": "object", - "properties": { - "script": { - "type": "string", - "description": "WelsonJS script source code. Must export main(args)." - }, - "args": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Arguments passed to main(args)." - }, - "timeoutMs": { - "type": "integer", - "minimum": 0, - "description": "Maximum execution time in milliseconds (up to 90 minutes / 5,400,000 ms).", - "maximum": 5400000 - } - }, - "required": [ - "script" - ] - } - } - ], - "libraryModules": [ - { - "module": "lib/adb.js", - "functions": [ - "create", - "createEmulator" - ] - }, - { - "module": "lib/anthropic.js", - "functions": [ - "chat" - ] - }, - { - "module": "lib/archive.js", - "functions": [ - "create" - ] - }, - { - "module": "lib/autohotkey.js", - "functions": [ - "execScript" - ] - }, - { - "module": "lib/autoit.js", - "functions": [ - "create" - ] - }, - { - "module": "lib/aviation.js", - "functions": [ - "getData", - "getFlights", - "getRoutes", - "getAirports", - "getAirlines", - "getAircraftTypes", - "getCities", - "getCountries", - "getFlightSchedules", - "getFlightsFuture", - "getRoundTrip", - "getOneWay" - ] - }, - { - "module": "lib/base64.js", - "functions": [ - "encode", - "decode" - ] - }, - { - "module": "lib/browser.js", - "functions": [ - "getIEVersion", - "waitUntil", - "addScript", - "addStylesheet", - "setContent", - "start", - "reload", - "close" - ] - }, - { - "module": "lib/catproxy.js", - "functions": [ - "create", - "CatProxyClient" - ] - }, - { - "module": "lib/chatgpt.js", - "functions": [ - "chat" - ] - }, - { - "module": "lib/chrome.js", - "functions": [ - "create", - "start", - "startWithDebugging", - "startWithDebuggingUA", - "startDebug", - "startDebugInPrivate", - "publisherName" - ] - }, - { - "module": "lib/cloudflare.js", - "functions": [ - "binPath", - "installService" - ] - }, - { - "module": "lib/config.js", - "functions": [ - "getValue" - ] - }, - { - "module": "lib/coupang.js", - "functions": [ - "search" - ] - }, - { - "module": "lib/credentials.js", - "functions": [ - "readFromFile", - "push", - "get" - ] - }, - { - "module": "lib/db.js", - "functions": [ - "open", - "blob2Text", - "saveBlob", - "quoteString" - ] - }, - { - "module": "lib/extramath.js", - "functions": [ - "DTM", - "arrayCos", - "measureSimilarity", - "export_measureSimilarity", - "cartesianProduct", - "clusteredCellsDensity", - "estimateTileStartPosition" - ] - }, - { - "module": "lib/fakeworker.js", - "functions": [ - "create", - "repeat" - ] - }, - { - "module": "lib/file.js", - "functions": [ - "fileExists", - "folderExists", - "fileGet", - "readFile", - "writeFile", - "writeBinaryFile", - "moveFile", - "createFolder", - "deleteFolder", - "deleteFile", - "includeFile", - "getFiles", - "appendFile", - "rotateFile", - "loadEnvFromFile", - "loadEnvFromArgs", - "normalizePath", - "isAbsolutePath", - "getFilesFromFolder", - "CdoCharset" - ] - }, - { - "module": "lib/filetypes.js", - "functions": [ - "getExtensionsByOpenWith" - ] - }, - { - "module": "lib/fsm.js", - "functions": [ - "State", - "FSM" - ] - }, - { - "module": "lib/grok.js", - "functions": [ - "chat" - ] - }, - { - "module": "lib/groq.js", - "functions": [ - "chat" - ] - }, - { - "module": "lib/gtk.js", - "functions": [ - "Widget", - "Window", - "Table", - "Button", - "Entry", - "RadioBox", - "RadioGroup", - "TextBox", - "GladeXML", - "init", - "wait", - "exit" - ] - }, - { - "module": "lib/har.js", - "functions": [ - "HARObject" - ] - }, - { - "module": "lib/hosts.js", - "functions": [ - "getHosts" - ] - }, - { - "module": "lib/http.js", - "functions": [ - "create", - "get", - "post", - "patch", - "put", - "_delete", - "parseURL", - "DEFAULT_USER_AGENT", - "defaultUserAgent" - ] - }, - { - "module": "lib/ip-reputation.js", - "functions": [ - "check" - ] - }, - { - "module": "lib/jsonrpc2.js", - "functions": [ - "wrap", - "create", - "DEFAULT_JSONRPC2_URL" - ] - }, - { - "module": "lib/jsunit.js", - "functions": [ - "JsUnit" - ] - }, - { - "module": "lib/kakaotalk.js", - "functions": [ - "KakaoTalk" - ] - }, - { - "module": "lib/language-inference-engine.js", - "functions": [ - "setBiasMessage", - "LanguageInferenceEngine", - "create" - ] - }, - { - "module": "lib/ldplayer.js", - "functions": [ - "getList" - ] - }, - { - "module": "lib/lz77.js", - "functions": [ - "compress", - "decompress" - ] - }, - { - "module": "lib/msmq.js", - "functions": [ - "MSMQObject", - "open" - ] - }, - { - "module": "lib/msoffice.js", - "functions": [ - "Excel", - "PowerPoint", - "Word", - "Outlook" - ] - }, - { - "module": "lib/nmap.js", - "functions": [ - "PortScanner" - ] - }, - { - "module": "lib/noxplayer.js", - "functions": [ - "getList" - ] - }, - { - "module": "lib/ovftool.js", - "functions": [ - "setCredential", - "create" - ] - }, - { - "module": "lib/pipe-ipc.js", - "functions": [ - "create", - "connect", - "Converter", - "UUIDv4", - "CRC32", - "ForReading", - "ForWriting", - "ForAppending", - "CdoCharset", - "CdoUTF_8", - "CdoUS_ASCII", - "CdoEUC_KR", - "CdoEUC_JP", - "adTypeBinary", - "adTypeText", - "adSaveCreateNotExist", - "adSaveCreateOverWrite", - "adModeReadWrite" - ] - }, - { - "module": "lib/powershell.js", - "functions": [ - "execScript", - "execCommand", - "runAs" - ] - }, - { - "module": "lib/punycode.js", - "functions": [ - "encode", - "decode" - ] - }, - { - "module": "lib/python3.js", - "functions": [ - "PythonObject", - "create", - "execScript" - ] - }, - { - "module": "lib/rand.js", - "functions": [ - "randomize", - "getInt", - "getSeed", - "one", - "makeString", - "uuidv4", - "shuffle", - "rotate", - "sample", - "discardOne", - "discardCallback" - ] - }, - { - "module": "lib/registry.js", - "functions": [ - "getProvider", - "write", - "read", - "destroy", - "create", - "execFile", - "HKCR", - "HKCU", - "HKLM", - "STRING", - "BINARY", - "DWORD", - "QWORD" - ] - }, - { - "module": "lib/router.js", - "functions": [ - "Router" - ] - }, - { - "module": "lib/sandboxie.js", - "functions": [ - "start" - ] - }, - { - "module": "lib/security.js", - "functions": [ - "DISABLED", - "ENABLED", - "setDisableAntiSpyware", - "getDisableAntiSpyware", - "setDisableRegistryTools", - "setDisableTaskMgr", - "getAntiVirusProducts", - "OpenThreatSettings" - ] - }, - { - "module": "lib/sendmail.js", - "functions": [ - "sendmail" - ] - }, - { - "module": "lib/serp.js", - "functions": [ - "parseUrl" - ] - }, - { - "module": "lib/shadowsocks.js", - "functions": [ - "connect" - ] - }, - { - "module": "lib/shell.js", - "functions": [ - "create", - "build", - "exec", - "run", - "show", - "runAs", - "showAs", - "createProcess", - "createDesktopIcon", - "getPathOfMyDocuments", - "CdoCharset" - ] - }, - { - "module": "lib/std.js", - "functions": [ - "Event", - "EventTarget", - "Accessor", - "Storage", - "EventableObject", - "alert", - "confirm", - "prompt" - ] - }, - { - "module": "lib/strings.js", - "functions": [ - "numberFormat", - "splitLines", - "selectLines" - ] - }, - { - "module": "lib/system.js", - "functions": [ - "createProcess", - "getEnvString", - "getAppDataDir", - "get32BitFolder", - "isElevated", - "getOS", - "getDCName", - "getArch", - "getUUID", - "getCurrentWorkingDirectory", - "getDirName", - "getFileName", - "getCurrentScriptDirectory", - "getCurrentScriptName", - "getNetworkInterfaces", - "getProcessList", - "getPIDList", - "isAlivePID", - "getProcessListByName", - "killProcess", - "createShortcut", - "ping", - "getProcessVersion" - ] - }, - { - "module": "lib/task-scheduler.js", - "functions": [ - "connect", - "getRootFolder", - "createAndRegisterTask", - "test" - ] - }, - { - "module": "lib/task.js", - "functions": [ - "__taskQueue__", - "setTimeout", - "setInterval", - "Task", - "TaskQueue", - "createTaskQueue", - "createTask", - "putTask", - "nextTask", - "run", - "stop" - ] - }, - { - "module": "lib/toolkit.js", - "functions": [ - "create", - "getInterface", - "sendClick", - "sendKeys", - "sendFnKey", - "alert", - "confirm", - "prompt", - "NamedSharedMemory", - "openProcess", - "closeProcess", - "encryptString", - "decryptString", - "encryptStringHIGHT", - "decryptStringHIGHT" - ] - }, - { - "module": "lib/totp.js", - "functions": [ - "getPubKey", - "getOtp" - ] - }, - { - "module": "lib/tun2socks.js", - "functions": [ - "binPath", - "assign" - ] - }, - { - "module": "lib/uri.js", - "functions": [ - "parseQueryString" - ] - }, - { - "module": "lib/vbscript.js", - "functions": [ - "execScript", - "execCommand" - ] - }, - { - "module": "lib/virtualinput.js", - "functions": [ - "create", - "moveMouse" - ] - }, - { - "module": "lib/wamr.js", - "functions": [ - "create" - ] - }, - { - "module": "lib/websocket.js", - "functions": [ - "create" - ] - }, - { - "module": "lib/winlibs.js", - "functions": [ - "createManifest", - "loadLibrary", - "SHELL32", - "showControlPanel", - "showNetworkAdapters", - "showEULA" - ] - }, - { - "module": "lib/winservice.js", - "functions": [ - "queryService", - "createService", - "startService", - "stopService", - "deleteService" - ] - }, - { - "module": "lib/wintap.js", - "functions": [ - "infPath", - "binPath", - "before", - "install", - "update", - "query", - "remove" - ] - }, - { - "module": "lib/wmi.js", - "functions": [ - "create", - "execQuery", - "setClass" - ] - }, - { - "module": "lib/xml.js", - "functions": [ - "create", - "load", - "encode", - "decode" - ] - } - ] - } -}