Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
fa38da7
refactor: decompose mcp-server into modular architecture with CLI ent…
cryptotavares Apr 15, 2026
c15cf5e
feat: add category-based observation filtering for tool responses
cryptotavares Apr 16, 2026
ccff6bb
fix: add missing return type annotation to CLI error handler
cryptotavares Apr 16, 2026
845ffc8
refactor: read package version from package.json instead of hardcoded…
cryptotavares Apr 16, 2026
072f40a
refactor: delegate sub-service port allocation to consumer contextFac…
cryptotavares Apr 16, 2026
668a165
feat: add structural roles, a11y enrichment, and node collapsing to d…
cryptotavares Apr 16, 2026
4b28791
feat: add within scoping for click, type, and wait_for tools
cryptotavares Apr 16, 2026
ad1a653
feat: add batch timeout, tool aliases, and ref shorthand to run_steps
cryptotavares Apr 16, 2026
76a12f3
feat: wait for animations to settle before post-mutation observations
cryptotavares Apr 16, 2026
eab29ea
feat: add --within flag and observations output to CLI
cryptotavares Apr 16, 2026
0d53d1b
fix: make CLI binary executable after build
cryptotavares Apr 16, 2026
36eaa12
docs: update tool docs for within scoping, batch timeout, and enrichment
cryptotavares Apr 16, 2026
e8a4e0a
chore: update coverage thresholds
cryptotavares Apr 16, 2026
dc3d2ae
fix: handle cross-platform error codes in lock release test
cryptotavares Apr 16, 2026
c256214
feat: add type definitions and schemas for get_text, launch context, …
cryptotavares Apr 17, 2026
c26a8d3
feat: implement get_text tool for reading element text content
cryptotavares Apr 17, 2026
a1d3b80
feat: add --context flag to launch for pre-session environment selection
cryptotavares Apr 17, 2026
e5a5de4
feat: include active tab info in describe_screen output
cryptotavares Apr 17, 2026
f4e9cb9
feat: register get_text tool and add new CLI commands
cryptotavares Apr 17, 2026
33eb141
docs: update README and SKILL reference for new tools and commands
cryptotavares Apr 17, 2026
92505a4
chore: update vitest coverage thresholds
cryptotavares Apr 17, 2026
8cd7d65
refactor: make KnowledgeStore injectable via ServerConfig
cryptotavares Apr 17, 2026
2bfcfc9
feat(server): add observation compaction module with option collapsing
cryptotavares Apr 17, 2026
4764feb
feat(types): add optional diff metadata to StepRecordObservation
cryptotavares Apr 17, 2026
35c41cd
feat(server): wire compact observations into HTTP response path
cryptotavares Apr 17, 2026
87b7c9e
docs: document compact observation behavior in SKILL.md
cryptotavares Apr 17, 2026
21bc588
feat(server): implement diff-based observation compaction
cryptotavares Apr 17, 2026
5f28b5e
feat(server): wire diff baseline and size guard into executeTool
cryptotavares Apr 17, 2026
93c50b2
docs: document diff-based observation behavior
cryptotavares Apr 17, 2026
2a8b6f2
fix(server): add required JSDoc to observation compaction functions
cryptotavares Apr 17, 2026
9417bbb
fix(server): remove non-null assertions from integration tests
cryptotavares Apr 17, 2026
2645ada
feat(types): add activeTab field to ExtensionState
cryptotavares Apr 20, 2026
767a8c3
feat(server): add post-mutation state recheck for unknown screens
cryptotavares Apr 20, 2026
fcafd1f
test(server): verify activeTab passthrough in observation compaction
cryptotavares Apr 20, 2026
1287f39
docs: format SKILL.md table alignment and code blocks
cryptotavares Apr 20, 2026
635aa5d
chore: update testing coverage
cryptotavares Apr 20, 2026
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,784 changes: 465 additions & 1,319 deletions README.md

Large diffs are not rendered by default.

538 changes: 538 additions & 0 deletions SKILL.md

Large diffs are not rendered by default.

13 changes: 9 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@metamask/client-mcp-core",
"version": "0.1.1",
"description": "MCP server for MetaMask Extension visual testing with LLM agents",
"description": "HTTP daemon and CLI for agent-driven browser extension testing with Playwright",
"keywords": [
"mcp",
"playwright",
"llm",
"visual-testing",
"browser-extension"
"browser-extension",
"cli"
],
"homepage": "https://github.com/MetaMask/client-mcp-core#readme",
"bugs": {
Expand Down Expand Up @@ -35,6 +35,9 @@
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.cts",
"bin": {
"mm": "./dist/cli/mm.cjs"
},
"files": [
"dist"
],
Expand All @@ -57,7 +60,8 @@
"@isaacs/brace-expansion": "5.0.1"
},
"dependencies": {
"@modelcontextprotocol/sdk": "^1.26.0",
"cosmiconfig": "^9.0.0",
"express": "^5.2.1",
"zod": "^4.3.5"
},
"devDependencies": {
Expand All @@ -71,6 +75,7 @@
"@metamask/eslint-config-vitest": "^15.0.0",
"@playwright/test": "^1.49.0",
"@ts-bridge/cli": "^0.6.3",
"@types/express": "^5.0.6",
"@types/node": "^20.0.0",
"@typescript-eslint/utils": "^8.6.0",
"@vitest/coverage-istanbul": "^3.0.7",
Expand Down
2 changes: 2 additions & 0 deletions scripts/prepack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ if [[ -n $SKIP_PREPACK ]]; then
fi

yarn build

chmod +x dist/cli/mm.cjs
35 changes: 31 additions & 4 deletions src/capabilities/context.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ describe('isE2EConfig', () => {
environment: 'e2e',
extensionName: 'MetaMask',
defaultPassword: 'password123',
toolPrefix: 'mm',
artifactsDir: './test-artifacts',
defaultChainId: 1337,
ports: {
Expand Down Expand Up @@ -54,7 +53,6 @@ describe('isE2EConfig', () => {
environment: 'prod',
extensionName: 'MetaMask',
defaultPassword: 'password123',
toolPrefix: 'mm',
defaultChainId: 1,
};

Expand Down Expand Up @@ -93,7 +91,6 @@ describe('isProdConfig', () => {
environment: 'prod',
extensionName: 'MetaMask',
defaultPassword: 'password123',
toolPrefix: 'mm',
artifactsDir: './artifacts',
defaultChainId: 1,
};
Expand All @@ -119,7 +116,6 @@ describe('isProdConfig', () => {
environment: 'e2e',
extensionName: 'MetaMask',
defaultPassword: 'password123',
toolPrefix: 'mm',
artifactsDir: './test-artifacts',
defaultChainId: 1337,
ports: {
Expand Down Expand Up @@ -438,3 +434,34 @@ describe('hasCapability', () => {
expect(hasCapability(context, 'mockServer')).toBe(true);
});
});

describe('WorkflowContext with allocatedPorts', () => {
it('accepts allocatedPorts with port mappings', () => {
const context: WorkflowContext = {
config: {
environment: 'e2e',
extensionName: 'MetaMask',
},
allocatedPorts: {
anvil: 3000,
fixture: 4000,
},
};

expect(context.allocatedPorts).toStrictEqual({
anvil: 3000,
fixture: 4000,
});
});

it('allows WorkflowContext without allocatedPorts (field is optional)', () => {
const context: WorkflowContext = {
config: {
environment: 'e2e',
extensionName: 'MetaMask',
},
};

expect(context.allocatedPorts).toBeUndefined();
});
});
7 changes: 5 additions & 2 deletions src/capabilities/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import type {
MockServerCapability,
} from './types.js';

/** Sparse port-name → port-number map. `Partial` ensures lookups resolve to `number | undefined`. */
export type PortMap = Partial<Record<string, number>>;

/**
* Environment mode discriminator.
* - 'e2e': End-to-end testing environment with local chain, fixtures, and contract seeding
Expand All @@ -22,8 +25,6 @@ export type BaseEnvironmentConfig = {
extensionName: string;
/** Default password for wallet unlock operations */
defaultPassword?: string;
/** Prefix for MCP tool names (e.g., "mm" -> "mm_build", "mm_launch") */
toolPrefix?: string;
/** Directory for storing screenshots and other artifacts */
artifactsDir?: string;
};
Expand Down Expand Up @@ -112,6 +113,8 @@ export type WorkflowContext = {
stateSnapshot?: StateSnapshotCapability;
mockServer?: MockServerCapability;
config: EnvironmentConfig;
/** Port metadata reported back to core from the contextFactory. Used for DaemonState persistence and /status endpoint. */
allocatedPorts?: PortMap;
};

/**
Expand Down
5 changes: 5 additions & 0 deletions src/capabilities/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ export type ExtensionState = {
networkName: string | null;
chainId: number | null;
balance: string | null;
activeTab?: {
role: string;
url: string;
title?: string;
};
};

export type LaunchOptions = {
Expand Down
Loading
Loading