be-template-mcp
v0.1.1
Published
MCP server that scaffolds a production-ready backend from an opinionated modern stack (default) or an interactively chosen custom stack.
Maintainers
Readme
be-template-mcp
백엔드 프로젝트 초기 세팅용 MCP 서버입니다. AI 에이전트(Claude Code, Cursor 등)가 이 MCP를 호출하면 사용자에게 직접 기술 스택을 물어보고, 선택된 스택으로 실행 가능한 백엔드 프로젝트를 통째로 생성합니다.
사용자: "백엔드 프로젝트 하나 만들어줘"
↓
AI가 start_setup 호출
↓
┌─────────────────────────────────────────┐
│ Stack │
│ ● Default (recommended) │ ← 마우스/키보드로 선택
│ ○ Custom (choose each item) │
└─────────────────────────────────────────┘
↓ Custom을 고르면 15개 항목을 하나씩 선택
↓
AI가 scaffold 호출 → 23~30개 파일 생성 → 바로 `bun install && bun run dev`1. 설치 (복붙만 하면 끝)
npx가 알아서 최신 버전을 받아옵니다. 전역 설치 필요 없습니다.
Claude Code
터미널에서 한 줄:
claude mcp add be-template -- npx -y be-template-mcp또는 프로젝트 루트에 .mcp.json:
{
"mcpServers": {
"be-template": {
"command": "npx",
"args": ["-y", "be-template-mcp"]
}
}
}Cursor
~/.cursor/mcp.json (전역) 또는 .cursor/mcp.json (프로젝트):
{
"mcpServers": {
"be-template": {
"command": "npx",
"args": ["-y", "be-template-mcp"]
}
}
}VS Code (GitHub Copilot / Agent mode)
.vscode/mcp.json:
{
"servers": {
"be-template": {
"type": "stdio",
"command": "npx",
"args": ["-y", "be-template-mcp"]
}
}
}Windsurf
~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"be-template": {
"command": "npx",
"args": ["-y", "be-template-mcp"]
}
}
}Codex CLI
~/.codex/config.toml:
[mcp_servers.be-template]
command = "npx"
args = ["-y", "be-template-mcp"]Zed
settings.json:
{
"context_servers": {
"be-template": {
"source": "custom",
"command": "npx",
"args": ["-y", "be-template-mcp"]
}
}
}Windows에서 npx 를 못 찾는다면
{
"mcpServers": {
"be-template": {
"command": "cmd",
"args": ["/c", "npx", "-y", "be-template-mcp"]
}
}
}설치 후 에디터를 재시작하고, be-template 서버가 연결됐는지 확인하세요.
(Claude Code: /mcp)
2. 사용법
에디터에서 그냥 이렇게 말하면 됩니다.
백엔드 프로젝트 초기 세팅 해줘. 이름은 orders-api.그러면 AI가 자동으로:
start_setup호출 → 사용자에게 Default vs Custom 선택창을 띄움- Custom을 고르면 → 15개 항목(런타임, 프레임워크, DB, ORM, 인증, …)을 각각 선택
scaffold호출 → 선택된 스택으로 파일 생성
선택창(pick list) 은 MCP의
elicitation기능을 씁니다. 이걸 지원하지 않는 클라이언트에서는 AI가 대신 질문을 하나씩 물어보는 방식으로 자동 폴백합니다. 결과는 동일합니다.
제공 도구
| 도구 | 하는 일 |
| --- | --- |
| start_setup | 사용자에게 스택을 물어보고 확정된 스택을 반환. 항상 먼저 호출 |
| list_stack_options | 선택 가능한 모든 항목과 기본값 목록 |
| scaffold | 프로젝트 파일 생성. dryRun, overwrite 옵션 지원 |
scaffold 인자:
{
"projectName": "orders-api",
"targetDir": "C:/work/orders-api", // 절대경로 필수
"stack": { "runtime": "bun", "framework": "hono" }, // 생략하면 기본 스택
"dryRun": false, // true면 생성될 파일 목록만 출력
"overwrite": false // 기존 파일이 있으면 기본적으로 거부
}3. 기본 스택 (Default)
"제일 유명하고, 지금 최신이고, 앞으로도 살아남을" 조합으로 골랐습니다.
| 항목 | 기본값 | 이유 | | --- | --- | --- | | Runtime | Bun | 설치·실행·테스트 모두 가장 빠름 | | Framework | Hono | 초경량 · Web 표준 · node/bun/edge 어디서나 동작 | | Database | PostgreSQL 17 | 사실상 기본값 | | ORM | Drizzle ORM | TS 우선, SQL에 가깝고 런타임 오버헤드 없음 | | Validation | Zod 4 | 생태계 표준 | | Auth | Better Auth | 셀프호스팅 세션 + OAuth + 2FA | | Cache | Redis (ioredis) | 캐시 · 레이트리밋 | | API Docs | OpenAPI + Scalar | 스키마에서 자동 생성 | | Testing | Vitest | 빠르고 Jest 호환 | | Lint/Format | Oxlint + Prettier | ESLint 대비 압도적으로 빠름 | | Logger | Pino | 구조화 JSON 로그, 최고 성능 | | Date | Day.js | 2kB | | Container | Dockerfile + compose | app + db + redis 로컬 일괄 실행 | | CI | GitHub Actions | PR마다 lint · typecheck · test | | Git hooks | Husky + lint-staged | 커밋 전 자동 검사 |
커스텀으로 바꿀 수 있는 것
runtime bun · node · deno
framework hono · fastify · nestjs · elysia · express
database postgresql · mysql · sqlite · mongodb · none
orm drizzle · prisma · typeorm · mongoose · none
validation zod · valibot · typebox
auth better-auth · jwt · none
cache redis · redis-bullmq · none
apiDocs scalar · swagger · none
testing vitest · bun-test · jest · none
lint oxlint-prettier · biome · eslint-prettier
logger pino · winston · consola
dates dayjs · date-fns · none
container docker-compose · dockerfile · none
ci github-actions · none
gitHooks husky · lefthook · none말이 안 되는 조합(예: MySQL + Mongoose)은 생성 전에 경고로 알려줍니다.
4. 생성되는 프로젝트
orders-api/
├─ src/
│ ├─ index.ts 앱 진입점 + 전역 에러 핸들링
│ ├─ env.ts Zod로 검증된 환경변수 (없으면 부팅 시 즉시 종료)
│ ├─ routes/health.ts /health
│ ├─ routes/health.test.ts
│ ├─ lib/logger.ts
│ ├─ lib/redis.ts
│ ├─ lib/auth.ts
│ └─ db/index.ts, db/schema.ts
├─ drizzle.config.ts
├─ docker-compose.yml app + postgres + redis
├─ Dockerfile 멀티스테이지, non-root
├─ .github/workflows/ci.yml
├─ .oxlintrc.json / .prettierrc
├─ .env.example
├─ tsconfig.json strict + noUncheckedIndexedAccess
├─ package.json
└─ README.md 선택된 스택 기준으로 작성된 실행 가이드생성 직후 바로 동작합니다:
cd orders-api
bun install
cp .env.example .env
docker compose up -d db redis
bun run db:generate && bun run db:migrate
bun run dev
# → http://localhost:3000/health5. 로컬 개발 / 기여
git clone <this-repo>
npm install
npm run build
npm test # 빌드 + stdio 스모크 테스트
npm run inspect # MCP Inspector로 도구 직접 호출스택 항목을 추가하려면 src/stack.ts의 CATEGORIES에 한 줄 추가하고,
src/templates.ts에서 해당 분기를 처리하면 됩니다. 선택창은 자동으로 갱신됩니다.
배포 방법은 PUBLISHING.md 참고.
라이선스
MIT
