Provides tools for interacting with GitHub repositories, including retrieving repository information, managing repository data, and accessing GitHub API functionality through Personal Access Tokens.
MCP GitHub + MCP Client 프로젝트
이 프로젝트는 GitHub MCP Server와 MCP Client (FastAPI + LangGraph) 두 부분으로 구성되어 있습니다.
🏗️ 프로젝트 구조
🚀 MCP GitHub Server
GitHub MCP server built with fastMCP.
설치
환경변수 설정
GitHub API를 사용하려면 Personal Access Token이 필요합니다:
GitHub Settings > Tokens에서 새 토큰 생성
필요한 권한:
repo
,user
환경변수 설정:
실행
Cursor 설정
Cursor에서 MCP 서버를 연결하려면 다음 설정을 사용하세요:
사용 가능한 도구들
읽기 전용 도구들 (Read Tools)
health
서버 상태 확인
getRepo
GitHub 저장소 정보 조회
listPullRequests
Pull Request 목록 조회
getPRDiff
Pull Request의 diff 조회
getFile
저장소의 파일 내용 조회
쓰기 도구들 (Write Tools)
createOrUpdateFile
파일 생성 또는 수정
deleteFile
파일 삭제
createBranch
새 브랜치 생성
createCommitWithMultipleFiles
여러 파일을 한 번에 커밋
getRepositoryStatus
저장소 상태 및 최신 커밋 정보 조회
사용 예시
파일 생성 및 커밋
새 파일 생성:
파일 수정:
새 브랜치에서 작업:
🧠 MCP Client (FastAPI + LangGraph)
Azure OpenAI + GitHub MCP Server를 연결하는 MCP Client(FastAPI + LangGraph) 프로젝트입니다.
🎯 프로젝트 개요
이 프로젝트는 사용자가 REST API(/chat
)로 자연어 요청을 보내면:
MCP Server(GitHub) 연결 → 사용 가능한 툴 목록 조회
LangGraph ReAct Agent → Azure OpenAI 모델로 툴 실행 계획 수립
MCP Server → 실제 툴 실행 및 결과 수집
LangGraph 워크플로우 → 최종 응답 생성 및 반환
🏗️ 아키텍처
🚀 빠른 시작
1. 가상 환경 설정
2. 의존성 설치
3. 환경 변수 설정
.env
파일을 프로젝트 루트에 생성하고 다음 내용을 추가하세요:
4. 서버 실행
📡 API 엔드포인트
POST /chat
사용자 질문을 처리하고 MCP 도구를 사용하여 응답을 생성합니다.
요청:
응답:
GET /health
서비스 상태를 확인합니다.
응답:
GET /workflow/info
워크플로우 정보를 조회합니다.
응답:
🛠️ 핵심 컴포넌트
MCPClientManager (mcp_client/mcp_client.py
)
langchain-mcp-adapters
의MultiServerMCPClient
래퍼 클래스비동기 컨텍스트 매니저 구현
에러 처리 및 재시도 로직
MCPAgentWorkflow (mcp_client/agent/workflow.py
)
LangGraph의
StateGraph
를 사용한 ReAct 에이전트 구성Azure OpenAI 모델과 MCP 도구 통합
워크플로우 실행 및 결과 처리
🔧 개발
프로젝트 구조
테스트 실행
코드 품질
📚 기술 스택
Python 3.11+
FastAPI - 웹 프레임워크
LangGraph - 워크플로우 오케스트레이션
langchain-mcp-adapters - MCP 통합
langchain-openai - Azure OpenAI 통합
Pydantic - 데이터 검증
Uvicorn - ASGI 서버
🔍 문제 해결
일반적인 문제들
MCP 서버 연결 실패
MCP 서버가 실행 중인지 확인
MCP_SERVER_URL
환경변수 확인
Azure OpenAI 인증 실패
API 키와 엔드포인트 확인
배포 이름과 API 버전 확인
Import 오류
가상 환경이 활성화되었는지 확인
pip install -r requirements.txt
실행
로그 확인
서버 실행 시 상세한 로그를 확인할 수 있습니다:
🤝 기여
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature
)Commit your changes (
git commit -m 'Add some amazing feature'
)Push to the branch (
git push origin feature/amazing-feature
)Open a Pull Request
📄 라이선스
이 프로젝트는 MIT 라이선스 하에 배포됩니다.
📞 지원
문제가 발생하거나 질문이 있으시면:
GitHub Issues에 문제를 등록
프로젝트 문서 확인
개발팀에 문의
개발팀: MCP GitHub + MCP Client Team
최종 업데이트: 2025-09-04
버전: 0.1.0
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables interaction with GitHub repositories through the GitHub API using fastMCP. Supports repository information retrieval and management with secure token-based authentication.