MCP-OPENAPI-DOCX
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
MCP-OPENAPI-DOCX
Enterprise-grade document editing and management server supporting MCP (Model Context Protocol) and OpenAPI protocols for DOCX documents.
π Features
Complete DOCX Support: Full support for reading, writing, and editing Microsoft Word documents
MCP Protocol: Implements the Model Context Protocol for AI-powered document operations
RESTful API: Comprehensive OpenAPI-compliant REST API with Swagger documentation
Async Architecture: Built with FastAPI and async/await for high performance
Document Processing: Paragraphs, tables, lists, images, styles, and more
Version Control: Track document versions and compare changes
Template Management: Create and manage document templates
Export Options: Export to PDF, HTML, Markdown, and plain text
Comments & Revisions: Add comments and track changes
Security: Document encryption, password protection, and permissions
Background Tasks: Celery integration for long-running operations
Containerized: Docker and Kubernetes ready
Related MCP server: che-word-mcp
π Table of Contents
π Installation
Prerequisites
Python 3.10 or higher
Docker and Docker Compose (optional)
PostgreSQL (optional, SQLite available for development)
Redis (for Celery tasks)
Using pip and venv (Recommended)
# Clone the repository
git clone https://github.com/Fu-Jie/MCP-OPENAPI-DOCX.git
cd MCP-OPENAPI-DOCX
# Create virtual environment
python -m venv venv
# Activate virtual environment
# On Linux/macOS:
source venv/bin/activate
# On Windows (Command Prompt):
venv\Scripts\activate.bat
# On Windows (PowerShell):
venv\Scripts\Activate.ps1
# Upgrade pip
pip install --upgrade pip
# Install dependencies
pip install -r requirements.txt
# Copy environment configuration
cp .env.example .env
# Run the application
python main.pyUsing Docker
# Clone the repository
git clone https://github.com/Fu-Jie/MCP-OPENAPI-DOCX.git
cd MCP-OPENAPI-DOCX
# Start with Docker Compose
docker-compose up -d
# View logs
docker-compose logs -f apiπ Quick Start
Start the API Server
# Method 1: Using main.py (Recommended)
python main.py
# Method 2: Using uvicorn directly
python -m uvicorn src.api.main:app --reload --port 8000
# Production mode with multiple workers
python -m uvicorn src.api.main:app --host 0.0.0.0 --port 8000 --workers 4Access the API
API Documentation: http://localhost:8000/docs
ReDoc: http://localhost:8000/redoc
OpenAPI Schema: http://localhost:8000/openapi.json
Start the MCP Server
# Run MCP server (for AI integrations)
python main.py --mcpπ API Documentation
The API provides comprehensive endpoints for document management:
Core Endpoints
Endpoint | Method | Description |
| GET | List all documents |
| POST | Create a new document |
| GET | Get document details |
| PUT | Update document |
| DELETE | Delete document |
Text Operations
Endpoint | Method | Description |
| GET | List paragraphs |
| POST | Add paragraph |
| PUT | Update paragraph |
| POST | Apply formatting |
Table Operations
Endpoint | Method | Description |
| GET | List tables |
| POST | Create table |
| PUT | Update cell |
| POST | Add row |
See the full API Documentation for complete details.
π MCP Protocol
This server implements the Model Context Protocol for AI integrations:
Available Tools
create_document- Create a new DOCX documentopen_document- Open an existing documentadd_paragraph- Add a paragraph to a documentadd_table- Add a table to a documentformat_text- Apply text formattingsearch_replace- Search and replace textexport_document- Export to various formatsAnd 80+ more tools...
Example Usage
# Using MCP client
async with MCPClient("http://localhost:8000/mcp") as client:
result = await client.call_tool(
"create_document",
{"name": "My Document"}
)See the MCP Protocol Guide for detailed usage.
βοΈ Configuration
Configuration is managed through environment variables. Copy .env.example to .env:
cp .env.example .envKey Configuration Options
Variable | Description | Default |
| Database connection URL |
|
| Redis connection URL |
|
| JWT secret key | (required in production) |
| Enable debug mode |
|
| Environment name |
|
| Upload directory |
|
| Max upload size (bytes) |
|
See .env.example for all available options.
π οΈ Development
Project Structure
mcp-openapi-docx/
βββ src/
β βββ api/ # FastAPI application
β β βββ routes/ # API endpoints
β β βββ dependencies.py
β βββ core/ # Core configuration
β βββ database/ # Database setup
β βββ handlers/ # DOCX file handlers
β βββ mcp/ # MCP server
β βββ middleware/ # HTTP middleware
β βββ models/ # Data models
β βββ services/ # Business logic
β βββ tasks/ # Celery tasks
β βββ utils/ # Utility functions
βββ tests/ # Test suite
βββ docs/ # Documentation
βββ alembic/ # Database migrations
βββ kubernetes/ # K8s configurations
βββ scripts/ # Utility scriptsRunning Locally
# Activate virtual environment
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dev dependencies
pip install -r requirements.txt
# Run linting
ruff check src/
black --check src/
isort --check-only src/
# Run type checking
mypy src/
# Start development server
python main.py
# Or with auto-reload:
python -m uvicorn src.api.main:app --reloadDatabase Migrations
# Create a new migration
alembic revision --autogenerate -m "description"
# Apply migrations
alembic upgrade head
# Rollback
alembic downgrade -1π§ͺ Testing
# Run all tests
pytest
# Run with coverage
pytest --cov=src --cov-report=html
# Run specific test file
pytest tests/unit/handlers/test_document_handler.py
# Run integration tests
pytest tests/integration/ -vπ’ Deployment
Docker Compose (Recommended for Development)
docker-compose up -dKubernetes
# Apply configurations
kubectl apply -f kubernetes/
# Check status
kubectl get pods -n docxManual Deployment
# Build the image
docker build -t mcp-openapi-docx:latest .
# Run the container
docker run -p 8000:8000 mcp-openapi-docx:latestSee the Deployment Guide for production recommendations.
π€ Contributing
Contributions are welcome! Please read our contributing guidelines before submitting a pull request.
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Support
Documentation: docs/
Issues: GitHub Issues
Discussions: GitHub Discussions
Made with β€οΈ for the document automation community
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
This server cannot be deployed
Maintenance
Related MCP Connectors
Convert, create and edit Word, PowerPoint, Excel and PDF documents from any AI agent.
Document editing, AI writing, saved documents, DOCX downloads, PDF, STT, TTS and watermarking
Online office suite for AI agents: edit docs, sheets, slides and PDFs in browser or via MCP.
MCP-native collaborative markdown editor with real-time AI document editing
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceAn MCP server that enables programmatic interaction with Microsoft Word documents on Windows via COM Interop, allowing operations like document creation, text manipulation, formatting, and table management.16MIT
- AlicenseNot gradedqualityBmaintenanceSwift-native MCP server for Word (.docx) document manipulation. 148 tools for creating, reading, editing, formatting, and exporting Word documents with full OOXML support.7MIT
- AlicenseNot gradedqualityDmaintenanceA 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.946 npmMIT