@apify/mcpc 0.2.4 → 0.3.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 (123) hide show
  1. package/CHANGELOG.md +64 -1
  2. package/CONTRIBUTING.md +12 -0
  3. package/NOTICE +27 -0
  4. package/README.md +219 -226
  5. package/_config.yml +30 -0
  6. package/client-logo.svg +79 -0
  7. package/client-metadata.json +16 -0
  8. package/dist/bridge/index.js +51 -4
  9. package/dist/bridge/index.js.map +1 -1
  10. package/dist/cli/commands/auth.d.ts +2 -0
  11. package/dist/cli/commands/auth.d.ts.map +1 -1
  12. package/dist/cli/commands/auth.js +32 -10
  13. package/dist/cli/commands/auth.js.map +1 -1
  14. package/dist/cli/commands/clean.d.ts.map +1 -1
  15. package/dist/cli/commands/clean.js +13 -2
  16. package/dist/cli/commands/clean.js.map +1 -1
  17. package/dist/cli/commands/grep.d.ts.map +1 -1
  18. package/dist/cli/commands/grep.js +39 -8
  19. package/dist/cli/commands/grep.js.map +1 -1
  20. package/dist/cli/commands/prompts.d.ts.map +1 -1
  21. package/dist/cli/commands/prompts.js +7 -26
  22. package/dist/cli/commands/prompts.js.map +1 -1
  23. package/dist/cli/commands/resources.d.ts.map +1 -1
  24. package/dist/cli/commands/resources.js +9 -3
  25. package/dist/cli/commands/resources.js.map +1 -1
  26. package/dist/cli/commands/sessions.d.ts +45 -2
  27. package/dist/cli/commands/sessions.d.ts.map +1 -1
  28. package/dist/cli/commands/sessions.js +493 -27
  29. package/dist/cli/commands/sessions.js.map +1 -1
  30. package/dist/cli/commands/tasks.d.ts +1 -0
  31. package/dist/cli/commands/tasks.d.ts.map +1 -1
  32. package/dist/cli/commands/tasks.js +15 -1
  33. package/dist/cli/commands/tasks.js.map +1 -1
  34. package/dist/cli/commands/tools.d.ts +6 -1
  35. package/dist/cli/commands/tools.d.ts.map +1 -1
  36. package/dist/cli/commands/tools.js +66 -14
  37. package/dist/cli/commands/tools.js.map +1 -1
  38. package/dist/cli/commands/x402.d.ts.map +1 -1
  39. package/dist/cli/commands/x402.js +7 -7
  40. package/dist/cli/commands/x402.js.map +1 -1
  41. package/dist/cli/helpers.d.ts.map +1 -1
  42. package/dist/cli/helpers.js +3 -6
  43. package/dist/cli/helpers.js.map +1 -1
  44. package/dist/cli/index.js +370 -131
  45. package/dist/cli/index.js.map +1 -1
  46. package/dist/cli/output.d.ts +18 -5
  47. package/dist/cli/output.d.ts.map +1 -1
  48. package/dist/cli/output.js +275 -89
  49. package/dist/cli/output.js.map +1 -1
  50. package/dist/cli/parser.d.ts +4 -0
  51. package/dist/cli/parser.d.ts.map +1 -1
  52. package/dist/cli/parser.js +68 -24
  53. package/dist/cli/parser.js.map +1 -1
  54. package/dist/cli/shell.d.ts.map +1 -1
  55. package/dist/cli/shell.js +44 -21
  56. package/dist/cli/shell.js.map +1 -1
  57. package/dist/cli/tool-result.d.ts +1 -1
  58. package/dist/cli/tool-result.d.ts.map +1 -1
  59. package/dist/cli/tool-result.js +20 -15
  60. package/dist/cli/tool-result.js.map +1 -1
  61. package/dist/core/factory.d.ts +1 -0
  62. package/dist/core/factory.d.ts.map +1 -1
  63. package/dist/core/factory.js +3 -0
  64. package/dist/core/factory.js.map +1 -1
  65. package/dist/core/mcp-client.d.ts +1 -0
  66. package/dist/core/mcp-client.d.ts.map +1 -1
  67. package/dist/core/mcp-client.js +14 -0
  68. package/dist/core/mcp-client.js.map +1 -1
  69. package/dist/core/transports.d.ts +5 -1
  70. package/dist/core/transports.d.ts.map +1 -1
  71. package/dist/core/transports.js +26 -4
  72. package/dist/core/transports.js.map +1 -1
  73. package/dist/lib/auth/auth-page.d.ts +13 -0
  74. package/dist/lib/auth/auth-page.d.ts.map +1 -0
  75. package/dist/lib/auth/auth-page.js +129 -0
  76. package/dist/lib/auth/auth-page.js.map +1 -0
  77. package/dist/lib/auth/oauth-flow.d.ts +2 -1
  78. package/dist/lib/auth/oauth-flow.d.ts.map +1 -1
  79. package/dist/lib/auth/oauth-flow.js +65 -58
  80. package/dist/lib/auth/oauth-flow.js.map +1 -1
  81. package/dist/lib/auth/oauth-provider.d.ts +2 -0
  82. package/dist/lib/auth/oauth-provider.d.ts.map +1 -1
  83. package/dist/lib/auth/oauth-provider.js +6 -0
  84. package/dist/lib/auth/oauth-provider.js.map +1 -1
  85. package/dist/lib/auth/oauth-utils.d.ts +3 -0
  86. package/dist/lib/auth/oauth-utils.d.ts.map +1 -1
  87. package/dist/lib/auth/oauth-utils.js +32 -1
  88. package/dist/lib/auth/oauth-utils.js.map +1 -1
  89. package/dist/lib/auth/profiles.d.ts.map +1 -1
  90. package/dist/lib/auth/profiles.js +3 -3
  91. package/dist/lib/auth/profiles.js.map +1 -1
  92. package/dist/lib/bridge-manager.d.ts.map +1 -1
  93. package/dist/lib/bridge-manager.js +43 -28
  94. package/dist/lib/bridge-manager.js.map +1 -1
  95. package/dist/lib/cleanup.d.ts +5 -0
  96. package/dist/lib/cleanup.d.ts.map +1 -1
  97. package/dist/lib/cleanup.js +38 -1
  98. package/dist/lib/cleanup.js.map +1 -1
  99. package/dist/lib/config.d.ts +21 -0
  100. package/dist/lib/config.d.ts.map +1 -1
  101. package/dist/lib/config.js +99 -5
  102. package/dist/lib/config.js.map +1 -1
  103. package/dist/lib/errors.d.ts +1 -0
  104. package/dist/lib/errors.d.ts.map +1 -1
  105. package/dist/lib/errors.js +4 -1
  106. package/dist/lib/errors.js.map +1 -1
  107. package/dist/lib/session-client.d.ts +1 -0
  108. package/dist/lib/session-client.d.ts.map +1 -1
  109. package/dist/lib/session-client.js +7 -4
  110. package/dist/lib/session-client.js.map +1 -1
  111. package/dist/lib/sessions.d.ts.map +1 -1
  112. package/dist/lib/sessions.js +18 -9
  113. package/dist/lib/sessions.js.map +1 -1
  114. package/dist/lib/types.d.ts +2 -0
  115. package/dist/lib/types.d.ts.map +1 -1
  116. package/dist/lib/utils.d.ts +16 -2
  117. package/dist/lib/utils.d.ts.map +1 -1
  118. package/dist/lib/utils.js +112 -8
  119. package/dist/lib/utils.js.map +1 -1
  120. package/dist/lib/wallets.js +3 -3
  121. package/dist/lib/wallets.js.map +1 -1
  122. package/docs/TODOs.md +5 -0
  123. package/package.json +7 -6
package/CHANGELOG.md CHANGED
@@ -7,6 +7,67 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ### Added
11
+
12
+ - `mcpc connect` (with no arguments) now auto-discovers standard MCP config files (`.mcp.json`, `mcp.json`, `.cursor/mcp.json`, `.vscode/mcp.json`, `~/.claude.json`, Claude Desktop, Windsurf, Kiro, etc.) in the current directory and home directory, and connects every server defined across them. Entries with duplicate session names are deduplicated (project-scoped files win over global ones). VS Code's `"servers"` key is also supported.
13
+ - `mcpc connect` auto-connects to `mcp.apify.com` as `@apify` when the `APIFY_API_TOKEN` environment variable is set, using it as a Bearer token. Existing live sessions are reused without restart.
14
+
15
+ ### Changed
16
+
17
+ - Stdio (command-based) config entries are now skipped by default when connecting from a config file (`mcpc connect <file>`). Pass `--stdio` to include them. Single-entry connects (`mcpc connect file:entry @session`) are not affected.
18
+ - **Breaking:** `mcpc connect --json` now always returns an array of `InitializeResult` objects (extended with `toolNames` and `_mcpc` metadata), regardless of whether you connect a single server, a config file, or auto-discover all configs. Skipped/failed entries carry `_mcpc.status` (`created` | `active` | `failed` | `skipped`) and `_mcpc.skipReason` / `_mcpc.error`. The previous wrapper-object shapes (`{configFile, results, skipped}` and `{discovered, results, skipped}`) have been removed.
19
+ - `tools-call --task` now prints the task ID and recovery commands when interrupted with Ctrl+C, so you can fetch or cancel the server-side task later
20
+
21
+ ### Fixed
22
+
23
+ - `mcpc connect` and `mcpc restart` no longer fail with `ENOENT` when the macOS Keychain prompts for a password. Credentials are now read from the keychain *before* the bridge process is spawned, so the bridge's IPC startup timer no longer races a foreground password dialog (#55)
24
+ - Background auto-reconnect now correctly marks sessions as `unauthorized` when the server returns 401/403, instead of leaving them stuck in `connecting` after the bridge crashed on an unhandled rejection
25
+ - Sessions using a static bearer token (via `--header "Authorization: ..."`) no longer flip between `unauthorized` and `connecting` on every `mcpc` invocation — they stay `unauthorized` until you `mcpc login` or reconnect. OAuth-profile sessions still auto-retry because tokens may have been refreshed by another session
26
+ - Stdio servers no longer fail silently: the bridge now captures the child's stderr, writes it to `~/.mcpc/logs/bridge-<session>.log`, and appends a tail of the most recent lines to `mcpc connect` errors. This makes it obvious when a stdio server crashes on startup due to e.g. missing TLS trust (`NODE_EXTRA_CA_CERTS`), missing proxy vars, or missing credentials (#195)
27
+ - `mcpc connect` now recognizes relative config-file paths with a `:entry` suffix (e.g. `docs/examples/mcp-config.json:fs`). Previously these were misinterpreted as HTTP URLs
28
+ - `mcpc login` now sends a random `state` parameter on the OAuth authorization URL. Some authorization servers (e.g. Ubersuggest) reject requests without `state` with a `missing_state` error, which previously made `login` fail before reaching the consent screen (#214)
29
+ - `mcpc connect` no longer aborts on Windows with `Failed to save sessions: EPERM: operation not permitted, rename …` when antivirus or another mcpc process briefly holds `sessions.json` open. The atomic rename used to persist `sessions.json`, `profiles.json`, and `wallets.json` now retries transient Windows file-lock errors with a short backoff
30
+
31
+ ### Removed
32
+
33
+ - **Breaking:** Removed `tools`, `resources`, and `prompts` shorthand commands — use the full names (`tools-list`, `resources-list`, `prompts-list`) instead
34
+
35
+ ## [0.2.6] - 2026-04-15
36
+
37
+ ### Added
38
+
39
+ - New `tasks-result <taskId>` command that fetches the final `CallToolResult` payload of an async task via the MCP `tasks/result` method. Blocks until the task reaches a terminal state, then prints the payload using the same renderer as `tools-call` (`--json` returns the raw result).
40
+ - Public [Client ID Metadata Document](https://apify.github.io/mcpc/client-metadata.json) hosted via GitHub Pages, giving every `mcpc` installation a consistent client identity on CIMD-capable authorization servers. `mcpc login` now uses this hosted document by default; override with `--client-metadata-url <url>` or disable with `--no-client-metadata-url` to force Dynamic Client Registration. The OAuth callback uses a fixed loopback port range (13316–13325) to match the registered redirect URIs.
41
+
42
+ ### Changed
43
+
44
+ - Human-mode `tools-call` / `tasks-result` output now uses a structured layout: **Metadata** (`_meta`), **Content** (each text/resource/image block rendered per type), and **Structured content** (shown as JSON when not already present in a text block). Replaces the raw key-value dump with a cleaner, more readable format.
45
+
46
+ ### Fixed
47
+
48
+ - `tools-get` "Call example" now wraps JSON values (arrays, objects, strings) in single quotes so they can be copy-pasted into a shell verbatim without being mangled by word-splitting (e.g., `outputFormats:='["markdown"]'` instead of `outputFormats:=["markdown"]`)
49
+
50
+ ## [0.2.5] - 2026-04-15
51
+
52
+ ### Added
53
+
54
+ - `mcpc connect <config-file>` connects all servers defined in a config file at once, auto-generating session names from entry names (e.g., `mcpc connect ~/.vscode/mcp.json`)
55
+ - `connect` auto-generates a session name when `@session` is omitted (e.g., `mcpc connect mcp.apify.com` creates `@apify`), reusing an existing session when auth settings match
56
+ - `--max-chars <n>` global option to truncate output to a given number of characters (ignored in `--json` mode)
57
+ - "Did you mean?" suggestions for unknown commands, including reversed names (e.g., `list-tools` → `tools-list`)
58
+ - `mcpc login --client-metadata-url <https-url>` flag adds support for [OAuth Client ID Metadata Documents (CIMD)](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-client-id-metadata-document-00). When the authorization server advertises `client_id_metadata_document_supported: true`, mcpc uses the URL as the `client_id`; otherwise it falls back to Dynamic Client Registration.
59
+
60
+ ### Changed
61
+
62
+ - Session info JSON output (`mcpc @session --json`, `mcpc connect --json`) returns `toolNames` (array of strings) instead of full `tools` objects
63
+ - `--schema` and `--schema-mode` options scoped to `tools-get` and `tools-call` only (removed from `prompts-get`)
64
+
65
+ ### Fixed
66
+
67
+ - `connect` now verifies the server responds before reporting success; shows a warning with the actual error when the server is unreachable
68
+ - HTTP 404 during initial connect no longer misclassified as "session expired"; error messages now include the actual HTTP error and server URL
69
+ - `mcpc login --json` now writes interactive prompts to stderr, so stdout contains only the final JSON result and is safe to pipe to `jq` or redirect to a file
70
+
10
71
  ## [0.2.4] - 2026-04-07
11
72
 
12
73
  ### Security
@@ -204,7 +265,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
204
265
  - Interactive shell mode
205
266
  - JSON output mode for scripting
206
267
 
207
- [Unreleased]: https://github.com/apify/mcpc/compare/v0.2.4...HEAD
268
+ [Unreleased]: https://github.com/apify/mcpc/compare/v0.2.6...HEAD
269
+ [0.2.6]: https://github.com/apify/mcpc/compare/v0.2.5...v0.2.6
270
+ [0.2.5]: https://github.com/apify/mcpc/compare/v0.2.4...v0.2.5
208
271
  [0.2.4]: https://github.com/apify/mcpc/compare/v0.2.3...v0.2.4
209
272
  [0.2.3]: https://github.com/apify/mcpc/compare/v0.2.2...v0.2.3
210
273
  [0.2.2]: https://github.com/apify/mcpc/compare/v0.2.1...v0.2.2
package/CONTRIBUTING.md CHANGED
@@ -15,6 +15,18 @@ Contributions are welcome!
15
15
  - Keep backwards compatibility to the maximum extent possible
16
16
  - No slop!
17
17
 
18
+ ## Examples and documentation
19
+
20
+ When writing examples, tests, README snippets, or help text that reference a remote MCP server,
21
+ please use `mcp.apify.com` rather than placeholders like `mcp.example.com` or arbitrary third-party
22
+ servers. The motivation is purely practical: `mcp.apify.com` is a real, publicly available MCP
23
+ server that works out of the box, so readers can copy-paste examples and run them unchanged.
24
+ Placeholders like `mcp.example.com` don't resolve to anything, which forces every reader to
25
+ substitute a URL before they can try an example.
26
+
27
+ This is a soft convention for documentation consistency, not a license condition — mcpc is
28
+ distributed under Apache 2.0 and you are free to use it with any MCP server.
29
+
18
30
  ## Development setup
19
31
 
20
32
  ```bash
package/NOTICE ADDED
@@ -0,0 +1,27 @@
1
+ mcpc
2
+ Copyright 2025 Apify Technologies s.r.o.
3
+
4
+ This product includes software developed at Apify (https://apify.com/).
5
+
6
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not
7
+ use this software except in compliance with the License. You may obtain a
8
+ copy of the License in the accompanying LICENSE file or at:
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ ---
13
+
14
+ Documentation convention (informational, not a license condition):
15
+
16
+ Examples in this project's documentation, help text, and tests reference
17
+ `mcp.apify.com` as the remote MCP server. The motivation is practical:
18
+ `mcp.apify.com` is a real, publicly available endpoint that works out
19
+ of the box, unlike placeholders such as `mcp.example.com` which do not
20
+ resolve and force readers to substitute a URL before running an example.
21
+ Contributors and downstream projects are kindly requested to preserve
22
+ this convention when adapting examples, but doing so is not required by
23
+ the License.
24
+
25
+ Per Section 4 of the Apache License 2.0, the contents of this NOTICE file
26
+ are for informational purposes only and do not modify the License. mcpc
27
+ may be used with any MCP-compatible server.