Skip to content

SKfaizan-786/contextweaver

Repository files navigation

ContextWeaver Banner

Logo ContextWeaver ✨

Weaving APIs into the Model Context Protocol

Paste an API URL. Get a production-ready MCP server. In under 3 minutes.

An AI agent swarm that analyzes, generates, validates, and self-heals TypeScript MCP servers from any OpenAPI specification — powered by Archestra.


License: MIT TypeScript Next.js React Tailwind CSS

Archestra Hackathon PRs Welcome


🌐 Live Demo · 📺 Watch Video · 💻 GitHub

Quick Start · How It Works · Features · Architecture · Docs




🎯 The Problem

The Model Context Protocol is reshaping how AI agents interact with external services. But there's a gap:

  • ~800 MCP servers exist today
  • Millions of APIs have OpenAPI/Swagger specs
  • Building one MCP server manually takes 2–3 days
  • Each requires: spec parsing, tool definitions, type safety, error handling, testing, documentation

The "long tail" of APIs remains unreachable for AI agents. Teams can't justify spending days of engineering time per API when they have dozens — or hundreds — to integrate.

  ╔══════════════════════╗
  ║  🌍 Millions of APIs ║
  ╠══════════════════════╣
  ║                      ║
  ║   ┌──────────────┐   ║
  ║   │  ~800 MCP    │   ║
  ║   │  Servers     │   ║
  ║   └──────────────┘   ║
  ║                      ║
  ║   The gap is HUGE    ║
  ╚══════════════════════╝

💡 The Solution

ContextWeaver bridges this gap. Paste an API URL, and an AI agent swarm produces a typed, tested, production-ready MCP server — automatically.


ContextWeaver deploys four specialized AI agents that work as a pipeline. Each agent has a single responsibility, and together they produce results no single prompt could achieve:

📚

The Librarian

API Discovery

Parses OpenAPI 3.0 & Swagger 2.0 specs. Extracts every endpoint, parameter, auth scheme, and data model into a structured schema.

🏗️

The Architect

Code Generation

Transforms the structured schema into a complete TypeScript MCP server with typed tool definitions, error handling, and proper interfaces.

🧪

The Tester

Validation

Runs structural validation across imports, handler signatures, JSON schemas, and syntax. Catches issues before they reach users.

🔧

The Healer

Self-Correction

Automatically patches detected issues — missing imports, broken types, malformed JSON. Retries up to 3 times before escalating to the user.


⚡ API URL → Working MCP Server → Under 3 Minutes → Zero Manual Coding

🎨 See It In Action

ContextWeaver generating MCP server

ContextWeaver successfully generating an MCP server for JSONPlaceholder API




🚀 Quick Start

Get ContextWeaver running locally in under 60 seconds:

# Clone
git clone https://github.com/SKfaizan-786/contextweaver.git
cd contextweaver

# Install & launch
cd web
npm install
npm run dev

Open http://localhost:3000 → paste an API URL → click "Weave Server" → done.

Or try it live: contextweaver-nu.vercel.app (No installation required!)

🧪 Try These APIs

API Complexity URL
🐾 PetStore Simple https://petstore3.swagger.io/api/v3/openapi.json
📝 JSONPlaceholder Simple https://jsonplaceholder.typicode.com
🌐 httpbin Medium https://httpbin.org/spec.json



⚙️ How It Works

🎬 Watch the Agent Swarm in Action

Agent Pipeline Progress

Real-time agent orchestration showing Librarian, Architect, Tester, and Healer working together



  ┌─────────────────────────────────────────────────────────────┐
  │                     USER PASTES API URL                     │
  └──────────────────────────┬──────────────────────────────────┘
                             │
                             ▼
  ┌──────────────────────────────────────────────────────────────┐
  │  📚 LIBRARIAN                                                │
  │  Parse OpenAPI spec → Extract endpoints, schemas, auth       │
  └──────────────────────────┬───────────────────────────────────┘
                             │ Structured API Schema
                             ▼
  ┌──────────────────────────────────────────────────────────────┐
  │  🏗️ ARCHITECT                                                │
  │  Generate TypeScript MCP server → Tools, types, handlers     │
  └──────────────────────────┬───────────────────────────────────┘
                             │ Generated Code
                             ▼
  ┌──────────────────────────────────────────────────────────────┐
  │  🧪 TESTER                                                   │
  │  Structural validation → Imports, handlers, JSON, syntax     │
  └──────────┬───────────────────────────────────┬───────────────┘
             │ ✅ Pass                           │ ❌ Fail
             ▼                                   ▼
  ┌─────────────────┐              ┌─────────────────────────────┐
  │  ✅ COMPLETE!   │              │  🔧 HEALER                  │
  │  Download .zip  │              │  Auto-fix → Re-validate     │
  │  Ready to use   │              │  (max 3 retries)            │
  └─────────────────┘              └──────────────┬──────────────┘
                                                  │ Patched Code
                                                  ▼
                                        ┌───────────────────┐
                                        │ 🧪 TESTER (retry) │
                                        └───────────────────┘

What You Get

Every generated MCP server is a complete, ready-to-deploy package:

my-api-mcp-server/
├── index.ts          # Full MCP server — typed tools for every endpoint
├── package.json      # Dependencies, scripts, metadata
├── README.md         # Setup instructions tailored to YOUR API
└── .env.example      # Environment variables for auth/config

Deploy in 30 Seconds

# Install and run
npm install && npm start

Then add it to Claude Desktop, Cursor, or any MCP client:

{
  "mcpServers": {
    "my-api": {
      "command": "node",
      "args": ["dist/index.js"]
    }
  }
}

That's it. Your API is now accessible to every AI agent on your machine.




🧪 Validation & Proof

Real MCP Servers, Real Results — Here's proof that ContextWeaver generates fully functional MCP servers:

Generated Code Quality

Generated TypeScript Code

Clean, production-ready TypeScript code with proper MCP protocol implementation


PetStore API Integration

PetStore Server Success

Successfully generated MCP server for Swagger PetStore API


Real API Tool Execution

Find Pet By Status Get Pet By ID
Get Inventory Login User

MCP Inspector showing live API calls through the generated server - these tools are fully functional and returning real data from the PetStore API


All generated servers:

  • Pass MCP protocol validation
  • Execute real API calls successfully
  • Include proper error handling
  • Support multiple endpoints
  • Work seamlessly with Claude Desktop, Cursor, and other MCP clients



✨ Features

🧠 Intelligent Generation

  • OpenAPI 3.0 & Swagger 2.0 — universal spec support
  • Full TypeScript — proper interfaces, enums, and types
  • Self-healing pipeline — autonomous bug fixing (max 3 retries)
  • Error handling — try/catch, retry logic, graceful degradation
  • One-click download — complete .zip with all files

🎨 Beautiful Frontend

  • 7 polished pages — Landing, Generate, Result, Explore, About, History, Settings
  • Dark / Light mode — system preference, smooth toggle, zero flash
  • Framer Motion — page transitions, micro-interactions, spring animations
  • Shiki highlighting — per-language syntax themes (TS, MD, JSON)
  • Radix UI — accessible tabs, dialogs, tooltips (WCAG compliant)

⚡ Production Architecture

  • 4-agent pipeline — Librarian → Architect → Tester → Healer
  • 651-line engine — complete orchestration with state management
  • 4 API routes — generate, status, result, download (fully wired)
  • Zustand store — shared state across all pages
  • Archestra Gateway — JSON-RPC 2.0 MCP client

🎯 Developer Experience

  • Real-time progress — live agent pipeline with log feed
  • API gallery — browse & try pre-configured example APIs
  • Responsive design — mobile-first, pipeline adapts to screen
  • 40+ design tokens — comprehensive CSS custom property system
  • 9 UI components — CVA variants, consistent teal/neutral palette



🏗️ Architecture

System Overview

┌─────────────────────────────────────────────────────────────────────┐
│                        CONTEXTWEAVER                                │
├──────────────────────┬──────────────────────────────────────────────┤
│                      │                                              │
│   ┌──────────────┐   │   ┌────────────────────────────────────┐     │
│   │  Next.js 16  │   │   │         Agent Pipeline             │     │
│   │  Frontend    │   │   │                                    │     │
│   │              │   │   │  ┌──────┐  ┌──────┐  ┌──────┐     │     │
│   │  • 7 Pages   │◄──┼──►│  │ 📚   │→ │ 🏗️   │→ │ 🧪   │     │     │
│   │  • 9 UI Comp │   │   │  └──────┘  └──────┘  └──┬───┘     │     │
│   │  • Zustand   │   │   │                         │         │     │
│   │  • Shiki     │   │   │              ┌──────┐   │         │     │
│   │  • Framer    │   │   │              │ 🔧   │◄──┘         │     │
│   │              │   │   │              └──────┘             │     │
│   └──────────────┘   │   └────────────────────────────────────┘     │
│                      │                                              │
│   4 API Routes       │   Archestra MCP Gateway (JSON-RPC 2.0)       │
│   POST /api/generate │   Full observability & orchestration         │
│   GET  /api/status   │                                              │
│   GET  /api/result   │                                              │
│   GET  /api/download │                                              │
│                      │                                              │
└──────────────────────┴──────────────────────────────────────────────┘

Archestra Integration

ContextWeaver uses every major Archestra platform capability:

Archestra Feature How We Use It
Multi-Agent Orchestration 4 agents coordinated through a single pipeline
Centralized Runtime All agents in Archestra's containerized environment
MCP Gateway Inter-agent communication via JSON-RPC 2.0
Observability Real-time agent activity stream & token tracking
Security & RBAC Human-in-the-loop checkpoints for sensitive operations
Cost Controls Token budgets per generation, automatic shutdown on exceeded
MCP Server Exposure ContextWeaver itself can be an MCP server

Full Architecture Documentation




🛠️ Technology Stack



Next.js 16


React 19


TypeScript


Tailwind v4


Framer Motion


Radix UI
Layer Technologies
Framework Next.js 16 (App Router) · React 19 · TypeScript 5.8 (strict)
Styling Tailwind CSS v4 · 40+ CSS design tokens · Geist Sans & Mono
Components Radix UI (Tabs, Dialog, Tooltip) · CVA variants · Lucide icons
Animation Framer Motion 12 — page transitions, springs, micro-interactions
State Zustand 5 — shared store across all pages
Syntax Shiki 3 — server-side, per-language, github-light / vitesse-dark
Theming next-themes — system/light/dark, class-based, no flash
API Parsing @apidevtools/swagger-parser · @modelcontextprotocol/sdk
Packaging JSZip — client-side .zip generation
Orchestration Archestra.ai — multi-agent runtime, MCP Gateway, observability



📁 Project Structure

contextweaver/
│
├── web/                            ← Next.js 16 Frontend
│   ├── app/
│   │   ├── page.tsx                    Landing page (hero, input, gallery)
│   │   ├── generate/[id]/page.tsx      Real-time generation progress
│   │   ├── result/[id]/page.tsx        Code preview + download
│   │   ├── explore/page.tsx            API gallery with search
│   │   ├── about/page.tsx              How It Works — pipeline explainer
│   │   ├── history/page.tsx            Generation history
│   │   ├── settings/page.tsx           Theme, API key, retry config
│   │   └── api/
│   │       ├── generate/route.ts       POST  — start generation
│   │       ├── status/[id]/route.ts    GET   — poll progress
│   │       ├── result/[id]/route.ts    GET   — retrieve code
│   │       └── download/[id]/route.ts  GET   — download .zip
│   │
│   ├── components/ui/              ← 9 Reusable Components
│   │   ├── navbar.tsx                  Responsive nav + theme toggle
│   │   ├── footer.tsx                  Site footer
│   │   ├── button.tsx                  CVA variants + Framer Motion
│   │   ├── code-block.tsx              Shiki syntax highlighting
│   │   ├── card.tsx                    Hover glow cards
│   │   ├── badge.tsx                   Status badges (active/done/error)
│   │   ├── skeleton.tsx                Loading placeholders
│   │   ├── animated-container.tsx      Motion wrapper (fade-up + stagger)
│   │   └── theme-toggle.tsx            Sun/moon theme cycling
│   │
│   └── lib/
│       ├── engine.ts               ← 4-agent pipeline (651 lines)
│       ├── store.ts                    Zustand state management
│       ├── archestra-client.ts         Archestra MCP Gateway client
│       ├── utils.ts                    cn() utility
│       └── fallback-specs/             Built-in OpenAPI specs
│
├── agents/                         ← Standalone MCP Agents
│   ├── librarian/index.ts              API Discovery agent
│   └── manager/index.ts                Orchestration agent
│
├── shared/                         ← Shared utilities
│   └── types/                          TypeScript type definitions
│
├── docs/                           ← Documentation
│   ├── architecture.md                 System architecture
│   ├── FRONTEND_BACKEND_INTEGRATION.md Backend integration guide
│   └── diagrams/                       Architecture diagrams
│
├── tests/                          ← Test suites
│   ├── e2e/                            End-to-end tests
│   ├── integration/                    Integration tests
│   └── fixtures/                       Test fixtures
│
├── SUBMISSION.md                   ← Hackathon submission
├── PRD.txt                         ← Product Requirements Document
├── day_wise_plan.txt               ← Development timeline
├── CONTRIBUTING.md                 ← Contribution guidelines
└── LICENSE                         ← MIT License



📊 By The Numbers

Metric Value
Lines of Engine Code 651
UI Components 9
Pages 7
API Routes 4
AI Agents 4
CSS Design Tokens 40+
Max Self-Heal Retries 3
Time to Generate < 3 min
Manual Coding Required 0



🏆 Hackathon

Built for the 2 Fast 2 MCP hackathon powered by Archestra.ai

February 8–15, 2026

Challenge: Best Use of Archestra
Goal: Expand the MCP ecosystem by automating server generation

🌐 Try Live Demo · 📺 Watch Video

Why ContextWeaver Wins

Criterion Our Answer
Potential Impact Millions of APIs could become MCP servers. ContextWeaver reduces 2-3 days → 3 minutes.
Creativity Self-healing agent swarm — AI that debugs its own output. No existing tool does this.
Technical Quality TypeScript strict, 651-line orchestration engine, 9 accessible components, production builds.
Aesthetics & UX One input field, one button. Real-time pipeline visualization. Dark/light. Responsive.
Best Use of Archestra Uses ALL 7 platform features — orchestration, gateway, RBAC, observability, cost controls.
Learning & Growth Deep dive into MCP protocol, multi-agent orchestration, and production AI systems.

SUBMISSION.md




🗺️ Roadmap

Status Feature
4-agent pipeline with self-healing
7-page frontend with dark/light mode
Shiki syntax highlighting (per-language)
One-click .zip download
Archestra MCP Gateway integration
Production deployment on Vercel
🔜 ContextWeaver as MCP server (meta-server: AI building AI)
🔜 OAuth 2.1 + PKCE authentication handling
🔜 CLI: npx contextweaver generate <api-url>
🔮 Multi-language support (Python MCP servers)
🔮 VS Code extension
🔮 GraphQL / gRPC → MCP conversion



📝 Documentation

Document Description
📐 Architecture System design, agent flow, data models
🔗 Frontend-Backend Integration Integration guide
Quick Start Getting started in 60 seconds
📋 PRD Product Requirements Document
📅 Development Plan Day-wise development timeline



🤝 Contributing

We welcome contributions! See CONTRIBUTING.md for the full guide.

git clone https://github.com/SKfaizan-786/contextweaver.git
cd contextweaver
git checkout -b feature/your-feature
# Make changes
git commit -m 'feat: your amazing feature'
git push origin feature/your-feature
# Open a Pull Request ✨

📄 License

MIT — see LICENSE.


🙏 Acknowledgments

Archestra
Multi-agent orchestration platform
Anthropic
Claude & MCP specification
Vercel
Next.js framework & deployment
MCP Community
Inspiration & support



ContextWeaver Logo

ContextWeaver ✨

Weaving APIs into the Model Context Protocol

Every API deserves an MCP server. Now they can have one.


🌐 Live Demo · 📺 Watch Video · 💻 GitHub · Issues · 2 Fast 2 MCP Hackathon


Made with ❤️ for the 2 Fast 2 MCP Hackathon

About

An autonomous multi-agent swarm orchestrated by Archestra to weave any API into the Model Context Protocol (MCP) in minutes.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors