qlik-sense-mcp-server


Nameqlik-sense-mcp-server JSON
Version 1.0.3 PyPI version JSON
download
home_pageNone
SummaryMCP Server for Qlik Sense Enterprise APIs
upload_time2025-07-22 19:47:38
maintainerNone
docs_urlNone
authorNone
requires_python>=3.12
licenseMIT
keywords analytics mcp model-context-protocol qlik qlik-sense
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Qlik Sense MCP Server

Model Context Protocol (MCP) server for integration with Qlik Sense Enterprise APIs. Provides unified interface for Repository API and Engine API operations through MCP protocol.

## Table of Contents

- [Overview](#overview)
- [Features](#features)
- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
- [API Reference](#api-reference)
- [Architecture](#architecture)
- [Development](#development)
- [Troubleshooting](#troubleshooting)
- [License](#license)

## Overview

Qlik Sense MCP Server bridges Qlik Sense Enterprise with systems supporting Model Context Protocol. Server provides 21 tools for applications, data, users, and analytics operations.

### Key Features

- **Unified API**: Single interface for all Qlik Sense APIs
- **Security**: Certificate-based authentication support
- **Performance**: Optimized queries and response handling
- **Flexibility**: Multiple data export formats
- **Analytics**: Advanced data analysis tools

## Features

### Repository API (Fully Working)
| Command | Description | Status |
|---------|-------------|--------|
| `get_apps` | Retrieve list of applications | ✅ |
| `get_app_details` | Get detailed application information | ✅ |
| `get_app_metadata` | Get application metadata via REST API | ✅ |
| `get_users` | Retrieve list of users | ✅ |
| `get_streams` | Get list of streams | ✅ |
| `get_tasks` | Retrieve list of tasks | ✅ |
| `start_task` | Execute task | ✅ |
| `get_data_connections` | Get data connections | ✅ |
| `get_extensions` | Retrieve extensions | ✅ |
| `get_content_libraries` | Get content libraries | ✅ |

### Engine API (Fully Working)
| Command | Description | Status |
|---------|-------------|--------|
| `engine_get_doc_list` | List documents via Engine API | ✅ |
| `engine_open_app` | Open application via Engine API | ✅ |
| `engine_get_script` | Get load script from application | ✅ |
| `engine_get_fields` | Retrieve application fields | ✅ |
| `engine_get_sheets` | Get application sheets | ✅ |
| `engine_get_table_data` | Extract data from tables | ✅ |
| `engine_get_field_values` | Get field values with frequency | ✅ |
| `engine_get_field_statistics` | Get comprehensive field statistics | ✅ |
| `engine_get_data_model` | Get complete data model | ✅ |
| `engine_create_hypercube` | Create hypercube for analysis | ✅ |
| `engine_create_data_export` | Export data in multiple formats | ✅ |

## Installation

### Quick Start with uvx (Recommended)

The easiest way to use Qlik Sense MCP Server is with uvx:

```bash
uvx qlik-sense-mcp-server
```

This command will automatically install and run the latest version without affecting your system Python environment.

### Alternative Installation Methods

#### From PyPI
```bash
pip install qlik-sense-mcp-server
```

#### From Source (Development)
```bash
git clone https://github.com/bintocher/qlik-sense-mcp.git
cd qlik-sense-mcp
make dev
```

### System Requirements

- Python 3.12+
- Qlik Sense Enterprise
- Valid certificates for authentication
- Network access to Qlik Sense server

### Setup

1. **Setup certificates**
```bash
mkdir certs
# Copy your Qlik Sense certificates to certs/ directory
```

2. **Create configuration**
```bash
cp .env.example .env
# Edit .env with your settings
```

## Configuration

### Environment Variables (.env)

```bash
# Server connection
QLIK_SERVER_URL=https://your-qlik-server.company.com
QLIK_USER_DIRECTORY=COMPANY
QLIK_USER_ID=your-username

# Certificate paths (absolute paths)
QLIK_CLIENT_CERT_PATH=/path/to/certs/client.pem
QLIK_CLIENT_KEY_PATH=/path/to/certs/client_key.pem
QLIK_CA_CERT_PATH=/path/to/certs/root.pem

# API ports (standard Qlik Sense ports)
QLIK_REPOSITORY_PORT=4242
QLIK_PROXY_PORT=4243
QLIK_ENGINE_PORT=4747

# SSL settings
QLIK_VERIFY_SSL=false
```

### MCP Configuration

Create `mcp.json` file for MCP client integration:

```json
{
  "mcpServers": {
    "qlik-sense": {
      "command": "uvx",
      "args": ["qlik-sense-mcp-server"],
      "env": {
        "QLIK_SERVER_URL": "https://your-qlik-server.company.com",
        "QLIK_USER_DIRECTORY": "COMPANY",
        "QLIK_USER_ID": "your-username",
        "QLIK_CLIENT_CERT_PATH": "/path/to/certs/client.pem",
        "QLIK_CLIENT_KEY_PATH": "/path/to/certs/client_key.pem",
        "QLIK_CA_CERT_PATH": "/path/to/certs/root.pem",
        "QLIK_REPOSITORY_PORT": "4242",
        "QLIK_ENGINE_PORT": "4747",
        "QLIK_VERIFY_SSL": "false"
      },
      "disabled": false,
      "autoApprove": [
        "get_apps",
        "get_app_details",
        "get_app_metadata",
        "get_users",
        "get_streams",
        "get_tasks",
        "get_data_connections",
        "get_extensions",
        "get_content_libraries",
        "engine_get_doc_list",
        "engine_open_app",
        "engine_get_script",
        "engine_get_fields",
        "engine_get_sheets",
        "engine_get_table_data",
        "engine_get_field_values",
        "engine_get_field_statistics",
        "engine_get_data_model",
        "engine_create_hypercube",
        "engine_create_data_export"
      ]
    }
  }
}
```

## Usage

### Start Server

```bash
# Using uvx (recommended)
uvx qlik-sense-mcp-server

# Using installed package
qlik-sense-mcp-server

# From source (development)
python -m qlik_sense_mcp_server.server
```

### Example Operations

#### Get Applications List
```python
# Via MCP client
result = mcp_client.call_tool("get_apps")
print(f"Found {len(result)} applications")
```

#### Create Data Analysis Hypercube
```python
# Create hypercube for sales analysis
result = mcp_client.call_tool("engine_create_hypercube", {
    "app_id": "your-app-id",
    "dimensions": ["Region", "Product"],
    "measures": ["Sum(Sales)", "Count(Orders)"],
    "max_rows": 1000
})
```

#### Export Data
```python
# Export data in CSV format
result = mcp_client.call_tool("engine_create_data_export", {
    "app_id": "your-app-id",
    "table_name": "Sales",
    "format_type": "csv",
    "max_rows": 10000
})
```

## API Reference

### Repository API Functions

#### get_apps
Retrieves list of all Qlik Sense applications.

**Parameters:**
- `filter` (optional): Filter query for application search

**Returns:** Array of application objects with metadata

#### get_app_details
Gets detailed information about specific application.

**Parameters:**
- `app_id` (required): Application identifier

**Returns:** Application object with complete metadata

#### get_app_metadata
Retrieves comprehensive application metadata including data model.

**Parameters:**
- `app_id` (required): Application identifier

**Returns:** Object containing app overview, data model summary, sheets information

#### get_users
Retrieves list of Qlik Sense users.

**Parameters:**
- `filter` (optional): Filter query for user search

**Returns:** Array of user objects

#### get_streams
Gets list of application streams.

**Parameters:** None

**Returns:** Array of stream objects

#### get_tasks
Retrieves list of tasks (reload, external program).

**Parameters:**
- `task_type` (optional): Type filter ("reload", "external", "all")

**Returns:** Array of task objects with execution history

#### start_task
Executes specified task.

**Parameters:**
- `task_id` (required): Task identifier

**Returns:** Execution result object

#### get_data_connections
Gets list of data connections.

**Parameters:**
- `filter` (optional): Filter query for connection search

**Returns:** Array of data connection objects

#### get_extensions
Retrieves list of Qlik Sense extensions.

**Parameters:** None

**Returns:** Array of extension objects

#### get_content_libraries
Gets list of content libraries.

**Parameters:** None

**Returns:** Array of content library objects

### Engine API Functions

#### engine_get_doc_list
Lists available documents via Engine API.

**Parameters:** None

**Returns:** Array of document objects with metadata

#### engine_open_app
Opens application via Engine API for further operations.

**Parameters:**
- `app_id` (required): Application identifier

**Returns:** Application handle object for subsequent operations

#### engine_get_script
Retrieves load script from application.

**Parameters:**
- `app_id` (required): Application identifier

**Returns:** Object containing script text and metadata

#### engine_get_fields
Gets list of fields from application.

**Parameters:**
- `app_id` (required): Application identifier

**Returns:** Array of field objects with metadata and statistics

#### engine_get_sheets
Retrieves application sheets.

**Parameters:**
- `app_id` (required): Application identifier

**Returns:** Array of sheet objects with metadata

#### engine_get_table_data
Extracts data from application tables.

**Parameters:**
- `app_id` (required): Application identifier
- `table_name` (optional): Specific table name
- `max_rows` (optional): Maximum rows to return (default: 1000)

**Returns:** Table data with headers and row information

#### engine_get_field_values
Gets field values with frequency information.

**Parameters:**
- `app_id` (required): Application identifier
- `field_name` (required): Field name
- `max_values` (optional): Maximum values to return (default: 100)
- `include_frequency` (optional): Include frequency data (default: true)

**Returns:** Field values with frequency and metadata

#### engine_get_field_statistics
Retrieves comprehensive field statistics.

**Parameters:**
- `app_id` (required): Application identifier
- `field_name` (required): Field name

**Returns:** Statistical analysis including min, max, average, median, mode, standard deviation

#### engine_get_data_model
Gets complete data model with tables and associations.

**Parameters:**
- `app_id` (required): Application identifier

**Returns:** Data model structure with relationships

#### engine_create_hypercube
Creates hypercube for data analysis.

**Parameters:**
- `app_id` (required): Application identifier
- `dimensions` (required): Array of dimension fields
- `measures` (required): Array of measure expressions
- `max_rows` (optional): Maximum rows to return (default: 1000)

**Returns:** Hypercube data with dimensions and measures

#### engine_create_data_export
Exports data in various formats.

**Parameters:**
- `app_id` (required): Application identifier
- `table_name` (optional): Table name for export
- `fields` (optional): Specific fields to export
- `format_type` (optional): Export format ("json", "csv", "simple")
- `max_rows` (optional): Maximum rows to export (default: 10000)
- `filters` (optional): Field filters for data selection

**Returns:** Exported data in specified format

## Architecture

### Project Structure
```
qlik-sense-mcp/
├── qlik_sense_mcp_server/
│   ├── __init__.py
│   ├── server.py          # Main MCP server
│   ├── config.py          # Configuration management
│   ├── repository_api.py  # Repository API client
│   └── engine_api.py      # Engine API client (WebSocket)
├── certs/                 # Certificates (git ignored)
│   ├── client.pem
│   ├── client_key.pem
│   └── root.pem
├── .env.example          # Configuration template
├── .env                  # Your configuration
├── mcp.json.example      # MCP configuration template
├── pyproject.toml        # Project dependencies
└── README.md
```

### System Components

#### QlikSenseMCPServer
Main server class handling MCP protocol operations, tool registration, and request routing.

#### QlikRepositoryAPI
HTTP client for Repository API operations including applications, users, tasks, and metadata management.

#### QlikEngineAPI
WebSocket client for Engine API operations including data extraction, analytics, and hypercube creation.

#### QlikSenseConfig
Configuration management class handling environment variables, certificate paths, and connection settings.

## Development

### Development Environment Setup

The project includes a Makefile with common development tasks:

```bash
# Setup development environment
make dev

# Show all available commands
make help

# Build package
make build
```

### Version Management and Releases

Use Makefile commands for version management:

```bash
# Bump patch version and create PR
make version-patch

# Bump minor version and create PR
make version-minor

# Bump major version and create PR
make version-major
```

This will automatically:
1. Bump the version in `pyproject.toml`
2. Create a new branch
3. Commit changes
4. Push branch and create PR

### Publishing Process

1. **Merge PR** with version bump
2. **Create and push tag** to trigger automatic PyPI publication:
   ```bash
   git tag v1.0.1
   git push origin v1.0.1
   ```
3. **GitHub Actions** will automatically build and publish to PyPI

### Clean Git History

If you need to start with a clean git history:

```bash
make git-clean
```

**Warning**: This completely removes git history!

### Adding New Functions

1. **Add tool definition in server.py**
```python
# In handle_list_tools()
{"name": "new_tool", "description": "Tool description", "inputSchema": {...}}
```

2. **Add handler in server.py**
```python
# In handle_call_tool()
elif name == "new_tool":
    result = await asyncio.to_thread(self.api_client.new_method, arguments)
    return [TextContent(type="text", text=json.dumps(result, indent=2))]
```

3. **Implement method in API client**
```python
# In repository_api.py or engine_api.py
def new_method(self, param: str) -> Dict[str, Any]:
    """Method implementation."""
    # Implementation code
    return result
```

### Code Standards

The project uses standard Python conventions. Build and test the package:

```bash
make build   # Build package
```

## Troubleshooting

### Common Issues

#### Certificate Errors
```
SSL: CERTIFICATE_VERIFY_FAILED
```
**Solution:**
- Verify certificate paths in `.env`
- Check certificate expiration
- Set `QLIK_VERIFY_SSL=false` for testing

#### Connection Errors
```
ConnectionError: Failed to connect to Engine API
```
**Solution:**
- Verify port 4747 accessibility
- Check server URL correctness
- Verify firewall settings

#### Authentication Errors
```
401 Unauthorized
```
**Solution:**
- Verify `QLIK_USER_DIRECTORY` and `QLIK_USER_ID`
- Check user exists in Qlik Sense
- Verify user permissions

### Diagnostics

#### Test Repository API
```bash
python -c "
from qlik_sense_mcp_server.config import QlikSenseConfig
from qlik_sense_mcp_server.repository_api import QlikRepositoryAPI
config = QlikSenseConfig.from_env()
api = QlikRepositoryAPI(config)
print('Apps:', len(api.get_apps()))
"
```

#### Test Engine API
```bash
python -c "
from qlik_sense_mcp_server.config import QlikSenseConfig
from qlik_sense_mcp_server.engine_api import QlikEngineAPI
config = QlikSenseConfig.from_env()
api = QlikEngineAPI(config)
api.connect()
print('Docs:', len(api.get_doc_list()))
api.disconnect()
"
```

## Performance

### Optimization Recommendations

1. **Use filters** to limit data volume
2. **Cache results** for frequently used queries
3. **Limit result size** with `max_rows` parameter
4. **Use Repository API** for metadata (faster than Engine API)

### Benchmarks

| Operation | Average Time | Recommendations |
|-----------|--------------|-----------------|
| get_apps | 0.5s | Use filters |
| get_app_metadata | 2-5s | Cache results |
| engine_create_hypercube | 1-10s | Limit size |
| engine_create_data_export | 5-30s | Use pagination |

## Security

### Recommendations

1. **Store certificates securely** - exclude from git
2. **Use environment variables** for sensitive data
3. **Limit user permissions** in Qlik Sense
4. **Update certificates regularly**
5. **Monitor API access**

### Access Control

Create user in QMC with minimal required permissions:
- Read applications
- Execute tasks (if needed)
- Access Engine API

## License

MIT License

Copyright (c) 2025 Stanislav Chernov

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

---

**Project Status**: Production Ready | 21/21 Commands Working | v1.0.0

**Installation**: `uvx qlik-sense-mcp-server`

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "qlik-sense-mcp-server",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.12",
    "maintainer_email": null,
    "keywords": "analytics, mcp, model-context-protocol, qlik, qlik-sense",
    "author": null,
    "author_email": "Stanislav Chernov <bintocher@yandex.com>",
    "download_url": "https://files.pythonhosted.org/packages/8f/c5/d38de4d064093da0909a9d54cf167d7f6d2cfca185655a7fb6638bbdd478/qlik_sense_mcp_server-1.0.3.tar.gz",
    "platform": null,
    "description": "# Qlik Sense MCP Server\n\nModel Context Protocol (MCP) server for integration with Qlik Sense Enterprise APIs. Provides unified interface for Repository API and Engine API operations through MCP protocol.\n\n## Table of Contents\n\n- [Overview](#overview)\n- [Features](#features)\n- [Installation](#installation)\n- [Configuration](#configuration)\n- [Usage](#usage)\n- [API Reference](#api-reference)\n- [Architecture](#architecture)\n- [Development](#development)\n- [Troubleshooting](#troubleshooting)\n- [License](#license)\n\n## Overview\n\nQlik Sense MCP Server bridges Qlik Sense Enterprise with systems supporting Model Context Protocol. Server provides 21 tools for applications, data, users, and analytics operations.\n\n### Key Features\n\n- **Unified API**: Single interface for all Qlik Sense APIs\n- **Security**: Certificate-based authentication support\n- **Performance**: Optimized queries and response handling\n- **Flexibility**: Multiple data export formats\n- **Analytics**: Advanced data analysis tools\n\n## Features\n\n### Repository API (Fully Working)\n| Command | Description | Status |\n|---------|-------------|--------|\n| `get_apps` | Retrieve list of applications | \u2705 |\n| `get_app_details` | Get detailed application information | \u2705 |\n| `get_app_metadata` | Get application metadata via REST API | \u2705 |\n| `get_users` | Retrieve list of users | \u2705 |\n| `get_streams` | Get list of streams | \u2705 |\n| `get_tasks` | Retrieve list of tasks | \u2705 |\n| `start_task` | Execute task | \u2705 |\n| `get_data_connections` | Get data connections | \u2705 |\n| `get_extensions` | Retrieve extensions | \u2705 |\n| `get_content_libraries` | Get content libraries | \u2705 |\n\n### Engine API (Fully Working)\n| Command | Description | Status |\n|---------|-------------|--------|\n| `engine_get_doc_list` | List documents via Engine API | \u2705 |\n| `engine_open_app` | Open application via Engine API | \u2705 |\n| `engine_get_script` | Get load script from application | \u2705 |\n| `engine_get_fields` | Retrieve application fields | \u2705 |\n| `engine_get_sheets` | Get application sheets | \u2705 |\n| `engine_get_table_data` | Extract data from tables | \u2705 |\n| `engine_get_field_values` | Get field values with frequency | \u2705 |\n| `engine_get_field_statistics` | Get comprehensive field statistics | \u2705 |\n| `engine_get_data_model` | Get complete data model | \u2705 |\n| `engine_create_hypercube` | Create hypercube for analysis | \u2705 |\n| `engine_create_data_export` | Export data in multiple formats | \u2705 |\n\n## Installation\n\n### Quick Start with uvx (Recommended)\n\nThe easiest way to use Qlik Sense MCP Server is with uvx:\n\n```bash\nuvx qlik-sense-mcp-server\n```\n\nThis command will automatically install and run the latest version without affecting your system Python environment.\n\n### Alternative Installation Methods\n\n#### From PyPI\n```bash\npip install qlik-sense-mcp-server\n```\n\n#### From Source (Development)\n```bash\ngit clone https://github.com/bintocher/qlik-sense-mcp.git\ncd qlik-sense-mcp\nmake dev\n```\n\n### System Requirements\n\n- Python 3.12+\n- Qlik Sense Enterprise\n- Valid certificates for authentication\n- Network access to Qlik Sense server\n\n### Setup\n\n1. **Setup certificates**\n```bash\nmkdir certs\n# Copy your Qlik Sense certificates to certs/ directory\n```\n\n2. **Create configuration**\n```bash\ncp .env.example .env\n# Edit .env with your settings\n```\n\n## Configuration\n\n### Environment Variables (.env)\n\n```bash\n# Server connection\nQLIK_SERVER_URL=https://your-qlik-server.company.com\nQLIK_USER_DIRECTORY=COMPANY\nQLIK_USER_ID=your-username\n\n# Certificate paths (absolute paths)\nQLIK_CLIENT_CERT_PATH=/path/to/certs/client.pem\nQLIK_CLIENT_KEY_PATH=/path/to/certs/client_key.pem\nQLIK_CA_CERT_PATH=/path/to/certs/root.pem\n\n# API ports (standard Qlik Sense ports)\nQLIK_REPOSITORY_PORT=4242\nQLIK_PROXY_PORT=4243\nQLIK_ENGINE_PORT=4747\n\n# SSL settings\nQLIK_VERIFY_SSL=false\n```\n\n### MCP Configuration\n\nCreate `mcp.json` file for MCP client integration:\n\n```json\n{\n  \"mcpServers\": {\n    \"qlik-sense\": {\n      \"command\": \"uvx\",\n      \"args\": [\"qlik-sense-mcp-server\"],\n      \"env\": {\n        \"QLIK_SERVER_URL\": \"https://your-qlik-server.company.com\",\n        \"QLIK_USER_DIRECTORY\": \"COMPANY\",\n        \"QLIK_USER_ID\": \"your-username\",\n        \"QLIK_CLIENT_CERT_PATH\": \"/path/to/certs/client.pem\",\n        \"QLIK_CLIENT_KEY_PATH\": \"/path/to/certs/client_key.pem\",\n        \"QLIK_CA_CERT_PATH\": \"/path/to/certs/root.pem\",\n        \"QLIK_REPOSITORY_PORT\": \"4242\",\n        \"QLIK_ENGINE_PORT\": \"4747\",\n        \"QLIK_VERIFY_SSL\": \"false\"\n      },\n      \"disabled\": false,\n      \"autoApprove\": [\n        \"get_apps\",\n        \"get_app_details\",\n        \"get_app_metadata\",\n        \"get_users\",\n        \"get_streams\",\n        \"get_tasks\",\n        \"get_data_connections\",\n        \"get_extensions\",\n        \"get_content_libraries\",\n        \"engine_get_doc_list\",\n        \"engine_open_app\",\n        \"engine_get_script\",\n        \"engine_get_fields\",\n        \"engine_get_sheets\",\n        \"engine_get_table_data\",\n        \"engine_get_field_values\",\n        \"engine_get_field_statistics\",\n        \"engine_get_data_model\",\n        \"engine_create_hypercube\",\n        \"engine_create_data_export\"\n      ]\n    }\n  }\n}\n```\n\n## Usage\n\n### Start Server\n\n```bash\n# Using uvx (recommended)\nuvx qlik-sense-mcp-server\n\n# Using installed package\nqlik-sense-mcp-server\n\n# From source (development)\npython -m qlik_sense_mcp_server.server\n```\n\n### Example Operations\n\n#### Get Applications List\n```python\n# Via MCP client\nresult = mcp_client.call_tool(\"get_apps\")\nprint(f\"Found {len(result)} applications\")\n```\n\n#### Create Data Analysis Hypercube\n```python\n# Create hypercube for sales analysis\nresult = mcp_client.call_tool(\"engine_create_hypercube\", {\n    \"app_id\": \"your-app-id\",\n    \"dimensions\": [\"Region\", \"Product\"],\n    \"measures\": [\"Sum(Sales)\", \"Count(Orders)\"],\n    \"max_rows\": 1000\n})\n```\n\n#### Export Data\n```python\n# Export data in CSV format\nresult = mcp_client.call_tool(\"engine_create_data_export\", {\n    \"app_id\": \"your-app-id\",\n    \"table_name\": \"Sales\",\n    \"format_type\": \"csv\",\n    \"max_rows\": 10000\n})\n```\n\n## API Reference\n\n### Repository API Functions\n\n#### get_apps\nRetrieves list of all Qlik Sense applications.\n\n**Parameters:**\n- `filter` (optional): Filter query for application search\n\n**Returns:** Array of application objects with metadata\n\n#### get_app_details\nGets detailed information about specific application.\n\n**Parameters:**\n- `app_id` (required): Application identifier\n\n**Returns:** Application object with complete metadata\n\n#### get_app_metadata\nRetrieves comprehensive application metadata including data model.\n\n**Parameters:**\n- `app_id` (required): Application identifier\n\n**Returns:** Object containing app overview, data model summary, sheets information\n\n#### get_users\nRetrieves list of Qlik Sense users.\n\n**Parameters:**\n- `filter` (optional): Filter query for user search\n\n**Returns:** Array of user objects\n\n#### get_streams\nGets list of application streams.\n\n**Parameters:** None\n\n**Returns:** Array of stream objects\n\n#### get_tasks\nRetrieves list of tasks (reload, external program).\n\n**Parameters:**\n- `task_type` (optional): Type filter (\"reload\", \"external\", \"all\")\n\n**Returns:** Array of task objects with execution history\n\n#### start_task\nExecutes specified task.\n\n**Parameters:**\n- `task_id` (required): Task identifier\n\n**Returns:** Execution result object\n\n#### get_data_connections\nGets list of data connections.\n\n**Parameters:**\n- `filter` (optional): Filter query for connection search\n\n**Returns:** Array of data connection objects\n\n#### get_extensions\nRetrieves list of Qlik Sense extensions.\n\n**Parameters:** None\n\n**Returns:** Array of extension objects\n\n#### get_content_libraries\nGets list of content libraries.\n\n**Parameters:** None\n\n**Returns:** Array of content library objects\n\n### Engine API Functions\n\n#### engine_get_doc_list\nLists available documents via Engine API.\n\n**Parameters:** None\n\n**Returns:** Array of document objects with metadata\n\n#### engine_open_app\nOpens application via Engine API for further operations.\n\n**Parameters:**\n- `app_id` (required): Application identifier\n\n**Returns:** Application handle object for subsequent operations\n\n#### engine_get_script\nRetrieves load script from application.\n\n**Parameters:**\n- `app_id` (required): Application identifier\n\n**Returns:** Object containing script text and metadata\n\n#### engine_get_fields\nGets list of fields from application.\n\n**Parameters:**\n- `app_id` (required): Application identifier\n\n**Returns:** Array of field objects with metadata and statistics\n\n#### engine_get_sheets\nRetrieves application sheets.\n\n**Parameters:**\n- `app_id` (required): Application identifier\n\n**Returns:** Array of sheet objects with metadata\n\n#### engine_get_table_data\nExtracts data from application tables.\n\n**Parameters:**\n- `app_id` (required): Application identifier\n- `table_name` (optional): Specific table name\n- `max_rows` (optional): Maximum rows to return (default: 1000)\n\n**Returns:** Table data with headers and row information\n\n#### engine_get_field_values\nGets field values with frequency information.\n\n**Parameters:**\n- `app_id` (required): Application identifier\n- `field_name` (required): Field name\n- `max_values` (optional): Maximum values to return (default: 100)\n- `include_frequency` (optional): Include frequency data (default: true)\n\n**Returns:** Field values with frequency and metadata\n\n#### engine_get_field_statistics\nRetrieves comprehensive field statistics.\n\n**Parameters:**\n- `app_id` (required): Application identifier\n- `field_name` (required): Field name\n\n**Returns:** Statistical analysis including min, max, average, median, mode, standard deviation\n\n#### engine_get_data_model\nGets complete data model with tables and associations.\n\n**Parameters:**\n- `app_id` (required): Application identifier\n\n**Returns:** Data model structure with relationships\n\n#### engine_create_hypercube\nCreates hypercube for data analysis.\n\n**Parameters:**\n- `app_id` (required): Application identifier\n- `dimensions` (required): Array of dimension fields\n- `measures` (required): Array of measure expressions\n- `max_rows` (optional): Maximum rows to return (default: 1000)\n\n**Returns:** Hypercube data with dimensions and measures\n\n#### engine_create_data_export\nExports data in various formats.\n\n**Parameters:**\n- `app_id` (required): Application identifier\n- `table_name` (optional): Table name for export\n- `fields` (optional): Specific fields to export\n- `format_type` (optional): Export format (\"json\", \"csv\", \"simple\")\n- `max_rows` (optional): Maximum rows to export (default: 10000)\n- `filters` (optional): Field filters for data selection\n\n**Returns:** Exported data in specified format\n\n## Architecture\n\n### Project Structure\n```\nqlik-sense-mcp/\n\u251c\u2500\u2500 qlik_sense_mcp_server/\n\u2502   \u251c\u2500\u2500 __init__.py\n\u2502   \u251c\u2500\u2500 server.py          # Main MCP server\n\u2502   \u251c\u2500\u2500 config.py          # Configuration management\n\u2502   \u251c\u2500\u2500 repository_api.py  # Repository API client\n\u2502   \u2514\u2500\u2500 engine_api.py      # Engine API client (WebSocket)\n\u251c\u2500\u2500 certs/                 # Certificates (git ignored)\n\u2502   \u251c\u2500\u2500 client.pem\n\u2502   \u251c\u2500\u2500 client_key.pem\n\u2502   \u2514\u2500\u2500 root.pem\n\u251c\u2500\u2500 .env.example          # Configuration template\n\u251c\u2500\u2500 .env                  # Your configuration\n\u251c\u2500\u2500 mcp.json.example      # MCP configuration template\n\u251c\u2500\u2500 pyproject.toml        # Project dependencies\n\u2514\u2500\u2500 README.md\n```\n\n### System Components\n\n#### QlikSenseMCPServer\nMain server class handling MCP protocol operations, tool registration, and request routing.\n\n#### QlikRepositoryAPI\nHTTP client for Repository API operations including applications, users, tasks, and metadata management.\n\n#### QlikEngineAPI\nWebSocket client for Engine API operations including data extraction, analytics, and hypercube creation.\n\n#### QlikSenseConfig\nConfiguration management class handling environment variables, certificate paths, and connection settings.\n\n## Development\n\n### Development Environment Setup\n\nThe project includes a Makefile with common development tasks:\n\n```bash\n# Setup development environment\nmake dev\n\n# Show all available commands\nmake help\n\n# Build package\nmake build\n```\n\n### Version Management and Releases\n\nUse Makefile commands for version management:\n\n```bash\n# Bump patch version and create PR\nmake version-patch\n\n# Bump minor version and create PR\nmake version-minor\n\n# Bump major version and create PR\nmake version-major\n```\n\nThis will automatically:\n1. Bump the version in `pyproject.toml`\n2. Create a new branch\n3. Commit changes\n4. Push branch and create PR\n\n### Publishing Process\n\n1. **Merge PR** with version bump\n2. **Create and push tag** to trigger automatic PyPI publication:\n   ```bash\n   git tag v1.0.1\n   git push origin v1.0.1\n   ```\n3. **GitHub Actions** will automatically build and publish to PyPI\n\n### Clean Git History\n\nIf you need to start with a clean git history:\n\n```bash\nmake git-clean\n```\n\n**Warning**: This completely removes git history!\n\n### Adding New Functions\n\n1. **Add tool definition in server.py**\n```python\n# In handle_list_tools()\n{\"name\": \"new_tool\", \"description\": \"Tool description\", \"inputSchema\": {...}}\n```\n\n2. **Add handler in server.py**\n```python\n# In handle_call_tool()\nelif name == \"new_tool\":\n    result = await asyncio.to_thread(self.api_client.new_method, arguments)\n    return [TextContent(type=\"text\", text=json.dumps(result, indent=2))]\n```\n\n3. **Implement method in API client**\n```python\n# In repository_api.py or engine_api.py\ndef new_method(self, param: str) -> Dict[str, Any]:\n    \"\"\"Method implementation.\"\"\"\n    # Implementation code\n    return result\n```\n\n### Code Standards\n\nThe project uses standard Python conventions. Build and test the package:\n\n```bash\nmake build   # Build package\n```\n\n## Troubleshooting\n\n### Common Issues\n\n#### Certificate Errors\n```\nSSL: CERTIFICATE_VERIFY_FAILED\n```\n**Solution:**\n- Verify certificate paths in `.env`\n- Check certificate expiration\n- Set `QLIK_VERIFY_SSL=false` for testing\n\n#### Connection Errors\n```\nConnectionError: Failed to connect to Engine API\n```\n**Solution:**\n- Verify port 4747 accessibility\n- Check server URL correctness\n- Verify firewall settings\n\n#### Authentication Errors\n```\n401 Unauthorized\n```\n**Solution:**\n- Verify `QLIK_USER_DIRECTORY` and `QLIK_USER_ID`\n- Check user exists in Qlik Sense\n- Verify user permissions\n\n### Diagnostics\n\n#### Test Repository API\n```bash\npython -c \"\nfrom qlik_sense_mcp_server.config import QlikSenseConfig\nfrom qlik_sense_mcp_server.repository_api import QlikRepositoryAPI\nconfig = QlikSenseConfig.from_env()\napi = QlikRepositoryAPI(config)\nprint('Apps:', len(api.get_apps()))\n\"\n```\n\n#### Test Engine API\n```bash\npython -c \"\nfrom qlik_sense_mcp_server.config import QlikSenseConfig\nfrom qlik_sense_mcp_server.engine_api import QlikEngineAPI\nconfig = QlikSenseConfig.from_env()\napi = QlikEngineAPI(config)\napi.connect()\nprint('Docs:', len(api.get_doc_list()))\napi.disconnect()\n\"\n```\n\n## Performance\n\n### Optimization Recommendations\n\n1. **Use filters** to limit data volume\n2. **Cache results** for frequently used queries\n3. **Limit result size** with `max_rows` parameter\n4. **Use Repository API** for metadata (faster than Engine API)\n\n### Benchmarks\n\n| Operation | Average Time | Recommendations |\n|-----------|--------------|-----------------|\n| get_apps | 0.5s | Use filters |\n| get_app_metadata | 2-5s | Cache results |\n| engine_create_hypercube | 1-10s | Limit size |\n| engine_create_data_export | 5-30s | Use pagination |\n\n## Security\n\n### Recommendations\n\n1. **Store certificates securely** - exclude from git\n2. **Use environment variables** for sensitive data\n3. **Limit user permissions** in Qlik Sense\n4. **Update certificates regularly**\n5. **Monitor API access**\n\n### Access Control\n\nCreate user in QMC with minimal required permissions:\n- Read applications\n- Execute tasks (if needed)\n- Access Engine API\n\n## License\n\nMIT License\n\nCopyright (c) 2025 Stanislav Chernov\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n---\n\n**Project Status**: Production Ready | 21/21 Commands Working | v1.0.0\n\n**Installation**: `uvx qlik-sense-mcp-server`\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "MCP Server for Qlik Sense Enterprise APIs",
    "version": "1.0.3",
    "project_urls": {
        "Homepage": "https://github.com/bintocher/qlik-sense-mcp",
        "Issues": "https://github.com/bintocher/qlik-sense-mcp/issues",
        "Repository": "https://github.com/bintocher/qlik-sense-mcp"
    },
    "split_keywords": [
        "analytics",
        " mcp",
        " model-context-protocol",
        " qlik",
        " qlik-sense"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "eb6d0f00cf1e388bac30638a9a4f74e20fc684d3dedc2038ab4a2db3e3f3cb9e",
                "md5": "bfac1cbfaaf99976bb184aa95619a971",
                "sha256": "12da42b2b878ca432a9e6891f3fca966dffa066409d5e03a5bcd082bf0b2b20b"
            },
            "downloads": -1,
            "filename": "qlik_sense_mcp_server-1.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bfac1cbfaaf99976bb184aa95619a971",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.12",
            "size": 32756,
            "upload_time": "2025-07-22T19:47:37",
            "upload_time_iso_8601": "2025-07-22T19:47:37.698599Z",
            "url": "https://files.pythonhosted.org/packages/eb/6d/0f00cf1e388bac30638a9a4f74e20fc684d3dedc2038ab4a2db3e3f3cb9e/qlik_sense_mcp_server-1.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "8fc5d38de4d064093da0909a9d54cf167d7f6d2cfca185655a7fb6638bbdd478",
                "md5": "13977eba3aa58ed2d708e6d401b0c55e",
                "sha256": "4de13238981182c3225ca8b7d98d583589420ac41cfbb069850c9e913fe6c5c3"
            },
            "downloads": -1,
            "filename": "qlik_sense_mcp_server-1.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "13977eba3aa58ed2d708e6d401b0c55e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.12",
            "size": 33070,
            "upload_time": "2025-07-22T19:47:38",
            "upload_time_iso_8601": "2025-07-22T19:47:38.952633Z",
            "url": "https://files.pythonhosted.org/packages/8f/c5/d38de4d064093da0909a9d54cf167d7f6d2cfca185655a7fb6638bbdd478/qlik_sense_mcp_server-1.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-22 19:47:38",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "bintocher",
    "github_project": "qlik-sense-mcp",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "qlik-sense-mcp-server"
}
        
Elapsed time: 1.04089s