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

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 (102) hide show
  1. package/CHANGELOG.md +77 -3
  2. package/README.md +232 -201
  3. package/dist/bridge/index.js +240 -43
  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 +179 -141
  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 +158 -12
  23. package/dist/cli/commands/tools.js.map +1 -1
  24. package/dist/cli/commands/x402.d.ts.map +1 -1
  25. package/dist/cli/commands/x402.js +20 -6
  26. package/dist/cli/commands/x402.js.map +1 -1
  27. package/dist/cli/helpers.d.ts +2 -6
  28. package/dist/cli/helpers.d.ts.map +1 -1
  29. package/dist/cli/helpers.js +27 -185
  30. package/dist/cli/helpers.js.map +1 -1
  31. package/dist/cli/index.js +437 -204
  32. package/dist/cli/index.js.map +1 -1
  33. package/dist/cli/output.d.ts +7 -3
  34. package/dist/cli/output.d.ts.map +1 -1
  35. package/dist/cli/output.js +135 -16
  36. package/dist/cli/output.js.map +1 -1
  37. package/dist/cli/parser.d.ts +11 -8
  38. package/dist/cli/parser.d.ts.map +1 -1
  39. package/dist/cli/parser.js +89 -65
  40. package/dist/cli/parser.js.map +1 -1
  41. package/dist/cli/shell.d.ts.map +1 -1
  42. package/dist/cli/shell.js +30 -3
  43. package/dist/cli/shell.js.map +1 -1
  44. package/dist/core/mcp-client.d.ts +17 -3
  45. package/dist/core/mcp-client.d.ts.map +1 -1
  46. package/dist/core/mcp-client.js +236 -3
  47. package/dist/core/mcp-client.js.map +1 -1
  48. package/dist/core/transports.d.ts.map +1 -1
  49. package/dist/core/transports.js +3 -0
  50. package/dist/core/transports.js.map +1 -1
  51. package/dist/lib/auth/keychain.d.ts.map +1 -1
  52. package/dist/lib/auth/keychain.js +51 -19
  53. package/dist/lib/auth/keychain.js.map +1 -1
  54. package/dist/lib/auth/oauth-flow.d.ts +4 -1
  55. package/dist/lib/auth/oauth-flow.d.ts.map +1 -1
  56. package/dist/lib/auth/oauth-flow.js +108 -16
  57. package/dist/lib/auth/oauth-flow.js.map +1 -1
  58. package/dist/lib/auth/oauth-provider.d.ts +5 -0
  59. package/dist/lib/auth/oauth-provider.d.ts.map +1 -1
  60. package/dist/lib/auth/oauth-provider.js +16 -1
  61. package/dist/lib/auth/oauth-provider.js.map +1 -1
  62. package/dist/lib/auth/oauth-utils.d.ts.map +1 -1
  63. package/dist/lib/auth/oauth-utils.js +3 -2
  64. package/dist/lib/auth/oauth-utils.js.map +1 -1
  65. package/dist/lib/bridge-client.d.ts +1 -1
  66. package/dist/lib/bridge-client.d.ts.map +1 -1
  67. package/dist/lib/bridge-client.js +18 -4
  68. package/dist/lib/bridge-client.js.map +1 -1
  69. package/dist/lib/bridge-manager.d.ts +1 -0
  70. package/dist/lib/bridge-manager.d.ts.map +1 -1
  71. package/dist/lib/bridge-manager.js +39 -17
  72. package/dist/lib/bridge-manager.js.map +1 -1
  73. package/dist/lib/errors.js +2 -2
  74. package/dist/lib/errors.js.map +1 -1
  75. package/dist/lib/file-lock.d.ts.map +1 -1
  76. package/dist/lib/file-lock.js +4 -2
  77. package/dist/lib/file-lock.js.map +1 -1
  78. package/dist/lib/proxy.d.ts +6 -0
  79. package/dist/lib/proxy.d.ts.map +1 -0
  80. package/dist/lib/proxy.js +13 -0
  81. package/dist/lib/proxy.js.map +1 -0
  82. package/dist/lib/session-client.d.ts +16 -3
  83. package/dist/lib/session-client.d.ts.map +1 -1
  84. package/dist/lib/session-client.js +121 -15
  85. package/dist/lib/session-client.js.map +1 -1
  86. package/dist/lib/sessions.d.ts.map +1 -1
  87. package/dist/lib/sessions.js +9 -4
  88. package/dist/lib/sessions.js.map +1 -1
  89. package/dist/lib/types.d.ts +37 -6
  90. package/dist/lib/types.d.ts.map +1 -1
  91. package/dist/lib/types.js +2 -0
  92. package/dist/lib/types.js.map +1 -1
  93. package/dist/lib/utils.d.ts +0 -2
  94. package/dist/lib/utils.d.ts.map +1 -1
  95. package/dist/lib/utils.js +1 -19
  96. package/dist/lib/utils.js.map +1 -1
  97. package/dist/lib/x402/fetch-middleware.d.ts.map +1 -1
  98. package/dist/lib/x402/fetch-middleware.js +41 -8
  99. package/dist/lib/x402/fetch-middleware.js.map +1 -1
  100. package/docs/TODOs.md +87 -35
  101. package/package.json +2 -2
  102. package/renovate.json +2 -1
package/CHANGELOG.md CHANGED
@@ -7,25 +7,84 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
- ### Added
11
- - 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`
10
+ ### Fixed
11
+
12
+ - Fixed auth loss when reconnecting an unauthorized session via `mcpc connect` — the `unauthorized` status was not cleared, causing all subsequent operations to fail with "Authentication required by server" even after successful reconnection
13
+ - HTTP proxy support (`HTTP_PROXY`/`HTTPS_PROXY` env vars) now works for MCP server connections, OAuth token refresh, and x402 payment signing — previously the MCP SDK transport and OAuth calls bypassed the global proxy dispatcher
12
14
 
13
15
  ### 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)
16
+
17
+ - **Breaking:** CLI syntax redesigned to command-first style. All commands now start with a verb; MCP operations require a named session.
18
+
19
+ | Before | After |
20
+ | --------------------------------------------- | ---------------------------------------------------------- |
21
+ | `mcpc <server> tools-list` | `mcpc connect <server> @name` then `mcpc @name tools-list` |
22
+ | `mcpc <server> connect @name` | `mcpc connect <server> @name` |
23
+ | `mcpc <server> login` | `mcpc login <server>` |
24
+ | `mcpc <server> logout` | `mcpc logout <server>` |
25
+ | `mcpc --clean=sessions` | `mcpc clean sessions` |
26
+ | `mcpc --config file.json entry connect @name` | `mcpc connect file.json:entry @name` |
27
+
28
+ Direct one-shot URL access (e.g. `mcpc mcp.apify.com tools-list`) is removed; create a session first with `mcpc connect`.
29
+
30
+ - Renamed `--async` flag to `--task` in `tools-call` for consistency with MCP specification; `--detach` now implies `--task`
31
+ - 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` state surfaces when bridge is alive but server has been unreachable for >2 minutes
32
+ - When `--profile` is not specified, only the `default` profile is used; non-default profiles require an explicit `--profile` flag
33
+ - `@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)
34
+ - `x402 sign` now takes the PAYMENT-REQUIRED header as a positional argument instead of `-r` flag (e.g. `mcpc x402 sign <base64>`)
35
+ - `tools-list` and `tools-get` now show `[task:optional]`, `[task:required]`, or `[task:forbidden]` instead of `[async]`
36
+ - Tools cache now fetches all pages on startup and on `tools/list_changed` notifications; `tools-get` uses cached list first and only re-fetches if the tool is not found
37
+ - `--header` / `-H` option is now specific to the `connect` command instead of being shown as a global option
38
+
39
+ ### Added
40
+
41
+ - New `tasks-list`, `tasks-get`, `tasks-cancel` commands for managing async tasks on the server
42
+ - `--task` flag for `tools-call` to opt-in to task execution with a progress spinner showing elapsed time, server status messages, and progress notifications in human mode
43
+ - `--detach` flag for `tools-call` to start a task and return the task ID immediately without waiting for completion (implies `--task`)
44
+ - Press ESC during `--task` execution to detach on the fly — the task continues in the background and the task ID is printed
45
+ - `--insecure` global option to skip TLS certificate verification, for MCP servers with self-signed certificates
46
+ - `--client-id` and `--client-secret` options for `mcpc login` command, for servers that don't support dynamic client registration
47
+ - `--no-profile` option for `connect` command to skip OAuth profile auto-detection and connect anonymously
48
+ - `mcpc close @session`, `mcpc restart @session`, and `mcpc shell @session` command-first syntax as alternatives to `mcpc @session close/restart/shell`
49
+ - `mcpc login` now falls back to accepting a pasted callback URL when the browser cannot be opened (e.g. headless servers, containers)
50
+ - `tools-list` now shows inline parameter signatures (e.g. `read_file(path: string, +4 optional)`) for quick scanning without `--full`
51
+ - `mcpc @session` now shows available tools list from bridge cache (no extra server call)
52
+ - Task capability and `execution.taskSupport` displayed in `tools-get` and server info
53
+ - x402 payments are now also sent via the MCP `_meta["x402/payment"]` field on `tools/call` requests, in addition to the existing HTTP header
54
+
55
+ ### Fixed
56
+
57
+ - 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
58
+ - Combining `--profile` with `--header "Authorization: ..."` now returns a clear error instead of silently stripping the header
59
+ - Session restart now auto-detects the `default` OAuth profile created after the session was established, fixing the `login` then `restart` flow for unauthorized sessions
60
+ - Sessions requiring authentication now correctly show as `expired` instead of `live` when the server rejects unauthenticated connections
61
+ - Auth errors wrapped in `NetworkError` by bridge IPC are now detected on first health check, avoiding unnecessary bridge restart
62
+ - `--timeout` flag now correctly propagates to MCP requests via session bridge
63
+ - `--task` and `--detach` tool calls now correctly send task creation parameters to the server
64
+ - Bridge now forwards `logging/message` notifications from the MCP server to connected clients, so `logging-set-level` actually takes effect in interactive shell sessions
65
+ - IPC buffer between CLI and bridge process is now capped at 10 MB, preventing unbounded memory growth
66
+ - `parseServerArg()` now handles Windows drive-letter config paths and other ambiguous cases
67
+ - Misplaced subcommand-specific flags (e.g. `--full`, `--proxy`) now produce clear "Unknown option" errors instead of confusing rejections
68
+ - `logging-set-level` JSON output no longer includes a redundant `success` field
69
+ - `logTarget` no longer prints a misleading prefix when a session doesn't exist
70
+ - File lock retries now use randomized exponential backoff to reduce contention
15
71
 
16
72
  ## [0.1.10] - 2026-03-01
17
73
 
18
74
  ### Added
75
+
19
76
  - Support for `HTTPS_PROXY`, `HTTP_PROXY`, and `NO_PROXY` / lowercase variants env vars for outbound connections
20
77
  - CI/CD automated test pipeline
21
78
 
22
79
  ### Changed
80
+
23
81
  - Replaced deprecated `keytar` package with `@napi-rs/keyring` for OS keychain integration
24
82
  - Temp files now written to `~/.mcpc/` instead of `/tmp/` to avoid cross-device rename errors on Linux
25
83
  - Improved error messages for invalid server hostnames and mistyped commands (e.g. `mcpc login`)
26
84
  - Added `prettier` formatting check to lint step
27
85
 
28
86
  ### Fixed
87
+
29
88
  - Fixed `ExperimentalWarning: Importing JSON modules is an experimental feature` on Node.js 22+
30
89
  - Fixed OAuth token refresh for servers with root-based discovery (`.well-known` at `/`)
31
90
  - Fixed OAuth errors incorrectly expiring the session instead of failing gracefully
@@ -33,10 +92,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
33
92
  ## [0.1.9] - 2026-02-02
34
93
 
35
94
  ### Added
95
+
36
96
  - Added CHANGELOG.md for tracking changes
37
97
  - Automated GitHub release creation in publish script
38
98
 
39
99
  ### Changed
100
+
40
101
  - `tools-list` now shows a compact summary by default to support dynamic tool discovery
41
102
  - Added `--full` flag to `tools-list` for detailed tool information
42
103
  - Publish script now automatically updates CHANGELOG.md version on release
@@ -44,10 +105,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
44
105
  ## [0.1.8] - 2026-01-21
45
106
 
46
107
  ### Changed
108
+
47
109
  - Session is now marked as expired (not auto-reconnected) when server rejects MCP session ID
48
110
  - Users must explicitly run `mcpc @session restart` to recover from expired sessions
49
111
 
50
112
  ### Fixed
113
+
51
114
  - Fixed incorrect flagging of expired sessions as crashed
52
115
  - Fixed session expiration detection for various error message formats
53
116
  - Fixed help command output
@@ -55,46 +118,56 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
55
118
  ## [0.1.7] - 2026-01-03
56
119
 
57
120
  ### Changed
121
+
58
122
  - Documentation improvements and updates
59
123
  - Various cosmetic improvements to CLI output
60
124
 
61
125
  ### Fixed
126
+
62
127
  - Minor bug fixes
63
128
 
64
129
  ## [0.1.6] - 2026-01-02
65
130
 
66
131
  ### Added
132
+
67
133
  - Session notifications with timestamps for tracking list changes (`tools/list_changed`, `resources/list_changed`, `prompts/list_changed`)
68
134
 
69
135
  ### Changed
136
+
70
137
  - Renamed `_meta` to `_mcpc` in JSON output for MCP spec conformance
71
138
  - Improved formatting of prompts output
72
139
  - Various cosmetic improvements
73
140
 
74
141
  ### Fixed
142
+
75
143
  - Fixed proxy server issues
76
144
  - Fixed screenshot URL in README
77
145
 
78
146
  ## [0.1.5] - 2026-01-01
79
147
 
80
148
  ### Added
149
+
81
150
  - Implemented `--proxy` option for exposing sessions as local MCP servers
82
151
  - Added `mcpc @session restart` command
83
152
 
84
153
  ### Changed
154
+
85
155
  - Renamed `session` command to `connect` for clarity
86
156
  - Renamed "dead" session status to "crashed" for clarity
87
157
 
88
158
  ### Fixed
159
+
89
160
  - Fixed `--timeout` option handling
90
161
 
91
162
  ## [0.1.4] - 2025-12-31
92
163
 
93
164
  ### Added
165
+
94
166
  - Implemented `--schema` and `--schema-mode` options for tools
95
167
  - Added `mcpc @session restart` command
96
168
 
97
169
  ### Changed
170
+
98
171
  - Renamed `tools-schema` command to `tools-get`
99
172
  - Improved formatting for prompts and tools output
100
173
  - Security review and improvements
@@ -102,6 +175,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
102
175
  ## [0.1.3] - 2025-12-29
103
176
 
104
177
  ### Added
178
+
105
179
  - Initial public release
106
180
  - Support for Streamable HTTP and stdio transports
107
181
  - Session management with persistent bridge processes