@apify/mcpc 0.1.11-beta.3 → 0.1.11-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/CHANGELOG.md +67 -1
  2. package/README.md +184 -189
  3. package/dist/bridge/index.js +190 -13
  4. package/dist/bridge/index.js.map +1 -1
  5. package/dist/cli/commands/auth.d.ts +2 -0
  6. package/dist/cli/commands/auth.d.ts.map +1 -1
  7. package/dist/cli/commands/auth.js +11 -1
  8. package/dist/cli/commands/auth.js.map +1 -1
  9. package/dist/cli/commands/logging.d.ts.map +1 -1
  10. package/dist/cli/commands/logging.js +1 -4
  11. package/dist/cli/commands/logging.js.map +1 -1
  12. package/dist/cli/commands/sessions.d.ts +3 -1
  13. package/dist/cli/commands/sessions.d.ts.map +1 -1
  14. package/dist/cli/commands/sessions.js +47 -8
  15. package/dist/cli/commands/sessions.js.map +1 -1
  16. package/dist/cli/commands/tasks.d.ts +5 -0
  17. package/dist/cli/commands/tasks.d.ts.map +1 -0
  18. package/dist/cli/commands/tasks.js +53 -0
  19. package/dist/cli/commands/tasks.js.map +1 -0
  20. package/dist/cli/commands/tools.d.ts +2 -0
  21. package/dist/cli/commands/tools.d.ts.map +1 -1
  22. package/dist/cli/commands/tools.js +88 -2
  23. package/dist/cli/commands/tools.js.map +1 -1
  24. package/dist/cli/helpers.d.ts +1 -5
  25. package/dist/cli/helpers.d.ts.map +1 -1
  26. package/dist/cli/helpers.js +25 -169
  27. package/dist/cli/helpers.js.map +1 -1
  28. package/dist/cli/index.js +426 -200
  29. package/dist/cli/index.js.map +1 -1
  30. package/dist/cli/output.d.ts +3 -1
  31. package/dist/cli/output.d.ts.map +1 -1
  32. package/dist/cli/output.js +71 -3
  33. package/dist/cli/output.js.map +1 -1
  34. package/dist/cli/parser.d.ts +11 -8
  35. package/dist/cli/parser.d.ts.map +1 -1
  36. package/dist/cli/parser.js +91 -65
  37. package/dist/cli/parser.js.map +1 -1
  38. package/dist/cli/shell.d.ts.map +1 -1
  39. package/dist/cli/shell.js +30 -3
  40. package/dist/cli/shell.js.map +1 -1
  41. package/dist/core/mcp-client.d.ts +10 -2
  42. package/dist/core/mcp-client.d.ts.map +1 -1
  43. package/dist/core/mcp-client.js +165 -0
  44. package/dist/core/mcp-client.js.map +1 -1
  45. package/dist/lib/auth/keychain.d.ts.map +1 -1
  46. package/dist/lib/auth/keychain.js +15 -8
  47. package/dist/lib/auth/keychain.js.map +1 -1
  48. package/dist/lib/auth/oauth-flow.d.ts +4 -1
  49. package/dist/lib/auth/oauth-flow.d.ts.map +1 -1
  50. package/dist/lib/auth/oauth-flow.js +21 -6
  51. package/dist/lib/auth/oauth-flow.js.map +1 -1
  52. package/dist/lib/auth/oauth-provider.d.ts +5 -0
  53. package/dist/lib/auth/oauth-provider.d.ts.map +1 -1
  54. package/dist/lib/auth/oauth-provider.js +16 -1
  55. package/dist/lib/auth/oauth-provider.js.map +1 -1
  56. package/dist/lib/bridge-client.d.ts +1 -1
  57. package/dist/lib/bridge-client.d.ts.map +1 -1
  58. package/dist/lib/bridge-client.js +17 -3
  59. package/dist/lib/bridge-client.js.map +1 -1
  60. package/dist/lib/bridge-manager.d.ts +1 -0
  61. package/dist/lib/bridge-manager.d.ts.map +1 -1
  62. package/dist/lib/bridge-manager.js +39 -17
  63. package/dist/lib/bridge-manager.js.map +1 -1
  64. package/dist/lib/errors.js +2 -2
  65. package/dist/lib/errors.js.map +1 -1
  66. package/dist/lib/file-lock.d.ts.map +1 -1
  67. package/dist/lib/file-lock.js +4 -2
  68. package/dist/lib/file-lock.js.map +1 -1
  69. package/dist/lib/session-client.d.ts +12 -2
  70. package/dist/lib/session-client.d.ts.map +1 -1
  71. package/dist/lib/session-client.js +113 -14
  72. package/dist/lib/session-client.js.map +1 -1
  73. package/dist/lib/sessions.d.ts.map +1 -1
  74. package/dist/lib/sessions.js +9 -4
  75. package/dist/lib/sessions.js.map +1 -1
  76. package/dist/lib/types.d.ts +30 -5
  77. package/dist/lib/types.d.ts.map +1 -1
  78. package/dist/lib/types.js +2 -0
  79. package/dist/lib/types.js.map +1 -1
  80. package/dist/lib/utils.d.ts +0 -2
  81. package/dist/lib/utils.d.ts.map +1 -1
  82. package/dist/lib/utils.js +1 -19
  83. package/dist/lib/utils.js.map +1 -1
  84. package/docs/TODOs.md +89 -35
  85. package/package.json +2 -2
  86. package/renovate.json +2 -1
package/CHANGELOG.md CHANGED
@@ -7,25 +7,76 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ### Changed
11
+ - Revised session states: auth failures (401/403) now show as `unauthorized` (separate from `expired` which is for session ID expiry), with actionable login guidance; new `disconnected` display state surfaces when bridge is alive but server has been unreachable for >2 minutes
12
+ - `DISCONNECTED_THRESHOLD_MS` is now derived from `KEEPALIVE_INTERVAL_MS` (2× ping interval + 5s buffer) via shared constants, eliminating duplicate magic numbers
13
+
10
14
  ### Added
15
+
16
+ - `--async` flag for `tools-call` to opt-in to async task execution (experimental) with a progress spinner showing elapsed time and server status messages in human mode
17
+ - `--detach` flag for `tools-call` to start an async task and return the task ID immediately without waiting for completion (implies `--async`)
18
+ - New `tasks-list`, `tasks-get`, `tasks-cancel` commands for managing async tasks on the server
19
+ - Task capability and `execution.taskSupport` displayed in `tools-get` and server info
20
+ - E2E test server now includes a `slow-task` tool that supports async task execution
21
+ - E2E tests for async task execution, detached mode, task management (list/get/cancel), and synchronous fallback
22
+ - `[async]` indicator in `tools-list` output for tools that support async task execution
23
+ - `--insecure` global option to skip TLS certificate verification, for MCP servers with self-signed certificates
24
+ - E2E test for `--insecure` flag using a self-signed HTTPS test server wrapper
25
+ - `--client-id` and `--client-secret` options for `mcpc login` command, for servers that don't support dynamic client registration
26
+ - `mcpc close @session`, `mcpc restart @session`, and `mcpc shell @session` command-first syntax as alternatives to `mcpc @session close/restart/shell`
11
27
  - E2E tests now run under the Bun runtime (in addition to Node.js); use `./test/e2e/run.sh --runtime bun` or `npm run test:e2e:bun`
28
+ - `--no-profile` option for `connect` command to skip OAuth profile auto-detection and connect anonymously
29
+
30
+ ### Fixed
31
+ - `--async` and `--detach` tool calls now correctly send task creation parameters to the server, fixing "task stream ended without creating a task" errors
32
+ - File lock retries now use randomized exponential backoff to reduce contention when multiple processes compete for the same lock
33
+ - Explicit `--header "Authorization: Bearer ..."` is no longer silently ignored when a default OAuth profile exists for the same server; explicit CLI headers now take precedence over auto-detected profiles
34
+ - Combining `--profile` with `--header "Authorization: ..."` now returns a clear error instead of silently stripping the header
35
+ - `logTarget` no longer prints a misleading `[→ @name (HTTP)]` prefix when a session doesn't exist; only the error message is shown
36
+ - `logging-set-level` JSON output no longer includes a `success` field; output is now `{"level":"<level>"}` consistent with the project's convention of indicating errors via exit codes
37
+ - `--header` / `-H` option is now specific to the `connect` command instead of being shown as a global option in `mcpc --help`
38
+ - Bridge now forwards `logging/message` notifications from the MCP server to connected clients, so `logging-set-level` actually takes effect in interactive shell sessions
39
+ - IPC buffer between CLI and bridge process is now capped at 10 MB; sockets are destroyed if the limit is exceeded, preventing unbounded memory growth
40
+ - `validateOptions()` no longer includes subcommand-specific options (`--full`, `--x402`, `--proxy`, etc.) in global known-options list; misplaced flags now produce clear "Unknown option" errors instead of confusing Commander rejections
41
+ - Sessions requiring authentication now correctly show as `expired` instead of `live` when the server rejects unauthenticated connections
42
+ - Auth errors wrapped in `NetworkError` by bridge IPC are now detected on first health check, avoiding unnecessary bridge restart
43
+ - Fixed flaky E2E invariant check that failed when `lastSeenAt` changed between `--json` and `--json --verbose` calls
44
+ - `--timeout` flag now correctly propagates to MCP requests via session bridge
45
+ - `parseServerArg()` now handles well Windows drive-letter config paths as well as other ambiguous cases
12
46
 
13
47
  ### Changed
14
- - OS keychain now falls back to `~/.mcpc/credentials.json` (mode 0600) when no keyring daemon is available (e.g. headless Linux servers, containers)
48
+
49
+ - **Breaking:** CLI syntax redesigned to command-first style. All commands now start with a verb; MCP operations require a named session.
50
+
51
+ | Before | After |
52
+ | --------------------------------------------- | ---------------------------------------------------------- |
53
+ | `mcpc <server> tools-list` | `mcpc connect <server> @name` then `mcpc @name tools-list` |
54
+ | `mcpc <server> connect @name` | `mcpc connect <server> @name` |
55
+ | `mcpc <server> login` | `mcpc login <server>` |
56
+ | `mcpc <server> logout` | `mcpc logout <server>` |
57
+ | `mcpc --clean=sessions` | `mcpc clean sessions` |
58
+ | `mcpc --config file.json entry connect @name` | `mcpc connect file.json:entry @name` |
59
+
60
+ Direct one-shot URL access (e.g. `mcpc mcp.apify.com tools-list`) is removed; create a session first with `mcpc connect`.
61
+
62
+ - `@napi-rs/keyring` native addon is now loaded lazily: `mcpc` starts and works normally even when `libsecret` (Linux) or the addon itself is missing; a one-time warning is emitted and credentials fall back to `~/.mcpc/credentials.json` (mode 0600)
15
63
 
16
64
  ## [0.1.10] - 2026-03-01
17
65
 
18
66
  ### Added
67
+
19
68
  - Support for `HTTPS_PROXY`, `HTTP_PROXY`, and `NO_PROXY` / lowercase variants env vars for outbound connections
20
69
  - CI/CD automated test pipeline
21
70
 
22
71
  ### Changed
72
+
23
73
  - Replaced deprecated `keytar` package with `@napi-rs/keyring` for OS keychain integration
24
74
  - Temp files now written to `~/.mcpc/` instead of `/tmp/` to avoid cross-device rename errors on Linux
25
75
  - Improved error messages for invalid server hostnames and mistyped commands (e.g. `mcpc login`)
26
76
  - Added `prettier` formatting check to lint step
27
77
 
28
78
  ### Fixed
79
+
29
80
  - Fixed `ExperimentalWarning: Importing JSON modules is an experimental feature` on Node.js 22+
30
81
  - Fixed OAuth token refresh for servers with root-based discovery (`.well-known` at `/`)
31
82
  - Fixed OAuth errors incorrectly expiring the session instead of failing gracefully
@@ -33,10 +84,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
33
84
  ## [0.1.9] - 2026-02-02
34
85
 
35
86
  ### Added
87
+
36
88
  - Added CHANGELOG.md for tracking changes
37
89
  - Automated GitHub release creation in publish script
38
90
 
39
91
  ### Changed
92
+
40
93
  - `tools-list` now shows a compact summary by default to support dynamic tool discovery
41
94
  - Added `--full` flag to `tools-list` for detailed tool information
42
95
  - Publish script now automatically updates CHANGELOG.md version on release
@@ -44,10 +97,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
44
97
  ## [0.1.8] - 2026-01-21
45
98
 
46
99
  ### Changed
100
+
47
101
  - Session is now marked as expired (not auto-reconnected) when server rejects MCP session ID
48
102
  - Users must explicitly run `mcpc @session restart` to recover from expired sessions
49
103
 
50
104
  ### Fixed
105
+
51
106
  - Fixed incorrect flagging of expired sessions as crashed
52
107
  - Fixed session expiration detection for various error message formats
53
108
  - Fixed help command output
@@ -55,46 +110,56 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
55
110
  ## [0.1.7] - 2026-01-03
56
111
 
57
112
  ### Changed
113
+
58
114
  - Documentation improvements and updates
59
115
  - Various cosmetic improvements to CLI output
60
116
 
61
117
  ### Fixed
118
+
62
119
  - Minor bug fixes
63
120
 
64
121
  ## [0.1.6] - 2026-01-02
65
122
 
66
123
  ### Added
124
+
67
125
  - Session notifications with timestamps for tracking list changes (`tools/list_changed`, `resources/list_changed`, `prompts/list_changed`)
68
126
 
69
127
  ### Changed
128
+
70
129
  - Renamed `_meta` to `_mcpc` in JSON output for MCP spec conformance
71
130
  - Improved formatting of prompts output
72
131
  - Various cosmetic improvements
73
132
 
74
133
  ### Fixed
134
+
75
135
  - Fixed proxy server issues
76
136
  - Fixed screenshot URL in README
77
137
 
78
138
  ## [0.1.5] - 2026-01-01
79
139
 
80
140
  ### Added
141
+
81
142
  - Implemented `--proxy` option for exposing sessions as local MCP servers
82
143
  - Added `mcpc @session restart` command
83
144
 
84
145
  ### Changed
146
+
85
147
  - Renamed `session` command to `connect` for clarity
86
148
  - Renamed "dead" session status to "crashed" for clarity
87
149
 
88
150
  ### Fixed
151
+
89
152
  - Fixed `--timeout` option handling
90
153
 
91
154
  ## [0.1.4] - 2025-12-31
92
155
 
93
156
  ### Added
157
+
94
158
  - Implemented `--schema` and `--schema-mode` options for tools
95
159
  - Added `mcpc @session restart` command
96
160
 
97
161
  ### Changed
162
+
98
163
  - Renamed `tools-schema` command to `tools-get`
99
164
  - Improved formatting for prompts and tools output
100
165
  - Security review and improvements
@@ -102,6 +167,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
102
167
  ## [0.1.3] - 2025-12-29
103
168
 
104
169
  ### Added
170
+
105
171
  - Initial public release
106
172
  - Support for Streamable HTTP and stdio transports
107
173
  - Session management with persistent bridge processes