feat: prototype shared-runtime embedded MCP for MOSS CLI#2
Open
0xBreadguy wants to merge 40 commits into
Open
Conversation
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.
Summary
This PR evolves the original embedded MCP architecture skeleton into a working prototype for MOSS CLI.
The goal is not just to expose CLI commands over MCP, but to demonstrate a shared-runtime architecture where:
What this branch now includes
Shared runtime direction
Introduces and expands internal structure for:
src/core/src/schemas/src/mcp/This is no longer just a folder proposal — several wallet operations now run through shared runtime code consumed by the MCP layer.
Embedded MCP server
Adds:
mega moss mcp servewith a working stream-based MCP server and tool registry.
Current MCP tools
Read:
moss_whoamimoss_list_keysmoss_permissionsmoss_wallet_statusmoss_debugPreview-first:
moss_transfer_previewmoss_execute_previewExecute:
moss_transfer_executemoss_executeCapability-aware delegated wallet runtime
This branch introduces a richer capability model so the MCP surface can reason about:
This enables tools to return structured issues and guidance rather than only succeeding/failing.
Permission deltas / approval guidance
Preview tools now support structured permission-delta output for missing authority, including:
This is intended to make MOSS MCP more than a generic wallet command wrapper: it becomes a delegated-authority-aware coordination surface for humans and agents.
Richer MCP introspection
mcp.toolsnow exposes more useful metadata, including:This makes the tool surface more self-describing for MCP hosts and agents.
Safety model
This branch keeps trust-boundary creation out of MCP v1.
Not exposed via MCP:
logincreate-keyrevokelogoutThe current design assumes:
readyBoth
moss_transfer_executeandmoss_executenow share preview-gated execution semantics.Tests
This branch now includes:
Validated with:
pnpm lintpnpm testWhy this matters
This PR is intended to show a more ambitious direction than “CLI commands exposed over MCP.”
The prototype demonstrates a path toward a permission-aware wallet runtime where:
Notes
This is still a prototype / feature-branch-quality implementation, not a final architectural endpoint.
What it is meant to prove:
Intended end-state architecture
The intended long-term direction is a shared wallet runtime with clear internal boundaries between:
core/— canonical wallet/business logicschemas/— canonical input/output contracts and tool metadatacli/— human/operator-facing rendering and command UXmcp/— agent-facing MCP server and tool exposureThe goal is for CLI commands and MCP tools to derive from the same conceptual wallet operations rather than drift into separate implementations.
In the end state:
login,create-key,revoke,logout) should remain human-governed unless intentionally expanded laterThis branch is not that final architecture yet, but it is intended to move the repo concretely in that direction.