Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@foxitsoftware/mcp-server-foxit-cloudapi

Package Overview
Dependencies
Maintainers
20
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@foxitsoftware/mcp-server-foxit-cloudapi - npm Package Compare versions

Comparing version
1.0.0
to
1.0.1
+69
build/common/debug.log
[2025-05-12T06:54:37.166Z] "CallToolRequestSchema request" "{\"method\":\"tools/call\",\"params\":{\"name\":\"split_pdf\",\"arguments\":{\"path\":\"https://gitee.com/wtw/dev-file/raw/master/FoxitPDFSDKforWeb_DemoGuide.pdf\",\"config\":{\"pageCount\":2}}}}"
[2025-05-12T06:54:37.167Z] "All env" "{\"CLIENT_ID\":\"0b0a248c2c877cd3797d1180cfa69206\",\"_ENV_BASE\":\"devcn\",\"PATH\":\"/Users/wutianwei/.pyenv/shims:/Users/wutianwei/Library/pnpm:/Users/wutianwei/Documents/Software/Maven/apache-maven-3.8.6/bin:/Users/wutianwei/Documents/Git/emsdk/upstream/emscripten:/Users/wutianwei/Documents/Git/emsdk:/Users/wutianwei/.rbenv/shims:/Applications/CMake.app/Contents/bin:/Users/wutianwei/.nvm/versions/node/v18.20.4/bin:/Library/Frameworks/Python.framework/Versions/3.10/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Applications/VMware Fusion.app/Contents/Public:/Users/wutianwei/.local/bin:/Users/wutianwei/Library/Android/sdk/emulator:/Users/wutianwei/Library/Android/sdk/platform-tools:node_modules/.bin:/Applications/Doxygen.app/Contents/Resources:/Users/wutianwei/.local/bin\",\"__CF_USER_TEXT_ENCODING\":\"0x1F5:0x19:0x34\"}"
[2025-05-12T06:54:37.167Z] "***" "{\"CLIENT_ID\":\"0b0a248c2c877cd3797d1180cfa69206\",\"_ENV_BASE\":\"devcn\",\"PATH\":\"/Users/wutianwei/.pyenv/shims:/Users/wutianwei/Library/pnpm:/Users/wutianwei/Documents/Software/Maven/apache-maven-3.8.6/bin:/Users/wutianwei/Documents/Git/emsdk/upstream/emscripten:/Users/wutianwei/Documents/Git/emsdk:/Users/wutianwei/.rbenv/shims:/Applications/CMake.app/Contents/bin:/Users/wutianwei/.nvm/versions/node/v18.20.4/bin:/Library/Frameworks/Python.framework/Versions/3.10/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Applications/VMware Fusion.app/Contents/Public:/Users/wutianwei/.local/bin:/Users/wutianwei/Library/Android/sdk/emulator:/Users/wutianwei/Library/Android/sdk/platform-tools:node_modules/.bin:/Applications/Doxygen.app/Contents/Resources:/Users/wutianwei/.local/bin\",\"__CF_USER_TEXT_ENCODING\":\"0x1F5:0x19:0x34\"}"
[2025-05-12T06:54:37.167Z] "CALL TOOL split_pdf, args: {\"path\":\"https://gitee.com/wtw/dev-file/raw/master/FoxitPDFSDKforWeb_DemoGuide.pdf\",\"config\":{\"pageCount\":2}}, env: {\"clientId\":\"0b0a248c2c877cd3797d1180cfa69206\"}"
[2025-05-12T06:54:37.321Z] {"fileUrl":"https://gitee.com/wtw/dev-file/raw/master/FoxitPDFSDKforWeb_DemoGuide.pdf"}
[2025-05-12T06:54:37.321Z] "==>" "/api/file/upload?fileUrl=https://gitee.com/wtw/dev-file/raw/master/FoxitPDFSDKforWeb_DemoGuide.pdf&sn=db4e7cc4db7638c3064953028201e545&clientId=0b0a248c2c877cd3797d1180cfa69206" "post"
[2025-05-12T06:54:38.786Z] "<==" "/api/file/upload?fileUrl=https://gitee.com/wtw/dev-file/raw/master/FoxitPDFSDKforWeb_DemoGuide.pdf&sn=db4e7cc4db7638c3064953028201e545&clientId=0b0a248c2c877cd3797d1180cfa69206" {"code":0,"msg":"Success","data":{"filename":"FoxitPDFSDKforWeb_DemoGuide.pdf","filesize":508651,"docId":"68219b2e035417472999af07"}}
[2025-05-12T06:54:38.914Z] "config: {\"pageCount\":2}"
[2025-05-12T06:54:38.914Z] "==>" "/api/document/split?sn=d0d164d997a50252fa6e2941a86688e1&clientId=0b0a248c2c877cd3797d1180cfa69206" "post"
[2025-05-12T06:54:38.914Z] "docId: 68219b2e035417472999af07"
[2025-05-12T06:54:39.218Z] "<==" "/api/document/split?sn=d0d164d997a50252fa6e2941a86688e1&clientId=0b0a248c2c877cd3797d1180cfa69206" {"code":0,"msg":"Success","data":{"taskInfo":{"taskId":"68219b2f361fa071c68f06a8"}}}
[2025-05-12T06:54:39.218Z] "requestTask params" {"taskId":"68219b2f361fa071c68f06a8","clientId":"0b0a248c2c877cd3797d1180cfa69206"}
[2025-05-12T06:54:41.342Z] "==>" "/api/task?sn=29704ac9443e69ee860daf8b43a88371&clientId=0b0a248c2c877cd3797d1180cfa69206&taskId=68219b2f361fa071c68f06a8" "get"
[2025-05-12T06:54:41.342Z]
[2025-05-12T06:54:41.595Z] "<==" "/api/task?sn=29704ac9443e69ee860daf8b43a88371&clientId=0b0a248c2c877cd3797d1180cfa69206&taskId=68219b2f361fa071c68f06a8" {"code":0,"msg":"Success","data":{"taskInfo":{"percentage":100,"docId":"68219b316c84f433d2b3afa5"}}}
[2025-05-12T06:54:41.595Z] "requestTask" 59 "68219b316c84f433d2b3afa5"
[2025-05-12T06:54:41.596Z] "saveFile params" {"doc":{"value":"FoxitPDFSDKforWeb_DemoGuide-split_pdf.zip","id":"68219b316c84f433d2b3afa5","type":"File","isExotic":true},"clientId":"0b0a248c2c877cd3797d1180cfa69206","path":"https://gitee.com/wtw/dev-file/raw/master/FoxitPDFSDKforWeb_DemoGuide.pdf"}
[2025-05-12T06:54:42.442Z] "saveFile finish" "/Users/wutianwei/Downloads/FoxitPDFSDKforWeb_DemoGuide-split_pdf.zip"
111
[2025-05-12T06:59:59.195Z] "CallToolRequestSchema request" "{\"method\":\"tools/call\",\"params\":{\"_meta\":{\"progressToken\":\"384aed0d-5d99-4363-b765-3a620c5fd406\"},\"name\":\"split_pdf\",\"arguments\":{\"config\":{\"pageCount\":2},\"path\":\"https://gitee.com/wtw/dev-file/raw/master/FoxitPDFSDKforWeb_DemoGuide.pdf\"}}}"
[2025-05-12T06:59:59.195Z] "CALL TOOL split_pdf, args: {\"config\":{\"pageCount\":2},\"path\":\"https://gitee.com/wtw/dev-file/raw/master/FoxitPDFSDKforWeb_DemoGuide.pdf\"}, env: {\"clientId\":\"0b0a248c2c877cd3797d1180cfa69206\"}"
[2025-05-12T06:59:59.195Z] "***" "{\"ANDROID_HOME\":\"/Users/wutianwei/Library/Android/sdk\",\"AQUA_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/aqua.vmoptions\",\"CLION_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/clion.vmoptions\",\"CMAKE_ROOT\":\"/Applications/CMake.app/Contents/bin\",\"COMMAND_MODE\":\"unix2003\",\"DATAGRIP_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/datagrip.vmoptions\",\"DATASPELL_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/dataspell.vmoptions\",\"DEVECOSTUDIO_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/devecostudio.vmoptions\",\"GATEWAY_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/gateway.vmoptions\",\"GOLAND_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/goland.vmoptions\",\"HOME\":\"/Users/wutianwei\",\"HOMEBREW_BOTTLE_DOMAIN\":\"https://mirrors.ustc.edu.cn/homebrew-bottles/bottles\",\"HOMEBREW_CELLAR\":\"/opt/homebrew/Cellar\",\"HOMEBREW_PREFIX\":\"/opt/homebrew\",\"HOMEBREW_REPOSITORY\":\"/opt/homebrew\",\"IDEA_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/idea.vmoptions\",\"INFOPATH\":\"/opt/homebrew/share/info:\",\"JAVA_HOME\":\"/Users/wutianwei/Documents/Software/Java/zulu17.38.21-ca-jdk17.0.5-macosx_aarch64\",\"JETBRAINSCLIENT_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/jetbrainsclient.vmoptions\",\"JETBRAINS_CLIENT_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/jetbrains_client.vmoptions\",\"LESS\":\"-R\",\"LOGNAME\":\"wutianwei\",\"LSCOLORS\":\"Gxfxcxdxbxegedabagacad\",\"LS_COLORS\":\"di=1;36:ln=35:so=32:pi=33:ex=31:bd=34;46:cd=34;43:su=30;41:sg=30;46:tw=30;42:ow=30;43\",\"MallocNanoZone\":\"0\",\"NVM_BIN\":\"/Users/wutianwei/.nvm/versions/node/v18.20.4/bin\",\"NVM_CD_FLAGS\":\"-q\",\"NVM_DIR\":\"/Users/wutianwei/.nvm\",\"NVM_INC\":\"/Users/wutianwei/.nvm/versions/node/v18.20.4/include/node\",\"OLDPWD\":\"/\",\"OLLAMA_HOST\":\"0.0.0.0\",\"OLLAMA_ORIGINS\":\"*\",\"ORIGINAL_XDG_CURRENT_DESKTOP\":\"undefined\",\"PAGER\":\"less\",\"PATH\":\"/Users/wutianwei/.pyenv/shims:/Users/wutianwei/Library/pnpm:/Users/wutianwei/Documents/Software/Maven/apache-maven-3.8.6/bin:/Users/wutianwei/Documents/Git/emsdk/upstream/emscripten:/Users/wutianwei/Documents/Git/emsdk:/Users/wutianwei/.rbenv/shims:/Applications/CMake.app/Contents/bin:/Users/wutianwei/.nvm/versions/node/v18.20.4/bin:/Library/Frameworks/Python.framework/Versions/3.10/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Applications/VMware Fusion.app/Contents/Public:/Users/wutianwei/.local/bin:/Users/wutianwei/Library/Android/sdk/emulator:/Users/wutianwei/Library/Android/sdk/platform-tools:node_modules/.bin:/Applications/Doxygen.app/Contents/Resources:/Users/wutianwei/.local/bin\",\"PHPSTORM_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/phpstorm.vmoptions\",\"PNPM_HOME\":\"/Users/wutianwei/Library/pnpm\",\"PWD\":\"/\",\"PYCHARM_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/pycharm.vmoptions\",\"PYENV_ROOT\":\"/Users/wutianwei/.pyenv\",\"PYENV_SHELL\":\"zsh\",\"RBENV_SHELL\":\"zsh\",\"RIDER_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/rider.vmoptions\",\"RUBYMINE_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/rubymine.vmoptions\",\"RUBY_CONFIGURE_OPTS\":\"--with-openssl-dir=/opt/homebrew/opt/openssl@1.1\",\"RUSTROVER_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/rustrover.vmoptions\",\"SHELL\":\"/bin/zsh\",\"SHLVL\":\"0\",\"SSH_AUTH_SOCK\":\"/private/tmp/com.apple.launchd.EBiCzPOY7S/Listeners\",\"STUDIO_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/studio.vmoptions\",\"TMPDIR\":\"/var/folders/0m/thcnznrd0ws6597snm1xcyvw0000gn/T/\",\"USER\":\"wutianwei\",\"VSCODE_CODE_CACHE_PATH\":\"/Users/wutianwei/Library/Application Support/Code/CachedData/19e0f9e681ecb8e5c09d8784acaa601316ca4571\",\"VSCODE_CRASH_REPORTER_PROCESS_TYPE\":\"extensionHost\",\"VSCODE_CWD\":\"/\",\"VSCODE_ESM_ENTRYPOINT\":\"vs/workbench/api/node/extensionHostProcess\",\"VSCODE_HANDLES_UNCAUGHT_ERRORS\":\"true\",\"VSCODE_IPC_HOOK\":\"/Users/wutianwei/Library/Application Support/Code/1.10-main.sock\",\"VSCODE_NLS_CONFIG\":\"{\\\"userLocale\\\":\\\"zh-cn\\\",\\\"osLocale\\\":\\\"zh-cn\\\",\\\"resolvedLanguage\\\":\\\"en\\\",\\\"defaultMessagesFile\\\":\\\"/Applications/Visual Studio Code.app/Contents/Resources/app/out/nls.messages.json\\\",\\\"locale\\\":\\\"zh-cn\\\",\\\"availableLanguages\\\":{}}\",\"VSCODE_PID\":\"625\",\"WEBIDE_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/webide.vmoptions\",\"WEBSTORM_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/webstorm.vmoptions\",\"XPC_FLAGS\":\"0x0\",\"XPC_SERVICE_NAME\":\"application.com.microsoft.VSCode.169514075.169514081\",\"ZSH\":\"/Users/wutianwei/.oh-my-zsh\",\"_\":\"/Applications/Visual Studio Code.app/Contents/MacOS/Electron\",\"__CFBundleIdentifier\":\"com.microsoft.VSCode\",\"__CF_USER_TEXT_ENCODING\":\"0x1F5:0x19:0x34\",\"ELECTRON_RUN_AS_NODE\":\"1\",\"VSCODE_L10N_BUNDLE_LOCATION\":\"\",\"CLIENT_ID\":\"0b0a248c2c877cd3797d1180cfa69206\",\"_ENV_BASE\":\"devcn\"}"
[2025-05-12T06:59:59.195Z] "All env" "{\"ANDROID_HOME\":\"/Users/wutianwei/Library/Android/sdk\",\"AQUA_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/aqua.vmoptions\",\"CLION_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/clion.vmoptions\",\"CMAKE_ROOT\":\"/Applications/CMake.app/Contents/bin\",\"COMMAND_MODE\":\"unix2003\",\"DATAGRIP_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/datagrip.vmoptions\",\"DATASPELL_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/dataspell.vmoptions\",\"DEVECOSTUDIO_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/devecostudio.vmoptions\",\"GATEWAY_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/gateway.vmoptions\",\"GOLAND_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/goland.vmoptions\",\"HOME\":\"/Users/wutianwei\",\"HOMEBREW_BOTTLE_DOMAIN\":\"https://mirrors.ustc.edu.cn/homebrew-bottles/bottles\",\"HOMEBREW_CELLAR\":\"/opt/homebrew/Cellar\",\"HOMEBREW_PREFIX\":\"/opt/homebrew\",\"HOMEBREW_REPOSITORY\":\"/opt/homebrew\",\"IDEA_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/idea.vmoptions\",\"INFOPATH\":\"/opt/homebrew/share/info:\",\"JAVA_HOME\":\"/Users/wutianwei/Documents/Software/Java/zulu17.38.21-ca-jdk17.0.5-macosx_aarch64\",\"JETBRAINSCLIENT_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/jetbrainsclient.vmoptions\",\"JETBRAINS_CLIENT_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/jetbrains_client.vmoptions\",\"LESS\":\"-R\",\"LOGNAME\":\"wutianwei\",\"LSCOLORS\":\"Gxfxcxdxbxegedabagacad\",\"LS_COLORS\":\"di=1;36:ln=35:so=32:pi=33:ex=31:bd=34;46:cd=34;43:su=30;41:sg=30;46:tw=30;42:ow=30;43\",\"MallocNanoZone\":\"0\",\"NVM_BIN\":\"/Users/wutianwei/.nvm/versions/node/v18.20.4/bin\",\"NVM_CD_FLAGS\":\"-q\",\"NVM_DIR\":\"/Users/wutianwei/.nvm\",\"NVM_INC\":\"/Users/wutianwei/.nvm/versions/node/v18.20.4/include/node\",\"OLDPWD\":\"/\",\"OLLAMA_HOST\":\"0.0.0.0\",\"OLLAMA_ORIGINS\":\"*\",\"ORIGINAL_XDG_CURRENT_DESKTOP\":\"undefined\",\"PAGER\":\"less\",\"PATH\":\"/Users/wutianwei/.pyenv/shims:/Users/wutianwei/Library/pnpm:/Users/wutianwei/Documents/Software/Maven/apache-maven-3.8.6/bin:/Users/wutianwei/Documents/Git/emsdk/upstream/emscripten:/Users/wutianwei/Documents/Git/emsdk:/Users/wutianwei/.rbenv/shims:/Applications/CMake.app/Contents/bin:/Users/wutianwei/.nvm/versions/node/v18.20.4/bin:/Library/Frameworks/Python.framework/Versions/3.10/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Applications/VMware Fusion.app/Contents/Public:/Users/wutianwei/.local/bin:/Users/wutianwei/Library/Android/sdk/emulator:/Users/wutianwei/Library/Android/sdk/platform-tools:node_modules/.bin:/Applications/Doxygen.app/Contents/Resources:/Users/wutianwei/.local/bin\",\"PHPSTORM_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/phpstorm.vmoptions\",\"PNPM_HOME\":\"/Users/wutianwei/Library/pnpm\",\"PWD\":\"/\",\"PYCHARM_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/pycharm.vmoptions\",\"PYENV_ROOT\":\"/Users/wutianwei/.pyenv\",\"PYENV_SHELL\":\"zsh\",\"RBENV_SHELL\":\"zsh\",\"RIDER_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/rider.vmoptions\",\"RUBYMINE_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/rubymine.vmoptions\",\"RUBY_CONFIGURE_OPTS\":\"--with-openssl-dir=/opt/homebrew/opt/openssl@1.1\",\"RUSTROVER_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/rustrover.vmoptions\",\"SHELL\":\"/bin/zsh\",\"SHLVL\":\"0\",\"SSH_AUTH_SOCK\":\"/private/tmp/com.apple.launchd.EBiCzPOY7S/Listeners\",\"STUDIO_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/studio.vmoptions\",\"TMPDIR\":\"/var/folders/0m/thcnznrd0ws6597snm1xcyvw0000gn/T/\",\"USER\":\"wutianwei\",\"VSCODE_CODE_CACHE_PATH\":\"/Users/wutianwei/Library/Application Support/Code/CachedData/19e0f9e681ecb8e5c09d8784acaa601316ca4571\",\"VSCODE_CRASH_REPORTER_PROCESS_TYPE\":\"extensionHost\",\"VSCODE_CWD\":\"/\",\"VSCODE_ESM_ENTRYPOINT\":\"vs/workbench/api/node/extensionHostProcess\",\"VSCODE_HANDLES_UNCAUGHT_ERRORS\":\"true\",\"VSCODE_IPC_HOOK\":\"/Users/wutianwei/Library/Application Support/Code/1.10-main.sock\",\"VSCODE_NLS_CONFIG\":\"{\\\"userLocale\\\":\\\"zh-cn\\\",\\\"osLocale\\\":\\\"zh-cn\\\",\\\"resolvedLanguage\\\":\\\"en\\\",\\\"defaultMessagesFile\\\":\\\"/Applications/Visual Studio Code.app/Contents/Resources/app/out/nls.messages.json\\\",\\\"locale\\\":\\\"zh-cn\\\",\\\"availableLanguages\\\":{}}\",\"VSCODE_PID\":\"625\",\"WEBIDE_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/webide.vmoptions\",\"WEBSTORM_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/webstorm.vmoptions\",\"XPC_FLAGS\":\"0x0\",\"XPC_SERVICE_NAME\":\"application.com.microsoft.VSCode.169514075.169514081\",\"ZSH\":\"/Users/wutianwei/.oh-my-zsh\",\"_\":\"/Applications/Visual Studio Code.app/Contents/MacOS/Electron\",\"__CFBundleIdentifier\":\"com.microsoft.VSCode\",\"__CF_USER_TEXT_ENCODING\":\"0x1F5:0x19:0x34\",\"ELECTRON_RUN_AS_NODE\":\"1\",\"VSCODE_L10N_BUNDLE_LOCATION\":\"\",\"CLIENT_ID\":\"0b0a248c2c877cd3797d1180cfa69206\",\"_ENV_BASE\":\"devcn\"}"
[2025-05-12T06:59:59.623Z] "==>" "/api/file/upload?fileUrl=https://gitee.com/wtw/dev-file/raw/master/FoxitPDFSDKforWeb_DemoGuide.pdf&sn=db4e7cc4db7638c3064953028201e545&clientId=0b0a248c2c877cd3797d1180cfa69206" "post"
[2025-05-12T06:59:59.623Z] {"fileUrl":"https://gitee.com/wtw/dev-file/raw/master/FoxitPDFSDKforWeb_DemoGuide.pdf"}
[2025-05-12T07:00:02.714Z] "<==" "/api/file/upload?fileUrl=https://gitee.com/wtw/dev-file/raw/master/FoxitPDFSDKforWeb_DemoGuide.pdf&sn=db4e7cc4db7638c3064953028201e545&clientId=0b0a248c2c877cd3797d1180cfa69206" {"code":0,"msg":"Success","data":{"filename":"FoxitPDFSDKforWeb_DemoGuide.pdf","filesize":508651,"docId":"68219c72361fa071c68f0fe0"}}
[2025-05-12T07:00:02.882Z] "==>" "/api/document/split?sn=6bb321ee1cfb831783aed932c3749afe&clientId=0b0a248c2c877cd3797d1180cfa69206" "post"
[2025-05-12T07:00:02.882Z] "config: {\"pageCount\":2}"
[2025-05-12T07:00:02.882Z] "docId: 68219c72361fa071c68f0fe0"
[2025-05-12T07:00:03.154Z] "<==" "/api/document/split?sn=6bb321ee1cfb831783aed932c3749afe&clientId=0b0a248c2c877cd3797d1180cfa69206" {"code":0,"msg":"Success","data":{"taskInfo":{"taskId":"68219c73035417472999b646"}}}
[2025-05-12T07:00:03.155Z] "requestTask params" {"taskId":"68219c73035417472999b646","clientId":"0b0a248c2c877cd3797d1180cfa69206"}
[2025-05-12T07:00:05.324Z]
[2025-05-12T07:00:05.324Z] "==>" "/api/task?sn=0a8df4cbc6cbd2460bd23d254c6ad7e7&clientId=0b0a248c2c877cd3797d1180cfa69206&taskId=68219c73035417472999b646" "get"
[2025-05-12T07:00:05.609Z] "<==" "/api/task?sn=0a8df4cbc6cbd2460bd23d254c6ad7e7&clientId=0b0a248c2c877cd3797d1180cfa69206&taskId=68219c73035417472999b646" {"code":0,"msg":"Success","data":{"taskInfo":{"percentage":100,"docId":"68219c73e178240095908c33"}}}
[2025-05-12T07:00:05.609Z] "requestTask" 59 "68219c73e178240095908c33"
[2025-05-12T07:00:05.610Z] "saveFile params" {"doc":{"value":"FoxitPDFSDKforWeb_DemoGuide-split_pdf.zip","id":"68219c73e178240095908c33","type":"File","isExotic":true},"clientId":"0b0a248c2c877cd3797d1180cfa69206","path":"https://gitee.com/wtw/dev-file/raw/master/FoxitPDFSDKforWeb_DemoGuide.pdf"}
[2025-05-12T07:00:06.473Z] "saveFile finish" "/Users/wutianwei/Downloads/FoxitPDFSDKforWeb_DemoGuide-split_pdf.zip"
[2025-05-12T07:16:23.212Z] "CallToolRequestSchema request" "{\"method\":\"tools/call\",\"params\":{\"name\":\"split_pdf\",\"arguments\":{\"path\":\"https://gitee.com/wtw/dev-file/raw/master/FoxitPDFSDKforWeb_DemoGuide.pdf\",\"config\":{\"pageCount\":2}}}}"
[2025-05-12T07:16:23.212Z] "All env" "{\"CLIENT_ID\":\"0b0a248c2c877cd3797d1180cfa69206\",\"MODE\":\"CLOUD\",\"_ENV_BASE\":\"devcn\",\"PATH\":\"/Users/wutianwei/.pyenv/shims:/Users/wutianwei/Library/pnpm:/Users/wutianwei/Documents/Software/Maven/apache-maven-3.8.6/bin:/Users/wutianwei/Documents/Git/emsdk/upstream/emscripten:/Users/wutianwei/Documents/Git/emsdk:/Users/wutianwei/.rbenv/shims:/Applications/CMake.app/Contents/bin:/Users/wutianwei/.nvm/versions/node/v18.20.4/bin:/Library/Frameworks/Python.framework/Versions/3.10/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Applications/VMware Fusion.app/Contents/Public:/Users/wutianwei/.local/bin:/Users/wutianwei/Library/Android/sdk/emulator:/Users/wutianwei/Library/Android/sdk/platform-tools:node_modules/.bin:/Applications/Doxygen.app/Contents/Resources:/Users/wutianwei/.local/bin\",\"__CF_USER_TEXT_ENCODING\":\"0x1F5:0x19:0x34\"}"
[2025-05-12T07:16:23.213Z] "CALL TOOL split_pdf, args: {\"path\":\"https://gitee.com/wtw/dev-file/raw/master/FoxitPDFSDKforWeb_DemoGuide.pdf\",\"config\":{\"pageCount\":2}}, env: {\"mode\":\"CLOUD\",\"clientId\":\"0b0a248c2c877cd3797d1180cfa69206\"}"
[2025-05-12T07:16:23.414Z] "==>" "/api/file/upload?fileUrl=https://gitee.com/wtw/dev-file/raw/master/FoxitPDFSDKforWeb_DemoGuide.pdf&sn=db4e7cc4db7638c3064953028201e545&clientId=0b0a248c2c877cd3797d1180cfa69206" "post"
[2025-05-12T07:16:23.414Z] {"fileUrl":"https://gitee.com/wtw/dev-file/raw/master/FoxitPDFSDKforWeb_DemoGuide.pdf"}
[2025-05-12T07:16:24.732Z] "<==" "/api/file/upload?fileUrl=https://gitee.com/wtw/dev-file/raw/master/FoxitPDFSDKforWeb_DemoGuide.pdf&sn=db4e7cc4db7638c3064953028201e545&clientId=0b0a248c2c877cd3797d1180cfa69206" {"code":0,"msg":"Success","data":{"filename":"FoxitPDFSDKforWeb_DemoGuide.pdf","filesize":508651,"docId":"6821a048035417472999d6ab"}}
[2025-05-12T07:16:24.845Z] "==>" "/api/document/split?sn=45f90cdc2831df719d140796f55408a3&clientId=0b0a248c2c877cd3797d1180cfa69206" "post"
[2025-05-12T07:16:24.845Z] "config: {\"pageCount\":2}"
[2025-05-12T07:16:24.845Z] "docId: 6821a048035417472999d6ab"
[2025-05-12T07:16:25.099Z] "<==" "/api/document/split?sn=45f90cdc2831df719d140796f55408a3&clientId=0b0a248c2c877cd3797d1180cfa69206" {"code":0,"msg":"Success","data":{"taskInfo":{"taskId":"6821a049361fa071c68f334a"}}}
[2025-05-12T07:16:25.100Z] "requestTask params" {"taskId":"6821a049361fa071c68f334a","clientId":"0b0a248c2c877cd3797d1180cfa69206"}
[2025-05-12T07:16:27.253Z]
[2025-05-12T07:16:27.253Z] "==>" "/api/task?sn=0c617ebce786cf4c1127cb632844650e&clientId=0b0a248c2c877cd3797d1180cfa69206&taskId=6821a049361fa071c68f334a" "get"
[2025-05-12T07:16:27.491Z] "<==" "/api/task?sn=0c617ebce786cf4c1127cb632844650e&clientId=0b0a248c2c877cd3797d1180cfa69206&taskId=6821a049361fa071c68f334a" {"code":0,"msg":"Success","data":{"taskInfo":{"percentage":100,"docId":"6821a049e178240095908c3b"}}}
[2025-05-12T07:16:27.491Z] "requestTask" 59 "6821a049e178240095908c3b"
[2025-05-12T07:16:27.491Z] "saveFile params" {"doc":{"value":"FoxitPDFSDKforWeb_DemoGuide-split_pdf.zip","id":"6821a049e178240095908c3b","type":"File","isExotic":true},"path":"https://gitee.com/wtw/dev-file/raw/master/FoxitPDFSDKforWeb_DemoGuide.pdf"}
[2025-05-12T07:18:39.412Z] "CallToolRequestSchema request" "{\"method\":\"tools/call\",\"params\":{\"_meta\":{\"progressToken\":\"9da4dcc8-4050-46b6-9e0d-4089e5820505\"},\"name\":\"split_pdf\",\"arguments\":{\"config\":{\"pageCount\":2},\"path\":\"https://gitee.com/wtw/dev-file/raw/master/FoxitPDFSDKforWeb_DemoGuide.pdf\"}}}"
[2025-05-12T07:18:39.413Z] "All env" "{\"ANDROID_HOME\":\"/Users/wutianwei/Library/Android/sdk\",\"AQUA_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/aqua.vmoptions\",\"CLION_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/clion.vmoptions\",\"CMAKE_ROOT\":\"/Applications/CMake.app/Contents/bin\",\"COMMAND_MODE\":\"unix2003\",\"DATAGRIP_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/datagrip.vmoptions\",\"DATASPELL_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/dataspell.vmoptions\",\"DEVECOSTUDIO_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/devecostudio.vmoptions\",\"GATEWAY_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/gateway.vmoptions\",\"GOLAND_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/goland.vmoptions\",\"HOME\":\"/Users/wutianwei\",\"HOMEBREW_BOTTLE_DOMAIN\":\"https://mirrors.ustc.edu.cn/homebrew-bottles/bottles\",\"HOMEBREW_CELLAR\":\"/opt/homebrew/Cellar\",\"HOMEBREW_PREFIX\":\"/opt/homebrew\",\"HOMEBREW_REPOSITORY\":\"/opt/homebrew\",\"IDEA_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/idea.vmoptions\",\"INFOPATH\":\"/opt/homebrew/share/info:\",\"JAVA_HOME\":\"/Users/wutianwei/Documents/Software/Java/zulu17.38.21-ca-jdk17.0.5-macosx_aarch64\",\"JETBRAINSCLIENT_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/jetbrainsclient.vmoptions\",\"JETBRAINS_CLIENT_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/jetbrains_client.vmoptions\",\"LESS\":\"-R\",\"LOGNAME\":\"wutianwei\",\"LSCOLORS\":\"Gxfxcxdxbxegedabagacad\",\"LS_COLORS\":\"di=1;36:ln=35:so=32:pi=33:ex=31:bd=34;46:cd=34;43:su=30;41:sg=30;46:tw=30;42:ow=30;43\",\"MallocNanoZone\":\"0\",\"NVM_BIN\":\"/Users/wutianwei/.nvm/versions/node/v18.20.4/bin\",\"NVM_CD_FLAGS\":\"-q\",\"NVM_DIR\":\"/Users/wutianwei/.nvm\",\"NVM_INC\":\"/Users/wutianwei/.nvm/versions/node/v18.20.4/include/node\",\"OLDPWD\":\"/\",\"OLLAMA_HOST\":\"0.0.0.0\",\"OLLAMA_ORIGINS\":\"*\",\"ORIGINAL_XDG_CURRENT_DESKTOP\":\"undefined\",\"PAGER\":\"less\",\"PATH\":\"/Users/wutianwei/.pyenv/shims:/Users/wutianwei/Library/pnpm:/Users/wutianwei/Documents/Software/Maven/apache-maven-3.8.6/bin:/Users/wutianwei/Documents/Git/emsdk/upstream/emscripten:/Users/wutianwei/Documents/Git/emsdk:/Users/wutianwei/.rbenv/shims:/Applications/CMake.app/Contents/bin:/Users/wutianwei/.nvm/versions/node/v18.20.4/bin:/Library/Frameworks/Python.framework/Versions/3.10/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Applications/VMware Fusion.app/Contents/Public:/Users/wutianwei/.local/bin:/Users/wutianwei/Library/Android/sdk/emulator:/Users/wutianwei/Library/Android/sdk/platform-tools:node_modules/.bin:/Applications/Doxygen.app/Contents/Resources:/Users/wutianwei/.local/bin\",\"PHPSTORM_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/phpstorm.vmoptions\",\"PNPM_HOME\":\"/Users/wutianwei/Library/pnpm\",\"PWD\":\"/\",\"PYCHARM_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/pycharm.vmoptions\",\"PYENV_ROOT\":\"/Users/wutianwei/.pyenv\",\"PYENV_SHELL\":\"zsh\",\"RBENV_SHELL\":\"zsh\",\"RIDER_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/rider.vmoptions\",\"RUBYMINE_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/rubymine.vmoptions\",\"RUBY_CONFIGURE_OPTS\":\"--with-openssl-dir=/opt/homebrew/opt/openssl@1.1\",\"RUSTROVER_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/rustrover.vmoptions\",\"SHELL\":\"/bin/zsh\",\"SHLVL\":\"0\",\"SSH_AUTH_SOCK\":\"/private/tmp/com.apple.launchd.EBiCzPOY7S/Listeners\",\"STUDIO_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/studio.vmoptions\",\"TMPDIR\":\"/var/folders/0m/thcnznrd0ws6597snm1xcyvw0000gn/T/\",\"USER\":\"wutianwei\",\"VSCODE_CODE_CACHE_PATH\":\"/Users/wutianwei/Library/Application Support/Code/CachedData/19e0f9e681ecb8e5c09d8784acaa601316ca4571\",\"VSCODE_CRASH_REPORTER_PROCESS_TYPE\":\"extensionHost\",\"VSCODE_CWD\":\"/\",\"VSCODE_ESM_ENTRYPOINT\":\"vs/workbench/api/node/extensionHostProcess\",\"VSCODE_HANDLES_UNCAUGHT_ERRORS\":\"true\",\"VSCODE_IPC_HOOK\":\"/Users/wutianwei/Library/Application Support/Code/1.10-main.sock\",\"VSCODE_NLS_CONFIG\":\"{\\\"userLocale\\\":\\\"zh-cn\\\",\\\"osLocale\\\":\\\"zh-cn\\\",\\\"resolvedLanguage\\\":\\\"en\\\",\\\"defaultMessagesFile\\\":\\\"/Applications/Visual Studio Code.app/Contents/Resources/app/out/nls.messages.json\\\",\\\"locale\\\":\\\"zh-cn\\\",\\\"availableLanguages\\\":{}}\",\"VSCODE_PID\":\"13026\",\"WEBIDE_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/webide.vmoptions\",\"WEBSTORM_VM_OPTIONS\":\"/Users/wutianwei/.Trash/jetbra/vmoptions/webstorm.vmoptions\",\"XPC_FLAGS\":\"0x0\",\"XPC_SERVICE_NAME\":\"application.com.microsoft.VSCode.169514075.169514081\",\"ZSH\":\"/Users/wutianwei/.oh-my-zsh\",\"_\":\"/Applications/Visual Studio Code.app/Contents/MacOS/Electron\",\"__CFBundleIdentifier\":\"com.microsoft.VSCode\",\"__CF_USER_TEXT_ENCODING\":\"0x1F5:0x19:0x34\",\"ELECTRON_RUN_AS_NODE\":\"1\",\"VSCODE_L10N_BUNDLE_LOCATION\":\"\",\"CLIENT_ID\":\"0b0a248c2c877cd3797d1180cfa69206\",\"MODE\":\"CLOUD\",\"_ENV_BASE\":\"devcn\"}"
[2025-05-12T07:18:39.413Z] "CALL TOOL split_pdf, args: {\"config\":{\"pageCount\":2},\"path\":\"https://gitee.com/wtw/dev-file/raw/master/FoxitPDFSDKforWeb_DemoGuide.pdf\"}, env: {\"mode\":\"CLOUD\",\"clientId\":\"0b0a248c2c877cd3797d1180cfa69206\"}"
[2025-05-12T07:18:39.607Z] "==>" "/api/file/upload?fileUrl=https://gitee.com/wtw/dev-file/raw/master/FoxitPDFSDKforWeb_DemoGuide.pdf&sn=db4e7cc4db7638c3064953028201e545&clientId=0b0a248c2c877cd3797d1180cfa69206" "post"
[2025-05-12T07:18:39.608Z] {"fileUrl":"https://gitee.com/wtw/dev-file/raw/master/FoxitPDFSDKforWeb_DemoGuide.pdf"}
[2025-05-12T07:18:41.232Z] "<==" "/api/file/upload?fileUrl=https://gitee.com/wtw/dev-file/raw/master/FoxitPDFSDKforWeb_DemoGuide.pdf&sn=db4e7cc4db7638c3064953028201e545&clientId=0b0a248c2c877cd3797d1180cfa69206" {"code":0,"msg":"Success","data":{"filename":"FoxitPDFSDKforWeb_DemoGuide.pdf","filesize":508651,"docId":"6821a0d1035417472999dabb"}}
[2025-05-12T07:18:41.346Z] "==>" "/api/document/split?sn=5b563b42f37944020ba348d90ed65f0e&clientId=0b0a248c2c877cd3797d1180cfa69206" "post"
[2025-05-12T07:18:41.346Z] "config: {\"pageCount\":2}"
[2025-05-12T07:18:41.346Z] "docId: 6821a0d1035417472999dabb"
[2025-05-12T07:18:41.597Z] "<==" "/api/document/split?sn=5b563b42f37944020ba348d90ed65f0e&clientId=0b0a248c2c877cd3797d1180cfa69206" {"code":0,"msg":"Success","data":{"taskInfo":{"taskId":"6821a0d1035417472999dabc"}}}
[2025-05-12T07:18:41.597Z] "requestTask params" {"taskId":"6821a0d1035417472999dabc","clientId":"0b0a248c2c877cd3797d1180cfa69206"}
[2025-05-12T07:18:43.753Z]
[2025-05-12T07:18:43.753Z] "==>" "/api/task?sn=e1e5de5cf931d7c405e901738e932cee&clientId=0b0a248c2c877cd3797d1180cfa69206&taskId=6821a0d1035417472999dabc" "get"
[2025-05-12T07:18:43.961Z] "requestTask" 59 "6821a0d1e178240095908c43"
[2025-05-12T07:18:43.961Z] "<==" "/api/task?sn=e1e5de5cf931d7c405e901738e932cee&clientId=0b0a248c2c877cd3797d1180cfa69206&taskId=6821a0d1035417472999dabc" {"code":0,"msg":"Success","data":{"taskInfo":{"percentage":100,"docId":"6821a0d1e178240095908c43"}}}
[2025-05-12T07:18:43.961Z] "saveFile params" {"doc":{"value":"FoxitPDFSDKforWeb_DemoGuide-split_pdf.zip","id":"6821a0d1e178240095908c43","type":"File","isExotic":true},"path":"https://gitee.com/wtw/dev-file/raw/master/FoxitPDFSDKforWeb_DemoGuide.pdf"}
+8
-4

@@ -10,3 +10,3 @@ "use strict";

exports.CombinePDFArgsSchema = zod_1.z.object({
path: zod_1.z.string().describe('压缩或归档文件的绝对路径'),
path: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).describe('压缩或归档文件的绝对路径或多个URL地址'),
config: zod_1.z.object({

@@ -32,8 +32,12 @@ isAddBookmark: zod_1.z.boolean().optional().describe('是否添加书签'),

let doc = await (0, service_1.requestTask)(res, { clientId: env.clientId });
doc.value = `${(0, path_1.basename)(args.path, (0, path_1.extname)(args.path))}-combine_pdf.pdf`;
if ((0, util_1.isPath)(args.path)) {
doc.value = `${(0, path_1.basename)(args.path, (0, path_1.extname)(args.path))}-combine_pdf.pdf`;
}
else {
doc.value = `${(0, path_1.basename)(args.path[0], (0, path_1.extname)(args.path[0]))}-combine_pdf.pdf`;
}
const resultPath = await (0, service_1.saveFile)({
doc,
clientId: env.clientId,
path: args.path,
});
}, env);
return {

@@ -40,0 +44,0 @@ content: [{ type: 'text', text: `PDF文档合并成功:${resultPath}` }],

@@ -10,4 +10,4 @@ "use strict";

exports.ComparePDFArgsSchema = zod_1.z.object({
basePath: zod_1.z.string().describe('基准PDF文档的绝对路径'),
comparePath: zod_1.z.string().describe('比较PDF文档的绝对路径'),
basePath: zod_1.z.string().describe('基准PDF文档的绝对路径或URL地址'),
comparePath: zod_1.z.string().describe('比较PDF文档的绝对路径或URL地址'),
resultType: zod_1.z.enum(['json', 'pdf']).describe('结果类型').default('json'),

@@ -32,5 +32,4 @@ compareType: zod_1.z.enum(['all', 'text']).describe('比较类型').default('all'),

doc,
clientId: env.clientId,
path: args.basePath,
});
}, env);
return {

@@ -37,0 +36,0 @@ content: [{ type: 'text', text: `PDF文档比较成功:${resultPath}` }],

@@ -10,3 +10,3 @@ "use strict";

exports.CompressPDFArgsSchema = zod_1.z.object({
path: zod_1.z.string().describe('PDF文档的绝对路径'),
path: zod_1.z.string().describe('PDF文档的绝对路径或URL地址'),
compressionLevel: zod_1.z.enum(['low', 'medium', 'high']).optional().describe('压缩级别').default('low'),

@@ -29,5 +29,4 @@ });

doc,
clientId: env.clientId,
path: args.path,
});
}, env);
return {

@@ -34,0 +33,0 @@ content: [{ type: 'text', text: `PDF文档压缩成功:${resultPath}` }],

@@ -10,3 +10,3 @@ "use strict";

exports.ConvertPDFArgsSchema = zod_1.z.object({
path: zod_1.z.string().describe('PDF文档的绝对路径'),
path: zod_1.z.string().describe('PDF文档的绝对路径或URL地址'),
format: zod_1.z.enum(['word', 'excel', 'ppt', 'image', 'text', 'html']).describe('转换后的文件类型').default('word'),

@@ -37,5 +37,4 @@ });

doc,
clientId: env.clientId,
path: args.path,
});
}, env);
return {

@@ -42,0 +41,0 @@ content: [{ type: 'text', text: `PDF文档转换成功:${resultPath}` }],

@@ -10,3 +10,3 @@ "use strict";

exports.CreatePDFArgsSchema = zod_1.z.object({
path: zod_1.z.string().describe('转换文件的绝对路径'),
path: zod_1.z.string().describe('转换文件的绝对路径或URL地址'),
format: zod_1.z.enum(['word', 'excel', 'ppt', 'image', 'text']).describe('输入的文件类型'),

@@ -29,5 +29,4 @@ });

doc,
clientId: env.clientId,
path: args.path,
});
}, env);
return {

@@ -34,0 +33,0 @@ content: [{ type: 'text', text: `PDF文档创建成功:${resultPath}` }],

@@ -11,3 +11,3 @@ "use strict";

format: zod_1.z.enum(['url', 'html', 'htm', 'shtml']).describe('输入格式,如果是url,则url参数不能为空,否则path参数不能为空').default('url'),
path: zod_1.z.string().optional().describe('HTML文件的绝对路径'),
path: zod_1.z.string().optional().describe('HTML文件的绝对路径或URL地址'),
url: zod_1.z.string().optional().describe('URL'),

@@ -46,5 +46,4 @@ config: zod_1.z.object({

doc,
clientId: env.clientId,
path: `${(0, util_1.getDownloadPath)()}/${doc.value}`,
});
}, env);
return {

@@ -51,0 +50,0 @@ content: [{ type: 'text', text: `PDF文档创建成功:${resultPath}` }],

@@ -10,3 +10,3 @@ "use strict";

exports.ExtractPDFArgsSchema = zod_1.z.object({
path: zod_1.z.string().describe('PDF文档的绝对路径'),
path: zod_1.z.string().describe('PDF文档的绝对路径或URL地址'),
mode: zod_1.z.enum(['extractImages', 'extractText']).describe('提取模式,extractText表示提取文本,extractImages表示提取图片').default('extractImages'),

@@ -34,5 +34,4 @@ pageRange: zod_1.z.string().optional().describe('提取页面范围,A、B和C以逗号分隔。A、B或C可以取数字,如99,也可以取范围,如1-30。如果为空,则提取整个文档'),

doc,
clientId: env.clientId,
path: args.path,
});
}, env);
return {

@@ -39,0 +38,0 @@ content: [{ type: 'text', text: `PDF文档提取成功:${resultPath}` }],

@@ -10,3 +10,3 @@ "use strict";

exports.FlattenPDFArgsSchema = zod_1.z.object({
path: zod_1.z.string().describe('PDF文档的绝对路径'),
path: zod_1.z.string().describe('PDF文档的绝对路径或URL地址'),
pageRange: zod_1.z.string().optional().describe('PDF文档的页面范围。文档中的页面可以按任何顺序引用,从开始或结束都可以。例如:1、2、3、7-9,全部。如果未指定,则执行所有页面').default('all'),

@@ -29,5 +29,4 @@ });

doc,
clientId: env.clientId,
path: args.path,
});
}, env);
return {

@@ -34,0 +33,0 @@ content: [{ type: 'text', text: `PDF文档扁平化成功:${resultPath}` }],

@@ -10,3 +10,3 @@ "use strict";

exports.LinearizePDFArgsSchema = zod_1.z.object({
path: zod_1.z.string().describe('PDF文档的绝对路径'),
path: zod_1.z.string().describe('PDF文档的绝对路径或URL地址'),
});

@@ -28,5 +28,4 @@ async function default_1(args, env) {

doc,
clientId: env.clientId,
path: args.path,
});
}, env);
return {

@@ -33,0 +32,0 @@ content: [{ type: 'text', text: `PDF文档线性化成功:${resultPath}` }],

@@ -10,3 +10,3 @@ "use strict";

exports.ManipulationPDFArgsSchema = zod_1.z.object({
path: zod_1.z.string().describe('PDF文档的绝对路径'),
path: zod_1.z.string().describe('PDF文档的绝对路径或URL地址'),
config: zod_1.z.object({

@@ -34,5 +34,4 @@ pageAction: zod_1.z.enum(['delete', 'rotate', 'move']).describe('页面操作类型'),

doc,
clientId: env.clientId,
path: args.path,
});
}, env);
return {

@@ -39,0 +38,0 @@ content: [{ type: 'text', text: `PDF文档操作成功:${resultPath}` }],

@@ -10,3 +10,3 @@ "use strict";

exports.ProtectPDFArgsSchema = zod_1.z.object({
path: zod_1.z.string().describe('PDF文档的绝对路径'),
path: zod_1.z.string().describe('PDF文档的绝对路径或URL地址'),
passwordProtection: zod_1.z.object({

@@ -42,5 +42,4 @@ userPassword: zod_1.z.string().optional().describe('用户密码'),

doc,
clientId: env.clientId,
path: args.path,
});
}, env);
return {

@@ -47,0 +46,0 @@ content: [{ type: 'text', text: `PDF文档保护成功:${resultPath}` }],

@@ -10,3 +10,3 @@ "use strict";

exports.RemovePasswordArgsSchema = zod_1.z.object({
path: zod_1.z.string().describe('PDF文档的绝对路径'),
path: zod_1.z.string().describe('PDF文档的绝对路径或URL地址'),
password: zod_1.z.string().describe('PDF文档密码。如果PDF受所有者密码保护,则用户需要在该字段中使用所有者密码来取消文档安全性,否则用户需要传入用户密码来打开文档'),

@@ -29,5 +29,4 @@ });

doc,
clientId: env.clientId,
path: args.path,
});
}, env);
return {

@@ -34,0 +33,0 @@ content: [{ type: 'text', text: `PDF文档密码移除成功:${resultPath}` }],

@@ -10,3 +10,3 @@ "use strict";

exports.SplitPDFArgsSchema = zod_1.z.object({
path: zod_1.z.string().describe('PDF文档的绝对路径'),
path: zod_1.z.string().describe('PDF文档的绝对路径或URL地址'),
config: zod_1.z.object({

@@ -31,5 +31,4 @@ pageCount: zod_1.z.number().int().positive().describe('拆分后的页数'),

doc,
clientId: env.clientId,
path: args.path,
});
}, env);
return {

@@ -36,0 +35,0 @@ content: [{ type: 'text', text: `PDF文档拆分成功:${resultPath}` }],

@@ -7,2 +7,3 @@ "use strict";

exports.requestClientSN = requestClientSN;
exports.requestFileUpload = requestFileUpload;
exports.requestTask = requestTask;

@@ -55,3 +56,3 @@ exports.requestProjectAll = requestProjectAll;

const res = await requestClientSN(params);
config.url = `${url}?sn=${res.data?.sn}&clientId=${clientId}`;
config.url = `${url}${url?.indexOf('?') === -1 ? '?' : '&'}sn=${res.data?.sn}&clientId=${clientId}`;
config.data = data;

@@ -63,6 +64,6 @@ }

const res = await requestClientSN(params);
config.url = `${url}?sn=${res.data?.sn}&clientId=${clientId}&${new URLSearchParams(rest).toString()}`;
config.url = `${url}${url?.indexOf('?') === -1 ? '?' : '&'}sn=${res.data?.sn}&clientId=${clientId}&${new URLSearchParams(rest).toString()}`;
config.params = {};
}
(0, util_1.logToFile)('==> axios.request.resolve', config.url, config.method);
(0, util_1.logToFile)('==>', config.url, config.method);
if (config.data instanceof formdata_node_1.FormData) {

@@ -79,3 +80,3 @@ config.data.forEach((value, key) => {

const { config } = error;
(0, util_1.logToFile)('==> axios.request.reject', config.url, error);
(0, util_1.logToFile)('==>', config.url, error);
return Promise.reject(error);

@@ -85,11 +86,11 @@ });

const { config } = response;
(0, util_1.logToFile)('<== axios.response.resolve', config.url, response.data);
(0, util_1.logToFile)('<==', config.url, response.data);
return response;
}, (error) => {
const { config } = error;
(0, util_1.logToFile)('<== axios.response.reject', config.url, error);
(0, util_1.logToFile)('<==', config.url, error);
return Promise.reject(error);
});
async function requestClientSN(params) {
(0, util_1.logToFile)('==> axios.request', 'post', `/api/client/sn`, params);
// logToFile('==>', 'post', `/api/client/sn`, params);
// const cacheManager = getApp().get(CACHE_MANAGER) as Cache;

@@ -107,7 +108,15 @@ // const keys = Object.keys(params).sort();

// }
const { data: res } = await axios_1.default.post(`${constant_1.SERVICE_API_BASE}/api/client/sn`, params);
(0, util_1.logToFile)('<== axios.response', res);
const { data } = await axios_1.default.post(`${constant_1.SERVICE_API_BASE}/api/client/sn`, params);
// logToFile('<==', `/api/client/sn`, data);
// if (res.data?.sn) {
// await cacheManager.set(cacheKey, res.data.sn, 60 * 60 * 24);
// }
return data;
}
async function requestFileUpload(params) {
params.fileUrl = decodeURIComponent(params.fileUrl); // 需要对`%20`等转义字符进行解码,否则接口会报错
const { data: res } = await devConsoleAxios.post(`/api/file/upload?fileUrl=${params.fileUrl}`, params);
if (res.code !== 0) {
throw new Error(JSON.stringify(res));
}
return res;

@@ -142,3 +151,3 @@ }

async function requestProjectAll(params) {
(0, util_1.logToFile)('==> axios.request', 'post', `/api/client/sn`, params);
(0, util_1.logToFile)('==>', 'post', `/api/client/sn`, params);
// const cacheManager = getApp().get(CACHE_MANAGER) as Cache;

@@ -157,3 +166,3 @@ // const keys = Object.keys(params).sort();

const { data: res } = await axios_1.default.post(`${constant_1.SERVICE_API_BASE}/api/project/all`, params);
(0, util_1.logToFile)('<== axios.response', res);
(0, util_1.logToFile)('<==', res);
// if (res.data?.sn) {

@@ -164,9 +173,12 @@ // await cacheManager.set(cacheKey, res.data.sn, 60 * 60 * 24);

}
async function saveFile(params) {
async function saveFile(params, env) {
(0, util_1.logToFile)('saveFile params', params);
const doc = params.doc;
const clientId = params.clientId;
const fileName = doc.value;
const clientId = env.clientId;
const fileName = decodeURIComponent(doc.value); // 需要对`%20`等转义字符进行解码,否则下载结果不正确
const res = await requestClientSN({ docId: doc.id, fileName, clientId: clientId });
const url = `${constant_1.SERVICE_API_BASE}/api/download?sn=${res.data?.sn}&clientId=${clientId}&docId=${doc.id}&fileName=${fileName}`;
if (env.mode === 'CLOUD') {
return url;
}
const { promise, resolve, reject } = (0, util_1.withResolvers)();

@@ -176,3 +188,3 @@ const response = await axios_1.default.get(url, {

});
const path = `${(0, node_path_1.dirname)(params.path)}/${doc.value}`;
const path = `${(0, util_1.isPath)(params.path) ? (0, node_path_1.dirname)(params.path) : (0, util_1.getDownloadPath)()}/${fileName}`;
const writer = (0, node_fs_1.createWriteStream)(path);

@@ -189,5 +201,12 @@ writer.on('finish', () => {

}
function handleDocParam(formData, path, fileName, key = 'inputDocument') {
const file = (0, node_fs_1.readFileSync)(path);
formData.append(key, new formdata_node_1.File([file], fileName));
async function handleDocParam(formData, params, docIdKey = 'docId', fileKey = 'inputDocument') {
const { path, clientId } = params;
if ((0, util_1.isPath)(path)) {
const file = (0, node_fs_1.readFileSync)(path);
formData.append(fileKey, new formdata_node_1.File([file], (0, node_path_1.basename)(path)));
}
else {
const res = await requestFileUpload({ fileUrl: path, clientId });
formData.append(docIdKey, res.data.docId);
}
}

@@ -200,3 +219,15 @@ async function requestCombine(params) {

}
handleDocParam(formData, params.path, (0, node_path_1.basename)(params.path), 'inputZipDocument');
if (Array.isArray(params.path)) {
let promise = Promise.resolve([]);
params.path.map((item) => {
promise = promise.then((result) => {
return requestFileUpload({ fileUrl: item, clientId: params.clientId }).then(res => [...result, res.data.docId]);
});
});
const docIds = await promise;
formData.append('docIds', JSON.stringify(docIds));
}
else {
await handleDocParam(formData, params, 'docIds', 'inputZipDocument');
}
const res = await devConsoleAxios.post(`/api/document/combine`, formData);

@@ -208,4 +239,4 @@ return res.data;

formData.append('clientId', params.clientId);
handleDocParam(formData, params.basePath, (0, node_path_1.basename)(params.basePath), 'inputBaseDocument');
handleDocParam(formData, params.comparePath, (0, node_path_1.basename)(params.comparePath), 'inputCompareDocument');
await handleDocParam(formData, { path: params.basePath, clientId: params.clientId }, 'baseDocId', 'inputBaseDocument');
await handleDocParam(formData, { path: params.comparePath, clientId: params.clientId }, 'compareDocId', 'inputCompareDocument');
formData.append('resultType', params.resultType);

@@ -220,3 +251,3 @@ formData.append('compareType', params.compareType);

formData.append('compressionLevel', params.compressionLevel);
handleDocParam(formData, params.path, (0, node_path_1.basename)(params.path));
await handleDocParam(formData, params);
const res = await devConsoleAxios.post(`/api/document/compress`, formData);

@@ -229,3 +260,3 @@ return res.data;

formData.append('format', params.format);
handleDocParam(formData, params.path, (0, node_path_1.basename)(params.path));
await handleDocParam(formData, params);
params.config && formData.append('config', params.config);

@@ -239,3 +270,3 @@ const res = await devConsoleAxios.post(`/api/document/convert`, formData);

formData.append('format', params.format);
handleDocParam(formData, params.path, (0, node_path_1.basename)(params.path));
await handleDocParam(formData, params);
const res = await devConsoleAxios.post(`/api/document/create`, formData);

@@ -252,3 +283,3 @@ return res.data;

else {
handleDocParam(formData, params.path, (0, node_path_1.basename)(params.path));
await handleDocParam(formData, params);
}

@@ -269,3 +300,3 @@ if (typeof params.config === 'object' && Object.keys(params.config).length > 0) {

params.pageRange && formData.append('pageRange', params.pageRange);
handleDocParam(formData, params.path, (0, node_path_1.basename)(params.path));
await handleDocParam(formData, params);
const res = await devConsoleAxios.post(`/api/document/extract`, formData);

@@ -278,3 +309,3 @@ return res.data;

formData.append('pageRange', params.pageRange);
handleDocParam(formData, params.path, (0, node_path_1.basename)(params.path));
await handleDocParam(formData, params);
const res = await devConsoleAxios.post(`/api/document/flatten`, formData);

@@ -286,3 +317,3 @@ return res.data;

formData.append('clientId', params.clientId);
handleDocParam(formData, params.path, (0, node_path_1.basename)(params.path));
await handleDocParam(formData, params);
const res = await devConsoleAxios.post(`/api/document/linearize`, formData);

@@ -294,3 +325,3 @@ return res.data;

formData.append('clientId', params.clientId);
handleDocParam(formData, params.path, (0, node_path_1.basename)(params.path));
await handleDocParam(formData, params);
if (typeof params.config === 'object' && Object.keys(params.config).length > 0) {

@@ -308,3 +339,3 @@ formData.append('config', JSON.stringify([params.config]));

formData.append('clientId', params.clientId);
handleDocParam(formData, params.path, (0, node_path_1.basename)(params.path));
await handleDocParam(formData, params);
if (typeof params.passwordProtection === 'object' && Object.keys(params.passwordProtection).length > 0) {

@@ -328,3 +359,3 @@ formData.append('passwordProtection', JSON.stringify(params.passwordProtection));

formData.append('password', params.password);
handleDocParam(formData, params.path, (0, node_path_1.basename)(params.path));
await handleDocParam(formData, params);
const res = await devConsoleAxios.post(`/api/document/removePassword`, formData);

@@ -342,5 +373,5 @@ return res.data;

}
handleDocParam(formData, params.path, (0, node_path_1.basename)(params.path));
await handleDocParam(formData, params);
const res = await devConsoleAxios.post(`/api/document/split`, formData);
return res.data;
}

@@ -43,2 +43,3 @@ "use strict";

exports.getDownloadPath = getDownloadPath;
exports.isPath = isPath;
const node_fs_1 = require("node:fs");

@@ -77,2 +78,5 @@ const promises_1 = __importDefault(require("fs/promises"));

async function validatePath(requestedPath) {
if (!isPath(requestedPath)) {
return requestedPath;
}
let finalPath = requestedPath;

@@ -107,1 +111,4 @@ const expandedPath = expandHome(requestedPath);

}
function isPath(path) {
return typeof path === 'string' && !path.startsWith('http://') && !path.startsWith('https://');
}

@@ -57,3 +57,3 @@ #!/usr/bin/env node

name: 'mcp-server-foxit-cloudapi',
version: '0.0.1',
version: '1.0.1',
}, {

@@ -70,3 +70,4 @@ capabilities: {

description: '将压缩或归档文件中的多个PDF文档,合并为一个PDF文档。'
+ '使用示例1:把<absolute_path/file_name.zip>中的PDF文档合并为一个PDF。',
+ '使用示例1:把<absolute_path/file_name.zip>中的PDF文档合并为一个PDF。'
+ '使用示例2:把<url/file_name.pdf>, <url/file_name1.pdf>合并为一个PDF。',
inputSchema: (0, zod_to_json_schema_1.zodToJsonSchema)(CombinePDF_1.CombinePDFArgsSchema),

@@ -77,4 +78,5 @@ },

description: '逐页比较一个PDF文档(作为“基准文档”)与另一个PDF文档(作为“比较文档”)。'
+ '使用示例1:把<absolute_path/file_name.pdf>与<absolute_path/file_name2.pdf>进行比较。'
+ '使用示例2:把<absolute_path/file_name.pdf>与<absolute_path/file_name2.pdf>进行比较,比较结果为:pdf。',
+ '使用示例1:把<absolute_path/file_name.pdf>与<absolute_path/file_name.pdf>进行比较。'
+ '使用示例2:把<absolute_path/file_name.pdf>与<absolute_path/file_name.pdf>进行比较,比较结果为:pdf。'
+ '使用示例3:把<url/file_name.pdf>与<url/file_name.pdf>进行比较。',
inputSchema: (0, zod_to_json_schema_1.zodToJsonSchema)(ComparePDF_1.ComparePDFArgsSchema),

@@ -86,3 +88,4 @@ },

+ '使用示例1:压缩<absolute_path/file_name.pdf>。'
+ '使用示例2:压缩<absolute_path/file_name.pdf>,压缩级别为:high。',
+ '使用示例2:压缩<absolute_path/file_name.pdf>,压缩级别为:high。'
+ '使用示例3:压缩<url/file_name.pdf>。',
inputSchema: (0, zod_to_json_schema_1.zodToJsonSchema)(CompressPDF_1.CompressPDFArgsSchema),

@@ -94,3 +97,4 @@ },

+ '使用示例1:把<absolute_path/file_name.pdf>转换为word。'
+ '使用示例2:把<absolute_path/file_name.pdf>转换为text。',
+ '使用示例2:把<absolute_path/file_name.pdf>转换为text。'
+ '使用示例3:把<url/file_name.pdf>转换为excel。',
inputSchema: (0, zod_to_json_schema_1.zodToJsonSchema)(ConvertPDF_1.ConvertPDFArgsSchema),

@@ -102,3 +106,4 @@ },

+ '使用示例1:把<absolute_path/file_name.docx>转换为PDF。'
+ '使用示例2:把<absolute_path/file_name.txt>转换为PDF。',
+ '使用示例2:把<absolute_path/file_name.txt>转换为PDF。'
+ '使用示例3:把<url/file_name.png>转换为PDF。',
inputSchema: (0, zod_to_json_schema_1.zodToJsonSchema)(CreatePDF_1.CreatePDFArgsSchema),

@@ -118,3 +123,4 @@ },

+ '使用示例1:提取<absolute_path/file_name.pdf>中的文本。'
+ '使用示例2:提取<absolute_path/file_name.pdf>中的图片。',
+ '使用示例2:提取<absolute_path/file_name.pdf>中的图片。'
+ '使用示例3:提取<url/file_name.pdf>中的文本。',
inputSchema: (0, zod_to_json_schema_1.zodToJsonSchema)(ExtractPDF_1.ExtractPDFArgsSchema),

@@ -125,3 +131,4 @@ },

description: '使PDF文档页面扁平化,使注释和表单字段成为页面内容的一部分。'
+ '使用示例1:把<absolute_path/file_name.pdf>扁平化。',
+ '使用示例1:把<absolute_path/file_name.pdf>扁平化。'
+ '使用示例2:把<url/file_name.pdf>扁平化。',
inputSchema: (0, zod_to_json_schema_1.zodToJsonSchema)(FlattenPDF_1.FlattenPDFArgsSchema),

@@ -132,3 +139,4 @@ },

description: '线性化PDF文档。'
+ '使用示例1:把<absolute_path/file_name.pdf>线性化。',
+ '使用示例1:把<absolute_path/file_name.pdf>线性化。'
+ '使用示例2:把<url/file_name.pdf>线性化。',
inputSchema: (0, zod_to_json_schema_1.zodToJsonSchema)(LinearizePDF_1.LinearizePDFArgsSchema),

@@ -140,3 +148,4 @@ },

+ '使用示例1:删除<absolute_path/file_name.pdf>的第1页。'
+ '使用示例2:把<absolute_path/file_name.pdf>的第2页移到第1页。',
+ '使用示例2:把<absolute_path/file_name.pdf>的第2页移到第1页。'
+ '使用示例3:删除<url/file_name.pdf>的第1页。',
inputSchema: (0, zod_to_json_schema_1.zodToJsonSchema)(ManipulationPDF_1.ManipulationPDFArgsSchema),

@@ -148,3 +157,4 @@ },

+ '使用示例1:给<absolute_path/file_name.pdf>设置用户密码,密码为:123456。'
+ '使用示例2:给<absolute_path/file_name.pdf>设置所有者密码,密码为:123456,权限设置为:不允许修改PDF内容。',
+ '使用示例2:给<absolute_path/file_name.pdf>设置所有者密码,密码为:123456,权限设置为:不允许修改PDF内容。'
+ '使用示例3:给<url/file_name.pdf>设置用户密码,密码为:123456。',
inputSchema: (0, zod_to_json_schema_1.zodToJsonSchema)(ProtectPDF_1.ProtectPDFArgsSchema),

@@ -156,3 +166,4 @@ },

+ '使用示例1:移除<absolute_path/file_name.pdf>的用户密码,密码为:123456。'
+ '使用示例2:移除<absolute_path/file_name.pdf>的所有者密码,密码为:123456。',
+ '使用示例2:移除<absolute_path/file_name.pdf>的所有者密码,密码为:123456。'
+ '使用示例3:移除<url/file_name.pdf>的用户密码,密码为:123456。',
inputSchema: (0, zod_to_json_schema_1.zodToJsonSchema)(RemovePassword_1.RemovePasswordArgsSchema),

@@ -163,3 +174,4 @@ },

description: '将PDF文档拆分为多个较小的文档。'
+ '使用示例1:把<absolute_path/file_name.pdf>拆分为多个文档,拆分后的页数为:3。',
+ '使用示例1:把<absolute_path/file_name.pdf>拆分为多个文档,拆分后的页数为:3。'
+ '使用示例2:把<url/file_name.pdf>拆分为多个文档,拆分后的页数为:2。',
inputSchema: (0, zod_to_json_schema_1.zodToJsonSchema)(SplitPDF_1.SplitPDFArgsSchema),

@@ -178,2 +190,3 @@ }

const env = {
mode: (process.env.MODE || 'LOCAL'),
clientId: process.env.CLIENT_ID,

@@ -180,0 +193,0 @@ };

{
"name": "@foxitsoftware/mcp-server-foxit-cloudapi",
"version": "1.0.0",
"version": "1.0.1",
"description": "MCP server for using the Foxit Cloud API",

@@ -5,0 +5,0 @@ "author": "Foxit Software Inc.",

@@ -9,3 +9,3 @@ # MCP server for using the Foxit Cloud API

- PDF Merging and Splitting: Supports merging multiple PDF files into one or splitting a PDF file into multiple files.
- PDF Compression and Optimization: Reduces PDF file size through image compression and optimization, flattening, linearizing documents, etc.
- PDF Compression and Optimization: Reduces PDF file size through image compression and optimization, flattening, linearization, and other functions.
- PDF Security: Provides password protection and advanced encryption features to ensure the security of PDF files.

@@ -17,6 +17,6 @@

Merge multiple PDF documents from a compressed or archived file into a single PDF document. Example 1: Merge PDF documents from <absolute_path/file_name.zip> into a single PDF.
Merge multiple PDF documents from compressed or archived files into one PDF document. Example 1: Merge PDF documents from <absolute_path/file_name.zip> into one PDF. Example 2: Merge <url/file_name.pdf>, <url/file_name1.pdf> into one PDF.
Parameters:
- path: string - The absolute path of the compressed or archived file
- path: string - Absolute path of the compressed or archived file or multiple URL addresses
- config: object - Configuration options

@@ -27,11 +27,11 @@ - isAddBookmark: boolean - Whether to add bookmarks

- isRetainPageNum: boolean - Whether to retain logical page numbers
- bookmarkLevels: enum('0', '1', '2', '3', '4', '5') - The level of the table of contents to display
- bookmarkLevels: enum('0', '1', '2', '3', '4', '5') - Level of table of contents display
### compare_pdf
Compare a PDF document (as the "base document") with another PDF document (as the "comparison document") page by page. Example 1: Compare <absolute_path/file_name.pdf> with <absolute_path/file_name2.pdf>. Example 2: Compare <absolute_path/file_name.pdf> with <absolute_path/file_name2.pdf>, result as: pdf.
Compare one PDF document (as the "base document") with another PDF document (as the "comparison document") page by page. Example 1: Compare <absolute_path/file_name.pdf> with <absolute_path/file_name.pdf>. Example 2: Compare <absolute_path/file_name.pdf> with <absolute_path/file_name.pdf>, result type: pdf. Example 3: Compare <url/file_name.pdf> with <url/file_name.pdf>.
Parameters:
- basePath: string - The absolute path of the base PDF document
- comparePath: string - The absolute path of the comparison PDF document
- basePath: string - Absolute path or URL address of the base PDF document
- comparePath: string - Absolute path or URL address of the comparison PDF document
- resultType: enum('json', 'pdf') - Result type

@@ -42,6 +42,6 @@ - compareType: enum('all', 'text') - Comparison type

Compress a PDF document using the specified compression level. Example 1: Compress <absolute_path/file_name.pdf>. Example 2: Compress <absolute_path/file_name.pdf>, compression level: high.
Compress PDF documents using the specified compression level. Example 1: Compress <absolute_path/file_name.pdf>. Example 2: Compress <absolute_path/file_name.pdf>, compression level: high. Example 3: Compress <url/file_name.pdf>.
Parameters:
- path: string - The absolute path of the PDF document
- path: string - Absolute path or URL address of the PDF document
- compressionLevel: enum('low', 'medium', 'high') - Compression level

@@ -51,26 +51,27 @@

Convert a PDF document to other formats, supported formats: word, excel, ppt, image, text, html. Example 1: Convert <absolute_path/file_name.pdf> to word. Example 2: Convert <absolute_path/file_name.pdf> to text.
Convert PDF documents to other formats, supported formats: word, excel, ppt, image, text, html. Example 1: Convert <absolute_path/file_name.pdf> to word. Example 2: Convert <absolute_path/file_name.pdf> to text. Example 3: Convert <url/file_name.pdf> to excel.
Parameters:
- path: string - The absolute path of the PDF document
- format: enum('word', 'excel', 'ppt', 'image', 'text', 'html') - The file type after conversion
- path: string - Absolute path or URL address of the PDF document
- format: enum('word', 'excel', 'ppt', 'image', 'text', 'html') - Converted file type
### create_pdf
Create or convert to a PDF document from other formats, supported formats: word, excel, ppt, image, text. Example 1: Convert <absolute_path/file_name.docx> to PDF. Example 2: Convert <absolute_path/file_name.txt> to PDF.
Create or convert to PDF documents from other formats, supported formats: word, excel, ppt, image, text. Example 1: Convert <absolute_path/file_name.docx> to PDF. Example 2: Convert <absolute_path/file_name.txt> to PDF. Example 3: Convert <url/file_name.png> to PDF.
Parameters:
- path: string - The absolute path of the file to convert
- path: string - Absolute path or URL address of the file to be converted
- format: enum('word', 'excel', 'ppt', 'image', 'text') - Input file type
### create_pdf_from_html
Create a PDF from an HTML file or a specified site URL. Example 1: Convert <absolute_path/file_name.html> to PDF. Example 2: Convert \<url> to PDF. Example 3: Convert \<url> to PDF, page mode: single page.
Create PDF from HTML files or specified site URLs. Example 1: Convert <absolute_path/file_name.html> to PDF. Example 2: Convert <url> to PDF. Example 3: Convert <url> to PDF, page mode: single page.
Parameters:
- format: enum('url', 'html', 'htm', 'shtml') - Input format, if url, the url parameter cannot be empty, otherwise the path parameter cannot be empty
- path: string - The absolute path of the HTML file
- path: string - Absolute path or URL address of the HTML file
- url: string - URL
- config: object - Configuration options
- width: number - Page width, must be greater than 16, default is 900 (unit is 1/72 inch)
- height: number - Page height, must be greater than 16, default is 600 (unit is 1/72 inch)
- width: number - Page width, must be greater than 16, default value is 900 (unit is 1/72 inch)
- height: number - Page height, must be greater than 16, default value is 600 (unit is 1/72 inch)
- rotate: number - Page rotation, 0: 0 degrees, 1: 90 degrees, 2: 180 degrees, 3: 270 degrees

@@ -82,42 +83,42 @@ - pageMode: number - Page mode, 0: single page, 1: multiple pages

Extract text or images from a PDF document. Example 1: Extract text from <absolute_path/file_name.pdf>. Example 2: Extract images from <absolute_path/file_name.pdf>.
Extract text or images from PDF documents. Example 1: Extract text from <absolute_path/file_name.pdf>. Example 2: Extract images from <absolute_path/file_name.pdf>. Example 3: Extract text from <url/file_name.pdf>.
Parameters:
- path: string - The absolute path of the PDF document
- path: string - Absolute path or URL address of the PDF document
- mode: enum('extractImages', 'extractText') - Extraction mode, extractText means extracting text, extractImages means extracting images
- pageRange: string - Page range to extract, separated by commas for A, B, and C. A, B, or C can be a number, such as 99, or a range, such as 1-30. If empty, the entire document is extracted
- pageRange: string - Page range for extraction, separated by commas for A, B, and C. A, B, or C can be a number, such as 99, or a range, such as 1-30. If empty, the entire document is extracted
### flatten_pdf
Flatten the pages of a PDF document, making annotations and form fields part of the page content. Example 1: Flatten <absolute_path/file_name.pdf>.
Flatten PDF document pages, making annotations and form fields part of the page content. Example 1: Flatten <absolute_path/file_name.pdf>. Example 2: Flatten <url/file_name.pdf>.
Parameters:
- path: string - The absolute path of the PDF document
- pageRange: string - Page range of the PDF document. Pages in the document can be referenced in any order, from the start or end. For example: 1, 2, 3, 7-9, all. If not specified, all pages are executed
- path: string - Absolute path or URL address of the PDF document
- pageRange: string - Page range of the PDF document. Pages in the document can be referenced in any order, from start or end. For example: 1, 2, 3, 7-9, all. If not specified, all pages are executed
### linearize_pdf
Linearize a PDF document. Example 1: Linearize <absolute_path/file_name.pdf>.
Linearize PDF documents. Example 1: Linearize <absolute_path/file_name.pdf>. Example 2: Linearize <url/file_name.pdf>.
Parameters:
- path: string - The absolute path of the PDF document
- path: string - Absolute path or URL address of the PDF document
### manipulation_pdf
Manipulate a PDF document, such as deleting pages, rotating pages, moving pages. Example 1: Delete the first page of <absolute_path/file_name.pdf>. Example 2: Move the second page of <absolute_path/file_name.pdf> to the first page.
Manipulate PDF documents, such as deleting pages, rotating pages, moving pages. Example 1: Delete page 1 of <absolute_path/file_name.pdf>. Example 2: Move page 2 of <absolute_path/file_name.pdf> to page 1. Example 3: Delete page 1 of <url/file_name.pdf>.
Parameters:
- path: string - The absolute path of the PDF document
- path: string - Absolute path or URL address of the PDF document
- config: object - PDF document operation configuration
- pageAction: enum('delete', 'rotate', 'move') - Page operation type
- pages: array(number) - Pages to operate on, such as [0,1,2,3], page index starts from 0
- pages: array(number) - Page numbers to operate on, such as [0,1,2,3], page index starts from 0
- angle: number - Page rotation, 0: 0 degrees, 1: 90 degrees, 2: 180 degrees, -1: 270 degrees
- destination: number - Target page number, required if "page operation type" is "move"
- destination: number - Destination page number, required if "page operation type" is "move"
### protect_pdf
Protect a PDF document with a user and/or owner password and set restrictions on certain features. Example 1: Set a user password for <absolute_path/file_name.pdf>, password: 123456. Example 2: Set an owner password for <absolute_path/file_name.pdf>, password: 123456, permission set to: do not allow modification of PDF content.
Protect PDF documents with user and/or owner passwords and set restrictions on certain functions. Example 1: Set user password for <absolute_path/file_name.pdf>, password: 123456. Example 2: Set owner password for <absolute_path/file_name.pdf>, password: 123456, permission settings: do not allow modification of PDF content. Example 3: Set user password for <url/file_name.pdf>, password: 123456.
Parameters:
- path: string - The absolute path of the PDF document
- path: string - Absolute path or URL address of the PDF document
- passwordProtection: object - Password protection settings, at least one password must be set

@@ -129,7 +130,7 @@ - userPassword: string - User password

- PRINT_HIGH_QUALITY: boolean - Print PDF document in high quality
- EDIT_CONTENT: boolean - Modify PDF content. After setting this value, users can modify the content of the PDF document through operations
- EDIT_FILL_AND_SIGN_FORM_FIELDS: boolean - Fill in PDF forms. If this value is set, users can fill in interactive form fields (including signature fields)
- EDIT_ANNOTATION: boolean - Operate text annotations and fill in interactive form fields. If the "modify PDF content" value is also set, users can create or modify interactive form fields
- EDIT_DOCUMENT_ASSEMBLY: boolean - Assemble PDF documents. If this value is set, documents can be assembled (insert, rotate, or delete pages and create bookmarks or thumbnails), regardless of whether the "modify PDF content" value is set
- COPY_CONTENT: boolean - Support for disabilities. If this value is set, users can extract text and graphics to support accessibility for disabled users or for other purposes
- EDIT_CONTENT: boolean - Modify PDF content. If set, users can modify the content of the PDF document through operations
- EDIT_FILL_AND_SIGN_FORM_FIELDS: boolean - Fill PDF forms. If set, users can fill interactive form fields (including signature fields)
- EDIT_ANNOTATION: boolean - Operate text annotations and fill interactive form fields. If "modify PDF content" is also set, users can create or modify interactive form fields
- EDIT_DOCUMENT_ASSEMBLY: boolean - Assemble PDF documents. If set, documents can be assembled (insert, rotate or delete pages and create bookmarks or thumbnails), regardless of whether "modify PDF content" is set
- COPY_CONTENT: boolean - Support for disabilities. If set, users can extract text and graphics to support accessibility for disabled users or for other purposes
- encryptionAlgorithm: enum('AES_128', 'AES_256', 'RC4') - Encryption algorithm

@@ -139,6 +140,6 @@

Remove password security from a PDF document. Example 1: Remove the user password from <absolute_path/file_name.pdf>, password: 123456. Example 2: Remove the owner password from <absolute_path/file_name.pdf>, password: 123456.
Remove password security from PDF documents. Example 1: Remove user password from <absolute_path/file_name.pdf>, password: 123456. Example 2: Remove owner password from <absolute_path/file_name.pdf>, password: 123456. Example 3: Remove user password from <url/file_name.pdf>, password: 123456.
Parameters:
- path: string - The absolute path of the PDF document
- path: string - Absolute path or URL address of the PDF document
- password: string - PDF document password. If the PDF is protected by an owner password, the user needs to use the owner password in this field to remove document security, otherwise the user needs to pass in the user password to open the document

@@ -148,10 +149,10 @@

Split a PDF document into multiple smaller documents. Example 1: Split <absolute_path/file_name.pdf> into multiple documents, number of pages after splitting: 3.
Split PDF documents into multiple smaller documents. Example 1: Split <absolute_path/file_name.pdf> into multiple documents, number of pages after splitting: 3. Example 2: Split <url/file_name.pdf> into multiple documents, number of pages after splitting: 2.
Parameters:
- path: string - The absolute path of the PDF document
- path: string - Absolute path or URL address of the PDF document
- config: object - Configuration options
- pageCount: number - Number of pages after splitting
## Use in VS Code's GitHub Copilot
## Using in VS Code's GitHub Copilot

@@ -183,3 +184,3 @@ Open the VS Code configuration file `settings.json`, add the following configuration, and replace `your_client_id`:

## Use in VS Code's Cline
## Using in VS Code's Cline

@@ -186,0 +187,0 @@ Open the Cline MCP configuration file `cline_mcp_settings.json`, add the following configuration, and replace `your_client_id`:

+27
-27

@@ -16,6 +16,6 @@ # MCP server for using the Foxit Cloud API

将压缩或归档文件中的多个PDF文档,合并为一个PDF文档。使用示例1:把<absolute_path/file_name.zip>中的PDF文档合并为一个PDF。
将压缩或归档文件中的多个PDF文档,合并为一个PDF文档。使用示例1:把<absolute_path/file_name.zip>中的PDF文档合并为一个PDF。使用示例2:把<url/file_name.pdf>, <url/file_name1.pdf>合并为一个PDF。
参数:
- path: string - 压缩或归档文件的绝对路径
- path: string - 压缩或归档文件的绝对路径或多个URL地址
- config: object - 配置项

@@ -30,7 +30,7 @@ - isAddBookmark: boolean - 是否添加书签

逐页比较一个PDF文档(作为“基准文档”)与另一个PDF文档(作为“比较文档”)。使用示例1:把<absolute_path/file_name.pdf>与<absolute_path/file_name2.pdf>进行比较。使用示例2:把<absolute_path/file_name.pdf>与<absolute_path/file_name2.pdf>进行比较,比较结果为:pdf。
逐页比较一个PDF文档(作为“基准文档”)与另一个PDF文档(作为“比较文档”)。使用示例1:把<absolute_path/file_name.pdf>与<absolute_path/file_name.pdf>进行比较。使用示例2:把<absolute_path/file_name.pdf>与<absolute_path/file_name.pdf>进行比较,比较结果为:pdf。使用示例3:把<url/file_name.pdf>与<url/file_name.pdf>进行比较。
参数:
- basePath: string - 基准PDF文档的绝对路径
- comparePath: string - 比较PDF文档的绝对路径
- basePath: string - 基准PDF文档的绝对路径或URL地址
- comparePath: string - 比较PDF文档的绝对路径或URL地址
- resultType: enum('json', 'pdf') - 结果类型

@@ -41,6 +41,6 @@ - compareType: enum('all', 'text') - 比较类型

使用指定的压缩级别压缩PDF文档。使用示例1:压缩<absolute_path/file_name.pdf>。使用示例2:压缩<absolute_path/file_name.pdf>,压缩级别为:high。
使用指定的压缩级别压缩PDF文档。使用示例1:压缩<absolute_path/file_name.pdf>。使用示例2:压缩<absolute_path/file_name.pdf>,压缩级别为:high。使用示例3:压缩<url/file_name.pdf>。
参数:
- path: string - PDF文档的绝对路径
- path: string - PDF文档的绝对路径或URL地址
- compressionLevel: enum('low', 'medium', 'high') - 压缩级别

@@ -50,6 +50,6 @@

转换PDF文档到其他格式,支持格式:word, excel, ppt, image, text, html。使用示例1:把<absolute_path/file_name.pdf>转换为word。使用示例2:把<absolute_path/file_name.pdf>转换为text。
转换PDF文档到其他格式,支持格式:word, excel, ppt, image, text, html。使用示例1:把<absolute_path/file_name.pdf>转换为word。使用示例2:把<absolute_path/file_name.pdf>转换为text。使用示例3:把<url/file_name.pdf>转换为excel。
参数:
- path: string - PDF文档的绝对路径
- path: string - PDF文档的绝对路径或URL地址
- format: enum('word', 'excel', 'ppt', 'image', 'text', 'html') - 转换后的文件类型

@@ -59,6 +59,7 @@

从其他格式,创建或转换为PDF文档,支持格式:word,excel,ppt,image,text。使用示例1:把<absolute_path/file_name.docx>转换为PDF。使用示例2:把<absolute_path/file_name.txt>转换为PDF。
从其他格式,创建或转换为PDF文档,支持格式:word,excel,ppt,image,text。使用示例1:把<absolute_path/file_name.docx>转换为PDF。使用示例2:把<absolute_path/file_name.txt>转换为PDF。使用示例3:把<url/file_name.png>转换为PDF。
参数:
- path: string - 转换文件的绝对路径
- path: string - 转换文件的绝对路径或URL地址
- format: enum('word', 'excel', 'ppt', 'image', 'text') - 输入的文件类型

@@ -71,3 +72,3 @@ ### create_pdf_from_html

- format: enum('url', 'html', 'htm', 'shtml') - 输入格式,如果是url,则url参数不能为空,否则path参数不能为空
- path: string - HTML文件的绝对路径
- path: string - HTML文件的绝对路径或URL地址
- url: string - URL

@@ -83,6 +84,6 @@ - config: object - 配置项

提取PDF文档中的文本或图像。使用示例1:提取<absolute_path/file_name.pdf>中的文本。使用示例2:提取<absolute_path/file_name.pdf>中的图片。
提取PDF文档中的文本或图像。使用示例1:提取<absolute_path/file_name.pdf>中的文本。使用示例2:提取<absolute_path/file_name.pdf>中的图片。使用示例3:提取<url/file_name.pdf>中的文本。
参数:
- path: string - PDF文档的绝对路径
- path: string - PDF文档的绝对路径或URL地址
- mode: enum('extractImages', 'extractText') - 提取模式,extractText表示提取文本,extractImages表示提取图片

@@ -93,6 +94,6 @@ - pageRange: string - 提取页面范围,A、B和C以逗号分隔。A、B或C可以取数字,如99,也可以取范围,如1-30。如果为空,则提取整个文档

使PDF文档页面扁平化,使注释和表单字段成为页面内容的一部分。使用示例1:把<absolute_path/file_name.pdf>扁平化。
使PDF文档页面扁平化,使注释和表单字段成为页面内容的一部分。使用示例1:把<absolute_path/file_name.pdf>扁平化。使用示例2:把<url/file_name.pdf>扁平化。
参数:
- path: string - PDF文档的绝对路径
- path: string - PDF文档的绝对路径或URL地址
- pageRange: string - PDF文档的页面范围。文档中的页面可以按任何顺序引用,从开始或结束都可以。例如:1、2、3、7-9,全部。如果未指定,则执行所有页面

@@ -102,13 +103,13 @@

线性化PDF文档。使用示例1:把<absolute_path/file_name.pdf>线性化。
线性化PDF文档。使用示例1:把<absolute_path/file_name.pdf>线性化。使用示例2:把<url/file_name.pdf>线性化。
参数:
- path: string - PDF文档的绝对路径
- path: string - PDF文档的绝对路径或URL地址
### manipulation_pdf
操作PDF文档,例如删除页面,旋转页面,移动页面。使用示例1:删除<absolute_path/file_name.pdf>的第1页。使用示例2:把<absolute_path/file_name.pdf>的第2页移到第1页。
操作PDF文档,例如删除页面,旋转页面,移动页面。使用示例1:删除<absolute_path/file_name.pdf>的第1页。使用示例2:把<absolute_path/file_name.pdf>的第2页移到第1页。使用示例3:删除<url/file_name.pdf>的第1页。
参数:
- path: string - PDF文档的绝对路径
- path: string - PDF文档的绝对路径或URL地址
- config: object - PDF文档操作配置

@@ -122,6 +123,6 @@ - pageAction: enum('delete', 'rotate', 'move') - 页面操作类型

使用用户或/和所有者密码保护PDF文档,并对某些功能设置限制。使用示例1:给<absolute_path/file_name.pdf>设置用户密码,密码为:123456。使用示例2:给<absolute_path/file_name.pdf>设置所有者密码,密码为:123456,权限设置为:不允许修改PDF内容。
使用用户或/和所有者密码保护PDF文档,并对某些功能设置限制。使用示例1:给<absolute_path/file_name.pdf>设置用户密码,密码为:123456。使用示例2:给<absolute_path/file_name.pdf>设置所有者密码,密码为:123456,权限设置为:不允许修改PDF内容。使用示例3:给<url/file_name.pdf>设置用户密码,密码为:123456。
参数:
- path: string - PDF文档的绝对路径
- path: string - PDF文档的绝对路径或URL地址
- passwordProtection: object - 密码保护设置,必须至少设置一个密码

@@ -142,6 +143,6 @@ - userPassword: string - 用户密码

从PDF文档中删除密码安全性。使用示例1:移除<absolute_path/file_name.pdf>的用户密码,密码为:123456。使用示例2:移除<absolute_path/file_name.pdf>的所有者密码,密码为:123456。
从PDF文档中删除密码安全性。使用示例1:移除<absolute_path/file_name.pdf>的用户密码,密码为:123456。使用示例2:移除<absolute_path/file_name.pdf>的所有者密码,密码为:123456。使用示例3:移除<url/file_name.pdf>的用户密码,密码为:123456。
参数:
- path: string - PDF文档的绝对路径
- path: string - PDF文档的绝对路径或URL地址
- password: string - PDF文档密码。如果PDF受所有者密码保护,则用户需要在该字段中使用所有者密码来取消文档安全性,否则用户需要传入用户密码来打开文档

@@ -151,6 +152,6 @@

将PDF文档拆分为多个较小的文档。使用示例1:把<absolute_path/file_name.pdf>拆分为多个文档,拆分后的页数为:3。
将PDF文档拆分为多个较小的文档。使用示例1:把<absolute_path/file_name.pdf>拆分为多个文档,拆分后的页数为:3。使用示例2:把<url/file_name.pdf>拆分为多个文档,拆分后的页数为:2。
参数:
- path: string - PDF文档的绝对路径
- path: string - PDF文档的绝对路径或URL地址
- config: object - 配置项

@@ -241,2 +242,1 @@ - pageCount: number - 拆分后的页数

```