@apify/mcpc 0.1.11-beta.2 → 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 +70 -1
  2. package/README.md +188 -190
  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 +3 -2
  86. package/renovate.json +2 -1
package/CHANGELOG.md CHANGED
@@ -8,21 +8,75 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8
8
  ## [Unreleased]
9
9
 
10
10
  ### Changed
11
- - OS keychain now falls back to `~/.mcpc/credentials.json` (mode 0600) when no keyring daemon is available (e.g. headless Linux servers, containers)
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
+
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`
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
46
+
47
+ ### Changed
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)
12
63
 
13
64
  ## [0.1.10] - 2026-03-01
14
65
 
15
66
  ### Added
67
+
16
68
  - Support for `HTTPS_PROXY`, `HTTP_PROXY`, and `NO_PROXY` / lowercase variants env vars for outbound connections
17
69
  - CI/CD automated test pipeline
18
70
 
19
71
  ### Changed
72
+
20
73
  - Replaced deprecated `keytar` package with `@napi-rs/keyring` for OS keychain integration
21
74
  - Temp files now written to `~/.mcpc/` instead of `/tmp/` to avoid cross-device rename errors on Linux
22
75
  - Improved error messages for invalid server hostnames and mistyped commands (e.g. `mcpc login`)
23
76
  - Added `prettier` formatting check to lint step
24
77
 
25
78
  ### Fixed
79
+
26
80
  - Fixed `ExperimentalWarning: Importing JSON modules is an experimental feature` on Node.js 22+
27
81
  - Fixed OAuth token refresh for servers with root-based discovery (`.well-known` at `/`)
28
82
  - Fixed OAuth errors incorrectly expiring the session instead of failing gracefully
@@ -30,10 +84,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
30
84
  ## [0.1.9] - 2026-02-02
31
85
 
32
86
  ### Added
87
+
33
88
  - Added CHANGELOG.md for tracking changes
34
89
  - Automated GitHub release creation in publish script
35
90
 
36
91
  ### Changed
92
+
37
93
  - `tools-list` now shows a compact summary by default to support dynamic tool discovery
38
94
  - Added `--full` flag to `tools-list` for detailed tool information
39
95
  - Publish script now automatically updates CHANGELOG.md version on release
@@ -41,10 +97,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
41
97
  ## [0.1.8] - 2026-01-21
42
98
 
43
99
  ### Changed
100
+
44
101
  - Session is now marked as expired (not auto-reconnected) when server rejects MCP session ID
45
102
  - Users must explicitly run `mcpc @session restart` to recover from expired sessions
46
103
 
47
104
  ### Fixed
105
+
48
106
  - Fixed incorrect flagging of expired sessions as crashed
49
107
  - Fixed session expiration detection for various error message formats
50
108
  - Fixed help command output
@@ -52,46 +110,56 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
52
110
  ## [0.1.7] - 2026-01-03
53
111
 
54
112
  ### Changed
113
+
55
114
  - Documentation improvements and updates
56
115
  - Various cosmetic improvements to CLI output
57
116
 
58
117
  ### Fixed
118
+
59
119
  - Minor bug fixes
60
120
 
61
121
  ## [0.1.6] - 2026-01-02
62
122
 
63
123
  ### Added
124
+
64
125
  - Session notifications with timestamps for tracking list changes (`tools/list_changed`, `resources/list_changed`, `prompts/list_changed`)
65
126
 
66
127
  ### Changed
128
+
67
129
  - Renamed `_meta` to `_mcpc` in JSON output for MCP spec conformance
68
130
  - Improved formatting of prompts output
69
131
  - Various cosmetic improvements
70
132
 
71
133
  ### Fixed
134
+
72
135
  - Fixed proxy server issues
73
136
  - Fixed screenshot URL in README
74
137
 
75
138
  ## [0.1.5] - 2026-01-01
76
139
 
77
140
  ### Added
141
+
78
142
  - Implemented `--proxy` option for exposing sessions as local MCP servers
79
143
  - Added `mcpc @session restart` command
80
144
 
81
145
  ### Changed
146
+
82
147
  - Renamed `session` command to `connect` for clarity
83
148
  - Renamed "dead" session status to "crashed" for clarity
84
149
 
85
150
  ### Fixed
151
+
86
152
  - Fixed `--timeout` option handling
87
153
 
88
154
  ## [0.1.4] - 2025-12-31
89
155
 
90
156
  ### Added
157
+
91
158
  - Implemented `--schema` and `--schema-mode` options for tools
92
159
  - Added `mcpc @session restart` command
93
160
 
94
161
  ### Changed
162
+
95
163
  - Renamed `tools-schema` command to `tools-get`
96
164
  - Improved formatting for prompts and tools output
97
165
  - Security review and improvements
@@ -99,6 +167,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99
167
  ## [0.1.3] - 2025-12-29
100
168
 
101
169
  ### Added
170
+
102
171
  - Initial public release
103
172
  - Support for Streamable HTTP and stdio transports
104
173
  - Session management with persistent bridge processes