From 3ae697ef1e64e082eb0bf1794696706d968f8e5a Mon Sep 17 00:00:00 2001 From: maxerton Date: Thu, 24 Sep 2026 14:17:00 +0000 Subject: [PATCH] =?UTF-8?q?trello-tools:=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B4?= =?UTF-8?q?=D0=B0=D0=B2=D0=B0=D1=82=D1=8C=20userConfig=20=D0=B2=20env=20?= =?UTF-8?q?=D1=81=D0=B5=D1=80=D0=B2=D0=B5=D1=80=D0=B0=20=D1=8F=D0=B2=D0=BD?= =?UTF-8?q?=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Claude Code 2.1.281 не экспортирует CLAUDE_PLUGIN_OPTION_* в MCP-сервер сам, поэтому plugin.json подставляет их через ${user_config.*}. Co-Authored-By: Claude Opus 5.5 --- .claude-plugin/plugin.json | 12 +++++++++++- README.md | 3 ++- server.py | 7 ++++--- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index ac946af..02b1bbc 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -7,7 +7,17 @@ "mcpServers": { "trello-tools": { "command": "uv", - "args": ["run", "--quiet", "--script", "${CLAUDE_PLUGIN_ROOT}/server.py"] + "args": ["run", "--quiet", "--script", "${CLAUDE_PLUGIN_ROOT}/server.py"], + "env": { + "CLAUDE_PLUGIN_OPTION_TRELLO_API_KEY": "${user_config.trello_api_key}", + "CLAUDE_PLUGIN_OPTION_TRELLO_TOKEN": "${user_config.trello_token}", + "CLAUDE_PLUGIN_OPTION_QA_TASKS_TOKEN": "${user_config.qa_tasks_token}", + "CLAUDE_PLUGIN_OPTION_QA_SERVICE_API_KEY": "${user_config.qa_service_api_key}", + "CLAUDE_PLUGIN_OPTION_QA_SERVICE_URL": "${user_config.qa_service_url}", + "CLAUDE_PLUGIN_OPTION_TRELLO_BOARD_ID": "${user_config.trello_board_id}", + "CLAUDE_PLUGIN_OPTION_TRELLO_CREATE_LISTS": "${user_config.trello_create_lists}", + "CLAUDE_PLUGIN_OPTION_TRELLO_ATTACHMENTS_DIR": "${user_config.trello_attachments_dir}" + } } }, "userConfig": { diff --git a/README.md b/README.md index ef3d5fe..c0eb0c2 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,8 @@ curl -LsSf https://astral.sh/uv/install.sh | sh | QA service API key | только владельцу, остальные оставляют пустым | | QA service URL, Trello board, Trello lists | уже заполнены, менять не нужно | -Изменить ключи позже — через `/config`. После установки перезапусти Claude Code. +Если окно с ключами не появилось или их нужно поменять: +`/plugin configure trello-tools@gp-tools`. После установки перезапусти Claude Code. ## Обновление diff --git a/server.py b/server.py index 18b4538..0ce7414 100644 --- a/server.py +++ b/server.py @@ -37,9 +37,10 @@ import trello load_dotenv(Path(__file__).parent / ".env") -# В плагине .env нет: Claude Code передаёт поля userConfig из -# .claude-plugin/plugin.json как CLAUDE_PLUGIN_OPTION_. Уже заданные -# переменные (например, QA_TASKS_TOKEN из ~/.bashrc) не перетираются. +# В плагине .env нет: .claude-plugin/plugin.json передаёт поля userConfig +# в env сервера как CLAUDE_PLUGIN_OPTION_ (незаполненные — пустой +# строкой). Пустые пропускаем, уже заданные переменные (например, +# QA_TASKS_TOKEN из ~/.bashrc) не перетираются. PLUGIN_OPTIONS = ( "TRELLO_API_KEY", "TRELLO_TOKEN",