npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ironclads/caddy-mcp

v1.0.0

Published

Caddy proxy management via MCP stdio protocol for Claude Code

Readme

Caddy MCP Server (TypeScript)

Caddy 웹서버 프록시 관리를 위한 MCP(Model Context Protocol) 서버 - TypeScript 버전

🚀 주요 기능

  • 프록시 관리: Caddy 리버스 프록시 추가/삭제/목록 조회
  • 설정 내보내기: Caddyfile 형식으로 현재 설정 내보내기
  • 헬스 체크: Caddy 서버 상태 모니터링
  • 타입 안전성: TypeScript로 완전히 재작성
  • 강화된 보안: 입력 검증 및 오류 처리 개선

📋 요구사항

  • Node.js 18+
  • TypeScript 5.0+
  • Caddy 서버 (Admin API 활성화)

🛠️ 설치 및 빌드

# 의존성 설치
npm install

# TypeScript 빌드
npm run build

# 개발 모드 (TypeScript 직접 실행)
npm run dev

# 프로덕션 모드
npm start

🧪 테스트

# Mock 테스트
npm test

# 실제 Caddy API 테스트
npm run test:real

# 타입 체크
npm run type-check

# 린팅
npm run lint

⚙️ 환경 설정

필수 환경 변수

export CADDY_ADMIN_URL="http://localhost:2019"
export DEBUG="false"  # 디버그 로깅 활성화

Claude Desktop 설정

claude_desktop_config.json:

{
  "mcpServers": {
    "caddy-mcp": {
      "command": "node",
      "args": ["/path/to/caddy-mcp/dist/server.js"],
      "env": {
        "CADDY_ADMIN_URL": "http://localhost:2019",
        "DEBUG": "false"
      }
    }
  }
}

🔧 사용 가능한 도구

1. list_proxies

현재 설정된 모든 프록시 목록을 조회합니다.

2. add_proxy

새로운 프록시를 추가합니다.

  • domain: 프록시할 도메인
  • targetUrl: 대상 서버 (host:port 형식)

3. delete_proxy

지정된 도메인의 프록시를 삭제합니다.

  • domain: 삭제할 도메인

4. export_caddyfile

현재 Caddy 설정을 Caddyfile 형식으로 내보냅니다.

5. check_caddy_health

Caddy 서버의 상태를 확인합니다.

📁 프로젝트 구조

caddy-mcp/
├── src/                    # TypeScript 소스 코드
│   ├── server.ts          # 메인 서버 클래스
│   ├── types.ts           # 타입 정의
│   ├── test.ts            # Mock 테스트
│   └── real-test.ts       # 실제 API 테스트
├── dist/                  # 컴파일된 JavaScript
├── tsconfig.json          # TypeScript 설정
├── .eslintrc.json         # ESLint 설정
└── package.json           # 프로젝트 설정

🎯 TypeScript 변환의 장점

1. 타입 안전성

  • 컴파일 타임 오류 검출
  • IDE 자동완성 및 IntelliSense
  • 런타임 오류 감소

2. 코드 품질

  • 명확한 인터페이스 정의
  • 엄격한 타입 체크
  • 더 나은 리팩토링 지원

3. 개발 경험

  • 더 나은 개발자 도구 지원
  • 명확한 API 문서화
  • 유지보수성 향상

🔒 보안 강화

  • 환경변수 필수 검증
  • 입력값 타입 및 형식 검증
  • API 요청 타임아웃 설정
  • 구조화된 오류 처리

📊 성능 개선

  • 재귀적 프록시 추출 로직
  • 중복 코드 제거
  • 효율적인 오류 처리
  • 구조화된 로깅 시스템

🤝 기여하기

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

📄 라이선스

MIT License


🎉 JavaScript에서 TypeScript로 성공적으로 변환 완료!