Architecture

How ContextWeaver works

An AI agent swarm where each agent is a specialist MCP server. They collaborate through a Manager that orchestrates the full pipeline from API spec to production-ready code.

The Pipeline

Six steps to your MCP server

YouStep 1

Submit OpenAPI Spec

Paste a URL to any OpenAPI 3.x or Swagger 2.0 specification. We accept JSON and YAML formats.

  • Supports OpenAPI 3.0, 3.1, and Swagger 2.0
  • Automatic format detection (JSON/YAML)
  • URL validation and reachability check
LibrarianStep 2

Analyze & Parse

The Librarian agent fetches your spec, resolves all $ref references, and extracts a structured representation of every endpoint.

  • Resolves circular $ref references
  • Extracts endpoint schemas & parameters
  • Detects authentication patterns
  • Maps request/response data types
ArchitectStep 3

Generate Code

The Architect agent uses Claude to generate a complete TypeScript MCP server with type-safe tools for every API endpoint.

  • Tool definitions for each endpoint
  • Full TypeScript interfaces & types
  • Error handling & retry logic
  • README.md & package.json included
TesterStep 4

Validate & Test

The Tester agent checks the generated code for syntax errors, type errors, and MCP protocol compliance.

  • TypeScript compiler validation (tsc --noEmit)
  • MCP protocol schema verification
  • Tool definition completeness check
  • Import & dependency validation
HealerStep 5

Self-Correct

If the Tester finds issues, the Healer agent automatically applies targeted fixes and re-validates. Up to 3 retry cycles.

  • Targeted fix for each error type
  • Preserves working code sections
  • Max 3 heal cycles to prevent loops
  • Falls back to human review if needed
If tests fail, loops back to Healer (max 3 cycles)
ManagerStep 6

Package & Deliver

The Manager orchestrates the entire pipeline and packages the final output as a downloadable .zip with all files ready to run.

  • Orchestrates agent sequencing
  • Packages index.ts, README, package.json
  • Generates download archive
  • Provides real-time progress updates
Under the Hood

Agent-to-Agent Communication

Each agent is a standalone MCP server. The Manager connects to them as an MCP client, calling tools and receiving structured responses.

Manager

Orchestrator

MCP Client

Librarian

MCP Server

Architect

MCP Server

Tester

MCP Server

Healer

MCP Server

Built With

Technology Stack

Next.js 16

React framework with App Router

TypeScript

End-to-end type safety

MCP SDK

Model Context Protocol tooling

Claude API

Anthropic AI for code generation

Zustand

Lightweight state management

Framer Motion

Smooth animations & transitions

Ready to try it?

Paste any OpenAPI spec and watch the agents work in real-time.