Skip to main content
Glama
REPOSITORY_STRUCTURE.mdβ€’8.3 kB
# πŸ“‚ Repository Structure This document explains the organization of the LibreOffice MCP Server repository. ## πŸ—‚οΈ Directory Structure ``` mcp-libre/ β”œβ”€β”€ πŸ“ src/ # Source code β”‚ β”œβ”€β”€ __init__.py # Package initialization β”‚ β”œβ”€β”€ libremcp.py # Main MCP server implementation β”‚ └── main.py # Entry point script β”œβ”€β”€ πŸ“ plugin/ # LibreOffice Extension (NEW!) β”‚ β”œβ”€β”€ πŸ“ META-INF/ # Extension metadata β”‚ β”‚ └── manifest.xml # Extension manifest file β”‚ β”œβ”€β”€ πŸ“ pythonpath/ # Python extension modules β”‚ β”‚ β”œβ”€β”€ uno_bridge.py # UNO API bridge for LibreOffice β”‚ β”‚ β”œβ”€β”€ mcp_server.py # Embedded MCP server β”‚ β”‚ β”œβ”€β”€ ai_interface.py # HTTP API for AI assistants β”‚ β”‚ └── registration.py # Extension registration and lifecycle β”‚ β”œβ”€β”€ Addons.xcu # LibreOffice menu configuration β”‚ β”œβ”€β”€ ProtocolHandler.xcu # Protocol handler configuration β”‚ β”œβ”€β”€ description.xml # Extension description β”‚ β”œβ”€β”€ description-en.txt # English description text β”‚ β”œβ”€β”€ release-notes-en.txt # Release notes β”‚ β”œβ”€β”€ README.md # Plugin documentation β”‚ β”œβ”€β”€ build.sh # Extension build script β”‚ β”œβ”€β”€ install.sh # Installation and management script β”‚ └── test_plugin.py # Plugin testing client β”œβ”€β”€ πŸ“ tests/ # Test files β”‚ β”œβ”€β”€ __init__.py # Test package initialization β”‚ β”œβ”€β”€ test_client.py # Interactive MCP client test β”‚ └── test_insert_fix.py # Specific function tests β”œβ”€β”€ πŸ“ examples/ # Demo and example scripts β”‚ β”œβ”€β”€ __init__.py # Examples package initialization β”‚ β”œβ”€β”€ demo_editing.py # Document editing demonstrations β”‚ └── demo_live_viewing.py # Live viewing and editing demo β”œβ”€β”€ πŸ“ config/ # Configuration templates β”‚ β”œβ”€β”€ claude_config.json.template # Claude Desktop configuration template β”‚ └── mcp.config.json.template # Super Assistant configuration template β”œβ”€β”€ πŸ“ scripts/ # Utility scripts β”‚ β”œβ”€β”€ generate-config.sh # Configuration generator script β”‚ └── mcp-helper.sh # Helper script for testing and setup β”œβ”€β”€ πŸ“ docs/ # Documentation β”‚ β”œβ”€β”€ CHATGPT_BROWSER_GUIDE.md # ChatGPT browser integration guide β”‚ β”œβ”€β”€ COMPLETE_SOLUTION.md # Comprehensive overview β”‚ β”œβ”€β”€ EXAMPLES.md # Usage examples β”‚ β”œβ”€β”€ LICENSE_OPTIONS.md # License information β”‚ β”œβ”€β”€ LIVE_VIEWING_GUIDE.md # Live viewing setup guide β”‚ β”œβ”€β”€ PREREQUISITES.md # System requirements β”‚ β”œβ”€β”€ QUICK_START.md # Quick start guide β”‚ β”œβ”€β”€ REPOSITORY_STRUCTURE.md # This file β”‚ β”œβ”€β”€ SUPER_ASSISTANT_SETUP.md # Super Assistant setup guide β”‚ └── TROUBLESHOOTING.md # Troubleshooting guide β”œβ”€β”€ πŸ“„ README.md # Main project documentation β”œβ”€β”€ πŸ“„ LICENSE # MIT License β”œβ”€β”€ πŸ“„ pyproject.toml # Python project configuration β”œβ”€β”€ πŸ“„ uv.lock # UV dependency lock file β”œβ”€β”€ πŸ“„ .gitignore # Git ignore rules β”œβ”€β”€ πŸ“„ .python-version # Python version specification β”œβ”€β”€ πŸ”§ mcp-helper.sh # Wrapper for scripts/mcp-helper.sh └── πŸ”§ generate-config.sh # Wrapper for scripts/generate-config.sh ``` ## πŸ“‹ File Descriptions ### Source Code (`src/`) **Core MCP server implementation for external usage:** - `libremcp.py`: Main MCP server with all tools and functionality - `main.py`: Entry point for running the external MCP server - `__init__.py`: Package initialization and exports ### LibreOffice Extension (`plugin/`) - NEW! **Native LibreOffice plugin/extension implementation:** - `pythonpath/uno_bridge.py`: Bridge between MCP and LibreOffice UNO API - `pythonpath/mcp_server.py`: Embedded MCP server for the extension - `pythonpath/ai_interface.py`: HTTP API server for AI assistant connections - `pythonpath/registration.py`: Extension lifecycle management - `META-INF/manifest.xml`: Extension packaging manifest - `Addons.xcu`: LibreOffice menu and toolbar configuration - `ProtocolHandler.xcu`: Protocol handler registration - `description.xml`: Extension metadata and information - `build.sh`: Script to build the .oxt extension package - `install.sh`: Installation and management utilities - `test_plugin.py`: Testing client for the plugin HTTP API - `README.md`: Comprehensive plugin documentation ### Tests (`tests/`) - **`test_client.py`**: Interactive test client that demonstrates all MCP tools - **`test_insert_fix.py`**: Specific tests for document text insertion functionality - **`__init__.py`**: Test package initialization ### Examples (`examples/`) - **`demo_editing.py`**: Comprehensive demo showing document editing capabilities - **`demo_live_viewing.py`**: Demo of live document viewing and real-time editing - **`__init__.py`**: Examples package initialization ### Configuration (`config/`) - **`claude_config.json.template`**: Template for Claude Desktop MCP configuration - **`mcp.config.json.template`**: Template for Super Assistant proxy configuration ### Scripts (`scripts/`) - **`generate-config.sh`**: Generates personalized configuration files from templates - **`mcp-helper.sh`**: Comprehensive helper script for testing, setup, and management ### Documentation (`docs/`) - **Setup Guides**: Step-by-step instructions for different integration scenarios - **Usage Examples**: Practical examples and use cases - **Troubleshooting**: Common issues and solutions - **Prerequisites**: System requirements and installation instructions ## πŸš€ Quick Access ### Root Level Wrappers For convenience, wrapper scripts are provided in the root directory: ```bash # These are equivalent: ./mcp-helper.sh check # Wrapper script ./scripts/mcp-helper.sh check # Direct access ./generate-config.sh both # Wrapper script ./scripts/generate-config.sh both # Direct access ``` ### Running Components ```bash # Run the MCP server directly uv run python src/main.py # Run tests uv run python tests/test_client.py # Run examples uv run python examples/demo_editing.py # Use helper scripts ./mcp-helper.sh test ./generate-config.sh claude ``` ## πŸ“¦ Package Structure The project follows Python packaging best practices: - **Source code** is in `src/` (src layout) - **Tests** are separate from source code - **Examples** are clearly separated from core functionality - **Configuration** templates are centralized - **Scripts** are organized in their own directory - **Documentation** is comprehensive and well-organized ## πŸ”§ Build and Installation The `pyproject.toml` file is configured for the new structure: ```toml [project.scripts] mcp-libre = "src.libremcp:main" ``` This allows the package to be installed and run as: ```bash uv pip install -e . # Install in development mode mcp-libre # Run the installed script ``` ## πŸ” Path Management All scripts automatically handle the new directory structure: - **generate-config.sh**: Uses `PROJECT_ROOT` to find templates and generate correct paths - **mcp-helper.sh**: Uses `PROJECT_ROOT` to run tests and examples from correct locations - **Test files**: Add `src/` to Python path automatically - **Example files**: Add `src/` to Python path automatically This ensures everything works regardless of where the repository is installed or how scripts are executed.

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/jwingnut/mcp-libre'

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