feat: move from mcp to cli#20
Merged
cryptotavares merged 36 commits intomainfrom Apr 21, 2026
Merged
Conversation
…ry point Restructure monolithic src/mcp-server/ into focused modules: - src/server/: HTTP server, daemon state, port allocation, request queue - src/tools/: all tool implementations and type definitions - src/knowledge-store/: knowledge store and tokenization - src/validation/: schema validation - src/utils/: shared logger, errors, time utilities - src/cli/: new CLI entry point (mm) Add SKILL.md and update package.json, README, and vitest config.
Tools are now classified into categories (mutating, readonly, discovery,
batch) that control whether post-execution observations appear in HTTP
responses. Mutating tools always include observations, readonly and
discovery tools omit them, and batch (run_steps) respects the new
includeObservations parameter ('all', 'none', 'failures').
… constant Remove src/version.ts which required manual sync with package.json. All version consumers now import directly from package.json, with ts-bridge handling the JSON import for both CJS and ESM outputs.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
| ...(body === null ? {} : { body: JSON.stringify(body) }), | ||
| }; | ||
| const response = await fetch( | ||
| `http://127.0.0.1:${port}${requestPath}`, |
Collaborator
Author
There was a problem hiding this comment.
This is fine as the http server is just a wrapper for a local running deamon. Meaning that the http server is only running locally.
…tory
- Remove ContextFactoryOptions; contextFactory now takes no arguments
- Support sync and async contextFactory return values
- Add PortMap type and optional allocatedPorts to WorkflowContext
- Validate contextFactory return shape at runtime (config.environment, allocatedPorts)
- Add startup error handling with cleanup rollback on post-contextFactory failures
- Replace hardcoded { anvil, fixture, mock } subPorts with consumer-defined PortMap
- Export allocatePort() utility for consumer convenience
- Update DaemonState.subPorts to use PortMap
- Add comprehensive tests for contextFactory error paths and /status port reporting
- Add edge-case test coverage for batch, launch, screenshot, seeding, discovery, and navigate schema
- Update coverage thresholds to reflect new test additions
unlink on a directory returns EISDIR on Linux but EPERM on macOS, causing CI (Ubuntu) to fail. Accept both error codes in the assertion and lower coverage thresholds to account for platform instrumentation differences.
AugmentedMode
approved these changes
Apr 20, 2026
seaona
approved these changes
Apr 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Decomposes the monolithic
src/mcp-server/module into a focused, layered architecture, introduces a standalone CLI entry point (mm), and adds several new tool capabilities including observation compaction, text extraction, and launch-time context selection.Why
The original
mcp-server/directory mixed HTTP server concerns, tool implementations, validation logic, utilities, and knowledge-store code in a single flat namespace. This made it difficult to reason about boundaries, test in isolation, or reuse components independently (e.g., running tools outside the MCP server context). The new structure enforces clear dependency directions and enables the CLI to consume tools directly without going through the HTTP layer.How
Architectural restructure — modules extracted from
src/mcp-server/into:src/server/src/tools/src/knowledge-store/src/validation/src/utils/src/cli/mmCLI entry pointNew features:
mutating,readonly,discovery, orbatch. Mutating tools always include post-execution observations; readonly/discovery omit them;run_stepsrespects a newincludeObservationsparameter (all|none|failures)<select>options are collapsed, and a diff-based mode compares the current page state against a baseline to emit only the changed elements when the diff is smaller than the full snapshot. A size guard prevents emitting diffs larger than the full observation.get_texttool — New tool for reading the text content of a DOM element by ref--contextlaunch flag — Launch accepts a--contextparameter for pre-session environment selection, allowing consumers to select which context/environment to initialize before the session startsdescribe_screennow includes active tab information in its output;ExtensionStategains anactiveTabfieldwithinscoping —click,type, andwait_fortools accept awithinparameter to scope element resolution to a subtreerun_stepsgains batch-level timeout, tool aliases, and ref shorthandmm) — Full CLI with--withinflag,--contextflag, observations output, andget_text/launch/describe_screencommandsRefactors:
contextFactorynow owns sub-service port allocation (removes hardcoded{ anvil, fixture, mock }sub-ports, introducesPortMaptype andallocatePort()utility).contextFactorytakes no arguments, supports sync/async return, and its return shape is validated at runtime.package.jsonat runtime instead of a manually-syncedsrc/version.tsKnowledgeStoreis now injectable viaServerConfiginstead of being instantiated internallyTest coverage — Comprehensive tests for all new modules, contextFactory error paths, batch/launch/screenshot/seeding/discovery/navigate schemas, observation compaction (option collapsing, diff-based, activeTab passthrough), cross-platform error code handling, and CLI commands. Coverage thresholds updated accordingly.