API wrapper, CLI tool, and MCP server for Vikunja
Project description
Vikunja Python
Python API wrapper, CLI tool, MCP server, and Home Assistant integration for the Vikunja task management system.
Built for Python 3.13 with httpx, pydantic v2, fastmcp, and typer.
Architecture
The project is structured into layers:
- core/ -- Pydantic models, async HTTP client (httpx), error handling, API token and JWT authentication
- cli/ -- Rich CLI built with typer and rich (task CRUD, project views, saved filter queries, dashboard summary)
- mcp/ -- MCP server for agentic AI workflows (13 tools including list_tasks, get_task, create_task, list_saved_filter, task_summary)
- custom_components/vikunja/ -- Home Assistant HACS integration (config flow, 3 sensors for saved filters)
Getting Started
Installation
From PyPI:
pip install vikunja-python
Or with uv:
uv sync --all-extras
Environment Variables
Configure your Vikunja instance in a .env file or your shell:
VIKUNJA_URL="https://your-vikunja-instance.com/api/v1"
VIKUNJA_API_TOKEN="your_api_token_here"
VIKUNJA_DEBUG="true" # Enable verbose stderr logging
Features
CLI (vikunja)
The CLI provides a human-friendly interface for managing tasks:
- list-tasks -- List tasks with rich table output (supports saved filters via negative project IDs)
- list-saved-filter -- Query saved filters (e.g., -2 for Due in 3 Days, -3 for Overdue, -4 for Due Today)
- summary -- Quick dashboard summary across all saved filters (parallel queries, optimized for ePaper dashboards)
- get-project -- Project details and views
- list-view-tasks -- List tasks from a specific project view
- get-task -- Full task details with description
- create-task -- Create a new task
- create-label -- Create a new label
uv run vikunja list-tasks
uv run vikunja list-saved-filter --filter-id -2
uv run vikunja summary --top 5
MCP Server (vikunja-mcp)
MCP server for agentic workflows. 13 tools including:
- list_tasks, get_task, create_task, update_task, complete_task, delete_task
- list_saved_filter -- Query saved filters (e.g., -2 for Due in 3 Days)
- task_summary -- Dashboard summary across all filters in one parallel call
- list_projects, get_project, list_project_view_tasks
- list_labels, create_label
- add_subtask, add_task_link
uv run vikunja-mcp
Home Assistant Integration
The package includes a HACS-ready custom component for Home Assistant:
- Config flow: URL + API token via the HA UI
- 3 sensors: Overdue, Due Today, Due in 3 Days (from Vikunja saved filters)
- Each sensor: state = task count, attributes = task list with IDs, titles, due dates
- Coordinator polls all filters in parallel every 5 minutes
Copy custom_components/vikunja/ to your HA config's custom_components/ directory, restart HA, and add via Settings -> Devices & Services.
Saved Filter Support
Vikunja saved filters are accessed via negative project IDs:
| ID | Filter |
|---|---|
| -2 | Due in 3 Days |
| -3 | Overdue |
| -4 | Due Today |
The API route is GET /tasks?project_id=-2 (NOT /projects/-2/tasks).
Testing
Unit tests run without Docker:
uv run pytest tests/test_task_models_unit.py tests/test_label_model_validation.py -v
Integration tests require Docker (spins up a real Vikunja instance via testcontainers):
uv run pytest
Security & Auth
- API Key auth is the primary authentication method for both CLI and MCP server
- JWT tokens are used for UI-specific features (kanban buckets, reactions) in the CLI only
- The MCP server only supports API key authentication
License
WTFPL - Do What the Fuck You Want to Public License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vikunja_python-0.1.2.tar.gz.
File metadata
- Download URL: vikunja_python-0.1.2.tar.gz
- Upload date:
- Size: 46.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5daca327b2b4aa1dffc02a511b4075f9d05b3c8dd5f0906689b5a62584c5194
|
|
| MD5 |
8fd53ef0883f880bd04397000202bfd0
|
|
| BLAKE2b-256 |
f1aab256c8b3c4d9bd90e4f2fe55a7e7b563a743e2cc3b59cc5a41dd36785f1c
|
File details
Details for the file vikunja_python-0.1.2-py3-none-any.whl.
File metadata
- Download URL: vikunja_python-0.1.2-py3-none-any.whl
- Upload date:
- Size: 51.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79ad45e96886db094055c2f0203877ee5eca45f3b5634f6c248067e3ee2ffbee
|
|
| MD5 |
3f4e311123baced62dc93b171dcf7889
|
|
| BLAKE2b-256 |
4ee6ce7d798abf05a9f2d035b931aebf02616e0c092bdedf19cc7543614f5d6d
|