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