@codeqr/ts-mcp 0.9.0 → 0.24.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.
- package/LICENSE +1 -1
- package/README.md +16 -218
- package/auth.d.mts +6 -0
- package/auth.d.mts.map +1 -0
- package/auth.d.ts +6 -0
- package/auth.d.ts.map +1 -0
- package/auth.js +37 -0
- package/auth.js.map +1 -0
- package/{headers.mjs → auth.mjs} +16 -2
- package/auth.mjs.map +1 -0
- package/code-tool-paths.cjs +8 -0
- package/code-tool-paths.cjs.map +1 -0
- package/code-tool-paths.d.cts +2 -0
- package/code-tool-paths.d.cts.map +1 -0
- package/code-tool-types.d.mts +7 -9
- package/code-tool-types.d.mts.map +1 -1
- package/code-tool-types.d.ts +7 -9
- package/code-tool-types.d.ts.map +1 -1
- package/code-tool-worker.d.mts +5 -0
- package/code-tool-worker.d.mts.map +1 -0
- package/code-tool-worker.d.ts +5 -0
- package/code-tool-worker.d.ts.map +1 -0
- package/code-tool-worker.js +291 -0
- package/code-tool-worker.js.map +1 -0
- package/code-tool-worker.mjs +253 -0
- package/code-tool-worker.mjs.map +1 -0
- package/code-tool.d.mts +12 -45
- package/code-tool.d.mts.map +1 -1
- package/code-tool.d.ts +12 -45
- package/code-tool.d.ts.map +1 -1
- package/code-tool.js +264 -27
- package/code-tool.js.map +1 -1
- package/code-tool.mjs +231 -27
- package/code-tool.mjs.map +1 -1
- package/docs-search-tool.d.mts +12 -3
- package/docs-search-tool.d.mts.map +1 -1
- package/docs-search-tool.d.ts +12 -3
- package/docs-search-tool.d.ts.map +1 -1
- package/docs-search-tool.js +23 -10
- package/docs-search-tool.js.map +1 -1
- package/docs-search-tool.mjs +22 -10
- package/docs-search-tool.mjs.map +1 -1
- package/http.d.mts +6 -3
- package/http.d.mts.map +1 -1
- package/http.d.ts +6 -3
- package/http.d.ts.map +1 -1
- package/http.js +130 -48
- package/http.js.map +1 -1
- package/http.mjs +130 -48
- package/http.mjs.map +1 -1
- package/index.js +19 -50
- package/index.js.map +1 -1
- package/index.mjs +19 -50
- package/index.mjs.map +1 -1
- package/instructions.d.mts +5 -0
- package/instructions.d.mts.map +1 -0
- package/instructions.d.ts +5 -0
- package/instructions.d.ts.map +1 -0
- package/instructions.js +45 -0
- package/instructions.js.map +1 -0
- package/instructions.mjs +39 -0
- package/instructions.mjs.map +1 -0
- package/local-docs-search.d.mts +28 -0
- package/local-docs-search.d.mts.map +1 -0
- package/local-docs-search.d.ts +28 -0
- package/local-docs-search.d.ts.map +1 -0
- package/local-docs-search.js +1259 -0
- package/local-docs-search.js.map +1 -0
- package/local-docs-search.mjs +1219 -0
- package/local-docs-search.mjs.map +1 -0
- package/logger.d.mts +7 -0
- package/logger.d.mts.map +1 -0
- package/logger.d.ts +7 -0
- package/logger.d.ts.map +1 -0
- package/logger.js +29 -0
- package/logger.js.map +1 -0
- package/logger.mjs +22 -0
- package/logger.mjs.map +1 -0
- package/methods.d.mts +10 -0
- package/methods.d.mts.map +1 -0
- package/methods.d.ts +10 -0
- package/methods.d.ts.map +1 -0
- package/methods.js +215 -0
- package/methods.js.map +1 -0
- package/methods.mjs +211 -0
- package/methods.mjs.map +1 -0
- package/options.d.mts +12 -9
- package/options.d.mts.map +1 -1
- package/options.d.ts +12 -9
- package/options.d.ts.map +1 -1
- package/options.js +67 -353
- package/options.js.map +1 -1
- package/options.mjs +67 -353
- package/options.mjs.map +1 -1
- package/package.json +94 -60
- package/server.d.mts +19 -16
- package/server.d.mts.map +1 -1
- package/server.d.ts +19 -16
- package/server.d.ts.map +1 -1
- package/server.js +95 -101
- package/server.js.map +1 -1
- package/server.mjs +94 -96
- package/server.mjs.map +1 -1
- package/src/{headers.ts → auth.ts} +18 -1
- package/src/code-tool-paths.cts +5 -0
- package/src/code-tool-types.ts +8 -9
- package/src/code-tool-worker.ts +304 -0
- package/src/code-tool.ts +292 -36
- package/src/docs-search-tool.ts +34 -14
- package/src/http.ts +154 -54
- package/src/index.ts +22 -63
- package/src/instructions.ts +57 -0
- package/src/local-docs-search.ts +1368 -0
- package/src/logger.ts +28 -0
- package/src/methods.ts +236 -0
- package/src/options.ts +90 -378
- package/src/server.ts +118 -117
- package/src/stdio.ts +9 -5
- package/src/{tools/types.ts → types.ts} +16 -5
- package/src/util.ts +25 -0
- package/stdio.d.mts +1 -1
- package/stdio.d.mts.map +1 -1
- package/stdio.d.ts +1 -1
- package/stdio.d.ts.map +1 -1
- package/stdio.js +8 -4
- package/stdio.js.map +1 -1
- package/stdio.mjs +8 -4
- package/stdio.mjs.map +1 -1
- package/{tools/types.d.mts → types.d.mts} +15 -2
- package/types.d.mts.map +1 -0
- package/{tools/types.d.ts → types.d.ts} +15 -2
- package/types.d.ts.map +1 -0
- package/types.js.map +1 -0
- package/types.mjs.map +1 -0
- package/util.d.mts +4 -0
- package/util.d.mts.map +1 -0
- package/util.d.ts +4 -0
- package/util.d.ts.map +1 -0
- package/util.js +30 -0
- package/util.js.map +1 -0
- package/util.mjs +24 -0
- package/util.mjs.map +1 -0
- package/compat.d.mts +0 -58
- package/compat.d.mts.map +0 -1
- package/compat.d.ts +0 -58
- package/compat.d.ts.map +0 -1
- package/compat.js +0 -387
- package/compat.js.map +0 -1
- package/compat.mjs +0 -378
- package/compat.mjs.map +0 -1
- package/dynamic-tools.d.mts +0 -12
- package/dynamic-tools.d.mts.map +0 -1
- package/dynamic-tools.d.ts +0 -12
- package/dynamic-tools.d.ts.map +0 -1
- package/dynamic-tools.js +0 -135
- package/dynamic-tools.js.map +0 -1
- package/dynamic-tools.mjs +0 -132
- package/dynamic-tools.mjs.map +0 -1
- package/filtering.d.mts +0 -3
- package/filtering.d.mts.map +0 -1
- package/filtering.d.ts +0 -3
- package/filtering.d.ts.map +0 -1
- package/filtering.js +0 -24
- package/filtering.js.map +0 -1
- package/filtering.mjs +0 -16
- package/filtering.mjs.map +0 -1
- package/headers.d.mts +0 -4
- package/headers.d.mts.map +0 -1
- package/headers.d.ts +0 -4
- package/headers.d.ts.map +0 -1
- package/headers.js +0 -22
- package/headers.js.map +0 -1
- package/headers.mjs.map +0 -1
- package/src/compat.ts +0 -483
- package/src/dynamic-tools.ts +0 -153
- package/src/filtering.ts +0 -18
- package/src/tools/analytics/retrieve-analytics.ts +0 -441
- package/src/tools/domains/create-domains.ts +0 -75
- package/src/tools/domains/delete-domains.ts +0 -55
- package/src/tools/domains/list-domains.ts +0 -68
- package/src/tools/domains/update-domains.ts +0 -79
- package/src/tools/events/list-events.ts +0 -421
- package/src/tools/index.ts +0 -133
- package/src/tools/links/bulk/create-links-bulk.ts +0 -966
- package/src/tools/links/bulk/delete-links-bulk.ts +0 -59
- package/src/tools/links/count-links.ts +0 -957
- package/src/tools/links/create-links.ts +0 -957
- package/src/tools/links/delete-links.ts +0 -56
- package/src/tools/links/list-links.ts +0 -980
- package/src/tools/links/retrieve-info-links.ts +0 -75
- package/src/tools/links/update-links.ts +0 -964
- package/src/tools/links/upsert-links.ts +0 -958
- package/src/tools/projects/list-projects.ts +0 -51
- package/src/tools/projects/retrieve-projects.ts +0 -56
- package/src/tools/qrcodes/bulk/create-qrcodes-bulk.ts +0 -1077
- package/src/tools/qrcodes/bulk/delete-qrcodes-bulk.ts +0 -59
- package/src/tools/qrcodes/count-qrcodes.ts +0 -220
- package/src/tools/qrcodes/create-qrcodes.ts +0 -1067
- package/src/tools/qrcodes/delete-qrcodes.ts +0 -56
- package/src/tools/qrcodes/list-qrcodes.ts +0 -221
- package/src/tools/qrcodes/retrieve-qrcodes.ts +0 -67
- package/src/tools/qrcodes/update-qrcodes.ts +0 -1074
- package/src/tools/qrcodes/upsert-qrcodes.ts +0 -1068
- package/src/tools/tags/create-tags.ts +0 -59
- package/src/tools/tags/delete-tags.ts +0 -55
- package/src/tools/tags/list-tags.ts +0 -87
- package/src/tools/tags/update-tags.ts +0 -63
- package/src/tools/track/track-lead-track.ts +0 -93
- package/src/tools/track/track-sale-track.ts +0 -108
- package/src/tools.ts +0 -1
- package/tools/analytics/retrieve-analytics.d.mts +0 -51
- package/tools/analytics/retrieve-analytics.d.mts.map +0 -1
- package/tools/analytics/retrieve-analytics.d.ts +0 -51
- package/tools/analytics/retrieve-analytics.d.ts.map +0 -1
- package/tools/analytics/retrieve-analytics.js +0 -438
- package/tools/analytics/retrieve-analytics.js.map +0 -1
- package/tools/analytics/retrieve-analytics.mjs +0 -431
- package/tools/analytics/retrieve-analytics.mjs.map +0 -1
- package/tools/domains/create-domains.d.mts +0 -51
- package/tools/domains/create-domains.d.mts.map +0 -1
- package/tools/domains/create-domains.d.ts +0 -51
- package/tools/domains/create-domains.d.ts.map +0 -1
- package/tools/domains/create-domains.js +0 -74
- package/tools/domains/create-domains.js.map +0 -1
- package/tools/domains/create-domains.mjs +0 -67
- package/tools/domains/create-domains.mjs.map +0 -1
- package/tools/domains/delete-domains.d.mts +0 -51
- package/tools/domains/delete-domains.d.mts.map +0 -1
- package/tools/domains/delete-domains.d.ts +0 -51
- package/tools/domains/delete-domains.d.ts.map +0 -1
- package/tools/domains/delete-domains.js +0 -55
- package/tools/domains/delete-domains.js.map +0 -1
- package/tools/domains/delete-domains.mjs +0 -48
- package/tools/domains/delete-domains.mjs.map +0 -1
- package/tools/domains/list-domains.d.mts +0 -51
- package/tools/domains/list-domains.d.mts.map +0 -1
- package/tools/domains/list-domains.d.ts +0 -51
- package/tools/domains/list-domains.d.ts.map +0 -1
- package/tools/domains/list-domains.js +0 -67
- package/tools/domains/list-domains.js.map +0 -1
- package/tools/domains/list-domains.mjs +0 -60
- package/tools/domains/list-domains.mjs.map +0 -1
- package/tools/domains/update-domains.d.mts +0 -51
- package/tools/domains/update-domains.d.mts.map +0 -1
- package/tools/domains/update-domains.d.ts +0 -51
- package/tools/domains/update-domains.d.ts.map +0 -1
- package/tools/domains/update-domains.js +0 -78
- package/tools/domains/update-domains.js.map +0 -1
- package/tools/domains/update-domains.mjs +0 -71
- package/tools/domains/update-domains.mjs.map +0 -1
- package/tools/events/list-events.d.mts +0 -51
- package/tools/events/list-events.d.mts.map +0 -1
- package/tools/events/list-events.d.ts +0 -51
- package/tools/events/list-events.d.ts.map +0 -1
- package/tools/events/list-events.js +0 -418
- package/tools/events/list-events.js.map +0 -1
- package/tools/events/list-events.mjs +0 -411
- package/tools/events/list-events.mjs.map +0 -1
- package/tools/index.d.mts +0 -10
- package/tools/index.d.mts.map +0 -1
- package/tools/index.d.ts +0 -10
- package/tools/index.d.ts.map +0 -1
- package/tools/index.js +0 -117
- package/tools/index.js.map +0 -1
- package/tools/index.mjs +0 -110
- package/tools/index.mjs.map +0 -1
- package/tools/links/bulk/create-links-bulk.d.mts +0 -51
- package/tools/links/bulk/create-links-bulk.d.mts.map +0 -1
- package/tools/links/bulk/create-links-bulk.d.ts +0 -51
- package/tools/links/bulk/create-links-bulk.d.ts.map +0 -1
- package/tools/links/bulk/create-links-bulk.js +0 -956
- package/tools/links/bulk/create-links-bulk.js.map +0 -1
- package/tools/links/bulk/create-links-bulk.mjs +0 -949
- package/tools/links/bulk/create-links-bulk.mjs.map +0 -1
- package/tools/links/bulk/delete-links-bulk.d.mts +0 -51
- package/tools/links/bulk/delete-links-bulk.d.mts.map +0 -1
- package/tools/links/bulk/delete-links-bulk.d.ts +0 -51
- package/tools/links/bulk/delete-links-bulk.d.ts.map +0 -1
- package/tools/links/bulk/delete-links-bulk.js +0 -58
- package/tools/links/bulk/delete-links-bulk.js.map +0 -1
- package/tools/links/bulk/delete-links-bulk.mjs +0 -51
- package/tools/links/bulk/delete-links-bulk.mjs.map +0 -1
- package/tools/links/count-links.d.mts +0 -51
- package/tools/links/count-links.d.mts.map +0 -1
- package/tools/links/count-links.d.ts +0 -51
- package/tools/links/count-links.d.ts.map +0 -1
- package/tools/links/count-links.js +0 -951
- package/tools/links/count-links.js.map +0 -1
- package/tools/links/count-links.mjs +0 -944
- package/tools/links/count-links.mjs.map +0 -1
- package/tools/links/create-links.d.mts +0 -51
- package/tools/links/create-links.d.mts.map +0 -1
- package/tools/links/create-links.d.ts +0 -51
- package/tools/links/create-links.d.ts.map +0 -1
- package/tools/links/create-links.js +0 -947
- package/tools/links/create-links.js.map +0 -1
- package/tools/links/create-links.mjs +0 -940
- package/tools/links/create-links.mjs.map +0 -1
- package/tools/links/delete-links.d.mts +0 -51
- package/tools/links/delete-links.d.mts.map +0 -1
- package/tools/links/delete-links.d.ts +0 -51
- package/tools/links/delete-links.d.ts.map +0 -1
- package/tools/links/delete-links.js +0 -55
- package/tools/links/delete-links.js.map +0 -1
- package/tools/links/delete-links.mjs +0 -48
- package/tools/links/delete-links.mjs.map +0 -1
- package/tools/links/list-links.d.mts +0 -51
- package/tools/links/list-links.d.mts.map +0 -1
- package/tools/links/list-links.d.ts +0 -51
- package/tools/links/list-links.d.ts.map +0 -1
- package/tools/links/list-links.js +0 -973
- package/tools/links/list-links.js.map +0 -1
- package/tools/links/list-links.mjs +0 -966
- package/tools/links/list-links.mjs.map +0 -1
- package/tools/links/retrieve-info-links.d.mts +0 -51
- package/tools/links/retrieve-info-links.d.mts.map +0 -1
- package/tools/links/retrieve-info-links.d.ts +0 -51
- package/tools/links/retrieve-info-links.d.ts.map +0 -1
- package/tools/links/retrieve-info-links.js +0 -71
- package/tools/links/retrieve-info-links.js.map +0 -1
- package/tools/links/retrieve-info-links.mjs +0 -64
- package/tools/links/retrieve-info-links.mjs.map +0 -1
- package/tools/links/update-links.d.mts +0 -51
- package/tools/links/update-links.d.mts.map +0 -1
- package/tools/links/update-links.d.ts +0 -51
- package/tools/links/update-links.d.ts.map +0 -1
- package/tools/links/update-links.js +0 -953
- package/tools/links/update-links.js.map +0 -1
- package/tools/links/update-links.mjs +0 -946
- package/tools/links/update-links.mjs.map +0 -1
- package/tools/links/upsert-links.d.mts +0 -51
- package/tools/links/upsert-links.d.mts.map +0 -1
- package/tools/links/upsert-links.d.ts +0 -51
- package/tools/links/upsert-links.d.ts.map +0 -1
- package/tools/links/upsert-links.js +0 -947
- package/tools/links/upsert-links.js.map +0 -1
- package/tools/links/upsert-links.mjs +0 -940
- package/tools/links/upsert-links.mjs.map +0 -1
- package/tools/projects/list-projects.d.mts +0 -51
- package/tools/projects/list-projects.d.mts.map +0 -1
- package/tools/projects/list-projects.d.ts +0 -51
- package/tools/projects/list-projects.d.ts.map +0 -1
- package/tools/projects/list-projects.js +0 -51
- package/tools/projects/list-projects.js.map +0 -1
- package/tools/projects/list-projects.mjs +0 -44
- package/tools/projects/list-projects.mjs.map +0 -1
- package/tools/projects/retrieve-projects.d.mts +0 -51
- package/tools/projects/retrieve-projects.d.mts.map +0 -1
- package/tools/projects/retrieve-projects.d.ts +0 -51
- package/tools/projects/retrieve-projects.d.ts.map +0 -1
- package/tools/projects/retrieve-projects.js +0 -55
- package/tools/projects/retrieve-projects.js.map +0 -1
- package/tools/projects/retrieve-projects.mjs +0 -48
- package/tools/projects/retrieve-projects.mjs.map +0 -1
- package/tools/qrcodes/bulk/create-qrcodes-bulk.d.mts +0 -51
- package/tools/qrcodes/bulk/create-qrcodes-bulk.d.mts.map +0 -1
- package/tools/qrcodes/bulk/create-qrcodes-bulk.d.ts +0 -51
- package/tools/qrcodes/bulk/create-qrcodes-bulk.d.ts.map +0 -1
- package/tools/qrcodes/bulk/create-qrcodes-bulk.js +0 -1068
- package/tools/qrcodes/bulk/create-qrcodes-bulk.js.map +0 -1
- package/tools/qrcodes/bulk/create-qrcodes-bulk.mjs +0 -1061
- package/tools/qrcodes/bulk/create-qrcodes-bulk.mjs.map +0 -1
- package/tools/qrcodes/bulk/delete-qrcodes-bulk.d.mts +0 -51
- package/tools/qrcodes/bulk/delete-qrcodes-bulk.d.mts.map +0 -1
- package/tools/qrcodes/bulk/delete-qrcodes-bulk.d.ts +0 -51
- package/tools/qrcodes/bulk/delete-qrcodes-bulk.d.ts.map +0 -1
- package/tools/qrcodes/bulk/delete-qrcodes-bulk.js +0 -58
- package/tools/qrcodes/bulk/delete-qrcodes-bulk.js.map +0 -1
- package/tools/qrcodes/bulk/delete-qrcodes-bulk.mjs +0 -51
- package/tools/qrcodes/bulk/delete-qrcodes-bulk.mjs.map +0 -1
- package/tools/qrcodes/count-qrcodes.d.mts +0 -51
- package/tools/qrcodes/count-qrcodes.d.mts.map +0 -1
- package/tools/qrcodes/count-qrcodes.d.ts +0 -51
- package/tools/qrcodes/count-qrcodes.d.ts.map +0 -1
- package/tools/qrcodes/count-qrcodes.js +0 -215
- package/tools/qrcodes/count-qrcodes.js.map +0 -1
- package/tools/qrcodes/count-qrcodes.mjs +0 -208
- package/tools/qrcodes/count-qrcodes.mjs.map +0 -1
- package/tools/qrcodes/create-qrcodes.d.mts +0 -51
- package/tools/qrcodes/create-qrcodes.d.mts.map +0 -1
- package/tools/qrcodes/create-qrcodes.d.ts +0 -51
- package/tools/qrcodes/create-qrcodes.d.ts.map +0 -1
- package/tools/qrcodes/create-qrcodes.js +0 -1059
- package/tools/qrcodes/create-qrcodes.js.map +0 -1
- package/tools/qrcodes/create-qrcodes.mjs +0 -1052
- package/tools/qrcodes/create-qrcodes.mjs.map +0 -1
- package/tools/qrcodes/delete-qrcodes.d.mts +0 -51
- package/tools/qrcodes/delete-qrcodes.d.mts.map +0 -1
- package/tools/qrcodes/delete-qrcodes.d.ts +0 -51
- package/tools/qrcodes/delete-qrcodes.d.ts.map +0 -1
- package/tools/qrcodes/delete-qrcodes.js +0 -55
- package/tools/qrcodes/delete-qrcodes.js.map +0 -1
- package/tools/qrcodes/delete-qrcodes.mjs +0 -48
- package/tools/qrcodes/delete-qrcodes.mjs.map +0 -1
- package/tools/qrcodes/list-qrcodes.d.mts +0 -51
- package/tools/qrcodes/list-qrcodes.d.mts.map +0 -1
- package/tools/qrcodes/list-qrcodes.d.ts +0 -51
- package/tools/qrcodes/list-qrcodes.d.ts.map +0 -1
- package/tools/qrcodes/list-qrcodes.js +0 -217
- package/tools/qrcodes/list-qrcodes.js.map +0 -1
- package/tools/qrcodes/list-qrcodes.mjs +0 -210
- package/tools/qrcodes/list-qrcodes.mjs.map +0 -1
- package/tools/qrcodes/retrieve-qrcodes.d.mts +0 -51
- package/tools/qrcodes/retrieve-qrcodes.d.mts.map +0 -1
- package/tools/qrcodes/retrieve-qrcodes.d.ts +0 -51
- package/tools/qrcodes/retrieve-qrcodes.d.ts.map +0 -1
- package/tools/qrcodes/retrieve-qrcodes.js +0 -65
- package/tools/qrcodes/retrieve-qrcodes.js.map +0 -1
- package/tools/qrcodes/retrieve-qrcodes.mjs +0 -58
- package/tools/qrcodes/retrieve-qrcodes.mjs.map +0 -1
- package/tools/qrcodes/update-qrcodes.d.mts +0 -51
- package/tools/qrcodes/update-qrcodes.d.mts.map +0 -1
- package/tools/qrcodes/update-qrcodes.d.ts +0 -51
- package/tools/qrcodes/update-qrcodes.d.ts.map +0 -1
- package/tools/qrcodes/update-qrcodes.js +0 -1065
- package/tools/qrcodes/update-qrcodes.js.map +0 -1
- package/tools/qrcodes/update-qrcodes.mjs +0 -1058
- package/tools/qrcodes/update-qrcodes.mjs.map +0 -1
- package/tools/qrcodes/upsert-qrcodes.d.mts +0 -51
- package/tools/qrcodes/upsert-qrcodes.d.mts.map +0 -1
- package/tools/qrcodes/upsert-qrcodes.d.ts +0 -51
- package/tools/qrcodes/upsert-qrcodes.d.ts.map +0 -1
- package/tools/qrcodes/upsert-qrcodes.js +0 -1059
- package/tools/qrcodes/upsert-qrcodes.js.map +0 -1
- package/tools/qrcodes/upsert-qrcodes.mjs +0 -1052
- package/tools/qrcodes/upsert-qrcodes.mjs.map +0 -1
- package/tools/tags/create-tags.d.mts +0 -51
- package/tools/tags/create-tags.d.mts.map +0 -1
- package/tools/tags/create-tags.d.ts +0 -51
- package/tools/tags/create-tags.d.ts.map +0 -1
- package/tools/tags/create-tags.js +0 -58
- package/tools/tags/create-tags.js.map +0 -1
- package/tools/tags/create-tags.mjs +0 -51
- package/tools/tags/create-tags.mjs.map +0 -1
- package/tools/tags/delete-tags.d.mts +0 -51
- package/tools/tags/delete-tags.d.mts.map +0 -1
- package/tools/tags/delete-tags.d.ts +0 -51
- package/tools/tags/delete-tags.d.ts.map +0 -1
- package/tools/tags/delete-tags.js +0 -55
- package/tools/tags/delete-tags.js.map +0 -1
- package/tools/tags/delete-tags.mjs +0 -48
- package/tools/tags/delete-tags.mjs.map +0 -1
- package/tools/tags/list-tags.d.mts +0 -51
- package/tools/tags/list-tags.d.mts.map +0 -1
- package/tools/tags/list-tags.d.ts +0 -51
- package/tools/tags/list-tags.d.ts.map +0 -1
- package/tools/tags/list-tags.js +0 -87
- package/tools/tags/list-tags.js.map +0 -1
- package/tools/tags/list-tags.mjs +0 -80
- package/tools/tags/list-tags.mjs.map +0 -1
- package/tools/tags/update-tags.d.mts +0 -51
- package/tools/tags/update-tags.d.mts.map +0 -1
- package/tools/tags/update-tags.d.ts +0 -51
- package/tools/tags/update-tags.d.ts.map +0 -1
- package/tools/tags/update-tags.js +0 -63
- package/tools/tags/update-tags.js.map +0 -1
- package/tools/tags/update-tags.mjs +0 -56
- package/tools/tags/update-tags.mjs.map +0 -1
- package/tools/track/track-lead-track.d.mts +0 -51
- package/tools/track/track-lead-track.d.mts.map +0 -1
- package/tools/track/track-lead-track.d.ts +0 -51
- package/tools/track/track-lead-track.d.ts.map +0 -1
- package/tools/track/track-lead-track.js +0 -87
- package/tools/track/track-lead-track.js.map +0 -1
- package/tools/track/track-lead-track.mjs +0 -80
- package/tools/track/track-lead-track.mjs.map +0 -1
- package/tools/track/track-sale-track.d.mts +0 -51
- package/tools/track/track-sale-track.d.mts.map +0 -1
- package/tools/track/track-sale-track.d.ts +0 -51
- package/tools/track/track-sale-track.d.ts.map +0 -1
- package/tools/track/track-sale-track.js +0 -99
- package/tools/track/track-sale-track.js.map +0 -1
- package/tools/track/track-sale-track.mjs +0 -92
- package/tools/track/track-sale-track.mjs.map +0 -1
- package/tools/types.d.mts.map +0 -1
- package/tools/types.d.ts.map +0 -1
- package/tools/types.js.map +0 -1
- package/tools/types.mjs.map +0 -1
- package/tools.d.mts +0 -2
- package/tools.d.mts.map +0 -1
- package/tools.d.ts +0 -2
- package/tools.d.ts.map +0 -1
- package/tools.js +0 -18
- package/tools.js.map +0 -1
- package/tools.mjs +0 -2
- package/tools.mjs.map +0 -1
- /package/{tools/types.js → types.js} +0 -0
- /package/{tools/types.mjs → types.mjs} +0 -0
package/src/options.ts
CHANGED
|
@@ -1,140 +1,105 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
1
3
|
import qs from 'qs';
|
|
2
4
|
import yargs from 'yargs';
|
|
3
5
|
import { hideBin } from 'yargs/helpers';
|
|
4
6
|
import z from 'zod';
|
|
5
|
-
import {
|
|
6
|
-
import { ClientCapabilities, knownClients, ClientType } from './compat';
|
|
7
|
+
import { readEnv } from './util';
|
|
7
8
|
|
|
8
9
|
export type CLIOptions = McpOptions & {
|
|
9
|
-
|
|
10
|
+
debug: boolean;
|
|
11
|
+
logFormat: 'json' | 'pretty';
|
|
10
12
|
transport: 'stdio' | 'http';
|
|
11
13
|
port: number | undefined;
|
|
12
14
|
socket: string | undefined;
|
|
13
15
|
};
|
|
14
16
|
|
|
15
17
|
export type McpOptions = {
|
|
16
|
-
|
|
17
|
-
includeDynamicTools?: boolean | undefined;
|
|
18
|
-
includeAllTools?: boolean | undefined;
|
|
19
|
-
includeCodeTools?: boolean | undefined;
|
|
18
|
+
includeCodeTool?: boolean | undefined;
|
|
20
19
|
includeDocsTools?: boolean | undefined;
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
stainlessApiKey?: string | undefined;
|
|
21
|
+
docsSearchMode?: 'local' | undefined;
|
|
22
|
+
docsDir?: string | undefined;
|
|
23
|
+
codeAllowHttpGets?: boolean | undefined;
|
|
24
|
+
codeAllowedMethods?: string[] | undefined;
|
|
25
|
+
codeBlockedMethods?: string[] | undefined;
|
|
26
|
+
codeExecutionMode: McpCodeExecutionMode;
|
|
27
|
+
customInstructionsPath?: string | undefined;
|
|
23
28
|
};
|
|
24
29
|
|
|
25
|
-
|
|
26
|
-
'top-level-unions',
|
|
27
|
-
'valid-json',
|
|
28
|
-
'refs',
|
|
29
|
-
'unions',
|
|
30
|
-
'formats',
|
|
31
|
-
'tool-name-length',
|
|
32
|
-
] as const;
|
|
33
|
-
|
|
34
|
-
type Capability = (typeof CAPABILITY_CHOICES)[number];
|
|
35
|
-
|
|
36
|
-
function parseCapabilityValue(cap: string): { name: Capability; value?: number } {
|
|
37
|
-
if (cap.startsWith('tool-name-length=')) {
|
|
38
|
-
const parts = cap.split('=');
|
|
39
|
-
if (parts.length === 2) {
|
|
40
|
-
const length = parseInt(parts[1]!, 10);
|
|
41
|
-
if (!isNaN(length)) {
|
|
42
|
-
return { name: 'tool-name-length', value: length };
|
|
43
|
-
}
|
|
44
|
-
throw new Error(`Invalid tool-name-length value: ${parts[1]}. Expected a number.`);
|
|
45
|
-
}
|
|
46
|
-
throw new Error(`Invalid format for tool-name-length. Expected tool-name-length=N.`);
|
|
47
|
-
}
|
|
48
|
-
if (!CAPABILITY_CHOICES.includes(cap as Capability)) {
|
|
49
|
-
throw new Error(`Unknown capability: ${cap}. Valid capabilities are: ${CAPABILITY_CHOICES.join(', ')}`);
|
|
50
|
-
}
|
|
51
|
-
return { name: cap as Capability };
|
|
52
|
-
}
|
|
30
|
+
export type McpCodeExecutionMode = 'local';
|
|
53
31
|
|
|
54
32
|
export function parseCLIOptions(): CLIOptions {
|
|
55
33
|
const opts = yargs(hideBin(process.argv))
|
|
56
|
-
.option('
|
|
57
|
-
type: '
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
description: 'Use dynamic tools or all tools',
|
|
61
|
-
})
|
|
62
|
-
.option('no-tools', {
|
|
63
|
-
type: 'string',
|
|
64
|
-
array: true,
|
|
65
|
-
choices: ['dynamic', 'all', 'code', 'docs'],
|
|
66
|
-
description: 'Do not use any dynamic or all tools',
|
|
34
|
+
.option('code-allow-http-gets', {
|
|
35
|
+
type: 'boolean',
|
|
36
|
+
description:
|
|
37
|
+
'Allow all code tool methods that map to HTTP GET operations. If all code-allow-* flags are unset, then everything is allowed.',
|
|
67
38
|
})
|
|
68
|
-
.option('
|
|
39
|
+
.option('code-allowed-methods', {
|
|
69
40
|
type: 'string',
|
|
70
41
|
array: true,
|
|
71
|
-
description:
|
|
42
|
+
description:
|
|
43
|
+
'Methods to explicitly allow for code tool. Evaluated as regular expressions against method fully qualified names. If all code-allow-* flags are unset, then everything is allowed.',
|
|
72
44
|
})
|
|
73
|
-
.option('
|
|
45
|
+
.option('code-blocked-methods', {
|
|
74
46
|
type: 'string',
|
|
75
47
|
array: true,
|
|
76
|
-
description:
|
|
48
|
+
description:
|
|
49
|
+
'Methods to explicitly block for code tool. Evaluated as regular expressions against method fully qualified names. If all code-allow-* flags are unset, then everything is allowed.',
|
|
77
50
|
})
|
|
78
|
-
.option('
|
|
51
|
+
.option('code-execution-mode', {
|
|
79
52
|
type: 'string',
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
description:
|
|
53
|
+
choices: ['local'],
|
|
54
|
+
default: 'local',
|
|
55
|
+
description:
|
|
56
|
+
'The server was generated without access to the Stainless API, so code execution can only run locally on the MCP server machine.',
|
|
83
57
|
})
|
|
84
|
-
.option('
|
|
58
|
+
.option('custom-instructions-path', {
|
|
85
59
|
type: 'string',
|
|
86
|
-
|
|
87
|
-
description: 'Include tools with the specified tags',
|
|
60
|
+
description: 'Path to custom instructions for the MCP server',
|
|
88
61
|
})
|
|
89
|
-
.option('
|
|
62
|
+
.option('debug', { type: 'boolean', description: 'Enable debug logging' })
|
|
63
|
+
.option('docs-dir', {
|
|
90
64
|
type: 'string',
|
|
91
|
-
|
|
92
|
-
|
|
65
|
+
description:
|
|
66
|
+
'Path to a directory of local documentation files (markdown/JSON) to include in local docs search.',
|
|
93
67
|
})
|
|
94
|
-
.option('
|
|
68
|
+
.option('docs-search-mode', {
|
|
95
69
|
type: 'string',
|
|
96
|
-
|
|
97
|
-
|
|
70
|
+
choices: ['local'],
|
|
71
|
+
default: 'local',
|
|
72
|
+
description:
|
|
73
|
+
"Documentation search will use an in-memory search index built from embedded SDK method data and optional local docs files; the 'stainless-api' option is unavailable.",
|
|
98
74
|
})
|
|
99
|
-
.option('
|
|
75
|
+
.option('log-format', {
|
|
100
76
|
type: 'string',
|
|
101
|
-
|
|
102
|
-
description: '
|
|
77
|
+
choices: ['json', 'pretty'],
|
|
78
|
+
description: 'Format for log output; defaults to json unless tty is detected',
|
|
103
79
|
})
|
|
104
|
-
.option('no-
|
|
80
|
+
.option('no-tools', {
|
|
105
81
|
type: 'string',
|
|
106
82
|
array: true,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
.option('list', {
|
|
110
|
-
type: 'boolean',
|
|
111
|
-
description: 'List all tools and exit',
|
|
83
|
+
choices: ['code', 'docs'],
|
|
84
|
+
description: 'Tools to explicitly disable',
|
|
112
85
|
})
|
|
113
|
-
.option('
|
|
114
|
-
type: '
|
|
115
|
-
|
|
116
|
-
description: '
|
|
86
|
+
.option('port', {
|
|
87
|
+
type: 'number',
|
|
88
|
+
default: 3000,
|
|
89
|
+
description: 'Port to serve on if using http transport',
|
|
117
90
|
})
|
|
118
|
-
.option('
|
|
91
|
+
.option('socket', { type: 'string', description: 'Unix socket to serve on if using http transport' })
|
|
92
|
+
.option('stainless-api-key', {
|
|
119
93
|
type: 'string',
|
|
120
|
-
|
|
121
|
-
description:
|
|
122
|
-
|
|
123
|
-
return values.flatMap((v) => v.split(','));
|
|
124
|
-
},
|
|
94
|
+
default: readEnv('STAINLESS_API_KEY'),
|
|
95
|
+
description:
|
|
96
|
+
'API key for Stainless. Used to authenticate requests to Stainless-hosted tools endpoints.',
|
|
125
97
|
})
|
|
126
|
-
.option('
|
|
98
|
+
.option('tools', {
|
|
127
99
|
type: 'string',
|
|
128
100
|
array: true,
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
coerce: (values: string[]) => {
|
|
132
|
-
return values.flatMap((v) => v.split(','));
|
|
133
|
-
},
|
|
134
|
-
})
|
|
135
|
-
.option('describe-capabilities', {
|
|
136
|
-
type: 'boolean',
|
|
137
|
-
description: 'Print detailed explanation of client capabilities and exit',
|
|
101
|
+
choices: ['code', 'docs'],
|
|
102
|
+
description: 'Tools to explicitly enable',
|
|
138
103
|
})
|
|
139
104
|
.option('transport', {
|
|
140
105
|
type: 'string',
|
|
@@ -142,133 +107,40 @@ export function parseCLIOptions(): CLIOptions {
|
|
|
142
107
|
default: 'stdio',
|
|
143
108
|
description: 'What transport to use; stdio for local servers or http for remote servers',
|
|
144
109
|
})
|
|
145
|
-
.
|
|
146
|
-
|
|
147
|
-
description: 'Port to serve on if using http transport',
|
|
148
|
-
})
|
|
149
|
-
.option('socket', {
|
|
150
|
-
type: 'string',
|
|
151
|
-
description: 'Unix socket to serve on if using http transport',
|
|
152
|
-
})
|
|
110
|
+
.env('MCP_SERVER')
|
|
111
|
+
.version(true)
|
|
153
112
|
.help();
|
|
154
113
|
|
|
155
|
-
for (const [command, desc] of examples()) {
|
|
156
|
-
opts.example(command, desc);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
114
|
const argv = opts.parseSync();
|
|
160
115
|
|
|
161
|
-
|
|
162
|
-
if (argv.describeCapabilities) {
|
|
163
|
-
console.log(getCapabilitiesExplanation());
|
|
164
|
-
process.exit(0);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
const filters: Filter[] = [];
|
|
168
|
-
|
|
169
|
-
// Helper function to support comma-separated values
|
|
170
|
-
const splitValues = (values: string[] | undefined): string[] => {
|
|
171
|
-
if (!values) return [];
|
|
172
|
-
return values.flatMap((v) => v.split(','));
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
for (const tag of splitValues(argv.tag)) {
|
|
176
|
-
filters.push({ type: 'tag', op: 'include', value: tag });
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
for (const tag of splitValues(argv.noTag)) {
|
|
180
|
-
filters.push({ type: 'tag', op: 'exclude', value: tag });
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
for (const resource of splitValues(argv.resource)) {
|
|
184
|
-
filters.push({ type: 'resource', op: 'include', value: resource });
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
for (const resource of splitValues(argv.noResource)) {
|
|
188
|
-
filters.push({ type: 'resource', op: 'exclude', value: resource });
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
for (const tool of splitValues(argv.tool)) {
|
|
192
|
-
filters.push({ type: 'tool', op: 'include', value: tool });
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
for (const tool of splitValues(argv.noTool)) {
|
|
196
|
-
filters.push({ type: 'tool', op: 'exclude', value: tool });
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
for (const operation of splitValues(argv.operation)) {
|
|
200
|
-
filters.push({ type: 'operation', op: 'include', value: operation });
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
for (const operation of splitValues(argv.noOperation)) {
|
|
204
|
-
filters.push({ type: 'operation', op: 'exclude', value: operation });
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
// Parse client capabilities
|
|
208
|
-
const clientCapabilities: Partial<ClientCapabilities> = {};
|
|
209
|
-
|
|
210
|
-
// Apply individual capability overrides
|
|
211
|
-
if (Array.isArray(argv.capability)) {
|
|
212
|
-
for (const cap of argv.capability) {
|
|
213
|
-
const parsedCap = parseCapabilityValue(cap);
|
|
214
|
-
if (parsedCap.name === 'top-level-unions') {
|
|
215
|
-
clientCapabilities.topLevelUnions = true;
|
|
216
|
-
} else if (parsedCap.name === 'valid-json') {
|
|
217
|
-
clientCapabilities.validJson = true;
|
|
218
|
-
} else if (parsedCap.name === 'refs') {
|
|
219
|
-
clientCapabilities.refs = true;
|
|
220
|
-
} else if (parsedCap.name === 'unions') {
|
|
221
|
-
clientCapabilities.unions = true;
|
|
222
|
-
} else if (parsedCap.name === 'formats') {
|
|
223
|
-
clientCapabilities.formats = true;
|
|
224
|
-
} else if (parsedCap.name === 'tool-name-length') {
|
|
225
|
-
clientCapabilities.toolNameLength = parsedCap.value;
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
// Handle no-capability options to unset capabilities
|
|
231
|
-
if (Array.isArray(argv.noCapability)) {
|
|
232
|
-
for (const cap of argv.noCapability) {
|
|
233
|
-
if (cap === 'top-level-unions') {
|
|
234
|
-
clientCapabilities.topLevelUnions = false;
|
|
235
|
-
} else if (cap === 'valid-json') {
|
|
236
|
-
clientCapabilities.validJson = false;
|
|
237
|
-
} else if (cap === 'refs') {
|
|
238
|
-
clientCapabilities.refs = false;
|
|
239
|
-
} else if (cap === 'unions') {
|
|
240
|
-
clientCapabilities.unions = false;
|
|
241
|
-
} else if (cap === 'formats') {
|
|
242
|
-
clientCapabilities.formats = false;
|
|
243
|
-
} else if (cap === 'tool-name-length') {
|
|
244
|
-
clientCapabilities.toolNameLength = undefined;
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
const shouldIncludeToolType = (toolType: 'dynamic' | 'all' | 'code' | 'docs') =>
|
|
116
|
+
const shouldIncludeToolType = (toolType: 'code' | 'docs') =>
|
|
250
117
|
argv.noTools?.includes(toolType) ? false
|
|
251
118
|
: argv.tools?.includes(toolType) ? true
|
|
252
119
|
: undefined;
|
|
253
120
|
|
|
254
|
-
const
|
|
255
|
-
const includeAllTools = shouldIncludeToolType('all');
|
|
256
|
-
const includeCodeTools = shouldIncludeToolType('code');
|
|
121
|
+
const includeCodeTool = shouldIncludeToolType('code');
|
|
257
122
|
const includeDocsTools = shouldIncludeToolType('docs');
|
|
258
123
|
|
|
259
124
|
const transport = argv.transport as 'stdio' | 'http';
|
|
125
|
+
const logFormat =
|
|
126
|
+
argv.logFormat ? (argv.logFormat as 'json' | 'pretty')
|
|
127
|
+
: process.stderr.isTTY ? 'pretty'
|
|
128
|
+
: 'json';
|
|
260
129
|
|
|
261
|
-
const client = argv.client as ClientType;
|
|
262
130
|
return {
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
131
|
+
...(includeCodeTool !== undefined && { includeCodeTool }),
|
|
132
|
+
...(includeDocsTools !== undefined && { includeDocsTools }),
|
|
133
|
+
debug: !!argv.debug,
|
|
134
|
+
stainlessApiKey: argv.stainlessApiKey,
|
|
135
|
+
docsSearchMode: argv.docsSearchMode as 'local' | undefined,
|
|
136
|
+
docsDir: argv.docsDir,
|
|
137
|
+
codeAllowHttpGets: argv.codeAllowHttpGets,
|
|
138
|
+
codeAllowedMethods: argv.codeAllowedMethods,
|
|
139
|
+
codeBlockedMethods: argv.codeBlockedMethods,
|
|
140
|
+
codeExecutionMode: argv.codeExecutionMode as McpCodeExecutionMode,
|
|
141
|
+
customInstructionsPath: argv.customInstructionsPath,
|
|
271
142
|
transport,
|
|
143
|
+
logFormat,
|
|
272
144
|
port: argv.port,
|
|
273
145
|
socket: argv.socket,
|
|
274
146
|
};
|
|
@@ -284,190 +156,30 @@ const coerceArray = <T extends z.ZodTypeAny>(zodType: T) =>
|
|
|
284
156
|
);
|
|
285
157
|
|
|
286
158
|
const QueryOptions = z.object({
|
|
287
|
-
tools: coerceArray(z.enum(['
|
|
288
|
-
no_tools: coerceArray(z.enum(['
|
|
289
|
-
'Specify which MCP tools to not use.',
|
|
290
|
-
),
|
|
159
|
+
tools: coerceArray(z.enum(['code', 'docs'])).describe('Specify which MCP tools to use'),
|
|
160
|
+
no_tools: coerceArray(z.enum(['code', 'docs'])).describe('Specify which MCP tools to not use.'),
|
|
291
161
|
tool: coerceArray(z.string()).describe('Include tools matching the specified names'),
|
|
292
|
-
resource: coerceArray(z.string()).describe('Include tools matching the specified resources'),
|
|
293
|
-
operation: coerceArray(z.enum(['read', 'write'])).describe(
|
|
294
|
-
'Include tools matching the specified operations',
|
|
295
|
-
),
|
|
296
|
-
tag: coerceArray(z.string()).describe('Include tools with the specified tags'),
|
|
297
|
-
no_tool: coerceArray(z.string()).describe('Exclude tools matching the specified names'),
|
|
298
|
-
no_resource: coerceArray(z.string()).describe('Exclude tools matching the specified resources'),
|
|
299
|
-
no_operation: coerceArray(z.enum(['read', 'write'])).describe(
|
|
300
|
-
'Exclude tools matching the specified operations',
|
|
301
|
-
),
|
|
302
|
-
no_tag: coerceArray(z.string()).describe('Exclude tools with the specified tags'),
|
|
303
|
-
client: ClientType.optional().describe('Specify the MCP client being used'),
|
|
304
|
-
capability: coerceArray(z.string()).describe('Specify client capabilities'),
|
|
305
|
-
no_capability: coerceArray(z.enum(CAPABILITY_CHOICES)).describe('Unset client capabilities'),
|
|
306
162
|
});
|
|
307
163
|
|
|
308
164
|
export function parseQueryOptions(defaultOptions: McpOptions, query: unknown): McpOptions {
|
|
309
165
|
const queryObject = typeof query === 'string' ? qs.parse(query) : query;
|
|
310
166
|
const queryOptions = QueryOptions.parse(queryObject);
|
|
311
167
|
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
}
|
|
317
|
-
for (const operation of queryOptions.operation || []) {
|
|
318
|
-
filters.push({ type: 'operation', op: 'include', value: operation });
|
|
319
|
-
}
|
|
320
|
-
for (const tag of queryOptions.tag || []) {
|
|
321
|
-
filters.push({ type: 'tag', op: 'include', value: tag });
|
|
322
|
-
}
|
|
323
|
-
for (const tool of queryOptions.tool || []) {
|
|
324
|
-
filters.push({ type: 'tool', op: 'include', value: tool });
|
|
325
|
-
}
|
|
326
|
-
for (const resource of queryOptions.no_resource || []) {
|
|
327
|
-
filters.push({ type: 'resource', op: 'exclude', value: resource });
|
|
328
|
-
}
|
|
329
|
-
for (const operation of queryOptions.no_operation || []) {
|
|
330
|
-
filters.push({ type: 'operation', op: 'exclude', value: operation });
|
|
331
|
-
}
|
|
332
|
-
for (const tag of queryOptions.no_tag || []) {
|
|
333
|
-
filters.push({ type: 'tag', op: 'exclude', value: tag });
|
|
334
|
-
}
|
|
335
|
-
for (const tool of queryOptions.no_tool || []) {
|
|
336
|
-
filters.push({ type: 'tool', op: 'exclude', value: tool });
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
// Parse client capabilities
|
|
340
|
-
const clientCapabilities: Partial<ClientCapabilities> = { ...defaultOptions.capabilities };
|
|
341
|
-
|
|
342
|
-
for (const cap of queryOptions.capability || []) {
|
|
343
|
-
const parsed = parseCapabilityValue(cap);
|
|
344
|
-
if (parsed.name === 'top-level-unions') {
|
|
345
|
-
clientCapabilities.topLevelUnions = true;
|
|
346
|
-
} else if (parsed.name === 'valid-json') {
|
|
347
|
-
clientCapabilities.validJson = true;
|
|
348
|
-
} else if (parsed.name === 'refs') {
|
|
349
|
-
clientCapabilities.refs = true;
|
|
350
|
-
} else if (parsed.name === 'unions') {
|
|
351
|
-
clientCapabilities.unions = true;
|
|
352
|
-
} else if (parsed.name === 'formats') {
|
|
353
|
-
clientCapabilities.formats = true;
|
|
354
|
-
} else if (parsed.name === 'tool-name-length') {
|
|
355
|
-
clientCapabilities.toolNameLength = parsed.value;
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
for (const cap of queryOptions.no_capability || []) {
|
|
360
|
-
if (cap === 'top-level-unions') {
|
|
361
|
-
clientCapabilities.topLevelUnions = false;
|
|
362
|
-
} else if (cap === 'valid-json') {
|
|
363
|
-
clientCapabilities.validJson = false;
|
|
364
|
-
} else if (cap === 'refs') {
|
|
365
|
-
clientCapabilities.refs = false;
|
|
366
|
-
} else if (cap === 'unions') {
|
|
367
|
-
clientCapabilities.unions = false;
|
|
368
|
-
} else if (cap === 'formats') {
|
|
369
|
-
clientCapabilities.formats = false;
|
|
370
|
-
} else if (cap === 'tool-name-length') {
|
|
371
|
-
clientCapabilities.toolNameLength = undefined;
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
let dynamicTools: boolean | undefined =
|
|
376
|
-
queryOptions.no_tools && queryOptions.no_tools?.includes('dynamic') ? false
|
|
377
|
-
: queryOptions.tools?.includes('dynamic') ? true
|
|
378
|
-
: defaultOptions.includeDynamicTools;
|
|
379
|
-
|
|
380
|
-
let allTools: boolean | undefined =
|
|
381
|
-
queryOptions.no_tools && queryOptions.no_tools?.includes('all') ? false
|
|
382
|
-
: queryOptions.tools?.includes('all') ? true
|
|
383
|
-
: defaultOptions.includeAllTools;
|
|
168
|
+
let codeTool: boolean | undefined =
|
|
169
|
+
queryOptions.no_tools && queryOptions.no_tools?.includes('code') ? false
|
|
170
|
+
: queryOptions.tools?.includes('code') ? true
|
|
171
|
+
: defaultOptions.includeCodeTool;
|
|
384
172
|
|
|
385
173
|
let docsTools: boolean | undefined =
|
|
386
174
|
queryOptions.no_tools && queryOptions.no_tools?.includes('docs') ? false
|
|
387
175
|
: queryOptions.tools?.includes('docs') ? true
|
|
388
176
|
: defaultOptions.includeDocsTools;
|
|
389
177
|
|
|
390
|
-
let codeTools: boolean | undefined =
|
|
391
|
-
queryOptions.no_tools && queryOptions.no_tools?.includes('code') ? false
|
|
392
|
-
: queryOptions.tools?.includes('code') && defaultOptions.includeCodeTools ? true
|
|
393
|
-
: defaultOptions.includeCodeTools;
|
|
394
|
-
|
|
395
178
|
return {
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
filters,
|
|
402
|
-
capabilities: clientCapabilities,
|
|
179
|
+
...(codeTool !== undefined && { includeCodeTool: codeTool }),
|
|
180
|
+
...(docsTools !== undefined && { includeDocsTools: docsTools }),
|
|
181
|
+
codeExecutionMode: defaultOptions.codeExecutionMode,
|
|
182
|
+
docsSearchMode: defaultOptions.docsSearchMode,
|
|
183
|
+
docsDir: defaultOptions.docsDir,
|
|
403
184
|
};
|
|
404
185
|
}
|
|
405
|
-
|
|
406
|
-
function getCapabilitiesExplanation(): string {
|
|
407
|
-
return `
|
|
408
|
-
Client Capabilities Explanation:
|
|
409
|
-
|
|
410
|
-
Different Language Models (LLMs) and the MCP clients that use them have varying limitations in how they handle tool schemas. Capability flags allow you to inform the MCP server about these limitations.
|
|
411
|
-
|
|
412
|
-
When a capability flag is set to false, the MCP server will automatically adjust the tool schemas to work around that limitation, ensuring broader compatibility.
|
|
413
|
-
|
|
414
|
-
Available Capabilities:
|
|
415
|
-
|
|
416
|
-
# top-level-unions
|
|
417
|
-
Some clients/LLMs do not support JSON schemas with a union type (anyOf) at the root level. If a client lacks this capability, the MCP server splits tools with top-level unions into multiple separate tools, one for each variant in the union.
|
|
418
|
-
|
|
419
|
-
# refs
|
|
420
|
-
Some clients/LLMs do not support $ref pointers for schema reuse. If a client lacks this capability, the MCP server automatically inlines all references ($defs) directly into the schema. Properties that would cause circular references are removed during this process.
|
|
421
|
-
|
|
422
|
-
# valid-json
|
|
423
|
-
Some clients/LLMs may incorrectly send arguments as a JSON-encoded string instead of a proper JSON object. If a client *has* this capability, the MCP server will attempt to parse string values as JSON if the initial validation against the schema fails.
|
|
424
|
-
|
|
425
|
-
# unions
|
|
426
|
-
Some clients/LLMs do not support union types (anyOf) in JSON schemas. If a client lacks this capability, the MCP server removes all anyOf fields and uses only the first variant as the schema.
|
|
427
|
-
|
|
428
|
-
# formats
|
|
429
|
-
Some clients/LLMs do not support the 'format' keyword in JSON Schema specifications. If a client lacks this capability, the MCP server removes all format fields and appends the format information to the field's description in parentheses.
|
|
430
|
-
|
|
431
|
-
# tool-name-length=N
|
|
432
|
-
Some clients/LLMs impose a maximum length on tool names. If this capability is set, the MCP server will automatically truncate tool names exceeding the specified length (N), ensuring uniqueness by appending numbers if necessary.
|
|
433
|
-
|
|
434
|
-
Client Presets (--client):
|
|
435
|
-
Presets like '--client=openai-agents' or '--client=cursor' automatically configure these capabilities based on current known limitations of those clients, simplifying setup.
|
|
436
|
-
|
|
437
|
-
Current presets:
|
|
438
|
-
${JSON.stringify(knownClients, null, 2)}
|
|
439
|
-
`;
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
function examples(): [string, string][] {
|
|
443
|
-
const firstEndpoint = endpoints[0]!;
|
|
444
|
-
const secondEndpoint =
|
|
445
|
-
endpoints.find((e) => e.metadata.resource !== firstEndpoint.metadata.resource) || endpoints[1];
|
|
446
|
-
const tag = endpoints.find((e) => e.metadata.tags.length > 0)?.metadata.tags[0];
|
|
447
|
-
const otherEndpoint = secondEndpoint || firstEndpoint;
|
|
448
|
-
|
|
449
|
-
return [
|
|
450
|
-
[
|
|
451
|
-
`--tool="${firstEndpoint.tool.name}" ${secondEndpoint ? `--tool="${secondEndpoint.tool.name}"` : ''}`,
|
|
452
|
-
'Include tools by name',
|
|
453
|
-
],
|
|
454
|
-
[
|
|
455
|
-
`--resource="${firstEndpoint.metadata.resource}" --operation="read"`,
|
|
456
|
-
'Filter by resource and operation',
|
|
457
|
-
],
|
|
458
|
-
[
|
|
459
|
-
`--resource="${otherEndpoint.metadata.resource}*" --no-tool="${otherEndpoint.tool.name}"`,
|
|
460
|
-
'Use resource wildcards and exclusions',
|
|
461
|
-
],
|
|
462
|
-
[`--client="cursor"`, 'Adjust schemas to be more compatible with Cursor'],
|
|
463
|
-
[
|
|
464
|
-
`--capability="top-level-unions" --capability="tool-name-length=40"`,
|
|
465
|
-
'Specify individual client capabilities',
|
|
466
|
-
],
|
|
467
|
-
[
|
|
468
|
-
`--client="cursor" --no-capability="tool-name-length"`,
|
|
469
|
-
'Use cursor client preset but remove tool name length limit',
|
|
470
|
-
],
|
|
471
|
-
...(tag ? [[`--tag="${tag}"`, 'Filter based on tags'] as [string, string]] : []),
|
|
472
|
-
];
|
|
473
|
-
}
|