1.0.9 • Published 8 months ago

@makerkim/mcp-threads-server v1.0.9

Weekly downloads
-
License
ISC
Repository
github
Last release
8 months ago

MCP Threads API 서버

Threads API를 활용한 서버 구현입니다.

기능

  • Threads API를 사용하여 게시물 읽기/쓰기
  • 액세스 토큰 기반 인증
  • 텍스트, 이미지, 비디오 게시물 지원
  • TypeScript를 사용한 타입 안전성

설치

npm install

환경 변수 설정

.env 파일을 생성하고 다음 내용을 설정하세요:

# 서버 설정
PORT=3000
NODE_ENV=development

# Threads API 설정
THREADS_ACCESS_TOKEN=your_access_token_here

실행

개발 모드로 실행:

npm run dev

빌드 후 실행:

npm run build
npm start

API 엔드포인트

프로필

  • GET /api/profile/me - 내 프로필 정보 가져오기
  • GET /api/profile/:username - 사용자 프로필 검색하기

스레드

  • GET /api/thread/:threadId - 스레드 정보 가져오기
  • POST /api/thread/create - 스레드 컨테이너 생성하기
  • POST /api/thread/publish - 스레드 게시하기

테스트

전체 테스트 실행

npm test

테스트 커버리지 확인

npm run test:coverage

개발 중 테스트 자동 실행

npm run test:watch

테스트 구성

  • 단위 테스트: src/__tests__ 디렉토리에 위치
  • 통합 테스트: src/__tests__/integration 디렉토리에 위치

프로젝트 구조

src/
├── __tests__/       # 테스트 코드
├── bin/            # CLI 도구
├── config/         # 설정 관련 코드
├── controllers/    # HTTP 요청 처리기
├── middlewares/    # 미들웨어 (인증 등)
├── routes/         # API 라우트
├── services/       # 비즈니스 로직
├── types/          # 타입 정의
└── utils/          # 유틸리티 함수

로컬 테스트

프로젝트를 로컬에서 테스트하려면:

  1. 저장소를 클론합니다:

    git clone https://github.com/yourusername/mcp-threads-server.git
    cd mcp-threads-server
  2. 의존성을 설치합니다:

    npm install
  3. .env 파일을 생성하고 인증 정보를 입력합니다:

    cp .env.example .env
    # .env 파일을 편집하여 Access Token 추가
  4. 서버를 실행합니다:

    npm start

Claude Desktop 설정

claude_desktop_config.json 파일에 다음과 같이 추가합니다:

{
  "mcpServers": {
    "threads": {
      "command": "npx",
      "args": [
        "-y",
        "@makerkim/mcp-threads-server",
        "--mcp",
        "--token",
        "your_access_token"
      ]
    }
  }
}

참고: MCP 모드로 실행할 때 기본 포트(3000)가 이미 사용 중인 경우, 서버는 자동으로 사용 가능한 다음 포트(3001, 3002, ...)를 찾아 실행됩니다.

참고 자료

라이선스

ISC

1.0.9

8 months ago

1.0.7

8 months ago

1.0.6

8 months ago

1.0.5

8 months ago

1.0.4

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago