kyuseokyi/mcp-server
3.1
If you are the rightful owner of mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
This is a simple Model Context Protocol (MCP) server example built using Python FastAPI.
MCP 서버 예제
Python FastAPI 기반의 간단한 Model Context Protocol(MCP) 서버 예제입니다.
주요 기능
- 코드/문서(Markdown) 인덱싱 및 임베딩
- 자연어 쿼리 기반 문서 검색 API 제공
- SQLite 로컬 DB 사용
실행 방법
-
패키지 설치
pip install -r requirements.txt -
서버 실행
uvicorn app.main:app --reload -
인덱싱 테스트 (예: data 폴더 내 문서 인덱싱)
curl -X POST "http://localhost:8000/index?path=data" -
검색 테스트
curl "http://localhost:8000/search?q=검색하고싶은내용"
참고/확장
- 실제로는
app/utils.py의get_embedding함수를 OpenAI, HuggingFace, SentenceTransformers 등으로 교체하여 사용하세요. - PDF/HTML 등 다양한 포맷을 지원하려면 파서를 추가하면 됩니다.
- 인증/권한, 대용량 DB, REST API 스펙 확장 등은 필요에 따라 발전시킬 수 있습니다.