How microsoft/autogenesis works
1. Repository shape
- AutoGenesis is a multi-package monorepo centered on AI-assisted test automation.
- It has three main product surfaces: a VS Code extension, a Python MCP server for mobile/mac automation, and a Python MCP server for Windows desktop automation.
- A small behave-demo project acts as a sample BDD consumer of the toolchain.
2. VS Code extension: bdd_ai_toolkit/
- This is the orchestration and authoring layer.
- It provides BDD feature support, UI surfaces, file watching, code generation, and Copilot/MCP integration.
- The extension is split into:
- core/gherkin for parsing features, scenarios, backgrounds, and steps
- core/matching for mapping feature steps to step definitions
- providers/ for editor UI such as CodeLens, decorations, and a webview
- services/ for automation status, dry runs, file watching, and Copilot integration
- setup/ for environment preparation and MCP server lifecycle management
- tools/ for higher-level generators and input adapters
3. BDD processing pipeline in the extension
- The extension reads .feature files, extracts Gherkin structure, and matches steps against existing step definitions.
- It caches parsed features, Python file metadata, automation status, and step matches to keep editor feedback responsive.
- That pipeline drives editor affordances such as code lenses, decorations, and the automation details webview.
4. Automation generation and analysis tools
- The extension includes utilities for generating test cases and converting external inputs into automation-ready artifacts.
- Notable inputs include natural language tasks, Figma-derived content, and XMind diagrams.
- This is the layer that turns user intent or design artifacts into BDD/test-case output rather than executing automation itself.
5. Mobile/mac automation server: appium-mcp-server/
- This Python package exposes platform automation capabilities through MCP-style tools.
- It is organized around platform-specific driver tools for Android, iOS, macOS, and shared Appium operations.
- driver_session.py holds session state, while tools/ contains the executable automation actions.
6. Windows automation server: pywinauto-mcp-server/
- This is the Windows desktop counterpart, built around pywinauto rather than Appium.
- Its tool set is smaller and Windows-focused: common actions, mouse operations, verification, and code generation.
- app_session.py manages the automation session boundary for the desktop app under test.
7. Shared server patterns across Python packages
- Both Python servers have a similar internal shape: configuration, LLM prompt/chat support, tool handlers, and shared utilities.
- Common utilities handle logging, element inspection, response formatting, and generated-code support.
- Each server can be run standalone through a simple server entry point, which keeps the automation back end decoupled from the VS Code extension.
8. Configuration and runtime setup
- Both MCP servers are configuration-driven, with templates or JSON config files under conf/.
- The VS Code extension has a substantial setup subsystem for locating Python, managing environments, launching terminals, installing or starting MCP servers, and platform detection.
- This setup layer is important because the extension does not just call APIs; it also provisions the local automation runtime.
9. External dependencies and execution boundaries
- The mobile/mac path depends on Appium and, for some flows, cloud/device services such as BrowserStack as described in the README.
- The Windows path depends on native Windows UI automation via pywinauto.
- The extension sits above those runtimes and coordinates them; the Python servers sit at the boundary between editor workflows and OS/device automation.
10. Sample consumer project
- behave-demo/ shows the expected BDD output shape: feature files, environment hooks, and step definitions.
- It is useful as a reference for how generated tests or recorded steps are expected to be organized and executed.
11. Overall data flow
- Typical flow is: user writes or generates a feature/test case in VS Code → extension parses and matches BDD steps → extension may dry-run or request automation actions → extension launches/contacts the appropriate MCP server → server invokes the platform driver or UI automation library → results and status flow back to the extension for editor feedback.
12. Key architectural boundary
- The most important boundary is between the authoring/intelligence layer in bdd_ai_toolkit and the execution layer in the two Python MCP servers.
- That separation lets the repo support multiple platforms with a shared user experience while keeping each automation backend platform-specific.
Main entry points: appium-mcp-server/simple_server.py Appium server · pywinauto-mcp-server/simple_server.py Windows server · extension.ts Extension entry · AutomationStatusService.ts Automation services
Components 24
VS Code extension
Authoring, orchestration, BDD processing, and runtime setup layer.
- Extension entry · Top-level VS Code extension activation and integration point.
bdd_ai_toolkit/src/extension.ts - BDD core · Parses features and extracts Gherkin structure for downstream analysis.
bdd_ai_toolkit/src/bdd-feature-support/core/gherkin/FeatureParser.ts - Step matching · Loads step definitions and matches feature steps to implementation patterns.
bdd_ai_toolkit/src/bdd-feature-support/core/matching/StepMatcher.ts - Caches · Caches parsed features, Python metadata, automation status, and step matches.
bdd_ai_toolkit/src/bdd-feature-support/cache/UnifiedCacheManager.ts - UI providers · CodeLens, decorations, and webview surfaces for BDD feedback.
bdd_ai_toolkit/src/bdd-feature-support/providers/WebviewProvider.ts - Automation services · Dry runs, status tracking, file watching, and Copilot integration.
bdd_ai_toolkit/src/bdd-feature-support/services/AutomationStatusService.ts - Setup system · Locates Python, manages environments, launches terminals, and starts MCP servers.
bdd_ai_toolkit/src/setup/mcpServerManager.ts - Authoring tools · Transforms natural language, Figma, and XMind inputs into test-case artifacts.
bdd_ai_toolkit/src/tools/testCaseGenerator.ts - Prompt templates · Shared prompt definitions used by extension-side generation and assistant flows.
bdd_ai_toolkit/src/constants/prompts.ts
Mobile/mac server
Appium-backed MCP execution layer for Android, iOS, and macOS automation.
- Appium server · Standalone server entry for mobile and macOS automation tools.
appium-mcp-server/simple_server.py - Driver session · Holds active Appium session state and runtime context.
appium-mcp-server/driver_session.py - Driver tools · Android, iOS, macOS, and shared Appium automation actions.
appium-mcp-server/tools/appium_driver_tool.py - LLM support · Chat and prompt helpers for model-assisted server behavior.
appium-mcp-server/llm/chat.py - Shared utils · Logging, element inspection, config handling, and response formatting.
appium-mcp-server/utils/config_manager.py - Config template · Template configuration for the Appium-based server runtime.
appium-mcp-server/conf/appium_conf.template.json
Windows server
pywinauto-backed MCP execution layer for Windows desktop automation.
- Windows server · Standalone server entry for Windows desktop automation tools.
pywinauto-mcp-server/simple_server.py - App session · Tracks the active desktop application session boundary.
pywinauto-mcp-server/app_session.py - Desktop tools · Windows actions for common operations, mouse input, verification, and code generation.
pywinauto-mcp-server/tools/common_tool.py - LLM support · Chat and prompt helpers for model-assisted server behavior.
pywinauto-mcp-server/llm/chat.py - Shared utils · Logging, element inspection, code generation, and response formatting.
pywinauto-mcp-server/utils/gen_code.py - Config file · JSON configuration for the Windows automation server.
pywinauto-mcp-server/conf/pywinauto_conf.json
Sample consumer
Minimal BDD project showing the expected generated/test output shape.
- Demo features · Sample feature file demonstrating expected BDD structure.
behave-demo/features/demo.feature - Step defs · Sample step-definition package for the demo consumer project.
behave-demo/features/steps/__init__.py - Env hooks · Sample environment hooks for the demo consumer project.
behave-demo/features/environment.py
Connections 26
- Extension entry → BDD core: parse features · Reads .feature files and extracts scenarios, backgrounds, and steps.
- Extension entry → Step matching: match steps · Maps feature steps to step definitions for editor feedback.
- BDD core → Caches: cache parsed data · Stores parsed Gherkin structure for responsive reuse.
- Step matching → Caches: cache matches · Stores resolved step matches and lookup results.
- Caches → UI providers: drive ui · Feeds CodeLens, decorations, and webview state.
- Automation services → Caches: read/write · Uses shared caches for status, file watching, and dry-run flows.
- Extension entry → Automation services: orchestrate · Coordinates automation status, file watching, and Copilot integration.
- Extension entry → Setup system: provision runtime · Finds Python, manages environments, and launches MCP servers.
- Authoring tools → Prompt templates: use prompts · Uses prompt templates for generation and transformation workflows.
- Authoring tools → Demo features: emit bdd · Produces test-case and feature-shaped outputs for consumer projects.
- Setup system → Appium server: start server · Launches or connects to the mobile/mac automation backend.
- Setup system → Windows server: start server · Launches or connects to the Windows automation backend.
- Appium server → Driver session: manage session · Initializes and uses active device/session state.
- Appium server → Driver tools: expose tools · Publishes platform automation actions through MCP-style tools.
- Driver tools → Shared utils: shared helpers · Uses common utilities for config, logging, element inspection, and formatting.
- Driver tools → LLM support: assist prompts · Uses chat/prompt support where model assistance is needed.
- Appium server → Config template: load config · Reads configuration template or JSON config at startup.
- Windows server → App session: manage session · Initializes and uses active desktop application session state.
- Windows server → Desktop tools: expose tools · Publishes Windows automation actions through MCP-style tools.
- Desktop tools → Shared utils: shared helpers · Uses common utilities for code generation, element inspection, and formatting.
- Desktop tools → LLM support: assist prompts · Uses chat/prompt support where model assistance is needed.
- Windows server → Config file: load config · Reads JSON configuration at startup.
- Automation services → Appium server: request actions · Routes automation requests toward the Appium-based execution layer.
- Automation services → Windows server: request actions · Routes automation requests toward the Windows execution layer.
- Demo features → Step defs: bind steps · Feature scenarios are intended to map to step definitions.
- Env hooks → Step defs: support run · Environment hooks support execution of the sample BDD suite.