Turn TypeScript Into
AI-Ready Context
The Context Compiler for TypeScript. Deterministic architectural contracts with strict diffs and AST-level guarantees. One-time setup, up to 70% token savings.
Fast • Deterministic • Open Source
npm install -g logicstamp-contextLogicStamp MCP Server
Native integration with Claude Desktop, Claude Code, and Cursor.
Turn TypeScript IntoAI-Ready ContextTurn TypeScript Into AI-Ready Context
The Context Compiler for TypeScript. Deterministic architectural contracts with strict diffs and AST-level guarantees. One-time setup, up to 70% token savings.
Fast • Deterministic • Open Source
npm install -g logicstamp-contextLogicStamp MCP Server
Native integration with Claude Desktop, Claude Code, and Cursor. AI assistants can analyze your codebase directly through LogicStamp's MCP server.
LogicStamp in Action
Open Source, Built for Developers
LogicStamp is 100% open source and community-driven. Contribute code, report issues, suggest features, or just star the repo to show your support.
Structured context
Generated from your TypeScript codebase. LogicStamp turns your project into structured JSON: contracts, dependencies, and optional style metadata - so tools can use real context instead of copy-paste.
Backend: New & Experimental
Manual context in chat
Pasting large files and re-explaining how pieces connect for every task
It is easy to omit dependents, repeat how the repo fits together, and spend tokens on boilerplate the model may not need for a given task.
Generated context artifacts
Run the CLI once (or in watch mode). Typical mid-sized repos finish in seconds; exact time depends on size, mode, and hardware.
$ stamp context emits bundle files with dependency metadata. Header-oriented modes typically use fewer tokens than pasting raw source; savings depend on your project and configuration.
What you get
Static analysis outputs you can regenerate and diff - not one-off prompts
Smaller bundles vs raw source
Header-oriented modes drop imports and implementation noise and keep contracts and signatures—often a large token reduction compared to pasting whole files.
Dependency graphs in the output
Bundles include how components and modules connect—imports and relationships—so context reflects structure, not a single isolated file.
Watch mode for fresh bundles
Regenerate context when files change, with incremental rebuilds. Optional strict watch can flag breaking contract changes while you refactor.
MCP server for compatible clients
Expose bundles and project context to Cursor, Claude Desktop, Claude CLI, and other MCP-capable tools instead of manually assembling prompts.
Same inputs, comparable bundles. LogicStamp is designed so repeated runs produce consistent artifacts from your tree: MCP can query them live, or you can commit or diff the generated JSON like any other build output.
How it works
$ npm i -g logicstamp-context changed 1 package, and audited 3 packages in 1s found 0 vulnerabilities $ stamp context 🔍 Scanning /project/src... Found 24 files 🔨 Analyzing components... Analyzed 24 components 📊 Building dependency graph... 📋 Using profile: llm-chat (depth=2, header only, max 100 nodes) 📦 Compiling context for 22 root components (depth=2)... 🔍 Validating generated context... ✅ Validation passed 📝 Writing context files for 5 folders... ✓ context.json (2 bundles) ✓ src/context.json (3 bundles) ✓ src/components/context.json (5 bundles) ✓ src/utils/context.json (2 bundles) ✓ app/context.json (3 bundles) 📝 Writing main context index... ✓ context_main.json (index of 5 folders) ✅ 6 context files written successfully 📊 Summary: Total components: 24 Root components: 22 Leaf components: 20 Bundles generated: 22 Total nodes in context: 25 Total edges: 3 Missing dependencies: 0 📏 Token Estimates (header mode): GPT-4o-mini: 14,484 | Full code: ~41,383 (~65% savings) Claude: 12,875 | Full code: ~36,785 (~65% savings) 📊 Mode Comparison: none: ~8,691 tokens header: ~14,484 tokens full: ~41,383 tokens ⏱ Completed in 3225ms▋
Works with your favorite tools
Seamlessly integrate with your existing development workflow and boost productivity
Model Context Protocol
FeaturedUse LogicStamp Context as an MCP server for AI assistants like Claude Desktop. Get real-time codebase analysis, component contracts, and structured context bundles directly in your AI workflow.
- Watch mode integration
- Context bundle access
- Real-time codebase queries
Supported Frameworks
AI-ready context compilation for modern frontend frameworks and TypeScript codebases.
TypeScript-first by design
LogicStamp Context currently analyzes .ts and .tsx files only. JavaScript .js and .jsxfiles are not analyzed yet, so components written in JS won't appear in context bundles.
React
Compile React components into contracts with hooks, props, and JSX structure
- Props signature extraction
- Hook dependency analysis
- Component structure contracts
Next.js
Full support for Next.js with App Router and Server Components
- App Router context bundles
- Server/Client component detection
- Route dependency graphs
TypeScript
Deep TypeScript compilation for types, interfaces, and generics
- Type signature extraction
- Interface documentation
- Generic parameter tracking
Watch Mode
Auto-regenerate context on file changes with incremental rebuilds and change detection
- Incremental rebuilds
- Change detection (props, hooks, state)
- Debounced regeneration
Express.js & NestJS
Compile backend routes, API handlers, controllers, and extract API signatures from Node.js code
- Route & controller extraction
- API signature detection
- Decorator & middleware analysis
UI Frameworks
Support for Tailwind CSS, Material UI, ShadCN/UI, Radix UI, Styled Components, and Framer Motion
- Style metadata extraction
- Component library detection
- Design system analysis
JavaScript & JSX
Support for JavaScript and JSX files in addition to TypeScript
- JavaScript file analysis
- JSX component detection
- JSDoc type inference
Vue Single File Components
Vue 3 Composition API support for TypeScript/TSX files available now. Single File Component (.vue) support coming soon
- Composition API tracking (TS/TSX)
- Props and emits extraction
- .vue SFC support planned
MCP Enhancements
Advanced MCP server features for better AI assistant integration and workflow automation
- Semantic component search
- Git baseline comparisons
- Streaming for large bundles
Development Tools
Works with your existing development tools and CI/CD pipelines
All trademarks and logos are the property of their respective owners. LogicStamp is an independent open-source project and is not affiliated with or endorsed by the listed frameworks or tools.
Frequently asked questions
LogicStamp Context is a context compiler: it parses your TypeScript codebase and compiles it into deterministic, structured JSON bundles for AI tools.
It extracts architectural contracts like props, state, hooks, events, exports, and dependencies, then organizes them into stable, diffable, token-efficient context.
This gives AI assistants a more accurate view of your project without relying on guesswork.
Run `stamp context` to generate the bundles.
Pasting raw code wastes tokens on boilerplate, imports, and redundant formatting.
LogicStamp Context compiles only what AI needs - deterministic architectural contracts, dependency relationships, and logic signatures - saving up to 65% tokens compared to full source code.
Plus, it provides structured context that AI can actually parse and understand, not just raw text.
Yes. LogicStamp Context is completely free and open-source.
Install it globally with `npm i -g logicstamp-context` and generate AI-ready context bundles immediately.
MCP integration is also available via `logicstamp-mcp` for real-time analysis in Cursor, Claude Desktop, and Claude CLI.
LogicStamp Context currently supports TypeScript codebases including React, Next.js, Express, and NestJS, plus Vue 3 TypeScript/TSX files.
Requires Node.js 20+.
MCP integration is available for Cursor, Claude Desktop, and Claude CLI.
Works with any React/TypeScript styling approach, including Tailwind, CSS modules, SCSS, styled-components, Material UI, ShadCN/UI, Radix UI, and Framer Motion.
Note: Vue Single File Components (`.vue`) are planned for a future release.
Run `npx logicstamp-context context` to get started instantly, or install it globally with `npm i -g logicstamp-context`.
Optionally run `stamp init` in your project directory to set up recommended defaults.
Then run `stamp context` to generate `context.json` bundles plus a `context_main.json` index for AI-ready codebase understanding.
You can validate the output with `stamp context validate`, or use MCP integration for real-time analysis in supported clients.
MCP (Model Context Protocol) provides real-time context analysis directly in Cursor, Claude Desktop, or Claude CLI.
Setup (one-time, global):
1. Install LogicStamp CLI: `npm install -g logicstamp-context`
2. Install MCP server: `npm install -g logicstamp-mcp`
3. Configure your MCP client by adding LogicStamp to your config file:
- Cursor: `~/.cursor/mcp.json` (macOS/Linux) or `%USERPROFILE%\.cursor\mcp.json` (Windows)
- Claude CLI: `~/.claude.json` (macOS/Linux) or `%USERPROFILE%\.claude.json` (Windows)
- Claude Desktop: `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows)
Add this configuration:
{ "mcpServers": { "logicstamp": { "command": "npx", "args": ["logicstamp-mcp"] } } }After setup, restart your MCP client. The AI can then use LogicStamp tools to analyze your codebase in real-time. See the MCP documentation at logicstamp.dev/docs/mcp for detailed platform-specific instructions.
LogicStamp Context offers three code inclusion modes: `none` (contracts only, ~79% savings vs full context), `header` (recommended, ~65% savings vs full context, ~70% vs raw source), and `full` (complete source).
The header mode compiles just enough context for AI to understand component logic without wasting tokens on implementation details.
Additionally, you can use `--format toon` for an alternative output format (a compact text-based format) that uses ~40% fewer tokens than JSON while maintaining the same data structure.
Use `stamp context --compare-modes` to see exact savings for your codebase.
Token counts are automatically calculated using model-accurate tokenizers (GPT-4 and Claude) when available, or character-based estimation as a fallback.
LogicStamp Context compiles per-root bundles (one bundle per page/feature component) rather than individual files per component.
Each bundle contains the root component plus its complete dependency graph - all related components together.
This design matches how developers work: when you need help with a specific page or feature, share that bundle and the AI has complete context in one self-contained unit.
The `stamp context style` command compiles context bundles with visual and layout metadata included.
It extracts style information from your components including Tailwind CSS classes, SCSS/CSS modules, inline styles, styled-components/Emotion, framer-motion animations, Material UI, ShadCN/UI, Radix UI, and Styled JSX.
This enables AI assistants to understand visual design, suggest visually consistent components, analyze layout patterns, track color palettes, and identify animations.
Use it when you need AI to understand the visual aspects of your UI (design system analysis, styling questions, visual consistency checks). For logic-only questions, use regular `stamp context` to save tokens. Note: Style metadata adds more tokens (~52-65% of raw source vs ~30% for header mode), so use `--compare-modes` to see the exact cost impact for your codebase.
Yes. Run `stamp context --watch` to automatically regenerate context files when source files change.
It supports incremental rebuilds, change detection, debouncing, and optional style file watching.
For stricter development workflows, `--strict-watch` detects breaking changes and writes violations to `.logicstamp/strict_watch_violations.json` when needed.
Watch mode is designed for development awareness rather than CI enforcement. For CI with exit codes, use `stamp context compare`.
No. LogicStamp is completely read-only.
It analyzes your codebase using the TypeScript AST and generates structured context bundles without modifying any source files.
All output is written to context files that you can share with AI assistants.
Ready to compile your codebase into AI-ready context?
Compile AI-ready context from your codebase in seconds.
Fast, deterministic, one-time setup.
"Stop pasting code. Start sharing structured context bundles that AI actually understands. LogicStamp compiles your codebase into deterministic architectural contracts with built-in token optimization."— LogicStamp