Skip to main content
Glama
MENARHQ-cloud

Document MCP

Document MCP

ChatGPT 스타일의 챗봇과 Document MCP 서버입니다. 설정에서 폴더 경로와 로컬 LiteLLM 모델을 등록합니다. 질문은 MCP 도구와 함께 LiteLLM으로 전송되며, 서버는 pywin32 COM을 사용하여 Word/Excel/PowerPoint 파일만 읽습니다(Model Council과 동일한 Office 경로).

Chat UI  →  LiteLLM /v1/chat/completions (+ tools)
              ↑ tool_calls (search_documents, read_document, …)
MCP host     →  Document MCP (stdio JSON-RPC)
                    →  allowlisted folders
                    →  win32com Word / Excel / PowerPoint

Claude Desktop, Claude Code, Cursor는 동일한 MCP 서버와 동일한 폴더 목록에 연결됩니다.

빠른 시작

  1. LiteLLM 프록시를 실행합니다.

  2. start.bat을 더블 클릭합니다.

  3. http://127.0.0.1:7860을 엽니다.

  4. 설정 → LiteLLM: 기본 URL(예: http://localhost:4000), API 키를 붙여넣고, 모델 로드 또는 모델 추가를 선택한 후 저장합니다.

  5. 설정 → 폴더: Windows 폴더 경로를 붙여넣습니다. sample_docs는 첫 실행 시 등록됩니다.

  6. 해당 파일들이 답변할 수 있는 모든 것을 질문하세요.

수동

python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
copy .env.example .env
python -m app

Related MCP server: file-analysis-mcp

설정

탭

기능

LiteLLM

기본 URL, 키, /v1/models 로드, 목록에 없는 로컬 모델 이름 추가, 연결 테스트

폴더

MCP 루트(허용 목록). Model Council의 OFFICE_ALLOWED_ROOTS와 동일한 개념

Claude MCP

Claude Desktop / Claude Code / Cursor 스니펫 복사, 또는 Claude Desktop 구성을 직접 작성

URL은 http://host:4000, http://host:4000/v1, 또는 .../v1/chat/completions 형식으로 붙여넣을 수 있습니다. Model Council과 같이 정규화됩니다.

LiteLLM + MCP 작동 방식

Model Council의 앱 내 MCP 루프에서 가져왔습니다:

  1. 호스트가 MCP tools/list를 호출하고 스키마를 OpenAI 도구로 변환합니다.

  2. 호스트가 해당 도구와 함께 chat/completions를 LiteLLM에 POST합니다(tool_choice: auto).

  3. 모델이 tool_calls를 반환하면 호스트가 MCP tools/call(stdio)을 실행합니다.

  4. 도구 JSON이 role: tool로 추가되고 일반 답변이 나올 때까지 루프가 반복됩니다.

모델은 도구를 호출하지 않는 한 파일을 볼 수 없습니다. 루트는 허용 목록에 있습니다. Office 파일은 COM을 선호하므로 Windows 잠금 해제/IRM 파일도 읽을 수 있습니다.

MCP 도구

도구

용도

ping

상태, 엔진, 폴더 수

list_folders

등록된 루트

add_folder / remove_folder

루트 변경

list_documents

인벤토리

search_documents

이름 + 추출된 텍스트

read_document

추출(COM 우선, 라이브러리 대체)

프롬프트: ask_documents.

Claude Desktop / Claude Code / Cursor

챗봇에서: 설정 → Claude MCP → Claude Desktop에 추가(%APPDATA%\Claude\claude_desktop_config.json에 작성). Claude를 다시 시작한 후 ping Document MCP를 요청하세요.

또는 이 형식을 복사하세요(경로는 설정에서 채워집니다):

{
  "mcpServers": {
    "document-mcp": {
      "command": "D:\\\\AntigravityCodes\\\\Document-MCP\\\\.venv\\\\Scripts\\\\python.exe",
      "args": ["-m", "document_mcp"],
      "cwd": "D:\\\\AntigravityCodes\\\\Document-MCP",
      "env": {
        "PYTHONUTF8": "1",
        "DOCUMENT_MCP_ROOTS": "D:\\\\AntigravityCodes\\\\Document-MCP\\\\data\\\\folders.json"
      }
    }
  }
}

Claude Code:

claude mcp add-json document-mcp "{...stdio server json from Settings...}"

Cursor: 저장소 mcp.json, 또는 설정 → Claude MCP에서 Cursor 스니펫을 복사하세요.

HTTP (LiteLLM MCP 게이트웨이):

start_mcp_http.bat

그런 다음 http://127.0.0.1:8765/mcp를 추가하세요.

pywin32 / Office

  • Word.Application → .doc / .docx

  • Excel.Application → .xls / .xlsx / .xlsm

  • PowerPoint.Application → .ppt / .pptx

대체: python-docx / openpyxl / python-pptx. PDF: PyMuPDF. 레거시 바이너리 Office는 여전히 Microsoft Office가 필요합니다.

python -m document_mcp.reader sample_docs\mena_rhq_overview.md

레이아웃

app/                 FastAPI chat host (MCP client + UI)
document_mcp/        FastMCP server, COM readers, Claude install helper
sample_docs/         Starter files
data/                folders.json, settings, extract cache (local)

Related MCP Connectors

Related MCP Servers

  • F
    license
    A
    quality
    C
    maintenance
    Enables read-only scanning and text extraction from PDF, DOCX, PPTX, SVG, and PNG files in a local folder, providing the raw text to AI models for summarization or analysis without an external LLM API.
    5
    -
  • F
    license
    A
    quality
    C
    maintenance
    Enables local Windows file management with allowlisted folder access and integration with Outlook Classic or Microsoft 365 email for AI assistants like Claude Desktop.
    38
    -
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables AI agents on Windows to drive real Microsoft Word and WPS Office applications through COM, automating legacy .doc/.docx batch conversion, bookmark and placeholder template filling, print-fidelity PDF export, extraction from legacy binaries, editing of documents currently open on screen, and mail-merge batch generation. It hardens these operations with CJK font preservation, password and corruption pre-checks, structured self-correcting errors, path allowlisting, read-only mode, and automatic Word-to-WPS failover.
    1
    MIT