README.md
Language Markdown4.2 KB90 lines
# Bitrix24 CRM: Desktop Extension (`.mcpb`)Packages `../server.py` as a one-click **desktop extension** so it can be sharedwith the team through **Organization settings → Connectors → Add → Custom →Desktop**, instead of hand-installing a `.env` on each machine.Why this is the better distribution path:- **The webhook secret moves to the OS keychain.** Each person enters their ownwebhook URL at install (`user_config.webhook_url`, `sensitive: true`); ClaudeDesktop stores it securely and injects it as `BITRIX_WEBHOOK_URL`. No plaintext`.env` to copy around or `chmod 600`.- **Central control.** Owners upload the bundle to the org and gate installs withthe **Desktop extension allowlist** (only allowlisted extensions can beinstalled). That's the "deny anyone outside the org" lever.- **One-click install** for members, with a config UI for every setting.## Runtime model (uv): why this bundle is Python-agnosticSince **v1.15.0** this extension uses the MCPB **`uv` runtime** (`server.type:"uv"`, `manifest_version: 0.4`). Dependencies are declared in[`pyproject.toml`](pyproject.toml), **not** bundled as wheels. At install/firstrun, the host (Claude Desktop) runs the server via:```uv run --directory <ext-dir> src/server.py````uv` resolves the dependencies (including native ones like `pydantic-core`)against a **compatible Python it provisions itself**, per platform and CPU. Thatmeans:- **No pinned Python.** Works on Python `>=3.10`; there is no `cp312`-only ABIlock. uv fetches a matching interpreter if the machine doesn't have one.- **No dependence on the user's `python` being on PATH.** This is what fixes theWindows *"Server disconnected"* failures (Microsoft Store `python` stub, wrongversion, or ABI mismatch).- **One universal bundle** for macOS, Windows, and Linux (Intel + ARM), ~100 KB.It can be built on any OS: no per-platform builds, no cross-fetching wheels.**Requirement:** the member's Claude Desktop must support uv-type extensions(manifest 0.4). Current app builds do, and the host provides/manages `uv`. If amachine somehow can't run the extension, the **manual install** (venv + `.env`,see the top-level README) is the fallback, with the same server.## Build```bashcd mcpb./build.sh # → bitrix24-crm-<version>.mcpb (universal)````build.sh` copies `../server.py` → `src/server.py`, then `mcpb validate` +`mcpb pack`. [`.mcpbignore`](.mcpbignore) keeps `.venv/`, caches, docs, and oldartifacts out of the package. Only `manifest.json`, `pyproject.toml`,`.mcpbignore`, `build.sh`, and this README are committed; `src/`, `.venv/`, and`*.mcpb` are build/runtime artifacts (gitignored).### Versioning for org uploadsThe org rejects an upload whose `version` is not greater than what's stored(`dxt_version_not_greater`). Bump `version` in **both** `manifest.json` and`pyproject.toml`, and keep them in step with the server's `VERSION` in`../server.py`, for every upload.## Settings exposed at install (`user_config`)| Config | Env var | Default || ------ | ------- | ------- || Bitrix24 Webhook URL (sensitive) | `BITRIX_WEBHOOK_URL` | – (required) || Local timezone | `BITRIX_LOCAL_TZ` | America/Chicago || Enable writes | `BITRIX_WRITES` | on || Write-enabled deal funnels | `BITRIX_WRITE_FUNNELS` | `24,26,36` (categoryIds: 24 Partner Tier Upgrade, 26 Winback, 36 Quarterly Check-In Flow; names also accepted but break on rename) || Enable contact/company writes | `BITRIX_WRITE_PARTIES` | on || Call-log redaction mode | `BITRIX_LOG_ARGS` | redact || Enable local transcription | `BITRIX_TRANSCRIBE` | off || Data folder (logs + schema) | `BITRIX_DATA_DIR` | `~/.bitrix24-mcp` |Data (logs + schema snapshots) is written to `BITRIX_DATA_DIR` so it survivesextension updates (the install dir is replaced on update).## Deploy to the org1. Build the `.mcpb` (above).2. As an Owner/Primary Owner: **Organization settings → Connectors → Add →Custom → Desktop**, upload the `.mcpb`.3. Turn on **Desktop extension allowlist** and add this extension so the team caninstall it (and only what you allow).4. Members install it from Claude Desktop and enter **their own** webhook URL.Bump `version` in `manifest.json` and `pyproject.toml` (in step with the server)when you ship an update.