MCP Office Interop Word Server
MCP Office Interop Word 서버
이 프로젝트는 Windows에서 COM Interop을 사용하여 Microsoft Word 문서와 상호 작용할 수 있는 MCP(Model Context Protocol) 서버를 구현합니다.
일반적인 워드 프로세싱 작업을 프로그래밍 방식으로 수행할 수 있는 MCP 도구를 제공합니다.
특징
COM Interop(
winax)를 통해 일반적인 Microsoft Word 작업을 래핑합니다.MCP 도구로서의 기능을 공개합니다.
MCP 통신을 위해
stdio와sse전송을 모두 지원합니다.TypeScript로 빌드되었으며
@modelcontextprotocol/sdk사용합니다.
Related MCP server: docx-mcp
필수 조건
Node.js(v18 이상 권장)
엔피엠
Windows 컴퓨터에 Microsoft Word가 설치되어 있습니다.
설치
저장소를 복제하거나 소스 코드를 다운로드하세요.
터미널에서 프로젝트 디렉토리로 이동합니다.
종속성 설치:
지엑스피1
건물
TypeScript 코드를 JavaScript로 컴파일하려면:
npm run build이렇게 하면 컴파일된 파일이 dist 디렉토리에 출력됩니다.
서버 실행
서버는 stdio 또는 sse 두 가지 MCP 전송을 사용하여 실행될 수 있습니다.
stdio 전송
기본 모드입니다. 표준 입출력(STIO)을 통해 통신하는 로컬 클라이언트에 적합합니다.
npm start또는
node dist/index.jsstdio 메서드를 사용하여 MCP 클라이언트(예: MCP Inspector)를 연결하고 node dist/index.js 명령을 가리킵니다.
SSE(서버에서 보낸 이벤트) 전송
이 모드는 웹 기반 또는 원격 클라이언트에 적합한 HTTP 및 서버 전송 이벤트를 사용합니다.
파워셸:
$env:MCP_TRANSPORT="sse"; npm start배시 / 커맨드:
MCP_TRANSPORT=sse npm start서버는 일반적으로 포트 3001(또는 PORT 환경 변수에 지정된 포트)에서 HTTP 서버를 시작합니다.
SSE 엔드포인트:
http://localhost:3001/sse메시지 엔드포인트(클라이언트 POST용):
http://localhost:3001/messages
SSE 방법을 사용하여 MCP 클라이언트를 연결하고 SSE 엔드포인트 URL을 제공합니다.
사용 가능한 도구
서버는 다음 도구를 제공합니다(도구 이름 앞에는 word_ 가 붙습니다).
문서 작업:
word_createDocument: 새로운 빈 Word 문서를 만듭니다.word_openDocument: 기존 문서를 엽니다.filePath(문자열): 문서의 절대 경로.
word_saveActiveDocument: 현재 활성 문서를 저장합니다.word_saveActiveDocumentAs: 활성 문서를 새 경로/형식으로 저장합니다.filePath(문자열): 저장할 절대 경로입니다.fileFormat(숫자, 선택 사항): 숫자형WdSaveFormat값(예: docx의 경우 16, pdf의 경우 17).
word_closeActiveDocument: 활성 문서를 닫습니다.saveChanges(숫자, 선택 사항):WdSaveOptions값(0=아니요, -1=예, -2=확인). 기본값: 0.
텍스트 조작:
word_insertText: 선택 영역에 텍스트를 삽입합니다.text(문자열): 삽입할 텍스트입니다.
word_deleteText: 선택 영역을 기준으로 텍스트를 삭제합니다.count(숫자, 선택 사항): 삭제할 단위 수(기본값: 1). 양수=전진, 음수=후진.unit(숫자, 선택 사항):WdUnits값(1=문자, 2=단어 등). 기본값: 1.
word_findAndReplace: 텍스트를 찾아 바꿉니다.findText(문자열): 찾을 텍스트.replaceText(문자열): 대체 텍스트.matchCase(부울, 선택 사항): 기본값: false.matchWholeWord(부울, 선택 사항): 기본값: false.replaceAll(부울, 선택 사항): 기본값: true.
word_toggleBold: 선택 항목에 대한 굵은 서식을 전환합니다.word_toggleItalic: 선택 항목에 대한 기울임체 서식을 전환합니다.word_toggleUnderline: 선택 항목에 대한 밑줄 서식을 전환합니다.underlineStyle(숫자, 선택 사항):WdUnderline값(기본값: 1=단일).
문단 서식:
word_setParagraphAlignment: 문단 정렬을 설정합니다.alignment(숫자):WdParagraphAlignment값(0=왼쪽, 1=가운데, 2=오른쪽, 3=정렬).
word_setParagraphLeftIndent: 왼쪽 들여쓰기를 설정합니다.indentPoints(숫자): 들여쓰기 값(포인트)입니다.
word_setParagraphRightIndent: 오른쪽 들여쓰기를 설정합니다.indentPoints(숫자): 들여쓰기 값(포인트)입니다.
word_setParagraphFirstLineIndent: 첫 줄/내어쓰기를 설정합니다.indentPoints(숫자): 들여쓰기 값(포인트)(양수=들여쓰기, 음수=내어쓰기).
word_setParagraphSpaceBefore: 문단 앞에 공백을 설정합니다.spacePoints(숫자): 포인트 단위의 공간 값입니다.
word_setParagraphSpaceAfter: 문단 뒤에 공백을 설정합니다.spacePoints(숫자): 포인트 단위의 공간 값입니다.
word_setParagraphLineSpacing: 줄 간격을 설정합니다.lineSpacingRule(숫자):WdLineSpacing값(0=단일, 1=1.5, 2=이중, 3=최소, 4=정확히, 5=다중).lineSpacingValue(숫자, 선택 사항): 규칙 3, 4, 5에 필요한 값입니다.
테이블 작업:
word_addTable: 선택 영역에 표를 추가합니다.numRows(숫자): 행의 개수.numCols(숫자): 열의 개수.
word_setTableCellText: 테이블 셀에 텍스트를 설정합니다.tableIndex(숫자): 1부터 시작하는 테이블 인덱스입니다.rowIndex(숫자): 1부터 시작하는 행 인덱스.colIndex(숫자): 1부터 시작하는 열 인덱스.text(문자열): 설정할 텍스트입니다.
word_insertTableRow: 표에 행을 삽입합니다.tableIndex(숫자): 1부터 시작하는 테이블 인덱스입니다.beforeRowIndex(숫자, 선택 사항): 1부터 시작하는 행 인덱스 앞에 삽입합니다(생략된 경우 끝에 삽입).
word_insertTableColumn: 테이블에 열을 삽입합니다.tableIndex(숫자): 1부터 시작하는 테이블 인덱스입니다.beforeColIndex(숫자, 선택 사항): 1부터 시작하는 열 인덱스 앞에 삽입합니다(생략된 경우 오른쪽 끝에 삽입).
word_applyTableAutoFormat: 표에 스타일을 적용합니다.tableIndex(숫자): 1부터 시작하는 테이블 인덱스입니다.formatName(문자열 | 숫자): 스타일 이름 또는WdTableFormat값.
이미지 작업:
word_insertPicture: 인라인 그림을 삽입합니다.filePath(문자열): 이미지 파일의 절대 경로.linkToFile(부울, 선택 사항): 기본값: false.saveWithDocument(부울, 선택 사항): 기본값: true.
word_setInlinePictureSize: 인라인 그림의 크기를 조정합니다.shapeIndex(숫자): 인라인 모양의 1부터 시작하는 인덱스입니다.heightPoints(숫자): 높이(포인트 단위, -1 또는 0은 자동 크기 조정).widthPoints(숫자): 포인트 단위의 너비(-1 또는 0은 자동 크기 조정).lockAspectRatio(부울, 선택 사항): 기본값: true.
헤더/푸터 작업:
word_setHeaderFooterText: 머리글이나 바닥글에 텍스트를 설정합니다.text(문자열): 텍스트 내용.isHeader(부울): 헤더인 경우 True, 푸터인 경우 False입니다.sectionIndex(숫자, 선택 사항): 1부터 시작하는 섹션 인덱스(기본값: 1).headerFooterType(숫자, 선택 사항):WdHeaderFooterIndex값(1=기본, 2=첫 페이지, 3=짝수 페이지). 기본값: 1.
페이지 설정 작업:
word_setPageMargins: 페이지 여백을 설정합니다.topPoints(숫자): 포인트 단위의 상단 여백.bottomPoints(숫자): 포인트 단위의 하단 여백.leftPoints(숫자): 왼쪽 여백(포인트)입니다.rightPoints(숫자): 오른쪽 여백(포인트)입니다.
word_setPageOrientation: 페이지 방향을 설정합니다.orientation(숫자):WdOrientation값(0=세로, 1=가로).
word_setPaperSize: 용지 크기를 설정합니다.paperSize(숫자):WdPaperSize값(예: 1=Letter, 8=A4).
노트
이 서버를 사용하려면 Microsoft Word가 설치되어 있어야 하며, 서버가 실행되는 컴퓨터에 COM Interop을 통해 액세스할 수 있어야 합니다.
COM 작업에 대한 오류 처리는 기본적인 내용입니다. 안정적인 운영 환경에서는 더욱 세부적인 오류 검사 및 복구가 필요할 수 있습니다.
Word 개체 모델 상수(예:
WdSaveFormat,WdUnits등)는 도구 인수에 숫자 값으로 표현됩니다. 특정 값은 Word VBA 설명서를 참조해야 할 수 있습니다.
This server cannot be installed
Maintenance
Related MCP Connectors
Document-to-Markdown MCP server — convert PDF, Office and HTML into LLM-ready Markdown.
MCP Server for Slima - AI Writing IDE for Novel Authors with AI Beta Reader.
MCP server for FormBro Canadian immigration application automation.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceAn MCP server that enables text extraction and replacement in Microsoft Word documents by directly automating the Word application on Windows. It supports processing content across headers, footers, tables, and shapes using the pywin32 library.
- AlicenseBqualityCmaintenanceAn MCP server for reading, editing, and validating Microsoft Word documents with specialized support for track changes, comments, and footnotes. It enables structural auditing, heading extraction, and precise OOXML-level document manipulation through natural language tools.10043MIT
- AlicenseNot gradedqualityCmaintenanceA powerful Word document editing MCP server that provides complete document manipulation capabilities, including creation, editing, formatting, tables, images, and advanced features like footnotes and interface document generation.3MIT
- AlicenseAqualityDmaintenanceMCP server for Word document (.docx) creation and manipulation — the production-grade document automation tool for AI agents.938MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/mario-andreschak/mcp-msoffice-interop-word'
If you have feedback or need assistance with the MCP directory API, please join our Discord server