Word MCP Server
A FastAPI-based Word document generation server with full MCP (Model Context Protocol) support.
Features
REST API for document creation and management
MCP Protocol Support for integration with MCP-compatible clients
Markdown Support in documents
Multiple Templates (standard, report, memo, letter)
Chat Export functionality to convert conversations to Word documents
Health Check endpoint for monitoring
API Endpoints
Health Check
GET /health- Service health status
Document Operations
POST /word/create- Create a new Word documentPOST /word/create-from-chat- Create a document from chat messagesGET /word/list- List all documentsGET /word/download/{filename}- Download a documentDELETE /word/delete/{filename}- Delete a document
MCP Protocol
POST /mcp- MCP JSON-RPC 2.0 endpoint
Service Info
GET /- Root endpoint with service informationGET /tools- Get available tools
Deployment
Docker Compose
The service will be available at https://word.mac.mndambuki.me.ke via Traefik.
Local Development
The server will run on http://localhost:8004
MCP Protocol Support
The server implements the MCP JSON-RPC 2.0 protocol with the following methods:
initialize- Initialize the MCP connectiontools/list- List available toolstools/call- Call a toolresources/list- List available resourcesresources/read- Read a resource
Example Requests
Create a Document (REST)
Create a Document (MCP Protocol)
Environment Variables
TZ- Timezone (default: Africa/Nairobi)PORT- Server port (default: 8004)
Requirements
Python 3.11+
Docker (for containerized deployment)
External Traefik network (for Docker Compose)
Configuration
Documents are stored in /app/documents inside the container. In Docker Compose, this can be mounted to a local directory.
License
MIT