# ZIM MCP Server

> ⚠️ **Experimental Warning**
> 
> This is an experimental version that has only been tested on WSL2. The installation and usage instructions below are specifically for WSL2 environment.

A Model Context Protocol server for reading and searching ZIM files. ZIM is a file format developed by [Kiwix](https://www.kiwix.org/) for offline storage of Wikipedia and other reference content.

## Installation (WSL2)

1. Install dependencies:
```bash
pnpm install
```

2. Build the project:
```bash
pnpm run build
```

3. Prepare ZIM files:
Download ZIM files from [Kiwix Library](https://browse.library.kiwix.org/) and place them in a directory, e.g., `/path/to/zim`

## Usage

### Configuration for Claude Desktop

Add the following to your `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "zim-mcp-server": {
      "command": "wsl.exe",
      "args": [
        "bash",
        "-c",
        "node /path/to/zim-mcp-server/build/index.js /path/to/zim"
      ]
    }
  }
}
```

Example:
```json
{
  "mcpServers": {
    "zim-mcp-server": {
      "command": "wsl.exe",
      "args": [
        "bash",
        "-c",
        "node /home/username/Code/zim-mcp-server/build/index.js /home/username/Code/zim"
      ]
    }
  }
}
```

Replace `/path/to/zim-mcp-server` with your project path and `/path/to/zim` with your ZIM files directory path.

## Available Tools

1. `list-zim-files`: List all ZIM files in allowed directories
2. `search-zim-file`: Search within ZIM file content
   - Required: `zimFilePath`, `query`
   - Optional: `limit` (default: 10), `offset` (default: 0)
3. `get-zim-entry`: Get detailed content of a specific entry
   - Required: `zimFilePath`, `entryPath`
   - Optional: `maxContentLength` (default: 10000)

## License

MIT
