MCP File Reader
MCP 파일 리더
**MCP(Model Context Protocol)**를 사용하여 Python 도구 서버와 로컬 LLM(Ollama + Mistral)을 연결하는 완전 로컬 무료 AI 기반 파일 리더입니다. API 키나 클라우드 없이 비용 부담 없이 기기에서 완전히 실행됩니다.
🧾 주요 기능
사용자 지정 도구(
list_files,read_file)가 포함된 MCP 서버Ollama를 통한 로컬 LLM 통합(Mistral / Llama3.2)
자동 파일 탐색 및 콘텐츠 읽기
AI 기반 파일 콘텐츠 요약
경로 탐색 보호(보안 내장)
제로 비용 — API 키나 구독이 필요 없음
🛠️ 기술 스택
기술 | 설명 |
Python | 서버 및 클라이언트를 위한 핵심 언어 |
MCP | 모델 컨텍스트 프로토콜(도구 서버) |
Ollama | 로컬 LLM 런타임(무료, 오프라인) |
Mistral | 요약을 위한 로컬 AI 모델 |
asyncio | 클라이언트/서버 간 비동기 통신 |
requests | Ollama API에 대한 HTTP 호출 |
📦 설치
git clone https://github.com/JaneKarunyaJ/MCP-File-Reader.git
cd MCP-File-Reader
pip install mcp requestshttps://ollama.com에서 Ollama를 설치한 후 모델을 가져옵니다:
ollama pull mistral🚀 사용법
Ollama가 실행 중인지 확인한 후(설치 후 자동으로 시작됨), 다음을 수행합니다:
python client.py클라이언트는 다음을 수행합니다:
MCP 서버를 하위 프로세스로 시작
list_files를 호출하여my_files/내의 파일 탐색발견된 각 파일에 대해
read_file호출실제 콘텐츠를 Mistral로 보내 요약
📁 프로젝트 구조
MCP-File-Reader/
│
├── server.py # MCP server — exposes list_files and read_file tools
├── client.py # MCP client — calls tools and queries Ollama
├── requirements.txt # Python dependencies
└── my_files/ # Folder the AI is allowed to read
├── project_ideas.txt
└── wishlist.txt🔐 보안
MCP 서버는
my_files/디렉토리에서의 읽기만 허용합니다.경로 탐색 공격(예:
../../etc/passwd)은 자동으로 차단됩니다.데이터가 기기를 벗어나지 않으며, 설정 후 완전히 오프라인으로 작동합니다.
🧠 작동 원리
client.py
│
├── Step 1: Calls MCP tool → list_files()
│ ↓
│ Returns filenames from my_files/
│
├── Step 2: Calls MCP tool → read_file(filename)
│ ↓
│ Returns actual file contents
│
└── Step 3: Sends real content to Ollama (Mistral)
↓
Returns AI summary➕ 프로젝트 확장
나만의 파일 추가:
.txt파일을my_files/에 넣고 다시 실행하세요.새 도구 추가:
server.py에 새 도구 핸들러를 추가하세요(예:search_in_file,write_file).질문 변경:
client.py의user_question을 수정하여 파일에 대해 무엇이든 물어보세요.모델 교체:
client.py의MODEL = "mistral"을 Ollama에서 가져온 다른 모델로 변경하세요.
📋 요구 사항
Python 3.9+
Ollama 설치 (ollama.com)
Mistral 모델 가져오기 (
ollama pull mistral)mcp및requestsPython 패키지
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/JaneKarunyaJ/MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server