Metadata-Version: 2.4
Name: anchor-stack
Version: 0.1.0
Summary: AI-friendly engineering foundation with stable versions, unified logging, and pluggable capability packs
Project-URL: Homepage, https://github.com/anchor-stack/anchor-stack
Project-URL: Documentation, https://github.com/anchor-stack/anchor-stack#readme
Project-URL: Repository, https://github.com/anchor-stack/anchor-stack
Project-URL: Issues, https://github.com/anchor-stack/anchor-stack/issues
Author: Anchor Stack Team
License: MIT
License-File: LICENSE
Keywords: ai,debug,engineering,mcp,scaffolding,template
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Code Generators
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: click<9.0.0,>=8.3.0
Requires-Dist: jinja2<4.0.0,>=3.1.6
Requires-Dist: mcp<2.0.0,>=1.25.0
Requires-Dist: pydantic-settings<3.0.0,>=2.12.0
Requires-Dist: pydantic<3.0.0,>=2.12.0
Requires-Dist: pyyaml<7.0.0,>=6.0.3
Requires-Dist: typing-extensions>=4.12.0
Provides-Extra: dev
Requires-Dist: mypy>=1.14.0; extra == 'dev'
Requires-Dist: pre-commit>=4.0.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.24.0; extra == 'dev'
Requires-Dist: pytest-cov>=6.0.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: ruff>=0.9.0; extra == 'dev'
Description-Content-Type: text/markdown

# Anchor Stack

Python 3.10+
MCP 1.25+
MIT License
PRs Welcome

**AI-Friendly Engineering Foundation**

*Stable versions, unified logging, and pluggable capability packs*

[English](./README.md) | [中文](./README_CN.md)

---

## Why Anchor Stack?

Have you ever experienced this?

> *"AI helped me write the code, but debugging took longer than writing it myself..."*

The problem isn't the AI - it's that **your project wasn't designed for AI collaboration**.

Anchor Stack solves this by creating projects that are:

| Problem | Solution |
|---------|----------|
| Inconsistent logging | Standardized `logger` module - AI knows exactly how to add logs |
| Environment chaos | Type-safe `config` module - no more `process.env` everywhere |
| Version conflicts | Curated dependency versions - tested and stable |
| AI confusion | Rules files that teach AI your project conventions |

## Features

- **Stable Stacks** - Curated technology stacks with version-locked dependencies
- **Unified Logging** - Standardized logging framework that AI understands
- **AI Rules** - Auto-generated rules for Claude, Cursor, Windsurf, and more
- **Pluggable Packs** - Add database, AI, auth capabilities on demand
- **MCP Native** - Works seamlessly with MCP-compatible AI tools

## Quick Start

### Installation

```bash
# Using pip
pip install anchor-stack

# Using uv (recommended)
uv pip install anchor-stack
```

### Configure Your AI Tool

Claude Desktop

Edit `%APPDATA%\Claude\claude_desktop_config.json` (Windows) or `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS):

```json
{
  "mcpServers": {
    "anchor-stack": {
      "command": "anchor-stack",
      "args": ["serve"]
    }
  }
}
```


Cursor

Edit `~/.cursor/mcp.json`:

```json
{
  "mcpServers": {
    "anchor-stack": {
      "command": "anchor-stack",
      "args": ["serve"]
    }
  }
}
```


VS Code (Copilot)

Edit `.vscode/settings.json`:

```json
{
  "mcp": {
    "servers": {
      "anchor-stack": {
        "command": "anchor-stack",
        "args": ["serve"]
      }
    }
  }
}
```


### Create Your First Project

Simply ask your AI assistant:

```
Create a Next.js project called "my-app" using Anchor Stack
```

The AI will use `scaffold_project` to create:

```
my-app/
├── src/
│   ├── app/              # Next.js App Router
│   ├── components/       # React components
│   ├── lib/
│   │   ├── core/         # Logger & Config (DO NOT MODIFY)
│   │   └── utils/        # Utility functions
│   └── services/         # Business logic
├── CLAUDE.md             # Rules for Claude
├── .cursor/rules/        # Rules for Cursor
├── .windsurfrules        # Rules for Windsurf
└── anchor.config.json    # Project metadata
```

## Available Tools

### `scaffold_project`

Create a new project from a Stack template.

```typescript
scaffold_project({
  stack_name: "nextjs",        // Stack type
  project_name: "my-app",      // Project name
  target_dir: "/path/to/dir"   // Target directory
})
```

### `add_pack`

Add a capability pack to an existing project.

```typescript
add_pack({
  project_dir: "/path/to/project",
  pack_name: "database-postgres"
})
```

### `doctor`

Check project health and configuration.

```typescript
doctor({
  project_dir: "/path/to/project"
})
```

## Available Stacks

| Stack | Version | Description |
|-------|---------|-------------|
| `nextjs` | 2026.1 | Next.js 16 + React 19 + TypeScript 5.9 + Tailwind CSS |
| `fastapi` | 2026.1 | FastAPI 0.128 + SQLAlchemy 2.0 + Pydantic v2 |

## Available Packs

| Pack | Description |
|------|-------------|
| `database-postgres` | PostgreSQL with Drizzle ORM (JS) or SQLAlchemy (Python) |
| `ai-langgraph` | LangChain + LangGraph for AI applications |

## How It Works

```
┌─────────────────┐     ┌──────────────────┐     ┌─────────────────┐
│   AI Assistant  │────▶│   Anchor Stack   │────▶│  Your Project   │
│  (Claude, etc.) │     │   (MCP Server)   │     │                 │
└─────────────────┘     └──────────────────┘     └─────────────────┘
                               │
                    ┌──────────┴──────────┐
                    ▼                     ▼
              ┌──────────┐         ┌──────────┐
              │  Stacks  │         │  Packs   │
              │ (nextjs) │         │ (db,ai)  │
              └──────────┘         └──────────┘
```

1. **You ask** your AI to create a project
2. **AI calls** Anchor Stack's MCP tools
3. **Anchor Stack generates** files with proper structure
4. **AI Rules** help future AI interactions understand your project

## CLI Commands

```bash
# Start MCP server
anchor-stack serve

# List available stacks
anchor-stack list-stacks

# List available packs
anchor-stack list-packs

# Show configuration
anchor-stack info
```

## Configuration

| Variable | Default | Description |
|----------|---------|-------------|
| `ANCHOR_STACK_LOG_LEVEL` | `INFO` | Logging level (DEBUG, INFO, WARNING, ERROR) |
| `ANCHOR_STACK_LOG_JSON` | `false` | Output logs in JSON format |
| `ANCHOR_STACK_STACKS_DIR` | `stacks` | Custom stacks directory |
| `ANCHOR_STACK_PACKS_DIR` | `packs` | Custom packs directory |

## Development

```bash
# Clone the repository
git clone https://github.com/anthropics/anchor-stack.git
cd anchor-stack

# Install dependencies
uv sync

# Run tests
uv run pytest tests/ -v

# Run linting
uv run ruff check src/

# Start dev server
uv run anchor-stack serve
```

## Roadmap

- [x] Core MCP Server implementation
- [x] Next.js Stack template
- [x] FastAPI Stack template
- [ ] Database Pack (PostgreSQL)
- [ ] AI Pack (LangGraph)
- [ ] Auth Pack (NextAuth/OAuth)
- [ ] Web UI for template management

## Contributing

Contributions are welcome! Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.

## License

MIT License - see [LICENSE](./LICENSE) for details.

---

**Built with Anchor Stack - Making AI-assisted development reliable**

[Report Bug](https://github.com/anthropics/anchor-stack/issues) · [Request Feature](https://github.com/anthropics/anchor-stack/issues)

