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
π 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)
Using Docker
π Quick Start
Start the API Server
Access the API
API Documentation: http://localhost:8000/docs
ReDoc: http://localhost:8000/redoc
OpenAPI Schema: http://localhost:8000/openapi.json
Start the MCP Server
π 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
See the MCP Protocol Guide for detailed usage.
βοΈ Configuration
Configuration is managed through environment variables. Copy .env.example to .env:
Key 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
Running Locally
Database Migrations
π§ͺ Testing
π’ Deployment
Docker Compose (Recommended for Development)
Kubernetes
Manual Deployment
See 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