Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- `mcpc completion <bash|zsh|fish>` prints a shell completion script; `mcpc completion install [shell]` auto-detects the user's shell and installs the script in the right place. Completion covers top-level commands, session subcommands, `@session` names (from `~/.mcpc/sessions.json`), saved auth servers, log levels, known flags (introspected from Commander at runtime so there is no static drift), and tool names / resource URIs / prompt names for connected sessions. Tool/resource/prompt names are cached on disk in `~/.mcpc/completion/<session>.json` whenever the user runs `tools-list` / `resources-list` / `prompts-list`, so TAB is fast and never triggers network calls or OAuth flows.
- `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.
- `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.

Expand Down
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ npm install -g @apify/mcpc
bun install -g @apify/mcpc
```

Optional: enable [shell tab-completion](#shell-completion) for bash/zsh/fish:

```bash
mcpc completion install
```

**Linux:** credentials use the OS keychain via the [Secret Service API](https://specifications.freedesktop.org/secret-service/).
GNOME/KDE desktops work out of the box. On headless/CI systems, `mcpc` falls back to a
file-based store (`~/.mcpc/credentials`, mode `0600`).
Expand Down Expand Up @@ -141,6 +147,7 @@ Commands:
clean [resources...] Clean up mcpc data (sessions, profiles, logs, all)
grep <pattern> Search tools and instructions across all active sessions
x402 [subcommand] [args...] Configure an x402 payment wallet (EXPERIMENTAL)
completion [args...] Print or install a shell completion script (bash, zsh, fish)
help [command] [subcommand] Show help for a specific command

Options:
Expand Down Expand Up @@ -260,6 +267,40 @@ mcpc @apify shell
Shell commands: `help`, `exit`/`quit`/Ctrl+D, Ctrl+C to cancel.
Arrow keys navigate history (saved to `~/.mcpc/history`).

### Shell completion

`mcpc` ships with tab-completion scripts for **bash**, **zsh**, and **fish**.
Completion covers top-level commands, session subcommands, `@session` names
(from `~/.mcpc/sessions.json`), saved auth servers (`mcpc login`/`logout`),
known flags, plus **tool names, resource URIs, and prompt names** for
connected sessions. Tool/resource/prompt names are cached in
`~/.mcpc/completion/<session>.json` whenever you run `tools-list`,
`resources-list`, or `prompts-list` β€” run those once to warm the cache.

```bash
# Auto-detect your shell and install
mcpc completion install

# Or install for a specific shell
mcpc completion install bash
mcpc completion install zsh
mcpc completion install fish
```

Alternatively, print the script and pipe it wherever you want:

```bash
# Always-fresh: re-evaluates on every shell start
echo 'eval "$(mcpc completion bash)"' >> ~/.bashrc

# Or write the file yourself
mcpc completion bash > ~/.local/share/bash-completion/completions/mcpc
```

Completion is **purely local** β€” it reads `~/.mcpc/sessions.json` and
`~/.mcpc/profiles.json` and never triggers network calls or OAuth flows on
TAB, so it stays fast even when sessions are offline.

### Grep (search across sessions)

`mcpc grep` searches tools, resources, and prompts across all active sessions or within a single session:
Expand Down
10 changes: 6 additions & 4 deletions bin/mcpc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
// Main CLI executable for mcpc
// This wrapper imports the compiled TypeScript CLI entry point

import('../dist/cli/index.js').catch((err) => {
console.error('Failed to load mcpc CLI:', err.message);
process.exit(1);
});
import('../dist/cli/index.js')
.then((mod) => mod.run())
.catch((err) => {
console.error('Failed to load mcpc CLI:', err.message);
process.exit(1);
});
1 change: 0 additions & 1 deletion docs/TODOs.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ Syntax errors: mcpc call linear_list_issues instead of mcpc @linear tools-call l
just re-type it dynamically to make it work.
- nit: Cooler OAuth flow finish web page with CSS animation, add Apify example there, show mcpc info. E.g. next step - check Apify rather than close
- security: For auth profiles, fetch the detailed user info via http, save to profiles.json and show in 'mcpc', ensure the info is up-to-date
- nit: Implement typing tab-completions (e.g. "mcpc @ap...") - not sure if that's even possible
- Consider adding `--dry-run` https://justin.poehnelt.com/posts/rewrite-your-cli-for-ai-agents/
For tool call it could return synthetic resutls conforming the schema.
- Show protocolVersion also for stdio in "mcpc --json" - but for that we need to update the SDK to save it! See setProtocolVersion
Expand Down
33 changes: 0 additions & 33 deletions jest.config.js

This file was deleted.

13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
"build:watch": "tsc --watch",
"build:readme": "./scripts/update-readme.sh",
"test": "pnpm run build && pnpm run test:unit && ./test/e2e/run.sh --no-build --parallel 8 && ./test/e2e/run.sh --no-build --parallel 8 --runtime bun",
"test:unit": "jest",
"test:watch": "jest --watch",
"test:unit": "vitest run",
"test:watch": "vitest",
"test:coverage": "pnpm run test:coverage:unit && pnpm run test:coverage:e2e && pnpm run test:coverage:merge",
"test:coverage:unit": "jest --coverage && find test/coverage/unit -name '*.html' -exec sed -i '' -e 's/Code coverage report for All files/mcpc Coverage (Unit Tests)/g' -e 's/<h1>All files<\\/h1>/<h1>Unit Test Coverage<\\/h1>/g' {} \\;",
"test:coverage:unit": "vitest run --coverage",
"test:coverage:e2e": "./test/e2e/run.sh --coverage",
"test:coverage:merge": "test/coverage/coverage-merge.sh",
"test:e2e": "./test/e2e/run.sh --keep",
Expand Down Expand Up @@ -69,24 +69,23 @@
"viem": "^2.46.3"
},
"devDependencies": {
"@types/jest": "^30.0.0",
"@types/node": "^25.0.3",
"@types/proper-lockfile": "^4.1.4",
"@types/qrcode-terminal": "^0.12.2",
"@types/uuid": "^11.0.0",
"@typescript-eslint/eslint-plugin": "8.57.2",
"@typescript-eslint/parser": "8.57.2",
"@vitest/coverage-v8": "4.1.5",
"c8": "^11.0.0",
"doctoc": "^2.2.1",
"eslint": "^8.57.1",
"jest": "^30.2.0",
"markdown-link-check": "^3.14.2",
"nyc": "^18.0.0",
"prettier": "^3.7.4",
"proxy-chain": "^2.7.1",
"ts-jest": "^29.4.6",
"tsx": "^4.21.0",
"typescript": "^5.9.3"
"typescript": "^5.9.3",
"vitest": "4.1.5"
},
"packageManager": "pnpm@10.33.4",
"devEngines": {
Expand Down
Loading
Loading