@nimrobo/mcporter-remote 0.1.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/.claude/settings.local.json +7 -0
- package/.gitattributes +2 -0
- package/.github/workflows/ci.yml +26 -0
- package/AGENTS.md +109 -0
- package/CHANGELOG.md +361 -0
- package/LICENSE +21 -0
- package/README.md +449 -0
- package/bin/git +180 -0
- package/biome.json +43 -0
- package/config/mcporter.json +134 -0
- package/dist/cli/adhoc-server.d.ts +21 -0
- package/dist/cli/adhoc-server.d.ts.map +1 -0
- package/dist/cli/adhoc-server.js +228 -0
- package/dist/cli/adhoc-server.js.map +1 -0
- package/dist/cli/auth-command.d.ts +6 -0
- package/dist/cli/auth-command.d.ts.map +1 -0
- package/dist/cli/auth-command.js +257 -0
- package/dist/cli/auth-command.js.map +1 -0
- package/dist/cli/call-argument-expression.d.ts +5 -0
- package/dist/cli/call-argument-expression.d.ts.map +1 -0
- package/dist/cli/call-argument-expression.js +57 -0
- package/dist/cli/call-argument-expression.js.map +1 -0
- package/dist/cli/call-argument-values.d.ts +10 -0
- package/dist/cli/call-argument-values.d.ts.map +1 -0
- package/dist/cli/call-argument-values.js +83 -0
- package/dist/cli/call-argument-values.js.map +1 -0
- package/dist/cli/call-arguments.d.ts +17 -0
- package/dist/cli/call-arguments.d.ts.map +1 -0
- package/dist/cli/call-arguments.js +183 -0
- package/dist/cli/call-arguments.js.map +1 -0
- package/dist/cli/call-command.d.ts +5 -0
- package/dist/cli/call-command.d.ts.map +1 -0
- package/dist/cli/call-command.js +371 -0
- package/dist/cli/call-command.js.map +1 -0
- package/dist/cli/call-expression-parser.d.ts +9 -0
- package/dist/cli/call-expression-parser.d.ts.map +1 -0
- package/dist/cli/call-expression-parser.js +177 -0
- package/dist/cli/call-expression-parser.js.map +1 -0
- package/dist/cli/cli-factory.d.ts +16 -0
- package/dist/cli/cli-factory.d.ts.map +1 -0
- package/dist/cli/cli-factory.js +37 -0
- package/dist/cli/cli-factory.js.map +1 -0
- package/dist/cli/command-inference.d.ts +12 -0
- package/dist/cli/command-inference.d.ts.map +1 -0
- package/dist/cli/command-inference.js +75 -0
- package/dist/cli/command-inference.js.map +1 -0
- package/dist/cli/config/add.d.ts +23 -0
- package/dist/cli/config/add.d.ts.map +1 -0
- package/dist/cli/config/add.js +267 -0
- package/dist/cli/config/add.js.map +1 -0
- package/dist/cli/config/auth.d.ts +4 -0
- package/dist/cli/config/auth.d.ts.map +1 -0
- package/dist/cli/config/auth.js +21 -0
- package/dist/cli/config/auth.js.map +1 -0
- package/dist/cli/config/doctor.d.ts +3 -0
- package/dist/cli/config/doctor.d.ts.map +1 -0
- package/dist/cli/config/doctor.js +26 -0
- package/dist/cli/config/doctor.js.map +1 -0
- package/dist/cli/config/get.d.ts +3 -0
- package/dist/cli/config/get.d.ts.map +1 -0
- package/dist/cli/config/get.js +45 -0
- package/dist/cli/config/get.js.map +1 -0
- package/dist/cli/config/help.d.ts +18 -0
- package/dist/cli/config/help.d.ts.map +1 -0
- package/dist/cli/config/help.js +193 -0
- package/dist/cli/config/help.js.map +1 -0
- package/dist/cli/config/import.d.ts +9 -0
- package/dist/cli/config/import.d.ts.map +1 -0
- package/dist/cli/config/import.js +88 -0
- package/dist/cli/config/import.js.map +1 -0
- package/dist/cli/config/index.d.ts +2 -0
- package/dist/cli/config/index.d.ts.map +1 -0
- package/dist/cli/config/index.js +2 -0
- package/dist/cli/config/index.js.map +1 -0
- package/dist/cli/config/list.d.ts +7 -0
- package/dist/cli/config/list.d.ts.map +1 -0
- package/dist/cli/config/list.js +71 -0
- package/dist/cli/config/list.js.map +1 -0
- package/dist/cli/config/remove.d.ts +3 -0
- package/dist/cli/config/remove.d.ts.map +1 -0
- package/dist/cli/config/remove.js +19 -0
- package/dist/cli/config/remove.js.map +1 -0
- package/dist/cli/config/render.d.ts +26 -0
- package/dist/cli/config/render.d.ts.map +1 -0
- package/dist/cli/config/render.js +99 -0
- package/dist/cli/config/render.js.map +1 -0
- package/dist/cli/config/shared.d.ts +21 -0
- package/dist/cli/config/shared.d.ts.map +1 -0
- package/dist/cli/config/shared.js +130 -0
- package/dist/cli/config/shared.js.map +1 -0
- package/dist/cli/config/types.d.ts +7 -0
- package/dist/cli/config/types.d.ts.map +1 -0
- package/dist/cli/config/types.js +2 -0
- package/dist/cli/config/types.js.map +1 -0
- package/dist/cli/config-command.d.ts +7 -0
- package/dist/cli/config-command.d.ts.map +1 -0
- package/dist/cli/config-command.js +67 -0
- package/dist/cli/config-command.js.map +1 -0
- package/dist/cli/daemon-command.d.ts +8 -0
- package/dist/cli/daemon-command.d.ts.map +1 -0
- package/dist/cli/daemon-command.js +219 -0
- package/dist/cli/daemon-command.js.map +1 -0
- package/dist/cli/emit-ts-command.d.ts +31 -0
- package/dist/cli/emit-ts-command.d.ts.map +1 -0
- package/dist/cli/emit-ts-command.js +217 -0
- package/dist/cli/emit-ts-command.js.map +1 -0
- package/dist/cli/emit-ts-templates.d.ts +23 -0
- package/dist/cli/emit-ts-templates.d.ts.map +1 -0
- package/dist/cli/emit-ts-templates.js +130 -0
- package/dist/cli/emit-ts-templates.js.map +1 -0
- package/dist/cli/ephemeral-flags.d.ts +7 -0
- package/dist/cli/ephemeral-flags.d.ts.map +1 -0
- package/dist/cli/ephemeral-flags.js +108 -0
- package/dist/cli/ephemeral-flags.js.map +1 -0
- package/dist/cli/ephemeral-target.d.ts +16 -0
- package/dist/cli/ephemeral-target.d.ts.map +1 -0
- package/dist/cli/ephemeral-target.js +105 -0
- package/dist/cli/ephemeral-target.js.map +1 -0
- package/dist/cli/errors.d.ts +4 -0
- package/dist/cli/errors.d.ts.map +1 -0
- package/dist/cli/errors.js +7 -0
- package/dist/cli/errors.js.map +1 -0
- package/dist/cli/flag-utils.d.ts +4 -0
- package/dist/cli/flag-utils.d.ts.map +1 -0
- package/dist/cli/flag-utils.js +27 -0
- package/dist/cli/flag-utils.js.map +1 -0
- package/dist/cli/generate/artifacts.d.ts +15 -0
- package/dist/cli/generate/artifacts.d.ts.map +1 -0
- package/dist/cli/generate/artifacts.js +247 -0
- package/dist/cli/generate/artifacts.js.map +1 -0
- package/dist/cli/generate/definition.d.ts +22 -0
- package/dist/cli/generate/definition.d.ts.map +1 -0
- package/dist/cli/generate/definition.js +265 -0
- package/dist/cli/generate/definition.js.map +1 -0
- package/dist/cli/generate/flag-parser.d.ts +11 -0
- package/dist/cli/generate/flag-parser.d.ts.map +1 -0
- package/dist/cli/generate/flag-parser.js +41 -0
- package/dist/cli/generate/flag-parser.js.map +1 -0
- package/dist/cli/generate/flags.d.ts +20 -0
- package/dist/cli/generate/flags.d.ts.map +1 -0
- package/dist/cli/generate/flags.js +220 -0
- package/dist/cli/generate/flags.js.map +1 -0
- package/dist/cli/generate/fs-helpers.d.ts +3 -0
- package/dist/cli/generate/fs-helpers.d.ts.map +1 -0
- package/dist/cli/generate/fs-helpers.js +34 -0
- package/dist/cli/generate/fs-helpers.js.map +1 -0
- package/dist/cli/generate/name-utils.d.ts +5 -0
- package/dist/cli/generate/name-utils.d.ts.map +1 -0
- package/dist/cli/generate/name-utils.js +170 -0
- package/dist/cli/generate/name-utils.js.map +1 -0
- package/dist/cli/generate/output.d.ts +5 -0
- package/dist/cli/generate/output.d.ts.map +1 -0
- package/dist/cli/generate/output.js +24 -0
- package/dist/cli/generate/output.js.map +1 -0
- package/dist/cli/generate/runtime.d.ts +3 -0
- package/dist/cli/generate/runtime.d.ts.map +1 -0
- package/dist/cli/generate/runtime.js +34 -0
- package/dist/cli/generate/runtime.js.map +1 -0
- package/dist/cli/generate/server-utils.d.ts +3 -0
- package/dist/cli/generate/server-utils.d.ts.map +1 -0
- package/dist/cli/generate/server-utils.js +33 -0
- package/dist/cli/generate/server-utils.js.map +1 -0
- package/dist/cli/generate/template-data.d.ts +25 -0
- package/dist/cli/generate/template-data.d.ts.map +1 -0
- package/dist/cli/generate/template-data.js +90 -0
- package/dist/cli/generate/template-data.js.map +1 -0
- package/dist/cli/generate/template-help.d.ts +2 -0
- package/dist/cli/generate/template-help.d.ts.map +1 -0
- package/dist/cli/generate/template-help.js +113 -0
- package/dist/cli/generate/template-help.js.map +1 -0
- package/dist/cli/generate/template.d.ts +30 -0
- package/dist/cli/generate/template.d.ts.map +1 -0
- package/dist/cli/generate/template.js +366 -0
- package/dist/cli/generate/template.js.map +1 -0
- package/dist/cli/generate/tools.d.ts +46 -0
- package/dist/cli/generate/tools.d.ts.map +1 -0
- package/dist/cli/generate/tools.js +304 -0
- package/dist/cli/generate/tools.js.map +1 -0
- package/dist/cli/generate/types.d.ts +5 -0
- package/dist/cli/generate/types.d.ts.map +1 -0
- package/dist/cli/generate/types.js +2 -0
- package/dist/cli/generate/types.js.map +1 -0
- package/dist/cli/generate-cli-runner.d.ts +3 -0
- package/dist/cli/generate-cli-runner.d.ts.map +1 -0
- package/dist/cli/generate-cli-runner.js +72 -0
- package/dist/cli/generate-cli-runner.js.map +1 -0
- package/dist/cli/help-output.d.ts +6 -0
- package/dist/cli/help-output.d.ts.map +1 -0
- package/dist/cli/help-output.js +186 -0
- package/dist/cli/help-output.js.map +1 -0
- package/dist/cli/http-utils.d.ts +9 -0
- package/dist/cli/http-utils.d.ts.map +1 -0
- package/dist/cli/http-utils.js +88 -0
- package/dist/cli/http-utils.js.map +1 -0
- package/dist/cli/identifier-helpers.d.ts +20 -0
- package/dist/cli/identifier-helpers.d.ts.map +1 -0
- package/dist/cli/identifier-helpers.js +84 -0
- package/dist/cli/identifier-helpers.js.map +1 -0
- package/dist/cli/image-output.d.ts +3 -0
- package/dist/cli/image-output.d.ts.map +1 -0
- package/dist/cli/image-output.js +57 -0
- package/dist/cli/image-output.js.map +1 -0
- package/dist/cli/inspect-cli-command.d.ts +11 -0
- package/dist/cli/inspect-cli-command.d.ts.map +1 -0
- package/dist/cli/inspect-cli-command.js +78 -0
- package/dist/cli/inspect-cli-command.js.map +1 -0
- package/dist/cli/json-output.d.ts +23 -0
- package/dist/cli/json-output.d.ts.map +1 -0
- package/dist/cli/json-output.js +38 -0
- package/dist/cli/json-output.js.map +1 -0
- package/dist/cli/list-command.d.ts +15 -0
- package/dist/cli/list-command.d.ts.map +1 -0
- package/dist/cli/list-command.js +372 -0
- package/dist/cli/list-command.js.map +1 -0
- package/dist/cli/list-detail-helpers.d.ts +41 -0
- package/dist/cli/list-detail-helpers.d.ts.map +1 -0
- package/dist/cli/list-detail-helpers.js +99 -0
- package/dist/cli/list-detail-helpers.js.map +1 -0
- package/dist/cli/list-doc-comments.d.ts +6 -0
- package/dist/cli/list-doc-comments.d.ts.map +1 -0
- package/dist/cli/list-doc-comments.js +114 -0
- package/dist/cli/list-doc-comments.js.map +1 -0
- package/dist/cli/list-format.d.ts +38 -0
- package/dist/cli/list-format.d.ts.map +1 -0
- package/dist/cli/list-format.js +98 -0
- package/dist/cli/list-format.js.map +1 -0
- package/dist/cli/list-output.d.ts +39 -0
- package/dist/cli/list-output.d.ts.map +1 -0
- package/dist/cli/list-output.js +159 -0
- package/dist/cli/list-output.js.map +1 -0
- package/dist/cli/list-signature.d.ts +26 -0
- package/dist/cli/list-signature.d.ts.map +1 -0
- package/dist/cli/list-signature.js +176 -0
- package/dist/cli/list-signature.js.map +1 -0
- package/dist/cli/logger-context.d.ts +9 -0
- package/dist/cli/logger-context.d.ts.map +1 -0
- package/dist/cli/logger-context.js +29 -0
- package/dist/cli/logger-context.js.map +1 -0
- package/dist/cli/output-format.d.ts +11 -0
- package/dist/cli/output-format.d.ts.map +1 -0
- package/dist/cli/output-format.js +51 -0
- package/dist/cli/output-format.js.map +1 -0
- package/dist/cli/output-utils.d.ts +5 -0
- package/dist/cli/output-utils.d.ts.map +1 -0
- package/dist/cli/output-utils.js +143 -0
- package/dist/cli/output-utils.js.map +1 -0
- package/dist/cli/path-utils.d.ts +2 -0
- package/dist/cli/path-utils.d.ts.map +1 -0
- package/dist/cli/path-utils.js +12 -0
- package/dist/cli/path-utils.js.map +1 -0
- package/dist/cli/runtime-debug.d.ts +4 -0
- package/dist/cli/runtime-debug.d.ts.map +1 -0
- package/dist/cli/runtime-debug.js +134 -0
- package/dist/cli/runtime-debug.js.map +1 -0
- package/dist/cli/server-lookup.d.ts +3 -0
- package/dist/cli/server-lookup.d.ts.map +1 -0
- package/dist/cli/server-lookup.js +21 -0
- package/dist/cli/server-lookup.js.map +1 -0
- package/dist/cli/terminal.d.ts +10 -0
- package/dist/cli/terminal.d.ts.map +1 -0
- package/dist/cli/terminal.js +33 -0
- package/dist/cli/terminal.js.map +1 -0
- package/dist/cli/timeouts.d.ts +9 -0
- package/dist/cli/timeouts.d.ts.map +1 -0
- package/dist/cli/timeouts.js +55 -0
- package/dist/cli/timeouts.js.map +1 -0
- package/dist/cli/tool-cache.d.ts +9 -0
- package/dist/cli/tool-cache.d.ts.map +1 -0
- package/dist/cli/tool-cache.js +31 -0
- package/dist/cli/tool-cache.js.map +1 -0
- package/dist/cli/transport-utils.d.ts +3 -0
- package/dist/cli/transport-utils.d.ts.map +1 -0
- package/dist/cli/transport-utils.js +9 -0
- package/dist/cli/transport-utils.js.map +1 -0
- package/dist/cli-metadata.d.ts +57 -0
- package/dist/cli-metadata.d.ts.map +1 -0
- package/dist/cli-metadata.js +92 -0
- package/dist/cli-metadata.js.map +1 -0
- package/dist/cli.d.ts +10 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +217 -0
- package/dist/cli.js.map +1 -0
- package/dist/config/imports/external.d.ts +8 -0
- package/dist/config/imports/external.d.ts.map +1 -0
- package/dist/config/imports/external.js +231 -0
- package/dist/config/imports/external.js.map +1 -0
- package/dist/config/imports/paths-utils.d.ts +3 -0
- package/dist/config/imports/paths-utils.d.ts.map +1 -0
- package/dist/config/imports/paths-utils.js +27 -0
- package/dist/config/imports/paths-utils.js.map +1 -0
- package/dist/config/imports/paths.d.ts +3 -0
- package/dist/config/imports/paths.d.ts.map +1 -0
- package/dist/config/imports/paths.js +135 -0
- package/dist/config/imports/paths.js.map +1 -0
- package/dist/config/imports/shared.d.ts +4 -0
- package/dist/config/imports/shared.d.ts.map +1 -0
- package/dist/config/imports/shared.js +25 -0
- package/dist/config/imports/shared.js.map +1 -0
- package/dist/config/path-discovery.d.ts +11 -0
- package/dist/config/path-discovery.d.ts.map +1 -0
- package/dist/config/path-discovery.js +65 -0
- package/dist/config/path-discovery.js.map +1 -0
- package/dist/config/read-config.d.ts +9 -0
- package/dist/config/read-config.d.ts.map +1 -0
- package/dist/config/read-config.js +74 -0
- package/dist/config/read-config.js.map +1 -0
- package/dist/config-imports.d.ts +7 -0
- package/dist/config-imports.d.ts.map +1 -0
- package/dist/config-imports.js +8 -0
- package/dist/config-imports.js.map +1 -0
- package/dist/config-normalize.d.ts +8 -0
- package/dist/config-normalize.d.ts.map +1 -0
- package/dist/config-normalize.js +184 -0
- package/dist/config-normalize.js.map +1 -0
- package/dist/config-schema.d.ts +164 -0
- package/dist/config-schema.d.ts.map +1 -0
- package/dist/config-schema.js +103 -0
- package/dist/config-schema.js.map +1 -0
- package/dist/config.d.ts +17 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +91 -0
- package/dist/config.js.map +1 -0
- package/dist/daemon/client.d.ts +34 -0
- package/dist/daemon/client.d.ts.map +1 -0
- package/dist/daemon/client.js +291 -0
- package/dist/daemon/client.js.map +1 -0
- package/dist/daemon/config-layers.d.ts +7 -0
- package/dist/daemon/config-layers.d.ts.map +1 -0
- package/dist/daemon/config-layers.js +20 -0
- package/dist/daemon/config-layers.js.map +1 -0
- package/dist/daemon/host.d.ts +32 -0
- package/dist/daemon/host.d.ts.map +1 -0
- package/dist/daemon/host.js +345 -0
- package/dist/daemon/host.js.map +1 -0
- package/dist/daemon/launch.d.ts +10 -0
- package/dist/daemon/launch.d.ts.map +1 -0
- package/dist/daemon/launch.js +35 -0
- package/dist/daemon/launch.js.map +1 -0
- package/dist/daemon/log-context.d.ts +18 -0
- package/dist/daemon/log-context.d.ts.map +1 -0
- package/dist/daemon/log-context.js +64 -0
- package/dist/daemon/log-context.js.map +1 -0
- package/dist/daemon/paths.d.ts +5 -0
- package/dist/daemon/paths.d.ts.map +1 -0
- package/dist/daemon/paths.js +30 -0
- package/dist/daemon/paths.js.map +1 -0
- package/dist/daemon/protocol.d.ts +51 -0
- package/dist/daemon/protocol.d.ts.map +1 -0
- package/dist/daemon/protocol.js +2 -0
- package/dist/daemon/protocol.js.map +1 -0
- package/dist/daemon/request-utils.d.ts +12 -0
- package/dist/daemon/request-utils.d.ts.map +1 -0
- package/dist/daemon/request-utils.js +52 -0
- package/dist/daemon/request-utils.js.map +1 -0
- package/dist/daemon/runtime-wrapper.d.ts +9 -0
- package/dist/daemon/runtime-wrapper.d.ts.map +1 -0
- package/dist/daemon/runtime-wrapper.js +110 -0
- package/dist/daemon/runtime-wrapper.js.map +1 -0
- package/dist/env.d.ts +5 -0
- package/dist/env.d.ts.map +1 -0
- package/dist/env.js +93 -0
- package/dist/env.js.map +1 -0
- package/dist/error-classifier.d.ts +11 -0
- package/dist/error-classifier.d.ts.map +1 -0
- package/dist/error-classifier.js +141 -0
- package/dist/error-classifier.js.map +1 -0
- package/dist/fs-json.d.ts +3 -0
- package/dist/fs-json.d.ts.map +1 -0
- package/dist/fs-json.js +21 -0
- package/dist/fs-json.js.map +1 -0
- package/dist/generate-cli.d.ts +32 -0
- package/dist/generate-cli.d.ts.map +1 -0
- package/dist/generate-cli.js +155 -0
- package/dist/generate-cli.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/lifecycle.d.ts +8 -0
- package/dist/lifecycle.d.ts.map +1 -0
- package/dist/lifecycle.js +106 -0
- package/dist/lifecycle.js.map +1 -0
- package/dist/logging.d.ts +19 -0
- package/dist/logging.d.ts.map +1 -0
- package/dist/logging.js +76 -0
- package/dist/logging.js.map +1 -0
- package/dist/oauth-manual.d.ts +9 -0
- package/dist/oauth-manual.d.ts.map +1 -0
- package/dist/oauth-manual.js +84 -0
- package/dist/oauth-manual.js.map +1 -0
- package/dist/oauth-persistence.d.ts +20 -0
- package/dist/oauth-persistence.d.ts.map +1 -0
- package/dist/oauth-persistence.js +254 -0
- package/dist/oauth-persistence.js.map +1 -0
- package/dist/oauth-vault.d.ts +19 -0
- package/dist/oauth-vault.d.ts.map +1 -0
- package/dist/oauth-vault.js +100 -0
- package/dist/oauth-vault.js.map +1 -0
- package/dist/oauth.d.ts +31 -0
- package/dist/oauth.d.ts.map +1 -0
- package/dist/oauth.js +414 -0
- package/dist/oauth.js.map +1 -0
- package/dist/result-utils.d.ts +22 -0
- package/dist/result-utils.d.ts.map +1 -0
- package/dist/result-utils.js +229 -0
- package/dist/result-utils.js.map +1 -0
- package/dist/runtime/errors.d.ts +2 -0
- package/dist/runtime/errors.d.ts.map +1 -0
- package/dist/runtime/errors.js +16 -0
- package/dist/runtime/errors.js.map +1 -0
- package/dist/runtime/http-transport.d.ts +15 -0
- package/dist/runtime/http-transport.d.ts.map +1 -0
- package/dist/runtime/http-transport.js +91 -0
- package/dist/runtime/http-transport.js.map +1 -0
- package/dist/runtime/manual-oauth.d.ts +8 -0
- package/dist/runtime/manual-oauth.d.ts.map +1 -0
- package/dist/runtime/manual-oauth.js +81 -0
- package/dist/runtime/manual-oauth.js.map +1 -0
- package/dist/runtime/oauth.d.ts +22 -0
- package/dist/runtime/oauth.d.ts.map +1 -0
- package/dist/runtime/oauth.js +83 -0
- package/dist/runtime/oauth.js.map +1 -0
- package/dist/runtime/transport.d.ts +24 -0
- package/dist/runtime/transport.d.ts.map +1 -0
- package/dist/runtime/transport.js +165 -0
- package/dist/runtime/transport.js.map +1 -0
- package/dist/runtime/utils.d.ts +5 -0
- package/dist/runtime/utils.d.ts.map +1 -0
- package/dist/runtime/utils.js +47 -0
- package/dist/runtime/utils.js.map +1 -0
- package/dist/runtime-header-utils.d.ts +2 -0
- package/dist/runtime-header-utils.d.ts.map +1 -0
- package/dist/runtime-header-utils.js +19 -0
- package/dist/runtime-header-utils.js.map +1 -0
- package/dist/runtime-oauth-support.d.ts +5 -0
- package/dist/runtime-oauth-support.d.ts.map +1 -0
- package/dist/runtime-oauth-support.js +21 -0
- package/dist/runtime-oauth-support.js.map +1 -0
- package/dist/runtime-process-utils.d.ts +11 -0
- package/dist/runtime-process-utils.d.ts.map +1 -0
- package/dist/runtime-process-utils.js +299 -0
- package/dist/runtime-process-utils.js.map +1 -0
- package/dist/runtime.d.ts +55 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +245 -0
- package/dist/runtime.js.map +1 -0
- package/dist/schema-cache.d.ts +10 -0
- package/dist/schema-cache.d.ts.map +1 -0
- package/dist/schema-cache.js +40 -0
- package/dist/schema-cache.js.map +1 -0
- package/dist/sdk-patches.d.ts +5 -0
- package/dist/sdk-patches.d.ts.map +1 -0
- package/dist/sdk-patches.js +399 -0
- package/dist/sdk-patches.js.map +1 -0
- package/dist/server-proxy.d.ts +17 -0
- package/dist/server-proxy.d.ts.map +1 -0
- package/dist/server-proxy.js +342 -0
- package/dist/server-proxy.js.map +1 -0
- package/docs/RELEASE.md +96 -0
- package/docs/adhoc.md +76 -0
- package/docs/call-heuristic.md +31 -0
- package/docs/call-syntax.md +75 -0
- package/docs/cli-generator.md +116 -0
- package/docs/cli-reference.md +76 -0
- package/docs/config.md +208 -0
- package/docs/daemon.md +95 -0
- package/docs/emit-ts.md +98 -0
- package/docs/hang-debug.md +88 -0
- package/docs/import.md +59 -0
- package/docs/known-issues.md +33 -0
- package/docs/livetests.md +31 -0
- package/docs/local.md +73 -0
- package/docs/logging.md +67 -0
- package/docs/manual-testing.md +78 -0
- package/docs/mcp.md +44 -0
- package/docs/migration.md +77 -0
- package/docs/pnpm-mcp-migration.md +15 -0
- package/docs/refactor.md +76 -0
- package/docs/shortcuts.md +31 -0
- package/docs/spec.md +86 -0
- package/docs/subagent.md +39 -0
- package/docs/supabase-auth-issue.md +53 -0
- package/docs/tmux.md +30 -0
- package/docs/tool-calling.md +73 -0
- package/docs/windows.md +25 -0
- package/examples/context7-headlines.ts +72 -0
- package/git +3 -0
- package/mcporter.png +0 -0
- package/mcporter.schema.json +263 -0
- package/package.json +105 -0
- package/pnpm-workspace.yaml +2 -0
- package/runner +13 -0
- package/scripts/agent-send.ts +179 -0
- package/scripts/build-bun.ts +125 -0
- package/scripts/committer +53 -0
- package/scripts/docs-list.ts +132 -0
- package/scripts/generate-json-schema.ts +50 -0
- package/scripts/git-policy.ts +165 -0
- package/scripts/mcp_signoz_retry_patch.cjs +9 -0
- package/scripts/release.sh +86 -0
- package/scripts/runner.ts +1556 -0
- package/scripts/test-runner.js +39 -0
- package/src/cli/adhoc-server.ts +263 -0
- package/src/cli/auth-command.ts +290 -0
- package/src/cli/call-argument-expression.ts +61 -0
- package/src/cli/call-argument-values.ts +95 -0
- package/src/cli/call-arguments.ts +246 -0
- package/src/cli/call-command.ts +478 -0
- package/src/cli/call-expression-parser.ts +210 -0
- package/src/cli/cli-factory.ts +51 -0
- package/src/cli/command-inference.ts +99 -0
- package/src/cli/config/add.ts +308 -0
- package/src/cli/config/auth.ts +23 -0
- package/src/cli/config/doctor.ts +27 -0
- package/src/cli/config/get.ts +47 -0
- package/src/cli/config/help.ts +213 -0
- package/src/cli/config/import.ts +97 -0
- package/src/cli/config/index.ts +1 -0
- package/src/cli/config/list.ts +81 -0
- package/src/cli/config/remove.ts +20 -0
- package/src/cli/config/render.ts +119 -0
- package/src/cli/config/shared.ts +159 -0
- package/src/cli/config/types.ts +8 -0
- package/src/cli/config-command.ts +72 -0
- package/src/cli/daemon-command.ts +260 -0
- package/src/cli/emit-ts-command.ts +260 -0
- package/src/cli/emit-ts-templates.ts +161 -0
- package/src/cli/ephemeral-flags.ts +128 -0
- package/src/cli/ephemeral-target.ts +134 -0
- package/src/cli/errors.ts +6 -0
- package/src/cli/flag-utils.ts +29 -0
- package/src/cli/generate/artifacts.ts +308 -0
- package/src/cli/generate/definition.ts +325 -0
- package/src/cli/generate/flag-parser.ts +50 -0
- package/src/cli/generate/flags.ts +248 -0
- package/src/cli/generate/fs-helpers.ts +34 -0
- package/src/cli/generate/name-utils.ts +176 -0
- package/src/cli/generate/output.ts +27 -0
- package/src/cli/generate/runtime.ts +38 -0
- package/src/cli/generate/server-utils.ts +38 -0
- package/src/cli/generate/template-data.ts +126 -0
- package/src/cli/generate/template-help.ts +112 -0
- package/src/cli/generate/template.ts +407 -0
- package/src/cli/generate/tools.ts +354 -0
- package/src/cli/generate/types.ts +1 -0
- package/src/cli/generate-cli-runner.ts +82 -0
- package/src/cli/help-output.ts +207 -0
- package/src/cli/http-utils.ts +89 -0
- package/src/cli/identifier-helpers.ts +107 -0
- package/src/cli/image-output.ts +62 -0
- package/src/cli/inspect-cli-command.ts +89 -0
- package/src/cli/json-output.ts +60 -0
- package/src/cli/list-command.ts +432 -0
- package/src/cli/list-detail-helpers.ts +179 -0
- package/src/cli/list-doc-comments.ts +129 -0
- package/src/cli/list-format.ts +150 -0
- package/src/cli/list-output.ts +224 -0
- package/src/cli/list-signature.ts +217 -0
- package/src/cli/logger-context.ts +36 -0
- package/src/cli/output-format.ts +63 -0
- package/src/cli/output-utils.ts +161 -0
- package/src/cli/path-utils.ts +13 -0
- package/src/cli/runtime-debug.ts +141 -0
- package/src/cli/server-lookup.ts +22 -0
- package/src/cli/terminal.ts +41 -0
- package/src/cli/timeouts.ts +67 -0
- package/src/cli/tool-cache.ts +43 -0
- package/src/cli/transport-utils.ts +10 -0
- package/src/cli-metadata.ts +164 -0
- package/src/cli.ts +234 -0
- package/src/config/imports/external.ts +284 -0
- package/src/config/imports/paths-utils.ts +29 -0
- package/src/config/imports/paths.ts +145 -0
- package/src/config/imports/shared.ts +27 -0
- package/src/config/path-discovery.ts +79 -0
- package/src/config/read-config.ts +91 -0
- package/src/config-imports.ts +12 -0
- package/src/config-normalize.ts +220 -0
- package/src/config-schema.ts +175 -0
- package/src/config.ts +136 -0
- package/src/daemon/client.ts +350 -0
- package/src/daemon/config-layers.ts +23 -0
- package/src/daemon/host.ts +455 -0
- package/src/daemon/launch.ts +45 -0
- package/src/daemon/log-context.ts +78 -0
- package/src/daemon/paths.ts +35 -0
- package/src/daemon/protocol.ts +57 -0
- package/src/daemon/request-utils.ts +67 -0
- package/src/daemon/runtime-wrapper.ts +135 -0
- package/src/env.ts +107 -0
- package/src/error-classifier.ts +158 -0
- package/src/fs-json.ts +21 -0
- package/src/generate-cli.ts +211 -0
- package/src/index.ts +14 -0
- package/src/lifecycle.ts +138 -0
- package/src/logging.ts +93 -0
- package/src/oauth-manual.ts +103 -0
- package/src/oauth-persistence.ts +316 -0
- package/src/oauth-vault.ts +128 -0
- package/src/oauth.ts +494 -0
- package/src/result-utils.ts +278 -0
- package/src/runtime/errors.ts +17 -0
- package/src/runtime/oauth.ts +112 -0
- package/src/runtime/transport.ts +198 -0
- package/src/runtime/utils.ts +54 -0
- package/src/runtime-header-utils.ts +23 -0
- package/src/runtime-oauth-support.ts +24 -0
- package/src/runtime-process-utils.ts +324 -0
- package/src/runtime.ts +321 -0
- package/src/schema-cache.ts +49 -0
- package/src/sdk-patches.ts +498 -0
- package/src/server-proxy.ts +407 -0
- package/tests/adhoc-server.test.ts +49 -0
- package/tests/call-arguments.test.ts +111 -0
- package/tests/cli-auth-help.test.ts +43 -0
- package/tests/cli-auth-retry.test.ts +41 -0
- package/tests/cli-auth.test.ts +96 -0
- package/tests/cli-call-args.test.ts +69 -0
- package/tests/cli-call-errors.test.ts +27 -0
- package/tests/cli-call-execution.test.ts +279 -0
- package/tests/cli-call-help.test.ts +43 -0
- package/tests/cli-command-inference.test.ts +73 -0
- package/tests/cli-config-command.test.ts +371 -0
- package/tests/cli-config-fallback.test.ts +259 -0
- package/tests/cli-config-routing.test.ts +20 -0
- package/tests/cli-ephemeral-flags.test.ts +54 -0
- package/tests/cli-flag-utils.test.ts +17 -0
- package/tests/cli-generate-artifacts.test.ts +52 -0
- package/tests/cli-generate-cli.integration.test.ts +675 -0
- package/tests/cli-generate-runner.test.ts +156 -0
- package/tests/cli-global-flags.test.ts +61 -0
- package/tests/cli-help-shortcuts.test.ts +42 -0
- package/tests/cli-image-output.test.ts +65 -0
- package/tests/cli-inspect-command.test.ts +15 -0
- package/tests/cli-list-classification.test.ts +291 -0
- package/tests/cli-list-flags.test.ts +83 -0
- package/tests/cli-list-formatting.test.ts +358 -0
- package/tests/cli-list-help.test.ts +43 -0
- package/tests/cli-list-json.test.ts +55 -0
- package/tests/cli-list-stdio-logs.test.ts +108 -0
- package/tests/cli-list-verbose-e2e.test.ts +83 -0
- package/tests/cli-oauth-timeout-flag.test.ts +94 -0
- package/tests/cli-output-utils.test.ts +129 -0
- package/tests/cli-regenerate.test.ts +261 -0
- package/tests/cli-version.test.ts +24 -0
- package/tests/config-add-dry-run.test.ts +45 -0
- package/tests/config-add-flags.test.ts +61 -0
- package/tests/config-add-imports.test.ts +28 -0
- package/tests/config-add-persist.test.ts +27 -0
- package/tests/config-add-scope-behavior.test.ts +46 -0
- package/tests/config-add-scope.test.ts +101 -0
- package/tests/config-add-sse.test.ts +23 -0
- package/tests/config-command-string.test.ts +96 -0
- package/tests/config-doctor.test.ts +45 -0
- package/tests/config-get-json.test.ts +24 -0
- package/tests/config-import-dedupe.test.ts +27 -0
- package/tests/config-import-paths.test.ts +49 -0
- package/tests/config-import.test.ts +64 -0
- package/tests/config-imports-unit.test.ts +337 -0
- package/tests/config-imports.test.ts +417 -0
- package/tests/config-layered.test.ts +178 -0
- package/tests/config-list-text-footer.test.ts +33 -0
- package/tests/config-list.test.ts +62 -0
- package/tests/config-missing.test.ts +140 -0
- package/tests/config-normalize.test.ts +71 -0
- package/tests/config-remove.test.ts +44 -0
- package/tests/config-render.test.ts +61 -0
- package/tests/config-resolution.test.ts +94 -0
- package/tests/config-schema-file.test.ts +29 -0
- package/tests/config-shared.test.ts +41 -0
- package/tests/config-sources.test.ts +58 -0
- package/tests/daemon-cli-command.test.ts +112 -0
- package/tests/daemon-client-config-stale.test.ts +222 -0
- package/tests/daemon-client-timeout.test.ts +114 -0
- package/tests/daemon-client.test.ts +61 -0
- package/tests/daemon-host.test.ts +33 -0
- package/tests/daemon.integration.test.ts +175 -0
- package/tests/emit-ts.test.ts +125 -0
- package/tests/ephemeral-target.test.ts +26 -0
- package/tests/error-classifier.test.ts +46 -0
- package/tests/fixtures/ansi.ts +18 -0
- package/tests/fixtures/cli-list-fixtures.ts +43 -0
- package/tests/fixtures/config-fixture.ts +29 -0
- package/tests/fixtures/imports/.claude/mcp.json +8 -0
- package/tests/fixtures/imports/.claude/settings.json +10 -0
- package/tests/fixtures/imports/.claude/settings.local.json +10 -0
- package/tests/fixtures/imports/.codeium/windsurf/mcp_config.json +14 -0
- package/tests/fixtures/imports/.codex/config.toml +7 -0
- package/tests/fixtures/imports/.config/opencode/opencode.jsonc +10 -0
- package/tests/fixtures/imports/.cursor/mcp.json +14 -0
- package/tests/fixtures/imports/Library/Application Support/Code/User/mcp.json +11 -0
- package/tests/fixtures/imports/config/mcporter.json +11 -0
- package/tests/fixtures/imports/home/.claude/settings.json +7 -0
- package/tests/fixtures/imports/home/.codeium/windsurf/mcp_config.json +14 -0
- package/tests/fixtures/imports/home/.codex/config.toml +7 -0
- package/tests/fixtures/imports/home/Library/Application Support/Code/User/mcp.json +11 -0
- package/tests/fixtures/imports/opencode.jsonc +11 -0
- package/tests/fixtures/mcporter.json +64 -0
- package/tests/fixtures/stdio-filesystem-server.mjs +63 -0
- package/tests/fixtures/stdio-memory-server.mjs +58 -0
- package/tests/fixtures/test-helpers.ts +24 -0
- package/tests/fixtures/tool-fixtures.ts +35 -0
- package/tests/fs-json.test.ts +35 -0
- package/tests/generate-cli-helpers.test.ts +162 -0
- package/tests/generate-cli.test.ts +595 -0
- package/tests/generate-definition.test.ts +25 -0
- package/tests/generator-flag-parser.test.ts +19 -0
- package/tests/index-api.test.ts +136 -0
- package/tests/keep-alive-runtime.test.ts +152 -0
- package/tests/lifecycle.test.ts +29 -0
- package/tests/list-detail-helpers.test.ts +204 -0
- package/tests/list-format.test.ts +40 -0
- package/tests/list-inline-stdio.test.ts +71 -0
- package/tests/list-output.test.ts +138 -0
- package/tests/live/deepwiki-live.test.ts +53 -0
- package/tests/oauth-callback.test.ts +108 -0
- package/tests/oauth-open-external.test.ts +29 -0
- package/tests/oauth-persistence.test.ts +146 -0
- package/tests/oauth-session.test.ts +216 -0
- package/tests/result-utils.test.ts +254 -0
- package/tests/runtime-call-timeout.test.ts +75 -0
- package/tests/runtime-compose.test.ts +298 -0
- package/tests/runtime-error-reset.test.ts +65 -0
- package/tests/runtime-header-utils.test.ts +36 -0
- package/tests/runtime-integration.test.ts +113 -0
- package/tests/runtime-oauth-connect.test.ts +72 -0
- package/tests/runtime-oauth-detection.test.ts +72 -0
- package/tests/runtime-oauth-timeout.test.ts +60 -0
- package/tests/runtime-oauth-utils.test.ts +14 -0
- package/tests/runtime-process-utils.test.ts +53 -0
- package/tests/runtime-transport.test.ts +69 -0
- package/tests/runtime-utils.test.ts +31 -0
- package/tests/runtime.test.ts +94 -0
- package/tests/sdk-patches.test.ts +24 -0
- package/tests/server-proxy.test.ts +336 -0
- package/tests/stdio-servers.integration.test.ts +139 -0
- package/tests/tool-cache.test.ts +42 -0
- package/tests/version-consistency.test.ts +11 -0
- package/tsconfig.build.json +11 -0
- package/tsconfig.json +17 -0
- package/vitest.config.ts +18 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: 'Checklist for diagnosing mcporter commands that never exit, using tmux and active-handle dumps.'
|
|
3
|
+
read_when:
|
|
4
|
+
- 'Seeing the CLI hang after tool completion'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Debugging Hanging mcporter Calls
|
|
8
|
+
|
|
9
|
+
When `mcporter call` prints a tool response but the process never exits, it
|
|
10
|
+
usually means Node still has active handles it is waiting on. The most common
|
|
11
|
+
culprit is a child MCP server process that keeps the stdio transport alive.
|
|
12
|
+
|
|
13
|
+
## Quick Checklist
|
|
14
|
+
|
|
15
|
+
1. **Run under tmux** – launch the command inside tmux so you can inspect the
|
|
16
|
+
pane even after Cursor or another agent times out.
|
|
17
|
+
2. **Enable hang diagnostics** – set `MCPORTER_DEBUG_HANG=1` when invoking the
|
|
18
|
+
CLI. mcporter will dump the active handles/requests after the tool finishes
|
|
19
|
+
and around the `runtime.close()` call.
|
|
20
|
+
3. **Inspect the handle list** – look for `ChildProcess (pid=…)` entries. If a
|
|
21
|
+
child remains, mcporter will now unref and force-kill it, but the debug list
|
|
22
|
+
tells you exactly what was keeping the event loop alive.
|
|
23
|
+
4. **Capture the pane output** – run `tmux capture-pane -p -t <session> -S
|
|
24
|
+
-200` to save the diagnostic log for later review.
|
|
25
|
+
5. **Retry with `--timeout`** – if the tool itself hangs, use
|
|
26
|
+
`--timeout <ms>` or `MCPORTER_CALL_TIMEOUT` to fail fast while still
|
|
27
|
+
gathering diagnostics.
|
|
28
|
+
6. **Clamp OAuth waits** – when the browser-based sign-in never completes,
|
|
29
|
+
run with `--oauth-timeout <ms>` (or `MCPORTER_OAUTH_TIMEOUT_MS`) so the CLI
|
|
30
|
+
tears down the pending flow instead of waiting the full minute.
|
|
31
|
+
|
|
32
|
+
## Example Session
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
tmux new-session -d -s mcphang \
|
|
36
|
+
'cd /path/to/project && \
|
|
37
|
+
MCPORTER_DEBUG_HANG=1 \
|
|
38
|
+
CHROME_DEVTOOLS_MCP_BROWSER_URL=http://127.0.0.1:9222 \
|
|
39
|
+
pnpm --dir "$HOME/projects/mcporter" exec tsx \
|
|
40
|
+
"$HOME/projects/mcporter/src/cli.ts" call \
|
|
41
|
+
--config "$PWD/config/mcporter.json" \
|
|
42
|
+
--root "$PWD" \
|
|
43
|
+
chrome-devtools --tool list_pages'
|
|
44
|
+
|
|
45
|
+
sleep 5
|
|
46
|
+
tmux capture-pane -p -t mcphang -S -200
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Sample diagnostic output (abridged):
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
[mcporter] [debug] after call (object result): 6 active handle(s), 0 request(s)
|
|
53
|
+
[mcporter] [debug] handle => ChildProcess (pid=78480)
|
|
54
|
+
[mcporter] [debug] beginning runtime.close()
|
|
55
|
+
[mcporter] [debug] after runtime.close: 6 active handle(s), 0 request(s)
|
|
56
|
+
[mcporter] [debug] forcibly killed child pid=78480 (runtime.finally)
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
This confirms the CLI response completed and that the lingering handle was a
|
|
60
|
+
child process, which mcporter will now terminate during shutdown.
|
|
61
|
+
|
|
62
|
+
## Notes
|
|
63
|
+
|
|
64
|
+
- The diagnostics only appear when `MCPORTER_DEBUG_HANG=1` is set.
|
|
65
|
+
- Killing residual children is best-effort; if you see repeated `kill-failed`
|
|
66
|
+
messages, manually terminate the PID listed in the log.
|
|
67
|
+
- Always keep tmux sessions tidy after debugging: `tmux kill-session -t
|
|
68
|
+
<session>`.
|
|
69
|
+
- The CLI now forces `process.exit(0)` after cleanup by default so Node never
|
|
70
|
+
lingers on leaked handles. Export `MCPORTER_NO_FORCE_EXIT=1` if you’re
|
|
71
|
+
debugging and need the process to stay alive.
|
|
72
|
+
- You can still set `MCPORTER_FORCE_EXIT=1` explicitly when you want to force
|
|
73
|
+
termination even with `MCPORTER_NO_FORCE_EXIT` in play.
|
|
74
|
+
- Stdio servers have their stderr output suppressed by default; set
|
|
75
|
+
`MCPORTER_STDIO_LOGS=1` to print their logs (they’re also surfaced whenever a
|
|
76
|
+
child exits with a non-zero status).
|
|
77
|
+
|
|
78
|
+
## Upstream Tracking
|
|
79
|
+
|
|
80
|
+
- `@modelcontextprotocol/sdk` **1.21.0** is the latest release pulled into mcporter.
|
|
81
|
+
- Open SDK issues related to stdio shutdown:
|
|
82
|
+
- [#579 StdioClientTransport does not follow the spec on close](https://github.com/modelcontextprotocol/typescript-sdk/issues/579)
|
|
83
|
+
- [#780 onerror listeners not removed after client close (stdio)](https://github.com/modelcontextprotocol/typescript-sdk/issues/780)
|
|
84
|
+
- [#1049 stdio client crashes when spawned server exits unexpectedly](https://github.com/modelcontextprotocol/typescript-sdk/issues/1049)
|
|
85
|
+
|
|
86
|
+
We keep a local checkout of the SDK under `~/Projects/typescript-sdk/` so we can
|
|
87
|
+
diff against upstream and craft repros/patches quickly. Any mcporter-specific
|
|
88
|
+
workarounds live in `src/sdk-patches.ts` until the upstream fixes land.
|
package/docs/import.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: 'Where mcporter looks for external MCP configs and the formats each import kind understands.'
|
|
3
|
+
read_when:
|
|
4
|
+
- 'Investigating missing imported servers'
|
|
5
|
+
- 'Adding or modifying config import kinds'
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Import Reference
|
|
9
|
+
|
|
10
|
+
mcporter merges your local `config/mcporter.json` with editor- or tool-specific config files so you can reuse servers without copying them manually. This document spells out the supported formats, the directories we scan for each import kind, and how precedence works.
|
|
11
|
+
|
|
12
|
+
## Import Pipeline
|
|
13
|
+
|
|
14
|
+
1. `config/mcporter.json` is loaded first (or the file passed to `--config`). If it includes an `"imports"` array, that array defines the exact order we follow. If the array is omitted, we use the default order `["cursor", "claude-code", "claude-desktop", "codex", "windsurf", "opencode", "vscode"]`.
|
|
15
|
+
2. For each import kind, we probe the project-relative path (e.g., `.cursor/mcp.json`) and then the per-user path. The first readable file is parsed and converted into mcporter’s normalized schema. Names collide on a “first wins” basis—once an imported name is merged, later imports with the same name are ignored unless the local config defines an override.
|
|
16
|
+
3. Finally, any servers declared inside `mcpServers` take precedence over imports regardless of the order above.
|
|
17
|
+
|
|
18
|
+
Set `"imports": []` when you want to disable auto-merging entirely, or supply a subset (for example `["cursor", "codex"]`) to reduce the latency of `mcporter list`.
|
|
19
|
+
|
|
20
|
+
## Supported Formats
|
|
21
|
+
|
|
22
|
+
- **JSON containers**: Cursor, Claude Code, Windsurf, and VS Code configs use JSON. We accept three shapes:
|
|
23
|
+
- Root-level dictionary where each key is a server (`{ "my-server": { ... } }`).
|
|
24
|
+
- `{ "mcpServers": { ... } }` (Cursor-style).
|
|
25
|
+
- `{ "servers": { ... } }` (older VS Code previews).
|
|
26
|
+
- **TOML container**: Codex uses TOML files with `[mcp_servers.<name>]` tables. Only `.codex/config.toml` is recognized.
|
|
27
|
+
- **Shared fields**: We convert JSON/TOML entries into mcporter’s schema, honoring `baseUrl`, `command` (string or array), `args`, `headers`, `env`, `bearerToken`, `bearerTokenEnv`, `description`, `tokenCacheDir`, `clientName`, and `auth`. Extra properties are ignored.
|
|
28
|
+
|
|
29
|
+
## Import Support Matrix
|
|
30
|
+
|
|
31
|
+
| Kind | Typical owner | Format | Project paths | User paths | Notes |
|
|
32
|
+
| --- | --- | --- | --- | --- | --- |
|
|
33
|
+
| `cursor` | Cursor IDE | JSON (`mcpServers`) | `.cursor/mcp.json` | macOS/Linux: `${XDG_CONFIG_HOME:-~/.config}/Cursor/User/mcp.json`<br>Windows: `%APPDATA%/Cursor/User/mcp.json` | Mirrors Cursor’s “MCP Servers” panel. Per-workspace files override the global file when both exist. |
|
|
34
|
+
| `claude-code` | Claude Code (browser) | JSON (`mcpServers`) | `.claude/settings.local.json`, `.claude/settings.json`, `.claude/mcp.json` | `~/.claude/settings.json`, `~/.claude/mcp.json`, `~/.claude.json` | `settings.local.json` (ignored by git) overrides `settings.json`, which is the shared project config; both beat the legacy `mcp.json`. |
|
|
35
|
+
| `claude-desktop` | Claude Desktop | JSON (`mcpServers`) | — | macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`<br>Windows: `%APPDATA%/Claude/claude_desktop_config.json`<br>Linux: `~/.config/Claude/claude_desktop_config.json` | Desktop Claude stores all servers per-machine, so there’s no project-relative file. |
|
|
36
|
+
| `codex` | Sweetistics Codex | TOML (`[mcp_servers.*]`) | `.codex/config.toml` | `~/.codex/config.toml` | Only `config.toml` is recognized; the deprecated `mcp.toml` filename is ignored. |
|
|
37
|
+
| `windsurf` | Codeium Windsurf | JSON (`mcpServers`) | — | Windows: `%APPDATA%/Codeium/windsurf/mcp_config.json`<br>macOS/Linux: `~/.codeium/windsurf/mcp_config.json` | Global-only config managed by Codeium. |
|
|
38
|
+
| `opencode` | OpenCode | JSON/JSONC (`mcp`, `mcpServers`, or root map) | `opencode.json`, `opencode.jsonc` | `OPENCODE_CONFIG` override<br>`OPENCODE_CONFIG_DIR/opencode.json(c)`<br>macOS/Linux: `${XDG_CONFIG_HOME:-~/.config}/opencode/opencode.json(c)`<br>Windows: `%APPDATA%/opencode/opencode.json(c)` | Accepts comment-friendly `.jsonc` files and honors OpenCode’s precedence env vars. |
|
|
39
|
+
| `vscode` | VS Code MCP extension | JSON (`mcpServers` or `servers`) | — | macOS: `~/Library/Application Support/Code(/Code - Insiders)/User/mcp.json`<br>Windows: `%APPDATA%/Code(/Code - Insiders)/User/mcp.json`<br>Linux: `~/.config/Code(/Code - Insiders)/User/mcp.json` | We probe both Stable and Insiders directories; the first readable file wins. |
|
|
40
|
+
|
|
41
|
+
> Tip: mcporter resolves `~` and `$XDG_CONFIG_HOME` inside these paths automatically, so you can rely on the same `imports` list across platforms.
|
|
42
|
+
>
|
|
43
|
+
> Claude tip: keep shared servers in `.claude/settings.json` and stash personal tweaks or credentials in `.claude/settings.local.json`, which Claude auto-ignores in git.
|
|
44
|
+
|
|
45
|
+
## Default Order & Overrides
|
|
46
|
+
|
|
47
|
+
- When `config/mcporter.json` omits the `"imports"` key, we load imports in this order: `["cursor", "claude-code", "claude-desktop", "codex", "windsurf", "opencode", "vscode"]`.
|
|
48
|
+
- If you set a non-empty `"imports"` array, mcporter appends any missing defaults after your list, so shared presets stay available without extra JSON churn.
|
|
49
|
+
- Set `"imports": []` to disable auto-merging entirely (handy for CI or projects that want deterministic configs).
|
|
50
|
+
|
|
51
|
+
## Verifying & Troubleshooting
|
|
52
|
+
|
|
53
|
+
- Run `mcporter list --source import --json` (or pipe through `rg '"source":'`) to confirm the resolved file for each imported server.
|
|
54
|
+
- Use `mcporter list --source import` to limit the output to merged definitions when you’re debugging precedence or verifying first-wins behavior.
|
|
55
|
+
- If a server is defined in multiple tools (e.g., Cursor and OpenCode), the first import in the list wins. Reorder `"imports"` or copy the entry locally via `mcporter config import <kind> --copy` to break ties.
|
|
56
|
+
- When debugging OpenCode, remember that `OPENCODE_CONFIG` beats every other path. Clearing or overriding that env var is often the fastest way to validate changes.
|
|
57
|
+
- When tests need deterministic data, follow `tests/config-imports.test.ts`—it copies fixtures into a fake home directory and asserts the merged server order. Mirror that pattern when adding new import kinds.
|
|
58
|
+
|
|
59
|
+
Keeping this reference up to date is the best way to prevent “my editor has servers but mcporter can’t see them” bug reports. If you add a new import kind, update this table, add fixtures under `tests/fixtures/imports`, and document the format here.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: 'Living list of mcporter limitations, hosted MCP quirks, and upstream gaps.'
|
|
3
|
+
read_when:
|
|
4
|
+
- 'Triaging a bug that might already be documented'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Known Issues
|
|
8
|
+
|
|
9
|
+
This file tracks limitations that users regularly run into. Most of these require upstream cooperation or larger refactors—feel free to reference this when triaging bugs.
|
|
10
|
+
|
|
11
|
+
## Hosted OAuth servers (Supabase, GitHub MCP, etc.)
|
|
12
|
+
- Supabase’s hosted MCP server rejects the standard `mcp:tools` scope and only accepts Supabase-specific scopes (`projects:read`, `database:write`, ...). Because they do not expose OAuth discovery metadata or scope negotiation, mcporter cannot auto-register or complete the flow. Workarounds:
|
|
13
|
+
- Use Supabase’s supported clients (Cursor, Windsurf).
|
|
14
|
+
- Self-host their MCP server and configure PAT headers / custom OAuth.
|
|
15
|
+
- Ask Supabase to accept the MCP scope or publish their scope list.
|
|
16
|
+
- GitHub’s MCP endpoint (`https://api.githubcopilot.com/mcp/`) returns “does not support dynamic client registration” when mcporter attempts to connect. Copilot’s backend expects pre-registered client credentials. Until GitHub publishes a dynamic-registration API (or client secrets), mcporter cannot interact with their hosted server.
|
|
17
|
+
|
|
18
|
+
## Output schemas missing/buggy on many servers
|
|
19
|
+
- The MCP spec allows servers to omit `outputSchema`. In practice, many hosted MCPs return empty or inconsistent schemas, so features that rely on return types (TypeScript signatures, generated CLIs, `createServerProxy` return helpers) may degrade to `unknown`.
|
|
20
|
+
- Workarounds: inspect the server’s README / manual docs for output details, or wrap the tool via `createServerProxy` and handle the raw envelope manually.
|
|
21
|
+
- Potential improvement: allow user-provided schema overrides (e.g., `mcporter config patch`, CLI flag to load schema JSON) so we can fill gaps on a per-tool basis.
|
|
22
|
+
|
|
23
|
+
## MCP SDK 1.22.0 inline-stdio regression
|
|
24
|
+
- Upgrading `@modelcontextprotocol/sdk` to 1.22.0 causes `mcporter generate-cli --compile` (and direct runtime `listTools`) to fail against inline STDIO servers with `MCP error -32603: Cannot read properties of undefined (reading 'typeName')`.
|
|
25
|
+
- Repro: `pnpm mcporter generate-cli "node mock-stdio.mjs" --compile /tmp/inline-cli --runtime bun` using the inline stdio harness in `tests/cli-generate-cli.integration.test.ts`.
|
|
26
|
+
- Status: reproduced locally; pinned the SDK to `~1.21.2` until upstream ships a fix.
|
|
27
|
+
|
|
28
|
+
## Next Steps
|
|
29
|
+
- Implement true scope negotiation (read discovery metadata, allow `--oauth-scope`).
|
|
30
|
+
- Keep lobbying providers for spec-compliant OAuth behavior.
|
|
31
|
+
- Consider adding schema override hooks or auto-caching schema snapshots per tool.
|
|
32
|
+
|
|
33
|
+
If you run into other recurring pain points, append them here so we can prioritize fixes.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: 'Opt-in live MCP integration tests that hit real hosted servers (off by default in CI).'
|
|
3
|
+
read_when:
|
|
4
|
+
- 'Running end-to-end validation against hosted MCP servers'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Live MCP Tests
|
|
8
|
+
|
|
9
|
+
These tests hit real hosted MCP servers and require outbound HTTP. They are **off by default** to keep CI and local runs deterministic.
|
|
10
|
+
|
|
11
|
+
## When to run
|
|
12
|
+
- Before releases when you want end-to-end validation against hosted servers.
|
|
13
|
+
- When debugging regressions that only repro against real servers (e.g., DeepWiki).
|
|
14
|
+
|
|
15
|
+
## How to run
|
|
16
|
+
```bash
|
|
17
|
+
MCP_LIVE_TESTS=1 pnpm test:live
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
This runs the Vitest suite under `tests/live`, in-band, with longer timeouts.
|
|
21
|
+
|
|
22
|
+
## Current coverage
|
|
23
|
+
- **DeepWiki** (both wire protocols):
|
|
24
|
+
- Streamable HTTP: `https://mcp.deepwiki.com/mcp`
|
|
25
|
+
- SSE: `https://mcp.deepwiki.com/sse`
|
|
26
|
+
- Test: calls `read_wiki_structure repoName:facebook/react` and asserts a non-empty result.
|
|
27
|
+
|
|
28
|
+
## Notes
|
|
29
|
+
- Tests are skipped entirely unless `MCP_LIVE_TESTS=1` is set.
|
|
30
|
+
- Ensure network egress is allowed. No secrets are required for the current DeepWiki checks.
|
|
31
|
+
- Keep assertions minimal to reduce flake; these are availability smokes, not full contract tests.
|
package/docs/local.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: 'How to run mcporter directly from the repo (tsx, tsx --watch, built artifacts) without npx.'
|
|
3
|
+
read_when:
|
|
4
|
+
- 'Setting up a local development loop for this repo'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Running mcporter Locally
|
|
8
|
+
|
|
9
|
+
You don’t need `npx` every time—here are the three local entry points we use while developing mcporter itself.
|
|
10
|
+
|
|
11
|
+
## 1. Direct TypeScript entry (no build step)
|
|
12
|
+
|
|
13
|
+
All commands can be executed with `tsx` straight from `src/cli.ts`:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# list servers (text)
|
|
17
|
+
pnpm exec tsx src/cli.ts list
|
|
18
|
+
|
|
19
|
+
# list servers as JSON
|
|
20
|
+
pnpm exec tsx src/cli.ts list --json
|
|
21
|
+
|
|
22
|
+
# call a tool (auto formatted)
|
|
23
|
+
pnpm exec tsx src/cli.ts call context7.resolve-library-id libraryName=react
|
|
24
|
+
|
|
25
|
+
# call a tool but emit structured JSON on success/failure
|
|
26
|
+
pnpm exec tsx src/cli.ts call context7.resolve-library-id libraryName=react --output json
|
|
27
|
+
|
|
28
|
+
# auth flow
|
|
29
|
+
pnpm exec tsx src/cli.ts auth vercel
|
|
30
|
+
|
|
31
|
+
# auth flow with structured JSON status
|
|
32
|
+
pnpm exec tsx src/cli.ts auth vercel --json
|
|
33
|
+
|
|
34
|
+
# ad-hoc auth
|
|
35
|
+
pnpm exec tsx src/cli.ts auth https://mcp.supabase.com/mcp
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
These invocations match the `pnpm mcporter:*` scripts and are ideal when you’re iterating on TypeScript without rebuilding.
|
|
39
|
+
|
|
40
|
+
## 2. Compiled CLI from `dist/`
|
|
41
|
+
|
|
42
|
+
When you want the same behaviour the published package ships with:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
pnpm build # emits dist/...
|
|
46
|
+
node dist/cli.js list
|
|
47
|
+
node dist/cli.js call chrome-devtools.take_snapshot
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Set flags exactly as you would in production:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
MCPORTER_DEBUG_HANG=1 node dist/cli.js list
|
|
54
|
+
MCPORTER_NO_FORCE_EXIT=1 node dist/cli.js call linear.search_documentation query="automations"
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## 3. Workspace executables
|
|
58
|
+
|
|
59
|
+
After `pnpm add mcporter` in your project (or inside this repo), the shim binaries are available:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
pnpm mcporter:list
|
|
63
|
+
pnpm mcporter:call context7.get-library-docs topic=hooks
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Debug flags recap
|
|
67
|
+
|
|
68
|
+
- `MCPORTER_DEBUG_HANG=1` – dumps active handles around shutdown (pairs well with tmux; see `docs/hang-debug.md`).
|
|
69
|
+
- `MCPORTER_NO_FORCE_EXIT=1` – keeps the process alive even after cleanup (useful while inspecting debug output).
|
|
70
|
+
- `MCPORTER_FORCE_EXIT=1` – force termination even if the above is set.
|
|
71
|
+
- `MCPORTER_STDIO_LOGS=1` – print the buffered stderr output from stdio MCP servers (handy when debugging noisy backends).
|
|
72
|
+
|
|
73
|
+
All three entry points honour the same `--config`, `--root`, and `--log-level` flags as the published CLI.
|
package/docs/logging.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: 'Reference for capturing mcporter diagnostics (daemon logs, per-server overrides, env flags).'
|
|
3
|
+
read_when:
|
|
4
|
+
- 'Need persistent daemon logs or want to trace keep-alive STDIO servers.'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Logging & Diagnostics
|
|
8
|
+
|
|
9
|
+
## Daemon logging
|
|
10
|
+
|
|
11
|
+
The keep-alive daemon can tee its stdout/stderr (and per-server call traces) into a file so you can see crashes or repeated failures without rerunning it in the foreground.
|
|
12
|
+
|
|
13
|
+
### CLI flags
|
|
14
|
+
|
|
15
|
+
- `mcporter daemon start --log` — enable logging at the default path `~/.mcporter/daemon/daemon-<config-hash>.log`.
|
|
16
|
+
- `mcporter daemon start --log-file /tmp/mcporter-daemon.log` — write logs to a specific file (path is created if needed).
|
|
17
|
+
- `mcporter daemon start --log-servers chrome-devtools,mobile-mcp` — only emit per-call entries for the listed servers. Without this flag, `--log` records every keep-alive server’s calls.
|
|
18
|
+
|
|
19
|
+
`mcporter daemon restart` accepts the same logging flags, so you can bounce the daemon without retyping your tracing preferences.
|
|
20
|
+
|
|
21
|
+
Foreground mode (`mcporter daemon start --foreground --log`) still prints to your terminal; the log file mirrors the same content.
|
|
22
|
+
|
|
23
|
+
### Environment overrides
|
|
24
|
+
|
|
25
|
+
Set these before invoking `mcporter` (helpful for scripts/CI):
|
|
26
|
+
|
|
27
|
+
- `MCPORTER_DAEMON_LOG=1` — enable logging.
|
|
28
|
+
- `MCPORTER_DAEMON_LOG_PATH=/tmp/mcporter-daemon.log` — custom log file.
|
|
29
|
+
- `MCPORTER_DAEMON_LOG_SERVERS=chrome-devtools,playwright` — per-server call filtering.
|
|
30
|
+
|
|
31
|
+
The CLI flags take precedence; env vars are the fallback.
|
|
32
|
+
|
|
33
|
+
### Per-server opt-in
|
|
34
|
+
|
|
35
|
+
Add a logging block inside the server definition (alongside `lifecycle`) when you only want a specific STDIO transport to produce call traces, regardless of global flags:
|
|
36
|
+
|
|
37
|
+
```json
|
|
38
|
+
"chrome-devtools": {
|
|
39
|
+
"description": "Chrome DevTools protocol bridge",
|
|
40
|
+
"command": "npx",
|
|
41
|
+
"args": ["-y", "chrome-devtools-mcp@latest"],
|
|
42
|
+
"lifecycle": "keep-alive",
|
|
43
|
+
"logging": {
|
|
44
|
+
"daemon": { "enabled": true }
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
When combined with `--log`/`MCPORTER_DAEMON_LOG=1`, any server that has `logging.daemon.enabled` emits `callTool start/success/error` lines even if it isn’t listed in `--log-servers`.
|
|
50
|
+
|
|
51
|
+
### Inspecting logs
|
|
52
|
+
|
|
53
|
+
- `mcporter daemon status` prints both the socket path and the current log file (if logging is enabled) so you can `tail -f` the output quickly.
|
|
54
|
+
- Each call looks like:
|
|
55
|
+
```
|
|
56
|
+
[daemon] 2025-11-10T15:08:21.123Z callTool start server=chrome-devtools tool=take_snapshot
|
|
57
|
+
[daemon] 2025-11-10T15:08:22.004Z callTool success server=chrome-devtools tool=take_snapshot
|
|
58
|
+
```
|
|
59
|
+
- Shutdown events and errors are logged the same way (`callTool error … err=...`, `listTools error …`, etc.).
|
|
60
|
+
|
|
61
|
+
### Defaults & cleanup
|
|
62
|
+
|
|
63
|
+
Log files live under `~/.mcporter/daemon/` next to the socket/metadata. They’re not rotated automatically yet; delete/rotate them manually if they grow large. Running `mcporter daemon stop` leaves the log intact so you can inspect it after a crash.
|
|
64
|
+
|
|
65
|
+
## Foreground debugging
|
|
66
|
+
|
|
67
|
+
When troubleshooting deeply, run `mcporter daemon start --foreground --log` in a dedicated terminal. This keeps the daemon attached (so Ctrl+C stops it) and still writes to the configured log file for later inspection.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: 'Tmux-based manual testing recipe for exercising mcporter against real MCP servers.'
|
|
3
|
+
read_when:
|
|
4
|
+
- 'Need to reproduce a bug or verify CLI output by hand'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Manual Testing Harness
|
|
8
|
+
|
|
9
|
+
When we need to sanity-check CLI flows against real MCP servers (or reproduce bugs by hand), use this repeatable harness. Everything runs under `tmux` so long-running commands can be inspected without blocking the current shell.
|
|
10
|
+
|
|
11
|
+
## Prerequisites
|
|
12
|
+
|
|
13
|
+
- `pnpm install` ran recently.
|
|
14
|
+
- Credentials exist for any auth-required servers you plan to exercise.
|
|
15
|
+
- `tmux` is installed (we rely on it below).
|
|
16
|
+
|
|
17
|
+
## Discover live servers
|
|
18
|
+
|
|
19
|
+
Start every session by listing all configured servers so you can pick a healthy target:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
tmux new-session -d -s list-all 'pnpm exec tsx src/cli.ts list --timeout 1000 > /tmp/list-all.log 2>&1; sleep 5'
|
|
23
|
+
sleep 2
|
|
24
|
+
cat /tmp/list-all.log
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The summary shows which servers are healthy, require auth, or are offline. Choose one of the "healthy" entries (e.g., `shadcn`, `firecrawl`, `obsidian-mcp-tools`) for the manual checks below.
|
|
28
|
+
|
|
29
|
+
## Test matrix
|
|
30
|
+
|
|
31
|
+
For each server under test, run the following commands, adjusting `SERVER`, `TOOL`, and arguments as needed. Each command writes to `/tmp` so logs are easy to share.
|
|
32
|
+
|
|
33
|
+
### List command
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
tmux new-session -d -s list-SERVER \
|
|
37
|
+
'pnpm exec tsx src/cli.ts list SERVER --timeout 2000 > /tmp/list-SERVER.log 2>&1; sleep 5'
|
|
38
|
+
sleep 2
|
|
39
|
+
cat /tmp/list-SERVER.log
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Verify:
|
|
43
|
+
- Header shows the right name/transport and the new metadata line (`tools · duration · transport`).
|
|
44
|
+
- Timeouts produce the footer block: `Tools: <timed out after ...>` and `Reason: ...`.
|
|
45
|
+
|
|
46
|
+
### Call command
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
tmux new-session -d -s call-SERVER \
|
|
50
|
+
'pnpm exec tsx src/cli.ts call SERVER.toolName key=value --timeout 2000 > /tmp/call-SERVER.log 2>&1; sleep 5'
|
|
51
|
+
sleep 2
|
|
52
|
+
cat /tmp/call-SERVER.log
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Checks:
|
|
56
|
+
- Successful calls print the payload; failures reuse the shared hinting (`SSE error ...`, auto-correct messages, etc.).
|
|
57
|
+
- For HTTP selectors (`https://.../mcp.tool` or `https://.../mcp.tool(args)`), ensure no OAuth prompt appears and the request hits the configured server.
|
|
58
|
+
|
|
59
|
+
### Auth command
|
|
60
|
+
|
|
61
|
+
For OAuth servers:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
tmux new-session -d -s auth-SERVER \
|
|
65
|
+
'pnpm exec tsx src/cli.ts auth SERVER --reset > /tmp/auth-SERVER.log 2>&1; sleep 5'
|
|
66
|
+
sleep 2
|
|
67
|
+
cat /tmp/auth-SERVER.log
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Expectations:
|
|
71
|
+
- If a token cache exists, log should mention the cleared directory.
|
|
72
|
+
- Failed auths emit the unified message (`Failed to authorize 'SERVER': ...`).
|
|
73
|
+
|
|
74
|
+
## Tips
|
|
75
|
+
|
|
76
|
+
- To exercise error paths, point at a placeholder endpoint and use `--timeout 1000` (e.g., `https://example.com/mcp.listStuff`).
|
|
77
|
+
- Kill tmux sessions before reusing a name: `tmux kill-session -t session-name`.
|
|
78
|
+
- To watch live output instead of dumping the log at the end, attach via `tmux attach -t session-name` and detach (`Ctrl+B`, then `D`) when done.
|
package/docs/mcp.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: 'High-level overview of mcporter’s runtime, entry points, and reusable helpers.'
|
|
3
|
+
read_when:
|
|
4
|
+
- 'Onboarding to this repository or explaining mcporter to others'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# mcporter Overview
|
|
8
|
+
|
|
9
|
+
mcporter is the Sweetistics CLI + runtime for the Model Context Protocol (MCP). It wraps the upstream TypeScript SDK with:
|
|
10
|
+
|
|
11
|
+
- **Runtime orchestration** – `createRuntime` loads servers from config JSON, editor imports, or ad-hoc flags and handles OAuth retries, transport promotion, and cleanup.
|
|
12
|
+
- **CLI surfaces** – `mcporter list`, `mcporter call`, `mcporter generate-cli`, `mcporter emit-ts`, and `mcporter inspect-cli` expose the runtime features to humans and scripts.
|
|
13
|
+
- **Tooling helpers** – `createServerProxy` maps MCP tools to camelCase methods for Node/Bun scripts and returns `CallResult` helpers (`.text()`, `.markdown()`, `.json()`).
|
|
14
|
+
|
|
15
|
+
## Primary Commands
|
|
16
|
+
|
|
17
|
+
- `npx mcporter list [server|--http-url|--stdio]`
|
|
18
|
+
Lists tool metadata, renders TypeScript-style signatures, and surfaces copy/pasteable examples (including ad-hoc HTTP selectors).
|
|
19
|
+
- `npx mcporter call server.tool key=value …`
|
|
20
|
+
Invokes a tool via either flag syntax or the function-call expression form; add `--output json` to capture structured responses.
|
|
21
|
+
- `npx mcporter generate-cli --server name [--bundle|--compile]`
|
|
22
|
+
Emits a standalone CLI for a single MCP server. Bundling defaults to Rolldown unless the runtime resolves to Bun; compiled binaries require Bun.
|
|
23
|
+
- `npx mcporter emit-ts <server> --mode types|client`
|
|
24
|
+
Produces `.d.ts` files or typed client factories that mirror the CLI schema output.
|
|
25
|
+
- `npx mcporter inspect-cli dist/server.js`
|
|
26
|
+
Reads embedded metadata so you can regenerate a CLI without guesswork.
|
|
27
|
+
|
|
28
|
+
## Runtime Helpers
|
|
29
|
+
|
|
30
|
+
Use `createServerProxy(runtime, name)` inside scripts when you want ergonomic camelCase calls instead of kebab-case tool names. The proxy:
|
|
31
|
+
|
|
32
|
+
1. Validates arguments against the MCP schema.
|
|
33
|
+
2. Automatically merges default values.
|
|
34
|
+
3. Returns a `CallResult` helper so you can render `.text()`, `.markdown()`, or `.json()` without manual parsing.
|
|
35
|
+
|
|
36
|
+
When you need raw access (custom transports, streaming), use the bare `Client` from `@modelcontextprotocol/sdk` or inspect `runtime.connect(name)` for lower-level control.
|
|
37
|
+
|
|
38
|
+
## Debug + Support Docs
|
|
39
|
+
|
|
40
|
+
- **Ad-hoc MCP Servers** (`docs/adhoc.md`) – explains the `--http-url` / `--stdio` flags.
|
|
41
|
+
- **Tool Calling Cheatsheet** (`docs/tool-calling.md`) – shows the two argument styles and when to use each.
|
|
42
|
+
- **Hang Diagnostics** (`docs/hang-debug.md` + `docs/tmux.md`) – run long-lived commands inside tmux and dump active handles if shutdown stalls.
|
|
43
|
+
|
|
44
|
+
Read these docs (via `pnpm run docs:list`) whenever your task touches the corresponding area. They contain the up-to-date guardrails used across Sweetistics repositories.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: 'How to migrate from pnpm mcp:* wrappers to the mcporter package.'
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Migration Guide
|
|
6
|
+
|
|
7
|
+
This guide walks through replacing the Python-based `pnpm mcp:*` helpers with the new TypeScript runtime and CLI.
|
|
8
|
+
|
|
9
|
+
## 1. Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pnpm add mcporter
|
|
13
|
+
# or
|
|
14
|
+
yarn add mcporter
|
|
15
|
+
# or
|
|
16
|
+
npm install mcporter
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## 2. Update Scripts
|
|
20
|
+
|
|
21
|
+
- Replace `pnpm mcporter:list` with `npx mcporter list`.
|
|
22
|
+
- Replace `pnpm mcporter:call <server>.<tool> key=value` with `npx mcporter call <server>.<tool> key=value`.
|
|
23
|
+
- Add `--config <path>` if your configuration is not under `./config/mcporter.json`.
|
|
24
|
+
- Optional: set `"imports"` inside `mcporter.json` (for example `[]` to disable auto-imports or `["cursor", "codex"]` to customize the order).
|
|
25
|
+
- Append `--tail-log` to stream the last 20 lines of any log file returned by the tool.
|
|
26
|
+
|
|
27
|
+
## 3. OAuth Tokens
|
|
28
|
+
|
|
29
|
+
- Tokens are saved under `~/.mcporter/<server>/` by default.
|
|
30
|
+
- To force a fresh login, delete that directory and rerun the command; the CLI will relaunch the browser.
|
|
31
|
+
- Custom `token_cache_dir` entries in `mcporter.json` continue to work as explicit overrides.
|
|
32
|
+
|
|
33
|
+
## 4. Programmatic Usage
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
import { createRuntime } from "mcporter";
|
|
37
|
+
|
|
38
|
+
const runtime = await createRuntime({ configPath: "./config/mcporter.json" });
|
|
39
|
+
const tools = await runtime.listTools("chrome-devtools");
|
|
40
|
+
await runtime.callTool("chrome-devtools", "take_screenshot", { args: { url: "https://x.com" } });
|
|
41
|
+
await runtime.close();
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Prefer `createRuntime` for long-lived agents so connections and OAuth tokens can be reused.
|
|
45
|
+
|
|
46
|
+
## 5. Single Call Helper
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
import { callOnce } from "mcporter";
|
|
50
|
+
|
|
51
|
+
await callOnce({
|
|
52
|
+
server: "firecrawl",
|
|
53
|
+
toolName: "crawl",
|
|
54
|
+
args: { url: "https://anthropic.com" },
|
|
55
|
+
});
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Use `callOnce` for fire-and-forget invocations.
|
|
59
|
+
|
|
60
|
+
## 6. Environment Variables
|
|
61
|
+
|
|
62
|
+
- `LINEAR_API_KEY`, `FIRECRAWL_API_KEY`, and similar tokens are read exactly as before via `${VAR}` syntax.
|
|
63
|
+
- `${VAR:-default}` continues to work; empty values are ignored.
|
|
64
|
+
- `$env:VAR` placeholders resolve to raw OS environment variables.
|
|
65
|
+
|
|
66
|
+
## 7. Troubleshooting
|
|
67
|
+
|
|
68
|
+
| Symptom | Fix |
|
|
69
|
+
| --- | --- |
|
|
70
|
+
| Browser did not open | Copy the printed OAuth URL manually into a browser. |
|
|
71
|
+
| Authorization hangs | Ensure the callback URL can bind to `127.0.0.1`; firewalls may block it. |
|
|
72
|
+
| Tokens are stale | Delete `~/.mcporter/<server>/tokens.json` and retry. |
|
|
73
|
+
| Stdio command fails | Pass `--root` to point at the repo root so relative paths resolve. |
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
For deeper architectural notes and future work, see [`docs/spec.md`](./spec.md).
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: 'Mapping from the legacy `pnpm mcp:*` scripts to the modern mcporter CLI.'
|
|
3
|
+
read_when:
|
|
4
|
+
- 'Helping teammates migrate old pnpm workflows to mcporter'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Migrating from `pnpm mcp:*`
|
|
8
|
+
|
|
9
|
+
The legacy `pnpm mcp:*` helpers map directly onto the `mcporter` CLI.
|
|
10
|
+
|
|
11
|
+
- `pnpm mcporter:list` → `npx mcporter list`
|
|
12
|
+
- `pnpm mcporter:call server.tool key=value` → `npx mcporter call server.tool key=value`
|
|
13
|
+
- New flags: `--schema` surfaces full tool schemas, and `--tail-log` follows log output referenced by responses.
|
|
14
|
+
|
|
15
|
+
For a step-by-step checklist (including config updates and environment variables) see [`docs/migration.md`](./migration.md).
|
package/docs/refactor.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: 'Status tracker for post-launch refactors, shared utilities, and remaining cleanup tasks.'
|
|
3
|
+
read_when:
|
|
4
|
+
- 'Scoping engineering work beyond immediate feature changes'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Next-Step Refactor Checklist
|
|
8
|
+
|
|
9
|
+
This doc tracks remaining reuse/refactor work now that the original plan is done.
|
|
10
|
+
Each section lists the goal, why it matters, and the concrete steps/tests needed.
|
|
11
|
+
|
|
12
|
+
## 1. Shared Tool Schema Cache *(Completed)*
|
|
13
|
+
- **Problem**: `generate-cli` and `emit-ts` both fetch & serialize tool schemas
|
|
14
|
+
independently (and `mcporter list` re-parses them too).
|
|
15
|
+
- **What we did**:
|
|
16
|
+
1. Added `src/cli/tool-cache.ts` with `loadToolMetadata()` caching tool metadata per runtime/server/options.
|
|
17
|
+
2. Switched `mcporter list` (single-server path) and `emit-ts` to consume the helper, so both reuse `ToolMetadata`.
|
|
18
|
+
3. Added `tests/tool-cache.test.ts` + updated emit-ts tests to ensure the helper is covered.
|
|
19
|
+
- **Next**: Consider integrating the cache into `generate-cli` if we ever reuse runtime instances there.
|
|
20
|
+
|
|
21
|
+
## 2. Unified Flag Parsing for Generator-style Commands *(Completed)*
|
|
22
|
+
- **Problem**: `generate-cli`, the (now legacy) `regenerate-cli` wrapper, and `emit-ts` each
|
|
23
|
+
reimplemented `--runtime`, `--timeout`, and `--include-optional` handling.
|
|
24
|
+
- **What we did**:
|
|
25
|
+
1. Added `extractGeneratorFlags()` in `src/cli/generate/flag-parser.ts` to
|
|
26
|
+
normalize shared flags while mutating `args` in place.
|
|
27
|
+
2. Updated all three commands to call the helper before parsing
|
|
28
|
+
command-specific options.
|
|
29
|
+
3. Added `tests/generator-flag-parser.test.ts` to cover runtime/timeout and
|
|
30
|
+
optional flags.
|
|
31
|
+
|
|
32
|
+
## 3. Test Fixture Reuse *(Completed)*
|
|
33
|
+
- **Problem**: Emit-ts/tool-cache/unit tests each defined their own tool/definition
|
|
34
|
+
fixtures, leading to divergence.
|
|
35
|
+
- **What we did**:
|
|
36
|
+
1. Added `tests/fixtures/tool-fixtures.ts` (shared definition + tools).
|
|
37
|
+
2. Updated `tests/emit-ts.test.ts` and `tests/tool-cache.test.ts` to import
|
|
38
|
+
the shared fixtures (and reuse them via `buildToolMetadata`).
|
|
39
|
+
3. Ensured the fixture covers required+optional parameters so both suites hit
|
|
40
|
+
the same edge cases.
|
|
41
|
+
|
|
42
|
+
## 4. CallResult Helper Extraction *(Completed)*
|
|
43
|
+
- **Problem**: `call-command.ts` and the emit-ts client template both wrapped
|
|
44
|
+
results with `createCallResult`, but there was no shared helper.
|
|
45
|
+
- **What we did**:
|
|
46
|
+
1. Added `wrapCallResult()` to `result-utils.ts` and exported it from the
|
|
47
|
+
package entry.
|
|
48
|
+
2. Updated `call-command.ts` and the emit-ts template to reuse the helper so
|
|
49
|
+
they stay in sync.
|
|
50
|
+
3. Adjusted emit-ts tests to assert the helper is referenced.
|
|
51
|
+
|
|
52
|
+
## 5. CLI Docs Consolidation *(Completed)*
|
|
53
|
+
- **Problem**: CLI usage guidance was scattered across README, `docs/spec.md`,
|
|
54
|
+
and various feature docs.
|
|
55
|
+
- **What we did**:
|
|
56
|
+
1. Added `docs/cli-reference.md` summarizing `list`, `call`, `generate-cli`,
|
|
57
|
+
and `emit-ts` flags/modes in one place.
|
|
58
|
+
2. Pointed emit-ts users to that doc so we can converge other references over
|
|
59
|
+
time (no README/spec churn yet to avoid clobbering parallel work).
|
|
60
|
+
- **Next**: Once the other doc changes land, update README/spec to link to the
|
|
61
|
+
reference and drop redundant sections.
|
|
62
|
+
|
|
63
|
+
## 6. Runtime Module Split *(Completed)*
|
|
64
|
+
- **Problem**: `src/runtime.ts` had grown bulky (600+ lines) mixing transport setup, OAuth flow control, and small helpers, making tests and reuse harder.
|
|
65
|
+
- **What we did**:
|
|
66
|
+
1. Extracted transport construction/retry logic to `src/runtime/transport.ts`.
|
|
67
|
+
2. Moved OAuth helpers (timeouts, connect retry, errors) to `src/runtime/oauth.ts` and centralized env-parsed timeouts.
|
|
68
|
+
3. Pulled argument/timeout utilities into `src/runtime/utils.ts`.
|
|
69
|
+
4. Made reset-policy logic reusable via `src/runtime/errors.ts`.
|
|
70
|
+
5. Switched tests to import helpers directly instead of using `runtime.__test`.
|
|
71
|
+
6. Added a targeted transport test to cover SSE fallback and OAuth promotion.
|
|
72
|
+
- **Next**: Keep new helpers in sync as runtime evolves; prefer adding surface to these modules over growing `runtime.ts` again.
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
Tracking the above here keeps future agents aligned. Update this checklist as
|
|
76
|
+
items ship (mark sections “Completed” when done, or delete the doc once empty).
|