OpenZIM MCP supports two distinct modes to accommodate different LLM capabilities:
- Simple Mode (default): Provides just 1 primary intelligent tool that accepts natural language queries
- Advanced Mode: Exposes all 18 specialized MCP tools for maximum control and flexibility
Simple mode is designed for:
- LLMs with limited tool-calling capabilities: Some models struggle with managing many tools
- Reduced context window usage: Fewer tools mean less context consumed by tool definitions
- Simpler integration: Easier to integrate with basic MCP clients
- Natural language interface: More intuitive for conversational AI applications
# Simple mode (default)
python -m openzim_mcp /path/to/zim/files
# or explicitly
python -m openzim_mcp --mode simple /path/to/zim/files
# Advanced mode
python -m openzim_mcp --mode advanced /path/to/zim/filesexport OPENZIM_MCP_TOOL_MODE=simple
python -m openzim_mcp /path/to/zim/filesFor Claude Desktop or other MCP clients:
{
"mcpServers": {
"openzim-mcp-simple": {
"command": "python",
"args": [
"-m",
"openzim_mcp",
"--mode",
"simple",
"/path/to/zim/files"
]
}
}
}Or using environment variable:
{
"mcpServers": {
"openzim-mcp-simple": {
"command": "python",
"args": ["-m", "openzim_mcp", "/path/to/zim/files"],
"env": {
"OPENZIM_MCP_TOOL_MODE": "simple"
}
}
}
}The primary tool for all ZIM content operations. It accepts natural language queries and intelligently routes them to the appropriate underlying operations.
Parameters:
query(required): Natural language query describing what you wantzim_file_path(optional): Path to ZIM file (auto-selects if only one exists)limit(optional): Maximum number of results for search/browse operationsoffset(optional): Starting offset for paginationmax_content_length(optional): Maximum content length for articles
Supported Query Types:
"list files"
"what ZIM files are available"
"show available archives"
"metadata for wikipedia.zim"
"info about this ZIM file"
"details of the archive"
"show main page"
"get home page"
"display start page"
"list namespaces"
"what namespaces exist"
"show available namespaces"
"browse namespace C"
"show articles in namespace A"
"explore namespace C with limit 20"
"structure of Biology"
"outline of Evolution"
"show sections of Protein"
"summary of Biology"
"summarize Evolution"
"overview of Protein"
"brief of DNA"
"table of contents for Biology"
"toc of Evolution"
"contents of Protein"
"links in Biology"
"references from Evolution"
"show related articles in Protein"
"suggestions for bio"
"autocomplete evol"
"hints for prot"
"search evolution in namespace C"
"find biology in type text/html"
"search protein in namespace C type text/html"
"get article Biology"
"show Evolution"
"read Protein"
"display article on DNA"
"search for biology"
"find evolution"
"look for protein"
{
"name": "zim_query",
"arguments": {
"query": "list files"
}
}If only one ZIM file exists, you don't need to specify the path:
{
"name": "zim_query",
"arguments": {
"query": "search for biology"
}
}{
"name": "zim_query",
"arguments": {
"query": "search for biology",
"zim_file_path": "/path/to/wikipedia.zim",
"limit": 5
}
}{
"name": "zim_query",
"arguments": {
"query": "get article Evolution",
"zim_file_path": "/path/to/wikipedia.zim",
"max_content_length": 5000
}
}{
"name": "zim_query",
"arguments": {
"query": "browse namespace C",
"zim_file_path": "/path/to/wikipedia.zim",
"limit": 20,
"offset": 0
}
}{
"name": "zim_query",
"arguments": {
"query": "structure of Biology",
"zim_file_path": "/path/to/wikipedia.zim"
}
}{
"name": "zim_query",
"arguments": {
"query": "summary of Evolution",
"zim_file_path": "/path/to/wikipedia.zim"
}
}{
"name": "zim_query",
"arguments": {
"query": "table of contents for Biology",
"zim_file_path": "/path/to/wikipedia.zim"
}
}The zim_query tool uses intelligent intent parsing to understand your query:
- Keyword Matching: Looks for specific keywords like "search", "get", "browse", etc.
- Pattern Recognition: Identifies patterns like "X in namespace Y"
- Parameter Extraction: Extracts article names, namespaces, and other parameters
- Priority Ordering: More specific patterns are checked first
- Fallback: Defaults to search if intent is unclear
| Aspect | Advanced Mode | Simple Mode |
|---|---|---|
| Number of Tools | 18 specialized tools | 1 primary tool |
| Interface | Explicit tool selection | Natural language queries |
| Context Usage | Higher (all tool definitions) | Lower (minimal tool definitions) |
| Flexibility | Maximum control | Simplified interface |
| Learning Curve | Steeper (need to know which tool to use) | Gentler (just describe what you want) |
| Best For | Advanced LLMs, power users | Simple LLMs, conversational AI |
When in advanced mode, these 18 tools are available:
list_zim_files- List all ZIM filessearch_zim_file- Search within ZIM fileget_zim_entry- Get specific entry contentget_zim_metadata- Get ZIM file metadataget_main_page- Get main page entrylist_namespaces- List available namespacesbrowse_namespace- Browse entries in namespacesearch_with_filters- Advanced filtered searchget_search_suggestions- Auto-complete suggestionsget_article_structure- Extract article structureextract_article_links- Extract article linksget_entry_summary- Get concise article summaryget_table_of_contents- Extract hierarchical TOCget_binary_entry- Retrieve binary content (images, PDFs, etc.)get_server_health- Server health and statisticsget_server_configuration- Server configurationdiagnose_server_state- Comprehensive diagnosticsresolve_server_conflicts- Resolve server conflicts
- Be Descriptive: The more descriptive your query, the better the intent parsing
- Use Quotes: For specific article names, use quotes:
"get article \"C/Biology\"" - Specify Limits: Add "with limit X" to control result count
- Auto-Selection: If you have only one ZIM file, you can omit the file path
- Fallback to Search: If intent is unclear, the tool defaults to search
If your query isn't understood correctly:
- Try being more explicit: "search for X" instead of just "X"
- Use keywords from the supported query types
- Check the response for suggestions
- Fall back to more specific queries
If the wrong operation is executed:
- Use more specific keywords
- Check the intent parsing patterns in the documentation
- Try rephrasing your query
- Consider using advanced mode for precise control
You can switch between modes at any time by changing the configuration:
# Switch to advanced mode
export OPENZIM_MCP_TOOL_MODE=advanced
# Switch to simple mode (default)
export OPENZIM_MCP_TOOL_MODE=simple
# or
unset OPENZIM_MCP_TOOL_MODE # defaults to simpleNo data migration is needed - both modes use the same underlying operations and data.