@apify/mcpc 0.1.3 → 0.1.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 (122) hide show
  1. package/.claude/settings.local.json +53 -1
  2. package/.idea/codeStyles/Project.xml +7 -0
  3. package/.idea/workspace.xml +314 -280
  4. package/CONTRIBUTING.md +210 -0
  5. package/README.md +690 -763
  6. package/dist/bridge/index.js +82 -18
  7. package/dist/bridge/index.js.map +1 -1
  8. package/dist/bridge/proxy-server.d.ts +21 -0
  9. package/dist/bridge/proxy-server.d.ts.map +1 -0
  10. package/dist/bridge/proxy-server.js +160 -0
  11. package/dist/bridge/proxy-server.js.map +1 -0
  12. package/dist/cli/commands/auth.d.ts.map +1 -1
  13. package/dist/cli/commands/auth.js +9 -4
  14. package/dist/cli/commands/auth.js.map +1 -1
  15. package/dist/cli/commands/clean.d.ts.map +1 -1
  16. package/dist/cli/commands/clean.js +21 -27
  17. package/dist/cli/commands/clean.js.map +1 -1
  18. package/dist/cli/commands/logging.js +1 -1
  19. package/dist/cli/commands/logging.js.map +1 -1
  20. package/dist/cli/commands/prompts.d.ts.map +1 -1
  21. package/dist/cli/commands/prompts.js +37 -5
  22. package/dist/cli/commands/prompts.js.map +1 -1
  23. package/dist/cli/commands/resources.js +5 -5
  24. package/dist/cli/commands/resources.js.map +1 -1
  25. package/dist/cli/commands/sessions.d.ts +7 -1
  26. package/dist/cli/commands/sessions.d.ts.map +1 -1
  27. package/dist/cli/commands/sessions.js +130 -189
  28. package/dist/cli/commands/sessions.js.map +1 -1
  29. package/dist/cli/commands/tools.d.ts +0 -1
  30. package/dist/cli/commands/tools.d.ts.map +1 -1
  31. package/dist/cli/commands/tools.js +48 -10
  32. package/dist/cli/commands/tools.js.map +1 -1
  33. package/dist/cli/commands/utilities.js +1 -1
  34. package/dist/cli/commands/utilities.js.map +1 -1
  35. package/dist/cli/helpers.d.ts +9 -4
  36. package/dist/cli/helpers.d.ts.map +1 -1
  37. package/dist/cli/helpers.js +62 -81
  38. package/dist/cli/helpers.js.map +1 -1
  39. package/dist/cli/index.js +104 -46
  40. package/dist/cli/index.js.map +1 -1
  41. package/dist/cli/output.d.ts +19 -3
  42. package/dist/cli/output.d.ts.map +1 -1
  43. package/dist/cli/output.js +374 -82
  44. package/dist/cli/output.js.map +1 -1
  45. package/dist/cli/parser.d.ts +10 -1
  46. package/dist/cli/parser.d.ts.map +1 -1
  47. package/dist/cli/parser.js +155 -43
  48. package/dist/cli/parser.js.map +1 -1
  49. package/dist/cli/shell.d.ts.map +1 -1
  50. package/dist/cli/shell.js +31 -18
  51. package/dist/cli/shell.js.map +1 -1
  52. package/dist/core/factory.d.ts +2 -4
  53. package/dist/core/factory.d.ts.map +1 -1
  54. package/dist/core/factory.js +3 -34
  55. package/dist/core/factory.js.map +1 -1
  56. package/dist/core/mcp-client.d.ts +7 -2
  57. package/dist/core/mcp-client.d.ts.map +1 -1
  58. package/dist/core/mcp-client.js +86 -36
  59. package/dist/core/mcp-client.js.map +1 -1
  60. package/dist/core/transports.d.ts +2 -2
  61. package/dist/core/transports.d.ts.map +1 -1
  62. package/dist/core/transports.js +36 -45
  63. package/dist/core/transports.js.map +1 -1
  64. package/dist/lib/auth/keychain.d.ts +3 -0
  65. package/dist/lib/auth/keychain.d.ts.map +1 -1
  66. package/dist/lib/auth/keychain.js +18 -0
  67. package/dist/lib/auth/keychain.js.map +1 -1
  68. package/dist/lib/auth/oauth-flow.d.ts.map +1 -1
  69. package/dist/lib/auth/oauth-flow.js +55 -12
  70. package/dist/lib/auth/oauth-flow.js.map +1 -1
  71. package/dist/lib/auth/oauth-provider.d.ts.map +1 -1
  72. package/dist/lib/auth/oauth-provider.js +5 -23
  73. package/dist/lib/auth/oauth-provider.js.map +1 -1
  74. package/dist/lib/auth/oauth-token-manager.d.ts.map +1 -1
  75. package/dist/lib/auth/oauth-token-manager.js +0 -10
  76. package/dist/lib/auth/oauth-token-manager.js.map +1 -1
  77. package/dist/lib/auth/profiles.d.ts +5 -1
  78. package/dist/lib/auth/profiles.d.ts.map +1 -1
  79. package/dist/lib/auth/profiles.js +80 -13
  80. package/dist/lib/auth/profiles.js.map +1 -1
  81. package/dist/lib/bridge-manager.d.ts +3 -2
  82. package/dist/lib/bridge-manager.d.ts.map +1 -1
  83. package/dist/lib/bridge-manager.js +42 -24
  84. package/dist/lib/bridge-manager.js.map +1 -1
  85. package/dist/lib/config.d.ts +3 -3
  86. package/dist/lib/config.d.ts.map +1 -1
  87. package/dist/lib/config.js.map +1 -1
  88. package/dist/lib/errors.d.ts +6 -1
  89. package/dist/lib/errors.d.ts.map +1 -1
  90. package/dist/lib/errors.js +13 -1
  91. package/dist/lib/errors.js.map +1 -1
  92. package/dist/lib/logger.d.ts +7 -1
  93. package/dist/lib/logger.d.ts.map +1 -1
  94. package/dist/lib/logger.js +20 -1
  95. package/dist/lib/logger.js.map +1 -1
  96. package/dist/lib/schema-validator.d.ts +36 -0
  97. package/dist/lib/schema-validator.d.ts.map +1 -0
  98. package/dist/lib/schema-validator.js +265 -0
  99. package/dist/lib/schema-validator.js.map +1 -0
  100. package/dist/lib/session-client.d.ts +2 -2
  101. package/dist/lib/session-client.d.ts.map +1 -1
  102. package/dist/lib/session-client.js +3 -3
  103. package/dist/lib/session-client.js.map +1 -1
  104. package/dist/lib/sessions.d.ts +1 -1
  105. package/dist/lib/sessions.d.ts.map +1 -1
  106. package/dist/lib/sessions.js +22 -10
  107. package/dist/lib/sessions.js.map +1 -1
  108. package/dist/lib/types.d.ts +19 -25
  109. package/dist/lib/types.d.ts.map +1 -1
  110. package/dist/lib/types.js.map +1 -1
  111. package/dist/lib/utils.d.ts +2 -0
  112. package/dist/lib/utils.d.ts.map +1 -1
  113. package/dist/lib/utils.js +13 -1
  114. package/dist/lib/utils.js.map +1 -1
  115. package/docs/README.md +19 -0
  116. package/docs/TODOs.md +43 -0
  117. package/docs/claude-skill/SKILL.md +50 -30
  118. package/docs/images/mcpc-screenshot.png +0 -0
  119. package/package.json +15 -10
  120. package/PUBLISHING.md +0 -111
  121. package/TESTING.md +0 -212
  122. package/TODOs.md +0 -85
package/TODOs.md DELETED
@@ -1,85 +0,0 @@
1
-
2
- # TODOs
3
-
4
- ## Bugs
5
- ...
6
-
7
-
8
- ## Next
9
-
10
- - Expand --help to use same text as in README, add link to README
11
-
12
- BIG: We need to decide whether to show Markdown-ish or not
13
-
14
-
15
- - implement resources-subscribe/resources-unsubscribe, --o file command properly, --max-size
16
- - > # TODO: automatically update the -o file on changes, without it just keep track of changed files in bridge process' cache, and report in resources-list
17
-
18
-
19
- ## Security
20
- - Double-check the MCP security guidelines
21
- - OAuth issuer - maybe save it and double-check it to ensure domain is not spoofed?
22
-
23
- ## Later
24
-
25
- - nit: Print version info to logs, and link to https://github.com/apify/mcpc (to right release tag) - add this also to --help
26
-
27
- - Implement "mcpc @session restart"
28
-
29
- - nit: Colorize output, e.g. JSONs in one color. MCP provided data like descriptions and instructions in orange.
30
- - warnings could be orange, errors red
31
- - nit: Cooler OAuth flow finish web page with CSS animation, add Apify example there. E.g. next step - check Apify rather than close
32
-
33
- - Add `--proxy [HOST:]PORT` feature to `connect` command to enable MCP proxy:
34
- - `--proxy-bearer-token X` to require auth token for better security
35
- - `--proxy-capabilities tools:TOOL_NAME,TOOL_NAME2,...,prompts[:...],...` to limit access to selected MCP features and tools
36
- (what if tools have ":" or "," in their names?)
37
- In theory, we could add limit of capabilities to normal sessions, but the LLM could still break out of it, so what's the point.
38
- - Explain this is useful for AI sandboxing!
39
-
40
- - For auth profiles, fetch the detailed user info from http, ensure the info is up-to-date
41
- - Add support for MCP elicitations, and potentially for sampling (e.g. via shell interface?)
42
-
43
- - nit: cooler OAuth web pages "Authentication successful!" - show mcpc info
44
- - audit that on every command, we print next steps as examples
45
- - more shortcuts, e.g. --profile => -p
46
- - nit: in README, explain the MCP commands better in a standlone section, with details how they work
47
- - Add unique Session.id and Profile.id and use it for OS keychain keys, to truly enable using multiple independent mcpc profiles
48
- - When user runs --clean=profiles, print warning if some sessions were using them
49
-
50
- - nit: Implement typing completions (e.g. "mcpc @a...") - not sure how difficult that is
51
-
52
-
53
-
54
-
55
-
56
- ## E2E test scenarios
57
- - DONE: add end-to-end tests e.g. under `test/e2e` - one bash script per test suite , organized in directories,and one master script that runs them all or selected ones (per directory) in parallel
58
- - Invariants (ideally test this for all commands used in other tests, or is it better just to always test one thing?):
59
- - --verbose only adds extra info to stderr, never to stdout
60
- - --json always returns single JSON object to stdout on success (exit code = 0), or an object or nothing at all on error (exit code != 0)
61
- - We'll need a testing server with all the available features and configurable, for testing.
62
- - "npm run test:coverage" doesn't seem to work and cover e2e tests
63
- - Things to test:
64
- - handling of errors, invalid params, names, etc.
65
- - pagination
66
- - env vars...
67
- - stdio + filesystem operations
68
- - sessions
69
- - test stdio transport with fs mcp server
70
- - test expired session (create fake record in session.json) - ensure attempts to use it will fail with the right error
71
- - for all commands, tests --verbose doesn't print anything extra to stdout, --json returns json
72
- - that on session close we send HTTP DELETE https://modelcontextprotocol.io/specification/2025-11-25/basic/transports#session-management
73
- - Test session failover - e.g. kill the bridge process, and try to access the session again - should be restarted, work, and have same MCP-Session-Id
74
- - Test auth - if no profile available and server requires OAuth, we need to fail with info what to do! e.g. "mcpc https://mcp.sentry.dev/mcp --verbose"
75
- - Test server session aborting - if session is aborted by server, bridge process should exit and set session status to "expired"
76
- - Test auth profiles work long-term and sessions too - basically when running some tests the next day they should use old saved auths and sessions
77
- - Test "mcpc @test close" and "mcpc <server> session @test" in rapid succession, it should work and use different pid (check sessions.json)
78
- - Ensure calling invalid/unknown MCP command in shell and normally doesn't causes the bridge to be flagged as expired or dead
79
- - Text copy can change, but the core texts needs to be shown in both text and JSON mode
80
- - Testing servers we can use:
81
- - https://mcp.apify.com (for testing real OAuth login, we can create various accounts, both OAuth and API tokens)
82
- - https://mcp.apify.com/tools=docs (anonymous, no auth needed)
83
- - https://mcp.sentry.dev/mcp (for testing if no auth profile available)
84
- - ideally get some on non-standard port, maybe localhost
85
-