Skip to content

feat(cli): MCP parity verbs for shell-only consumers#160

Merged
SutuSebastian merged 11 commits into
mainfrom
feat/cli-mcp-parity
May 28, 2026
Merged

feat(cli): MCP parity verbs for shell-only consumers#160
SutuSebastian merged 11 commits into
mainfrom
feat/cli-mcp-parity

Conversation

@SutuSebastian

Copy link
Copy Markdown
Contributor

Summary

  • Add CLI commands that call the same tool-handlers and resource builders as MCP/HTTP, so consumers without a transport get identical JSON payloads.
  • New verbs: codemap query batch, trace, explore, node, file, schema, plus context --include-snippets.
  • Export buildFileRollup / buildSchemaCatalog from resource-handlers.ts for shared MCP + CLI paths.

Test plan

  • bun test src/cli/cmd-cli-parity.test.ts src/cli/cmd-context.test.ts
  • bun run typecheck
  • Pre-commit hook (format, lint, typecheck, tests)
  • Manual smoke: codemap context --include-snippets, codemap schema, codemap file src/db.ts
  • Manual smoke: echo '{"statements":["SELECT 1"]}' | codemap query batch --stdin

Wire CLI commands that call the same tool-handlers and resource builders
as MCP/HTTP so consumers without a transport still get identical JSON.
@changeset-bot

changeset-bot Bot commented May 28, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0e481b5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@stainless-code/codemap Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@SutuSebastian, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 22 minutes and 16 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 45a99e71-2d11-4131-94ba-af0afcb79351

📥 Commits

Reviewing files that changed from the base of the PR and between 68799ef and 0e481b5.

📒 Files selected for processing (26)
  • .changeset/cli-mcp-parity.md
  • README.md
  • docs/architecture.md
  • docs/glossary.md
  • src/application/context-engine.ts
  • src/application/mcp-server.ts
  • src/application/resource-handlers.test.ts
  • src/application/resource-handlers.ts
  • src/cli.test.ts
  • src/cli/bootstrap.ts
  • src/cli/cmd-cli-parity-e2e.test.ts
  • src/cli/cmd-cli-parity.test.ts
  • src/cli/cmd-composers.ts
  • src/cli/cmd-context.test.ts
  • src/cli/cmd-context.ts
  • src/cli/cmd-mcp.ts
  • src/cli/cmd-query-batch.test.ts
  • src/cli/cmd-query-batch.ts
  • src/cli/cmd-resource.ts
  • src/cli/emit-tool-result.ts
  • src/cli/main.ts
  • src/cli/read-json-stdin.ts
  • templates/agent-content/mcp-instructions.md
  • templates/agent-content/rule/00-full.md
  • templates/agent-content/skill/10-recipes-context.md
  • templates/agent-content/skill/50-maintenance.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/cli-mcp-parity

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

validateIndexModeArgs blocked trace/explore/node/file/schema before dispatch.
Validate query batch input with queryBatchArgsSchema; add dispatch smoke tests.
Reject invalid group_by/changed_since in batch JSON instead of silently
coercing to CLI defaults. Extend dispatch smoke tests and architecture docs.
Route context through handleContext, dedupe resource builders, align
composer validation with MCP zod schemas, emit JSON parse errors for
always-JSON verbs, and sync cmd-mcp help plus agent-content docs.
Add codemap symbols resource twin, align file-not-indexed errors with
MCP, add query batch --no-summary, and extend dispatch smoke tests.
Golden-path subprocess tests on fixtures/minimal; glossary/bootstrap/mcp
help and context-engine comments updated for symbols and --no-summary.
Add explore, node, and context --include-snippets e2e coverage; align
architecture and glossary with handleContext and CLI --include-snippets.
Align with repo convention: additive CLI twins ship as patch, not minor.
@SutuSebastian SutuSebastian merged commit b1e3d58 into main May 28, 2026
11 checks passed
@SutuSebastian SutuSebastian deleted the feat/cli-mcp-parity branch May 28, 2026 10:22
@github-actions github-actions Bot mentioned this pull request May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant