Skip to main content
Glama
little2512
by little2512
INSTALL.mdβ€’4.61 kB
# Installation and Usage Guide ## πŸš€ Quick Start ### 1. Install Dependencies ```bash cd word-doc-mcp npm install ``` ### 2. Choose Server Version - **Basic Version**: `server-basic.js` - Original functionality, simple document reading and search - **Full Version**: `server.js` - Complete version with all new features ### 3. Start Server #### Basic Version ```bash npm run start:basic # or node server-basic.js ``` #### Full Version ```bash npm start # or node server.js ``` ### 4. Configure MCP Client Add to your MCP client configuration: ```json { "mcpServers": { "word-doc-reader": { "command": "node", "args": ["path/to/word-doc-mcp/server.js"] } } } ``` ## πŸ“‹ Feature Comparison | Feature | Basic Version | Full Version | |---------|---------------|--------------| | Text Extraction | βœ… | βœ… | | Memory Storage | βœ… | βœ… | | Simple Search | βœ… | βœ… | | Table Extraction | ❌ | βœ… | | Image OCR | ❌ | βœ… | | Large Document Optimization | ❌ | βœ… | | Smart Caching | ❌ | βœ… | | Full-text Index | ❌ | βœ… | | Configuration File | ❌ | βœ… | ## πŸ”§ System Requirements ### Basic Version - Node.js 14+ - 2GB RAM - 100MB disk space ### Full Version - Node.js 16+ - 4GB RAM (8GB+ recommended) - 1GB disk space (for cache and temp files) - Multi-core CPU (for parallel processing) ## βš™οΈ Configuration ### Basic Configuration No configuration required, ready to use out of the box. ### Advanced Configuration Edit the `config.json` file: ```json { "processing": { "maxFileSize": 10485760, "maxPages": 100, "chunkSize": 1048576, "parallelProcessing": true }, "cache": { "enabled": true, "defaultTTL": 3600, "cacheDirectory": "./.cache" }, "ocr": { "enabled": true, "languages": ["chi_sim", "eng"] } } ``` ## πŸ“ Directory Structure ``` word-doc-mcp/ β”œβ”€β”€ server.js # Full version β”œβ”€β”€ server-basic.js # Basic version β”œβ”€β”€ package.json # Dependencies configuration β”œβ”€β”€ config.json # Configuration file β”œβ”€β”€ README.md # Documentation β”œβ”€β”€ INSTALL.md # Installation guide β”œβ”€β”€ tests/ # Test directory β”œβ”€β”€ .cache/ # Cache directory (auto-created) β”œβ”€β”€ output/ # Output directory (auto-created) └── node_modules/ # Dependencies ``` ## 🎯 Usage Examples ### 1. Read Document ```javascript const result = await mcp.call("read_word_document", { filePath: "./document.docx", memoryKey: "doc1", documentType: "api-doc", extractTables: true, extractImages: true, useCache: true }); ``` ### 2. Search Documents ```javascript const searchResults = await mcp.call("search_documents", { query: "API interface", documentType: "api-doc", limit: 10 }); ``` ### 3. Cache Management ```javascript // View cache statistics const stats = await mcp.call("get_cache_stats"); // Clear cache await mcp.call("clear_cache", { type: "all" }); ``` ## πŸ› Troubleshooting ### Common Issues 1. **Module Installation Failure** ```bash # Clear cache and reinstall npm cache clean --force npm install ``` 2. **OCR Recognition Failure** - Ensure sufficient memory - Check supported image formats - Try reducing image resolution 3. **Slow Large Document Processing** - Increase `chunkSize` configuration - Enable parallel processing - Use SSD storage 4. **Memory Insufficient** ```bash # Increase Node.js memory limit node --max-old-space-size=4096 server.js ``` ### Performance Optimization 1. **Enable Caching** ```json { "useCache": true } ``` 2. **Selective Extraction** ```json { "extractTables": false, "extractImages": false } ``` 3. **Adjust Processing Parameters** ```json { "processing": { "chunkSize": 2097152, // 2MB chunks "parallelProcessing": true } } ``` ## πŸ“ž Support If you encounter issues, please: 1. Check log output 2. Confirm file paths are correct 3. Verify file format support 4. Check system resource usage ## πŸ”„ Upgrade Guide ### Upgrading from Basic to Full Version 1. Backup existing configuration 2. Install new dependencies: ```bash npm install tesseract.js node-cache sharp jszip ``` 3. Update startup script: ```bash node server.js ``` 4. Optional: Configure `config.json` ### Clean Old Data ```javascript // Clear old memory cache await mcp.call("clear_memory"); // Clear all new cache await mcp.call("clear_cache", { type: "all" }); ```

Latest Blog Posts

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/little2512/word-doc-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server