From 6272ae875c1529a0a53bb82d4ee7bd58b54b0238 Mon Sep 17 00:00:00 2001 From: "takemi.ohama" Date: Sun, 5 Jul 2026 20:57:32 +0000 Subject: [PATCH 01/10] =?UTF-8?q?chore:=20runtime-split-mcp-plugins=20Draf?= =?UTF-8?q?t=20PR=20=E4=BD=9C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From 93db5dbf6b9554a62c53ef2c5952faa52d6206f9 Mon Sep 17 00:00:00 2001 From: "takemi.ohama" Date: Tue, 7 Jul 2026 03:56:42 +0000 Subject: [PATCH 02/10] =?UTF-8?q?feat:=20MCP=E3=83=97=E3=83=A9=E3=82=B0?= =?UTF-8?q?=E3=82=A4=E3=83=B3=E3=82=92=E3=83=A9=E3=83=B3=E3=82=BF=E3=82=A4?= =?UTF-8?q?=E3=83=A0=E5=88=A5=E3=81=AB=E5=88=86=E9=9B=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .agents/plugins/marketplace.json | 150 ++++++++++++ .claude-plugin/marketplace.json | 20 +- CLAUDE.md | 2 +- docs/project-overview.md | 15 +- docs/specifications/ndf-knowledge-and-kiro.md | 2 +- issues/agent-runtime-plugin-split.md | 12 +- .../mcp-aws-docs/.claude-plugin/plugin.json | 0 .../{ => mcp/claude}/mcp-aws-docs/.mcp.json | 0 .../{ => mcp/claude}/mcp-aws-docs/README.md | 20 ++ .../mcp-aws-docs/docs/aws-docs-guide.md | 0 .../mcp-bigquery/.claude-plugin/plugin.json | 0 .../{ => mcp/claude}/mcp-bigquery/.mcp.json | 0 .../{ => mcp/claude}/mcp-bigquery/README.md | 23 ++ .../mcp-bigquery/docs/bigquery-guide.md | 0 .../.claude-plugin/plugin.json | 0 .../claude}/mcp-chrome-devtools/.mcp.json | 0 .../claude}/mcp-chrome-devtools/README.md | 20 ++ .../docs/chrome-devtools-guide.md | 0 .../mcp-dbhub/.claude-plugin/plugin.json | 0 .../{ => mcp/claude}/mcp-dbhub/.env.example | 0 plugins/{ => mcp/claude}/mcp-dbhub/.mcp.json | 0 plugins/{ => mcp/claude}/mcp-dbhub/README.md | 20 ++ .../claude}/mcp-dbhub/dbhub.toml.example | 0 .../claude}/mcp-dbhub/docs/dbhub-guide.md | 0 .../mcp-devin/.claude-plugin/plugin.json | 0 plugins/{ => mcp/claude}/mcp-devin/.mcp.json | 0 plugins/{ => mcp/claude}/mcp-devin/README.md | 20 ++ .../mcp-markitdown/.claude-plugin/plugin.json | 0 .../{ => mcp/claude}/mcp-markitdown/.mcp.json | 0 .../{ => mcp/claude}/mcp-markitdown/README.md | 20 ++ .../mcp-markitdown/docs/markitdown-guide.md | 0 .../mcp-notion/.claude-plugin/plugin.json | 0 plugins/{ => mcp/claude}/mcp-notion/.mcp.json | 0 plugins/{ => mcp/claude}/mcp-notion/README.md | 20 ++ .../mcp-playwright/.claude-plugin/plugin.json | 0 .../{ => mcp/claude}/mcp-playwright/.mcp.json | 0 .../{ => mcp/claude}/mcp-playwright/README.md | 26 +- .../claude}/mcp-playwright/hooks/hooks.json | 0 .../scripts/ensure-playwright.js | 0 .../mcp-redash/.claude-plugin/plugin.json | 0 .../{ => mcp/claude}/mcp-redash/.env.example | 0 plugins/{ => mcp/claude}/mcp-redash/.mcp.json | 0 plugins/{ => mcp/claude}/mcp-redash/README.md | 23 +- .../mcp-redash/scripts/redash-mcp-config.js | 0 .../mcp-redash/skills/redash-add/SKILL.md | 0 .../mcp-redash/skills/redash-guide/SKILL.md | 0 .../mcp-redash/skills/redash-list/SKILL.md | 0 .../mcp-redash/skills/redash-remove/SKILL.md | 0 .../mcp-redash/skills/redash-status/SKILL.md | 0 .../mcp-serena/.claude-plugin/plugin.json | 0 plugins/{ => mcp/claude}/mcp-serena/.mcp.json | 0 plugins/{ => mcp/claude}/mcp-serena/README.md | 20 ++ .../claude}/mcp-serena/docs/serena-guide.md | 0 .../claude}/mcp-serena/hooks/hooks.json | 0 .../mcp-aws-docs/.codex-plugin/plugin.json | 7 + plugins/mcp/codex/mcp-aws-docs/.mcp.json | 13 + plugins/mcp/codex/mcp-aws-docs/README.md | 77 ++++++ .../codex/mcp-aws-docs/docs/aws-docs-guide.md | 29 +++ .../mcp-bigquery/.codex-plugin/plugin.json | 7 + plugins/mcp/codex/mcp-bigquery/.mcp.json | 21 ++ plugins/mcp/codex/mcp-bigquery/README.md | 105 +++++++++ .../codex/mcp-bigquery/docs/bigquery-guide.md | 31 +++ .../.codex-plugin/plugin.json | 7 + .../mcp/codex/mcp-chrome-devtools/.mcp.json | 17 ++ .../mcp/codex/mcp-chrome-devtools/README.md | 69 ++++++ .../docs/chrome-devtools-guide.md | 21 ++ .../codex/mcp-dbhub/.codex-plugin/plugin.json | 7 + plugins/mcp/codex/mcp-dbhub/.env.example | 12 + plugins/mcp/codex/mcp-dbhub/.mcp.json | 12 + plugins/mcp/codex/mcp-dbhub/README.md | 167 +++++++++++++ .../mcp/codex/mcp-dbhub/dbhub.toml.example | 38 +++ .../mcp/codex/mcp-dbhub/docs/dbhub-guide.md | 30 +++ .../codex/mcp-devin/.codex-plugin/plugin.json | 7 + plugins/mcp/codex/mcp-devin/.mcp.json | 15 ++ plugins/mcp/codex/mcp-devin/README.md | 104 ++++++++ .../mcp-markitdown/.codex-plugin/plugin.json | 7 + plugins/mcp/codex/mcp-markitdown/.mcp.json | 11 + plugins/mcp/codex/mcp-markitdown/README.md | 71 ++++++ .../mcp-markitdown/docs/markitdown-guide.md | 30 +++ .../mcp-notion/.codex-plugin/plugin.json | 7 + plugins/mcp/codex/mcp-notion/.mcp.json | 10 + plugins/mcp/codex/mcp-notion/README.md | 89 +++++++ .../mcp-playwright/.codex-plugin/plugin.json | 7 + plugins/mcp/codex/mcp-playwright/.mcp.json | 20 ++ plugins/mcp/codex/mcp-playwright/README.md | 178 ++++++++++++++ .../mcp/codex/mcp-playwright/hooks/hooks.json | 22 ++ .../scripts/ensure-playwright.js | 90 +++++++ .../mcp-redash/.codex-plugin/plugin.json | 7 + plugins/mcp/codex/mcp-redash/.env.example | 16 ++ plugins/mcp/codex/mcp-redash/.mcp.json | 12 + plugins/mcp/codex/mcp-redash/README.md | 160 +++++++++++++ .../mcp-redash/scripts/redash-mcp-config.js | 223 ++++++++++++++++++ .../mcp-redash/skills/redash-add/SKILL.md | 27 +++ .../mcp-redash/skills/redash-guide/SKILL.md | 87 +++++++ .../mcp-redash/skills/redash-list/SKILL.md | 24 ++ .../mcp-redash/skills/redash-remove/SKILL.md | 27 +++ .../mcp-redash/skills/redash-status/SKILL.md | 24 ++ .../mcp-serena/.codex-plugin/plugin.json | 7 + plugins/mcp/codex/mcp-serena/.mcp.json | 22 ++ plugins/mcp/codex/mcp-serena/README.md | 49 ++++ .../mcp/codex/mcp-serena/docs/serena-guide.md | 73 ++++++ plugins/mcp/codex/mcp-serena/hooks/hooks.json | 19 ++ plugins/mcp/kiro/mcp-aws-docs/.mcp.json | 13 + plugins/mcp/kiro/mcp-aws-docs/README.md | 77 ++++++ .../kiro/mcp-aws-docs/docs/aws-docs-guide.md | 29 +++ plugins/mcp/kiro/mcp-aws-docs/install.sh | 52 ++++ plugins/mcp/kiro/mcp-bigquery/.mcp.json | 21 ++ plugins/mcp/kiro/mcp-bigquery/README.md | 105 +++++++++ .../kiro/mcp-bigquery/docs/bigquery-guide.md | 31 +++ plugins/mcp/kiro/mcp-bigquery/install.sh | 52 ++++ .../mcp/kiro/mcp-chrome-devtools/.mcp.json | 17 ++ .../mcp/kiro/mcp-chrome-devtools/README.md | 69 ++++++ .../docs/chrome-devtools-guide.md | 21 ++ .../mcp/kiro/mcp-chrome-devtools/install.sh | 52 ++++ plugins/mcp/kiro/mcp-dbhub/.env.example | 12 + plugins/mcp/kiro/mcp-dbhub/.mcp.json | 12 + plugins/mcp/kiro/mcp-dbhub/README.md | 167 +++++++++++++ plugins/mcp/kiro/mcp-dbhub/dbhub.toml.example | 38 +++ .../mcp/kiro/mcp-dbhub/docs/dbhub-guide.md | 30 +++ plugins/mcp/kiro/mcp-dbhub/install.sh | 52 ++++ plugins/mcp/kiro/mcp-devin/.mcp.json | 15 ++ plugins/mcp/kiro/mcp-devin/README.md | 104 ++++++++ plugins/mcp/kiro/mcp-devin/install.sh | 52 ++++ plugins/mcp/kiro/mcp-markitdown/.mcp.json | 11 + plugins/mcp/kiro/mcp-markitdown/README.md | 71 ++++++ .../mcp-markitdown/docs/markitdown-guide.md | 30 +++ plugins/mcp/kiro/mcp-markitdown/install.sh | 52 ++++ plugins/mcp/kiro/mcp-notion/.mcp.json | 10 + plugins/mcp/kiro/mcp-notion/README.md | 89 +++++++ plugins/mcp/kiro/mcp-notion/install.sh | 52 ++++ plugins/mcp/kiro/mcp-playwright/.mcp.json | 20 ++ plugins/mcp/kiro/mcp-playwright/README.md | 178 ++++++++++++++ .../mcp/kiro/mcp-playwright/hooks/hooks.json | 22 ++ plugins/mcp/kiro/mcp-playwright/install.sh | 52 ++++ .../scripts/ensure-playwright.js | 90 +++++++ plugins/mcp/kiro/mcp-redash/.env.example | 16 ++ plugins/mcp/kiro/mcp-redash/.mcp.json | 12 + plugins/mcp/kiro/mcp-redash/README.md | 160 +++++++++++++ plugins/mcp/kiro/mcp-redash/install.sh | 52 ++++ .../mcp-redash/scripts/redash-mcp-config.js | 223 ++++++++++++++++++ .../mcp-redash/skills/redash-add/SKILL.md | 27 +++ .../mcp-redash/skills/redash-guide/SKILL.md | 87 +++++++ .../mcp-redash/skills/redash-list/SKILL.md | 24 ++ .../mcp-redash/skills/redash-remove/SKILL.md | 27 +++ .../mcp-redash/skills/redash-status/SKILL.md | 24 ++ plugins/mcp/kiro/mcp-serena/.mcp.json | 22 ++ plugins/mcp/kiro/mcp-serena/README.md | 49 ++++ .../mcp/kiro/mcp-serena/docs/serena-guide.md | 73 ++++++ plugins/mcp/kiro/mcp-serena/hooks/hooks.json | 19 ++ plugins/mcp/kiro/mcp-serena/install.sh | 52 ++++ .../mcp-aws-docs/.claude-plugin/plugin.json | 10 + plugins/mcp/shared/mcp-aws-docs/.mcp.json | 13 + plugins/mcp/shared/mcp-aws-docs/README.md | 77 ++++++ .../mcp-aws-docs/docs/aws-docs-guide.md | 29 +++ .../mcp-bigquery/.claude-plugin/plugin.json | 10 + plugins/mcp/shared/mcp-bigquery/.mcp.json | 21 ++ plugins/mcp/shared/mcp-bigquery/README.md | 105 +++++++++ .../mcp-bigquery/docs/bigquery-guide.md | 31 +++ .../.claude-plugin/plugin.json | 10 + .../mcp/shared/mcp-chrome-devtools/.mcp.json | 17 ++ .../mcp/shared/mcp-chrome-devtools/README.md | 69 ++++++ .../docs/chrome-devtools-guide.md | 21 ++ .../mcp-dbhub/.claude-plugin/plugin.json | 10 + plugins/mcp/shared/mcp-dbhub/.env.example | 12 + plugins/mcp/shared/mcp-dbhub/.mcp.json | 12 + plugins/mcp/shared/mcp-dbhub/README.md | 167 +++++++++++++ .../mcp/shared/mcp-dbhub/dbhub.toml.example | 38 +++ .../mcp/shared/mcp-dbhub/docs/dbhub-guide.md | 30 +++ .../mcp-devin/.claude-plugin/plugin.json | 10 + plugins/mcp/shared/mcp-devin/.mcp.json | 15 ++ plugins/mcp/shared/mcp-devin/README.md | 104 ++++++++ .../mcp-markitdown/.claude-plugin/plugin.json | 10 + plugins/mcp/shared/mcp-markitdown/.mcp.json | 11 + plugins/mcp/shared/mcp-markitdown/README.md | 71 ++++++ .../mcp-markitdown/docs/markitdown-guide.md | 30 +++ .../mcp-notion/.claude-plugin/plugin.json | 10 + plugins/mcp/shared/mcp-notion/.mcp.json | 10 + plugins/mcp/shared/mcp-notion/README.md | 89 +++++++ .../mcp-playwright/.claude-plugin/plugin.json | 10 + plugins/mcp/shared/mcp-playwright/.mcp.json | 20 ++ plugins/mcp/shared/mcp-playwright/README.md | 178 ++++++++++++++ .../shared/mcp-playwright/hooks/hooks.json | 22 ++ .../scripts/ensure-playwright.js | 90 +++++++ .../mcp-redash/.claude-plugin/plugin.json | 17 ++ plugins/mcp/shared/mcp-redash/.env.example | 16 ++ plugins/mcp/shared/mcp-redash/.mcp.json | 12 + plugins/mcp/shared/mcp-redash/README.md | 160 +++++++++++++ .../mcp-redash/scripts/redash-mcp-config.js | 223 ++++++++++++++++++ .../mcp-redash/skills/redash-add/SKILL.md | 27 +++ .../mcp-redash/skills/redash-guide/SKILL.md | 87 +++++++ .../mcp-redash/skills/redash-list/SKILL.md | 24 ++ .../mcp-redash/skills/redash-remove/SKILL.md | 27 +++ .../mcp-redash/skills/redash-status/SKILL.md | 24 ++ .../mcp-serena/.claude-plugin/plugin.json | 10 + plugins/mcp/shared/mcp-serena/.mcp.json | 22 ++ plugins/mcp/shared/mcp-serena/README.md | 49 ++++ .../shared/mcp-serena/docs/serena-guide.md | 73 ++++++ .../mcp/shared/mcp-serena/hooks/hooks.json | 19 ++ scripts/build-runtime-plugins.sh | 190 ++++++++++++++- 199 files changed, 7401 insertions(+), 34 deletions(-) rename plugins/{ => mcp/claude}/mcp-aws-docs/.claude-plugin/plugin.json (100%) rename plugins/{ => mcp/claude}/mcp-aws-docs/.mcp.json (100%) rename plugins/{ => mcp/claude}/mcp-aws-docs/README.md (82%) rename plugins/{ => mcp/claude}/mcp-aws-docs/docs/aws-docs-guide.md (100%) rename plugins/{ => mcp/claude}/mcp-bigquery/.claude-plugin/plugin.json (100%) rename plugins/{ => mcp/claude}/mcp-bigquery/.mcp.json (100%) rename plugins/{ => mcp/claude}/mcp-bigquery/README.md (84%) rename plugins/{ => mcp/claude}/mcp-bigquery/docs/bigquery-guide.md (100%) rename plugins/{ => mcp/claude}/mcp-chrome-devtools/.claude-plugin/plugin.json (100%) rename plugins/{ => mcp/claude}/mcp-chrome-devtools/.mcp.json (100%) rename plugins/{ => mcp/claude}/mcp-chrome-devtools/README.md (80%) rename plugins/{ => mcp/claude}/mcp-chrome-devtools/docs/chrome-devtools-guide.md (100%) rename plugins/{ => mcp/claude}/mcp-dbhub/.claude-plugin/plugin.json (100%) rename plugins/{ => mcp/claude}/mcp-dbhub/.env.example (100%) rename plugins/{ => mcp/claude}/mcp-dbhub/.mcp.json (100%) rename plugins/{ => mcp/claude}/mcp-dbhub/README.md (93%) rename plugins/{ => mcp/claude}/mcp-dbhub/dbhub.toml.example (100%) rename plugins/{ => mcp/claude}/mcp-dbhub/docs/dbhub-guide.md (100%) rename plugins/{ => mcp/claude}/mcp-devin/.claude-plugin/plugin.json (100%) rename plugins/{ => mcp/claude}/mcp-devin/.mcp.json (100%) rename plugins/{ => mcp/claude}/mcp-devin/README.md (89%) rename plugins/{ => mcp/claude}/mcp-markitdown/.claude-plugin/plugin.json (100%) rename plugins/{ => mcp/claude}/mcp-markitdown/.mcp.json (100%) rename plugins/{ => mcp/claude}/mcp-markitdown/README.md (83%) rename plugins/{ => mcp/claude}/mcp-markitdown/docs/markitdown-guide.md (100%) rename plugins/{ => mcp/claude}/mcp-notion/.claude-plugin/plugin.json (100%) rename plugins/{ => mcp/claude}/mcp-notion/.mcp.json (100%) rename plugins/{ => mcp/claude}/mcp-notion/README.md (84%) rename plugins/{ => mcp/claude}/mcp-playwright/.claude-plugin/plugin.json (100%) rename plugins/{ => mcp/claude}/mcp-playwright/.mcp.json (100%) rename plugins/{ => mcp/claude}/mcp-playwright/README.md (93%) rename plugins/{ => mcp/claude}/mcp-playwright/hooks/hooks.json (100%) rename plugins/{ => mcp/claude}/mcp-playwright/scripts/ensure-playwright.js (100%) rename plugins/{ => mcp/claude}/mcp-redash/.claude-plugin/plugin.json (100%) rename plugins/{ => mcp/claude}/mcp-redash/.env.example (100%) rename plugins/{ => mcp/claude}/mcp-redash/.mcp.json (100%) rename plugins/{ => mcp/claude}/mcp-redash/README.md (92%) rename plugins/{ => mcp/claude}/mcp-redash/scripts/redash-mcp-config.js (100%) rename plugins/{ => mcp/claude}/mcp-redash/skills/redash-add/SKILL.md (100%) rename plugins/{ => mcp/claude}/mcp-redash/skills/redash-guide/SKILL.md (100%) rename plugins/{ => mcp/claude}/mcp-redash/skills/redash-list/SKILL.md (100%) rename plugins/{ => mcp/claude}/mcp-redash/skills/redash-remove/SKILL.md (100%) rename plugins/{ => mcp/claude}/mcp-redash/skills/redash-status/SKILL.md (100%) rename plugins/{ => mcp/claude}/mcp-serena/.claude-plugin/plugin.json (100%) rename plugins/{ => mcp/claude}/mcp-serena/.mcp.json (100%) rename plugins/{ => mcp/claude}/mcp-serena/README.md (80%) rename plugins/{ => mcp/claude}/mcp-serena/docs/serena-guide.md (100%) rename plugins/{ => mcp/claude}/mcp-serena/hooks/hooks.json (100%) create mode 100644 plugins/mcp/codex/mcp-aws-docs/.codex-plugin/plugin.json create mode 100644 plugins/mcp/codex/mcp-aws-docs/.mcp.json create mode 100644 plugins/mcp/codex/mcp-aws-docs/README.md create mode 100644 plugins/mcp/codex/mcp-aws-docs/docs/aws-docs-guide.md create mode 100644 plugins/mcp/codex/mcp-bigquery/.codex-plugin/plugin.json create mode 100644 plugins/mcp/codex/mcp-bigquery/.mcp.json create mode 100644 plugins/mcp/codex/mcp-bigquery/README.md create mode 100644 plugins/mcp/codex/mcp-bigquery/docs/bigquery-guide.md create mode 100644 plugins/mcp/codex/mcp-chrome-devtools/.codex-plugin/plugin.json create mode 100644 plugins/mcp/codex/mcp-chrome-devtools/.mcp.json create mode 100644 plugins/mcp/codex/mcp-chrome-devtools/README.md create mode 100644 plugins/mcp/codex/mcp-chrome-devtools/docs/chrome-devtools-guide.md create mode 100644 plugins/mcp/codex/mcp-dbhub/.codex-plugin/plugin.json create mode 100644 plugins/mcp/codex/mcp-dbhub/.env.example create mode 100644 plugins/mcp/codex/mcp-dbhub/.mcp.json create mode 100644 plugins/mcp/codex/mcp-dbhub/README.md create mode 100644 plugins/mcp/codex/mcp-dbhub/dbhub.toml.example create mode 100644 plugins/mcp/codex/mcp-dbhub/docs/dbhub-guide.md create mode 100644 plugins/mcp/codex/mcp-devin/.codex-plugin/plugin.json create mode 100644 plugins/mcp/codex/mcp-devin/.mcp.json create mode 100644 plugins/mcp/codex/mcp-devin/README.md create mode 100644 plugins/mcp/codex/mcp-markitdown/.codex-plugin/plugin.json create mode 100644 plugins/mcp/codex/mcp-markitdown/.mcp.json create mode 100644 plugins/mcp/codex/mcp-markitdown/README.md create mode 100644 plugins/mcp/codex/mcp-markitdown/docs/markitdown-guide.md create mode 100644 plugins/mcp/codex/mcp-notion/.codex-plugin/plugin.json create mode 100644 plugins/mcp/codex/mcp-notion/.mcp.json create mode 100644 plugins/mcp/codex/mcp-notion/README.md create mode 100644 plugins/mcp/codex/mcp-playwright/.codex-plugin/plugin.json create mode 100644 plugins/mcp/codex/mcp-playwright/.mcp.json create mode 100644 plugins/mcp/codex/mcp-playwright/README.md create mode 100644 plugins/mcp/codex/mcp-playwright/hooks/hooks.json create mode 100755 plugins/mcp/codex/mcp-playwright/scripts/ensure-playwright.js create mode 100644 plugins/mcp/codex/mcp-redash/.codex-plugin/plugin.json create mode 100644 plugins/mcp/codex/mcp-redash/.env.example create mode 100644 plugins/mcp/codex/mcp-redash/.mcp.json create mode 100644 plugins/mcp/codex/mcp-redash/README.md create mode 100644 plugins/mcp/codex/mcp-redash/scripts/redash-mcp-config.js create mode 100644 plugins/mcp/codex/mcp-redash/skills/redash-add/SKILL.md create mode 100644 plugins/mcp/codex/mcp-redash/skills/redash-guide/SKILL.md create mode 100644 plugins/mcp/codex/mcp-redash/skills/redash-list/SKILL.md create mode 100644 plugins/mcp/codex/mcp-redash/skills/redash-remove/SKILL.md create mode 100644 plugins/mcp/codex/mcp-redash/skills/redash-status/SKILL.md create mode 100644 plugins/mcp/codex/mcp-serena/.codex-plugin/plugin.json create mode 100644 plugins/mcp/codex/mcp-serena/.mcp.json create mode 100644 plugins/mcp/codex/mcp-serena/README.md create mode 100644 plugins/mcp/codex/mcp-serena/docs/serena-guide.md create mode 100644 plugins/mcp/codex/mcp-serena/hooks/hooks.json create mode 100644 plugins/mcp/kiro/mcp-aws-docs/.mcp.json create mode 100644 plugins/mcp/kiro/mcp-aws-docs/README.md create mode 100644 plugins/mcp/kiro/mcp-aws-docs/docs/aws-docs-guide.md create mode 100755 plugins/mcp/kiro/mcp-aws-docs/install.sh create mode 100644 plugins/mcp/kiro/mcp-bigquery/.mcp.json create mode 100644 plugins/mcp/kiro/mcp-bigquery/README.md create mode 100644 plugins/mcp/kiro/mcp-bigquery/docs/bigquery-guide.md create mode 100755 plugins/mcp/kiro/mcp-bigquery/install.sh create mode 100644 plugins/mcp/kiro/mcp-chrome-devtools/.mcp.json create mode 100644 plugins/mcp/kiro/mcp-chrome-devtools/README.md create mode 100644 plugins/mcp/kiro/mcp-chrome-devtools/docs/chrome-devtools-guide.md create mode 100755 plugins/mcp/kiro/mcp-chrome-devtools/install.sh create mode 100644 plugins/mcp/kiro/mcp-dbhub/.env.example create mode 100644 plugins/mcp/kiro/mcp-dbhub/.mcp.json create mode 100644 plugins/mcp/kiro/mcp-dbhub/README.md create mode 100644 plugins/mcp/kiro/mcp-dbhub/dbhub.toml.example create mode 100644 plugins/mcp/kiro/mcp-dbhub/docs/dbhub-guide.md create mode 100755 plugins/mcp/kiro/mcp-dbhub/install.sh create mode 100644 plugins/mcp/kiro/mcp-devin/.mcp.json create mode 100644 plugins/mcp/kiro/mcp-devin/README.md create mode 100755 plugins/mcp/kiro/mcp-devin/install.sh create mode 100644 plugins/mcp/kiro/mcp-markitdown/.mcp.json create mode 100644 plugins/mcp/kiro/mcp-markitdown/README.md create mode 100644 plugins/mcp/kiro/mcp-markitdown/docs/markitdown-guide.md create mode 100755 plugins/mcp/kiro/mcp-markitdown/install.sh create mode 100644 plugins/mcp/kiro/mcp-notion/.mcp.json create mode 100644 plugins/mcp/kiro/mcp-notion/README.md create mode 100755 plugins/mcp/kiro/mcp-notion/install.sh create mode 100644 plugins/mcp/kiro/mcp-playwright/.mcp.json create mode 100644 plugins/mcp/kiro/mcp-playwright/README.md create mode 100644 plugins/mcp/kiro/mcp-playwright/hooks/hooks.json create mode 100755 plugins/mcp/kiro/mcp-playwright/install.sh create mode 100755 plugins/mcp/kiro/mcp-playwright/scripts/ensure-playwright.js create mode 100644 plugins/mcp/kiro/mcp-redash/.env.example create mode 100644 plugins/mcp/kiro/mcp-redash/.mcp.json create mode 100644 plugins/mcp/kiro/mcp-redash/README.md create mode 100755 plugins/mcp/kiro/mcp-redash/install.sh create mode 100644 plugins/mcp/kiro/mcp-redash/scripts/redash-mcp-config.js create mode 100644 plugins/mcp/kiro/mcp-redash/skills/redash-add/SKILL.md create mode 100644 plugins/mcp/kiro/mcp-redash/skills/redash-guide/SKILL.md create mode 100644 plugins/mcp/kiro/mcp-redash/skills/redash-list/SKILL.md create mode 100644 plugins/mcp/kiro/mcp-redash/skills/redash-remove/SKILL.md create mode 100644 plugins/mcp/kiro/mcp-redash/skills/redash-status/SKILL.md create mode 100644 plugins/mcp/kiro/mcp-serena/.mcp.json create mode 100644 plugins/mcp/kiro/mcp-serena/README.md create mode 100644 plugins/mcp/kiro/mcp-serena/docs/serena-guide.md create mode 100644 plugins/mcp/kiro/mcp-serena/hooks/hooks.json create mode 100755 plugins/mcp/kiro/mcp-serena/install.sh create mode 100644 plugins/mcp/shared/mcp-aws-docs/.claude-plugin/plugin.json create mode 100644 plugins/mcp/shared/mcp-aws-docs/.mcp.json create mode 100644 plugins/mcp/shared/mcp-aws-docs/README.md create mode 100644 plugins/mcp/shared/mcp-aws-docs/docs/aws-docs-guide.md create mode 100644 plugins/mcp/shared/mcp-bigquery/.claude-plugin/plugin.json create mode 100644 plugins/mcp/shared/mcp-bigquery/.mcp.json create mode 100644 plugins/mcp/shared/mcp-bigquery/README.md create mode 100644 plugins/mcp/shared/mcp-bigquery/docs/bigquery-guide.md create mode 100644 plugins/mcp/shared/mcp-chrome-devtools/.claude-plugin/plugin.json create mode 100644 plugins/mcp/shared/mcp-chrome-devtools/.mcp.json create mode 100644 plugins/mcp/shared/mcp-chrome-devtools/README.md create mode 100644 plugins/mcp/shared/mcp-chrome-devtools/docs/chrome-devtools-guide.md create mode 100644 plugins/mcp/shared/mcp-dbhub/.claude-plugin/plugin.json create mode 100644 plugins/mcp/shared/mcp-dbhub/.env.example create mode 100644 plugins/mcp/shared/mcp-dbhub/.mcp.json create mode 100644 plugins/mcp/shared/mcp-dbhub/README.md create mode 100644 plugins/mcp/shared/mcp-dbhub/dbhub.toml.example create mode 100644 plugins/mcp/shared/mcp-dbhub/docs/dbhub-guide.md create mode 100644 plugins/mcp/shared/mcp-devin/.claude-plugin/plugin.json create mode 100644 plugins/mcp/shared/mcp-devin/.mcp.json create mode 100644 plugins/mcp/shared/mcp-devin/README.md create mode 100644 plugins/mcp/shared/mcp-markitdown/.claude-plugin/plugin.json create mode 100644 plugins/mcp/shared/mcp-markitdown/.mcp.json create mode 100644 plugins/mcp/shared/mcp-markitdown/README.md create mode 100644 plugins/mcp/shared/mcp-markitdown/docs/markitdown-guide.md create mode 100644 plugins/mcp/shared/mcp-notion/.claude-plugin/plugin.json create mode 100644 plugins/mcp/shared/mcp-notion/.mcp.json create mode 100644 plugins/mcp/shared/mcp-notion/README.md create mode 100644 plugins/mcp/shared/mcp-playwright/.claude-plugin/plugin.json create mode 100644 plugins/mcp/shared/mcp-playwright/.mcp.json create mode 100644 plugins/mcp/shared/mcp-playwright/README.md create mode 100644 plugins/mcp/shared/mcp-playwright/hooks/hooks.json create mode 100755 plugins/mcp/shared/mcp-playwright/scripts/ensure-playwright.js create mode 100644 plugins/mcp/shared/mcp-redash/.claude-plugin/plugin.json create mode 100644 plugins/mcp/shared/mcp-redash/.env.example create mode 100644 plugins/mcp/shared/mcp-redash/.mcp.json create mode 100644 plugins/mcp/shared/mcp-redash/README.md create mode 100644 plugins/mcp/shared/mcp-redash/scripts/redash-mcp-config.js create mode 100644 plugins/mcp/shared/mcp-redash/skills/redash-add/SKILL.md create mode 100644 plugins/mcp/shared/mcp-redash/skills/redash-guide/SKILL.md create mode 100644 plugins/mcp/shared/mcp-redash/skills/redash-list/SKILL.md create mode 100644 plugins/mcp/shared/mcp-redash/skills/redash-remove/SKILL.md create mode 100644 plugins/mcp/shared/mcp-redash/skills/redash-status/SKILL.md create mode 100644 plugins/mcp/shared/mcp-serena/.claude-plugin/plugin.json create mode 100644 plugins/mcp/shared/mcp-serena/.mcp.json create mode 100644 plugins/mcp/shared/mcp-serena/README.md create mode 100644 plugins/mcp/shared/mcp-serena/docs/serena-guide.md create mode 100644 plugins/mcp/shared/mcp-serena/hooks/hooks.json diff --git a/.agents/plugins/marketplace.json b/.agents/plugins/marketplace.json index d10864f..fc7c6b7 100644 --- a/.agents/plugins/marketplace.json +++ b/.agents/plugins/marketplace.json @@ -15,6 +15,156 @@ "interface": { "displayName": "NDF" } + }, + { + "name": "mcp-playwright", + "source": { + "source": "local", + "path": "./plugins/mcp/codex/mcp-playwright" + }, + "policy": { + "installation": "AVAILABLE", + "authentication": "ON_INSTALL" + }, + "category": "Productivity", + "interface": { + "displayName": "Playwright MCP" + } + }, + { + "name": "mcp-chrome-devtools", + "source": { + "source": "local", + "path": "./plugins/mcp/codex/mcp-chrome-devtools" + }, + "policy": { + "installation": "AVAILABLE", + "authentication": "ON_INSTALL" + }, + "category": "Productivity", + "interface": { + "displayName": "Chrome DevTools MCP" + } + }, + { + "name": "mcp-bigquery", + "source": { + "source": "local", + "path": "./plugins/mcp/codex/mcp-bigquery" + }, + "policy": { + "installation": "AVAILABLE", + "authentication": "ON_INSTALL" + }, + "category": "Productivity", + "interface": { + "displayName": "BigQuery MCP" + } + }, + { + "name": "mcp-aws-docs", + "source": { + "source": "local", + "path": "./plugins/mcp/codex/mcp-aws-docs" + }, + "policy": { + "installation": "AVAILABLE", + "authentication": "ON_INSTALL" + }, + "category": "Productivity", + "interface": { + "displayName": "AWS Docs MCP" + } + }, + { + "name": "mcp-dbhub", + "source": { + "source": "local", + "path": "./plugins/mcp/codex/mcp-dbhub" + }, + "policy": { + "installation": "AVAILABLE", + "authentication": "ON_INSTALL" + }, + "category": "Productivity", + "interface": { + "displayName": "DBHub MCP" + } + }, + { + "name": "mcp-notion", + "source": { + "source": "local", + "path": "./plugins/mcp/codex/mcp-notion" + }, + "policy": { + "installation": "AVAILABLE", + "authentication": "ON_INSTALL" + }, + "category": "Productivity", + "interface": { + "displayName": "Notion MCP" + } + }, + { + "name": "mcp-devin", + "source": { + "source": "local", + "path": "./plugins/mcp/codex/mcp-devin" + }, + "policy": { + "installation": "AVAILABLE", + "authentication": "ON_INSTALL" + }, + "category": "Productivity", + "interface": { + "displayName": "Devin MCP" + } + }, + { + "name": "mcp-redash", + "source": { + "source": "local", + "path": "./plugins/mcp/codex/mcp-redash" + }, + "policy": { + "installation": "AVAILABLE", + "authentication": "ON_INSTALL" + }, + "category": "Productivity", + "interface": { + "displayName": "Redash MCP" + } + }, + { + "name": "mcp-markitdown", + "source": { + "source": "local", + "path": "./plugins/mcp/codex/mcp-markitdown" + }, + "policy": { + "installation": "AVAILABLE", + "authentication": "ON_INSTALL" + }, + "category": "Productivity", + "interface": { + "displayName": "MarkItDown MCP" + } + }, + { + "name": "mcp-serena", + "source": { + "source": "local", + "path": "./plugins/mcp/codex/mcp-serena" + }, + "policy": { + "installation": "AVAILABLE", + "authentication": "ON_INSTALL" + }, + "category": "Productivity", + "interface": { + "displayName": "Serena MCP" + } } ] } diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index ea7fb88..9b6e319 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -13,52 +13,52 @@ }, { "name": "mcp-playwright", - "source": "./plugins/mcp-playwright", + "source": "./plugins/mcp/claude/mcp-playwright", "description": "Playwright MCP auto-setup plugin with Chromium browser installation and configuration" }, { "name": "mcp-chrome-devtools", - "source": "./plugins/mcp-chrome-devtools", + "source": "./plugins/mcp/claude/mcp-chrome-devtools", "description": "Chrome DevTools MCP server for browser automation and testing" }, { "name": "mcp-bigquery", - "source": "./plugins/mcp-bigquery", + "source": "./plugins/mcp/claude/mcp-bigquery", "description": "BigQuery MCP server for data analysis and SQL queries" }, { "name": "mcp-aws-docs", - "source": "./plugins/mcp-aws-docs", + "source": "./plugins/mcp/claude/mcp-aws-docs", "description": "AWS Documentation MCP server for accessing official AWS documentation" }, { "name": "mcp-dbhub", - "source": "./plugins/mcp-dbhub", + "source": "./plugins/mcp/claude/mcp-dbhub", "description": "DBHub MCP server for database operations and SQL queries" }, { "name": "mcp-notion", - "source": "./plugins/mcp-notion", + "source": "./plugins/mcp/claude/mcp-notion", "description": "Notion MCP server for note management and knowledge base operations" }, { "name": "mcp-devin", - "source": "./plugins/mcp-devin", + "source": "./plugins/mcp/claude/mcp-devin", "description": "Devin MCP server for accessing repository documentation and code knowledge via DeepWiki" }, { "name": "mcp-redash", - "source": "./plugins/mcp-redash", + "source": "./plugins/mcp/claude/mcp-redash", "description": "Redash MCP server with multi-environment support (arbitrary suffix)" }, { "name": "mcp-markitdown", - "source": "./plugins/mcp-markitdown", + "source": "./plugins/mcp/claude/mcp-markitdown", "description": "MarkItDown MCP server for converting documents (PDF, Office, images, etc.) to Markdown" }, { "name": "mcp-serena", - "source": "./plugins/mcp-serena", + "source": "./plugins/mcp/claude/mcp-serena", "description": "Serena MCP server for semantic code intelligence (symbol search, reference search, refactoring)" } ] diff --git a/CLAUDE.md b/CLAUDE.md index fd38389..352fdf2 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -17,7 +17,7 @@ Serena MCPは**mcp-serena**プラグインとして提供されます(NDFと **Serena memoryは使用禁止**。知識は `docs/` に、手順は `skills/` に配置してください。 -詳細は `plugins/mcp-serena/docs/serena-guide.md` を参照。 +詳細は `plugins/mcp/claude/mcp-serena/docs/serena-guide.md` を参照。 ## 知識アーキテクチャ diff --git a/docs/project-overview.md b/docs/project-overview.md index 46f1764..61e0e86 100644 --- a/docs/project-overview.md +++ b/docs/project-overview.md @@ -28,12 +28,15 @@ ai-plugins/ ├── .claude-plugin/ │ └── marketplace.json # Claude Codeマーケットプレイスメタデータ ├── plugins/ -│ ├── ndf/ # NDFプラグイン(メイン) -│ │ ├── skills/ # 全Skill実体(Claude Code/Kiroはmanifest配列で公開対象を指定) -│ │ ├── skills-codex/ # Codex向け公開Skill(実ディレクトリ) -│ │ └── skills-optional/ # ランタイム別除外候補リスト -│ ├── mcp-serena/ # Serena MCPプラグイン -│ └── {plugin-name}/ # その他のプラグイン +│ ├── ndf-shared/ # NDF共通ソース +│ ├── ndf-claude/ # Claude Code版NDF +│ ├── ndf-codex/ # Codex版NDF +│ ├── ndf-kiro/ # Kiro CLI版NDF +│ └── mcp/ +│ ├── shared/ # MCPプラグイン共通ソース +│ ├── claude/ # Claude Code版MCPプラグイン +│ ├── codex/ # Codex版MCPプラグイン +│ └── kiro/ # Kiro CLI版MCPプラグイン ├── docs/ # リポジトリ知識 ├── AGENTS.md # 共通エントリポイント ├── CLAUDE.md # Claude Code固有設定 diff --git a/docs/specifications/ndf-knowledge-and-kiro.md b/docs/specifications/ndf-knowledge-and-kiro.md index dbfce8b..82fef4d 100644 --- a/docs/specifications/ndf-knowledge-and-kiro.md +++ b/docs/specifications/ndf-knowledge-and-kiro.md @@ -59,6 +59,6 @@ Codex 連携は MCP サーバではなく `/ndf:codex` skill と `corder` エー ## 関連リンク -- [mcp-serena README](../../plugins/mcp-serena/README.md) +- [mcp-serena README](../../plugins/mcp/claude/mcp-serena/README.md) - [NDF Plugin リファレンス](../ndf-plugin-reference.md) - [NDF README](../../plugins/ndf/README.md) diff --git a/issues/agent-runtime-plugin-split.md b/issues/agent-runtime-plugin-split.md index 4f3aee4..9b8a2c1 100644 --- a/issues/agent-runtime-plugin-split.md +++ b/issues/agent-runtime-plugin-split.md @@ -540,7 +540,7 @@ base branch: `main` ## 実装進捗 -2026-07-06 時点の進捗。 +2026-07-07 時点の進捗。 | 状態 | PR | branch | 内容 | 備考 | |---|---:|---|---|---| @@ -548,19 +548,19 @@ base branch: `main` | merge 済み | #46 | `feature/runtime-split-shared-builder` | Task 1: `ndf-shared` と `scripts/build-runtime-plugins.sh` を追加 | cross-review approved。`release/runtime-plugin-split` へ merge 済み。worktree / local branch cleanup 済み | | merge 済み | #47 | `feature/runtime-split-claude` | Task 2: `plugins/ndf-claude` を追加し、Claude marketplace を切替 | cross-review approved。`release/runtime-plugin-split` へ merge 済み。worktree / local branch cleanup 済み | | merge 済み | #48 | `feature/runtime-split-codex` | Task 3: `plugins/ndf-codex` を追加し、Codex marketplace を切替 | cross-review approved。`release/runtime-plugin-split` へ merge 済み。worktree / local branch cleanup 済み | -| 実装中 | #49 | `feature/runtime-split-kiro` | Task 4: `plugins/ndf-kiro` を作成し、Kiro installer / docs / templates を移動 | installer の Claude manifest 依存を除去し、Kiro runtime 生成物を追加中 | +| merge 済み | #49 | `feature/runtime-split-kiro` | Task 4: `plugins/ndf-kiro` を作成し、Kiro installer / docs / templates を移動 | cross-review approved。`release/runtime-plugin-split` へ merge 済み。worktree / local branch cleanup 済み | | 未着手 | #50 | `feature/runtime-split-docs-cleanup` | Task 5: README / AGENTS / docs / specs 更新、旧 `plugins/ndf` の stub 化または削除 | PR2, PR3, PR4 merge 後 | -| 未着手 | #51 | `feature/runtime-split-mcp-plugins` | Task 6: MCP plugin を runtime 別に分離 | PR1 merge 後なので着手可能だが、Kiro との接続方針確認後が安全 | +| 実装中 | #51 | `feature/runtime-split-mcp-plugins` | Task 6: MCP plugin を runtime 別に分離 | MCP plugin を `plugins/mcp/shared` へ移動し、Claude / Codex / Kiro runtime 生成物を追加中 | | 未着手 | #52 | `feature/runtime-split-validation` | Task 7: validate script、dev hook、CI、リンク検証 | PR2, PR3, PR4, PR6 merge 後 | | 未着手 | #53 | `feature/runtime-split-container-smoke` | Task 8: runtime smoke test | PR7 merge 後 | 再開時の前提: -- 現在の作業ブランチは `feature/runtime-split-kiro`。 +- 現在の作業ブランチは `feature/runtime-split-mcp-plugins`。 - `main` は `origin/main` と同期済み。 - `release/runtime-plugin-split` は `origin/release/runtime-plugin-split` と同期済み。 -- PR #46 / #47 / #48 用の一時 worktree は削除済み。 -- 次は PR #49 `feature/runtime-split-kiro` の実装差分をレビューし、必要な修正後に push / Draft PR 更新を行う。 +- PR #46 / #47 / #48 / #49 用の一時 worktree は削除済み。 +- 次は PR #51 `feature/runtime-split-mcp-plugins` の実装差分をレビューし、必要な修正後に push / Draft PR 更新と cross-review を行う。 ## 影響範囲 diff --git a/plugins/mcp-aws-docs/.claude-plugin/plugin.json b/plugins/mcp/claude/mcp-aws-docs/.claude-plugin/plugin.json similarity index 100% rename from plugins/mcp-aws-docs/.claude-plugin/plugin.json rename to plugins/mcp/claude/mcp-aws-docs/.claude-plugin/plugin.json diff --git a/plugins/mcp-aws-docs/.mcp.json b/plugins/mcp/claude/mcp-aws-docs/.mcp.json similarity index 100% rename from plugins/mcp-aws-docs/.mcp.json rename to plugins/mcp/claude/mcp-aws-docs/.mcp.json diff --git a/plugins/mcp-aws-docs/README.md b/plugins/mcp/claude/mcp-aws-docs/README.md similarity index 82% rename from plugins/mcp-aws-docs/README.md rename to plugins/mcp/claude/mcp-aws-docs/README.md index 6ad040d..d030a73 100644 --- a/plugins/mcp-aws-docs/README.md +++ b/plugins/mcp/claude/mcp-aws-docs/README.md @@ -15,10 +15,30 @@ AWS公式ドキュメントにアクセスするためのMCPサーバープラ ## インストール +### Claude Code + ```bash /plugin install mcp-aws-docs@ai-plugins ``` +### Codex + +```bash +codex plugin add mcp-aws-docs@ai-plugins +``` + +### Kiro CLI + +Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 + +```bash +bash plugins/mcp/kiro/mcp-aws-docs/install.sh +``` + +### 必要な環境変数 + +- 追加の環境変数は不要です。 + ## 使用方法 ### 基本的な使用例 diff --git a/plugins/mcp-aws-docs/docs/aws-docs-guide.md b/plugins/mcp/claude/mcp-aws-docs/docs/aws-docs-guide.md similarity index 100% rename from plugins/mcp-aws-docs/docs/aws-docs-guide.md rename to plugins/mcp/claude/mcp-aws-docs/docs/aws-docs-guide.md diff --git a/plugins/mcp-bigquery/.claude-plugin/plugin.json b/plugins/mcp/claude/mcp-bigquery/.claude-plugin/plugin.json similarity index 100% rename from plugins/mcp-bigquery/.claude-plugin/plugin.json rename to plugins/mcp/claude/mcp-bigquery/.claude-plugin/plugin.json diff --git a/plugins/mcp-bigquery/.mcp.json b/plugins/mcp/claude/mcp-bigquery/.mcp.json similarity index 100% rename from plugins/mcp-bigquery/.mcp.json rename to plugins/mcp/claude/mcp-bigquery/.mcp.json diff --git a/plugins/mcp-bigquery/README.md b/plugins/mcp/claude/mcp-bigquery/README.md similarity index 84% rename from plugins/mcp-bigquery/README.md rename to plugins/mcp/claude/mcp-bigquery/README.md index 28a629f..6608b5b 100644 --- a/plugins/mcp-bigquery/README.md +++ b/plugins/mcp/claude/mcp-bigquery/README.md @@ -40,10 +40,33 @@ BIGQUERY_KEY_FILE=/path/to/service-account-key.json ## インストール +### Claude Code + ```bash /plugin install mcp-bigquery@ai-plugins ``` +### Codex + +```bash +codex plugin add mcp-bigquery@ai-plugins +``` + +### Kiro CLI + +Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 + +```bash +bash plugins/mcp/kiro/mcp-bigquery/install.sh +``` + +### 必要な環境変数 + +- `BIGQUERY_DATASET` +- `BIGQUERY_KEY_FILE` +- `BIGQUERY_LOCATION` +- `BIGQUERY_PROJECT` + ## 使用方法 ### 基本的な使用例 diff --git a/plugins/mcp-bigquery/docs/bigquery-guide.md b/plugins/mcp/claude/mcp-bigquery/docs/bigquery-guide.md similarity index 100% rename from plugins/mcp-bigquery/docs/bigquery-guide.md rename to plugins/mcp/claude/mcp-bigquery/docs/bigquery-guide.md diff --git a/plugins/mcp-chrome-devtools/.claude-plugin/plugin.json b/plugins/mcp/claude/mcp-chrome-devtools/.claude-plugin/plugin.json similarity index 100% rename from plugins/mcp-chrome-devtools/.claude-plugin/plugin.json rename to plugins/mcp/claude/mcp-chrome-devtools/.claude-plugin/plugin.json diff --git a/plugins/mcp-chrome-devtools/.mcp.json b/plugins/mcp/claude/mcp-chrome-devtools/.mcp.json similarity index 100% rename from plugins/mcp-chrome-devtools/.mcp.json rename to plugins/mcp/claude/mcp-chrome-devtools/.mcp.json diff --git a/plugins/mcp-chrome-devtools/README.md b/plugins/mcp/claude/mcp-chrome-devtools/README.md similarity index 80% rename from plugins/mcp-chrome-devtools/README.md rename to plugins/mcp/claude/mcp-chrome-devtools/README.md index 58c5b79..b62f5a1 100644 --- a/plugins/mcp-chrome-devtools/README.md +++ b/plugins/mcp/claude/mcp-chrome-devtools/README.md @@ -17,10 +17,30 @@ Chrome DevTools MCPサーバーをClaude Codeで利用するためのプラグ ## インストール +### Claude Code + ```bash /plugin install mcp-chrome-devtools@ai-plugins ``` +### Codex + +```bash +codex plugin add mcp-chrome-devtools@ai-plugins +``` + +### Kiro CLI + +Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 + +```bash +bash plugins/mcp/kiro/mcp-chrome-devtools/install.sh +``` + +### 必要な環境変数 + +- 追加の環境変数は不要です。 + ## 使用方法 ### 基本的な使用例 diff --git a/plugins/mcp-chrome-devtools/docs/chrome-devtools-guide.md b/plugins/mcp/claude/mcp-chrome-devtools/docs/chrome-devtools-guide.md similarity index 100% rename from plugins/mcp-chrome-devtools/docs/chrome-devtools-guide.md rename to plugins/mcp/claude/mcp-chrome-devtools/docs/chrome-devtools-guide.md diff --git a/plugins/mcp-dbhub/.claude-plugin/plugin.json b/plugins/mcp/claude/mcp-dbhub/.claude-plugin/plugin.json similarity index 100% rename from plugins/mcp-dbhub/.claude-plugin/plugin.json rename to plugins/mcp/claude/mcp-dbhub/.claude-plugin/plugin.json diff --git a/plugins/mcp-dbhub/.env.example b/plugins/mcp/claude/mcp-dbhub/.env.example similarity index 100% rename from plugins/mcp-dbhub/.env.example rename to plugins/mcp/claude/mcp-dbhub/.env.example diff --git a/plugins/mcp-dbhub/.mcp.json b/plugins/mcp/claude/mcp-dbhub/.mcp.json similarity index 100% rename from plugins/mcp-dbhub/.mcp.json rename to plugins/mcp/claude/mcp-dbhub/.mcp.json diff --git a/plugins/mcp-dbhub/README.md b/plugins/mcp/claude/mcp-dbhub/README.md similarity index 93% rename from plugins/mcp-dbhub/README.md rename to plugins/mcp/claude/mcp-dbhub/README.md index ca14a33..32ea657 100644 --- a/plugins/mcp-dbhub/README.md +++ b/plugins/mcp/claude/mcp-dbhub/README.md @@ -16,10 +16,30 @@ ## インストール +### Claude Code + ```bash /plugin install mcp-dbhub@ai-plugins ``` +### Codex + +```bash +codex plugin add mcp-dbhub@ai-plugins +``` + +### Kiro CLI + +Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 + +```bash +bash plugins/mcp/kiro/mcp-dbhub/install.sh +``` + +### 必要な環境変数 + +- 追加の環境変数は不要です。 + ## 設定 2つの設定方法があり、`dbhub.toml`が優先されます。 diff --git a/plugins/mcp-dbhub/dbhub.toml.example b/plugins/mcp/claude/mcp-dbhub/dbhub.toml.example similarity index 100% rename from plugins/mcp-dbhub/dbhub.toml.example rename to plugins/mcp/claude/mcp-dbhub/dbhub.toml.example diff --git a/plugins/mcp-dbhub/docs/dbhub-guide.md b/plugins/mcp/claude/mcp-dbhub/docs/dbhub-guide.md similarity index 100% rename from plugins/mcp-dbhub/docs/dbhub-guide.md rename to plugins/mcp/claude/mcp-dbhub/docs/dbhub-guide.md diff --git a/plugins/mcp-devin/.claude-plugin/plugin.json b/plugins/mcp/claude/mcp-devin/.claude-plugin/plugin.json similarity index 100% rename from plugins/mcp-devin/.claude-plugin/plugin.json rename to plugins/mcp/claude/mcp-devin/.claude-plugin/plugin.json diff --git a/plugins/mcp-devin/.mcp.json b/plugins/mcp/claude/mcp-devin/.mcp.json similarity index 100% rename from plugins/mcp-devin/.mcp.json rename to plugins/mcp/claude/mcp-devin/.mcp.json diff --git a/plugins/mcp-devin/README.md b/plugins/mcp/claude/mcp-devin/README.md similarity index 89% rename from plugins/mcp-devin/README.md rename to plugins/mcp/claude/mcp-devin/README.md index ee833d3..3c1d032 100644 --- a/plugins/mcp-devin/README.md +++ b/plugins/mcp/claude/mcp-devin/README.md @@ -27,10 +27,30 @@ DEVIN_API_KEY=your-devin-api-key ## インストール +### Claude Code + ```bash /plugin install mcp-devin@ai-plugins ``` +### Codex + +```bash +codex plugin add mcp-devin@ai-plugins +``` + +### Kiro CLI + +Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 + +```bash +bash plugins/mcp/kiro/mcp-devin/install.sh +``` + +### 必要な環境変数 + +- `DEVIN_API_KEY` + ## 使用方法 ### 基本的な使用例 diff --git a/plugins/mcp-markitdown/.claude-plugin/plugin.json b/plugins/mcp/claude/mcp-markitdown/.claude-plugin/plugin.json similarity index 100% rename from plugins/mcp-markitdown/.claude-plugin/plugin.json rename to plugins/mcp/claude/mcp-markitdown/.claude-plugin/plugin.json diff --git a/plugins/mcp-markitdown/.mcp.json b/plugins/mcp/claude/mcp-markitdown/.mcp.json similarity index 100% rename from plugins/mcp-markitdown/.mcp.json rename to plugins/mcp/claude/mcp-markitdown/.mcp.json diff --git a/plugins/mcp-markitdown/README.md b/plugins/mcp/claude/mcp-markitdown/README.md similarity index 83% rename from plugins/mcp-markitdown/README.md rename to plugins/mcp/claude/mcp-markitdown/README.md index 0ed24c3..5988fd2 100644 --- a/plugins/mcp-markitdown/README.md +++ b/plugins/mcp/claude/mcp-markitdown/README.md @@ -14,10 +14,30 @@ ## インストール +### Claude Code + ```bash /plugin install mcp-markitdown@ai-plugins ``` +### Codex + +```bash +codex plugin add mcp-markitdown@ai-plugins +``` + +### Kiro CLI + +Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 + +```bash +bash plugins/mcp/kiro/mcp-markitdown/install.sh +``` + +### 必要な環境変数 + +- 追加の環境変数は不要です。 + ## 使用例 ```bash diff --git a/plugins/mcp-markitdown/docs/markitdown-guide.md b/plugins/mcp/claude/mcp-markitdown/docs/markitdown-guide.md similarity index 100% rename from plugins/mcp-markitdown/docs/markitdown-guide.md rename to plugins/mcp/claude/mcp-markitdown/docs/markitdown-guide.md diff --git a/plugins/mcp-notion/.claude-plugin/plugin.json b/plugins/mcp/claude/mcp-notion/.claude-plugin/plugin.json similarity index 100% rename from plugins/mcp-notion/.claude-plugin/plugin.json rename to plugins/mcp/claude/mcp-notion/.claude-plugin/plugin.json diff --git a/plugins/mcp-notion/.mcp.json b/plugins/mcp/claude/mcp-notion/.mcp.json similarity index 100% rename from plugins/mcp-notion/.mcp.json rename to plugins/mcp/claude/mcp-notion/.mcp.json diff --git a/plugins/mcp-notion/README.md b/plugins/mcp/claude/mcp-notion/README.md similarity index 84% rename from plugins/mcp-notion/README.md rename to plugins/mcp/claude/mcp-notion/README.md index db4f2a7..d6a2d6b 100644 --- a/plugins/mcp-notion/README.md +++ b/plugins/mcp/claude/mcp-notion/README.md @@ -31,10 +31,30 @@ NOTION_TOKEN= ## インストール +### Claude Code + ```bash /plugin install mcp-notion@ai-plugins ``` +### Codex + +```bash +codex plugin add mcp-notion@ai-plugins +``` + +### Kiro CLI + +Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 + +```bash +bash plugins/mcp/kiro/mcp-notion/install.sh +``` + +### 必要な環境変数 + +- 追加の環境変数は不要です。 + ## 使用方法 ### 基本的な使用例 diff --git a/plugins/mcp-playwright/.claude-plugin/plugin.json b/plugins/mcp/claude/mcp-playwright/.claude-plugin/plugin.json similarity index 100% rename from plugins/mcp-playwright/.claude-plugin/plugin.json rename to plugins/mcp/claude/mcp-playwright/.claude-plugin/plugin.json diff --git a/plugins/mcp-playwright/.mcp.json b/plugins/mcp/claude/mcp-playwright/.mcp.json similarity index 100% rename from plugins/mcp-playwright/.mcp.json rename to plugins/mcp/claude/mcp-playwright/.mcp.json diff --git a/plugins/mcp-playwright/README.md b/plugins/mcp/claude/mcp-playwright/README.md similarity index 93% rename from plugins/mcp-playwright/README.md rename to plugins/mcp/claude/mcp-playwright/README.md index 8e9ef19..8662f56 100644 --- a/plugins/mcp-playwright/README.md +++ b/plugins/mcp/claude/mcp-playwright/README.md @@ -15,11 +15,29 @@ Playwright MCPを自動的にセットアップし、ブラウザ自動化機能 ## インストール -このプラグインをインストールすると、以下が自動的に設定されます: +### Claude Code -1. Playwright MCP設定(`.mcp.json`) -2. SessionStart hookによる自動セットアップ -3. Chromiumブラウザのインストール +```bash +/plugin install mcp-playwright@ai-plugins +``` + +### Codex + +```bash +codex plugin add mcp-playwright@ai-plugins +``` + +### Kiro CLI + +Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 + +```bash +bash plugins/mcp/kiro/mcp-playwright/install.sh +``` + +### 必要な環境変数 + +- `HOME` ## 使用方法 diff --git a/plugins/mcp-playwright/hooks/hooks.json b/plugins/mcp/claude/mcp-playwright/hooks/hooks.json similarity index 100% rename from plugins/mcp-playwright/hooks/hooks.json rename to plugins/mcp/claude/mcp-playwright/hooks/hooks.json diff --git a/plugins/mcp-playwright/scripts/ensure-playwright.js b/plugins/mcp/claude/mcp-playwright/scripts/ensure-playwright.js similarity index 100% rename from plugins/mcp-playwright/scripts/ensure-playwright.js rename to plugins/mcp/claude/mcp-playwright/scripts/ensure-playwright.js diff --git a/plugins/mcp-redash/.claude-plugin/plugin.json b/plugins/mcp/claude/mcp-redash/.claude-plugin/plugin.json similarity index 100% rename from plugins/mcp-redash/.claude-plugin/plugin.json rename to plugins/mcp/claude/mcp-redash/.claude-plugin/plugin.json diff --git a/plugins/mcp-redash/.env.example b/plugins/mcp/claude/mcp-redash/.env.example similarity index 100% rename from plugins/mcp-redash/.env.example rename to plugins/mcp/claude/mcp-redash/.env.example diff --git a/plugins/mcp-redash/.mcp.json b/plugins/mcp/claude/mcp-redash/.mcp.json similarity index 100% rename from plugins/mcp-redash/.mcp.json rename to plugins/mcp/claude/mcp-redash/.mcp.json diff --git a/plugins/mcp-redash/README.md b/plugins/mcp/claude/mcp-redash/README.md similarity index 92% rename from plugins/mcp-redash/README.md rename to plugins/mcp/claude/mcp-redash/README.md index 727b1c8..532f5a4 100644 --- a/plugins/mcp-redash/README.md +++ b/plugins/mcp/claude/mcp-redash/README.md @@ -17,10 +17,31 @@ Redash MCP サーバーをマルチ環境対応で利用するための Claude C ## インストール +### Claude Code + ```bash /plugin install mcp-redash@ai-plugins ``` +### Codex + +```bash +codex plugin add mcp-redash@ai-plugins +``` + +### Kiro CLI + +Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 + +```bash +bash plugins/mcp/kiro/mcp-redash/install.sh +``` + +### 必要な環境変数 + +- `REDASH_API_KEY` +- `REDASH_URL` + ## 環境変数 プロジェクトの `.env` に設定してください。 @@ -82,7 +103,7 @@ REDASH_API_KEY=your-api-key ## ファイル構成 ``` -plugins/mcp-redash/ +plugins/mcp/shared/mcp-redash/ ├── .claude-plugin/ │ └── plugin.json # プラグインメタデータ ├── .mcp.json # MCP 設定(redash のみ同梱) diff --git a/plugins/mcp-redash/scripts/redash-mcp-config.js b/plugins/mcp/claude/mcp-redash/scripts/redash-mcp-config.js similarity index 100% rename from plugins/mcp-redash/scripts/redash-mcp-config.js rename to plugins/mcp/claude/mcp-redash/scripts/redash-mcp-config.js diff --git a/plugins/mcp-redash/skills/redash-add/SKILL.md b/plugins/mcp/claude/mcp-redash/skills/redash-add/SKILL.md similarity index 100% rename from plugins/mcp-redash/skills/redash-add/SKILL.md rename to plugins/mcp/claude/mcp-redash/skills/redash-add/SKILL.md diff --git a/plugins/mcp-redash/skills/redash-guide/SKILL.md b/plugins/mcp/claude/mcp-redash/skills/redash-guide/SKILL.md similarity index 100% rename from plugins/mcp-redash/skills/redash-guide/SKILL.md rename to plugins/mcp/claude/mcp-redash/skills/redash-guide/SKILL.md diff --git a/plugins/mcp-redash/skills/redash-list/SKILL.md b/plugins/mcp/claude/mcp-redash/skills/redash-list/SKILL.md similarity index 100% rename from plugins/mcp-redash/skills/redash-list/SKILL.md rename to plugins/mcp/claude/mcp-redash/skills/redash-list/SKILL.md diff --git a/plugins/mcp-redash/skills/redash-remove/SKILL.md b/plugins/mcp/claude/mcp-redash/skills/redash-remove/SKILL.md similarity index 100% rename from plugins/mcp-redash/skills/redash-remove/SKILL.md rename to plugins/mcp/claude/mcp-redash/skills/redash-remove/SKILL.md diff --git a/plugins/mcp-redash/skills/redash-status/SKILL.md b/plugins/mcp/claude/mcp-redash/skills/redash-status/SKILL.md similarity index 100% rename from plugins/mcp-redash/skills/redash-status/SKILL.md rename to plugins/mcp/claude/mcp-redash/skills/redash-status/SKILL.md diff --git a/plugins/mcp-serena/.claude-plugin/plugin.json b/plugins/mcp/claude/mcp-serena/.claude-plugin/plugin.json similarity index 100% rename from plugins/mcp-serena/.claude-plugin/plugin.json rename to plugins/mcp/claude/mcp-serena/.claude-plugin/plugin.json diff --git a/plugins/mcp-serena/.mcp.json b/plugins/mcp/claude/mcp-serena/.mcp.json similarity index 100% rename from plugins/mcp-serena/.mcp.json rename to plugins/mcp/claude/mcp-serena/.mcp.json diff --git a/plugins/mcp-serena/README.md b/plugins/mcp/claude/mcp-serena/README.md similarity index 80% rename from plugins/mcp-serena/README.md rename to plugins/mcp/claude/mcp-serena/README.md index 8c8ddb1..f8ebfe5 100644 --- a/plugins/mcp-serena/README.md +++ b/plugins/mcp/claude/mcp-serena/README.md @@ -4,10 +4,30 @@ Serena MCPサーバーを提供するプラグインです。セマンティッ ## インストール +### Claude Code + ```bash /plugin install mcp-serena@ai-plugins ``` +### Codex + +```bash +codex plugin add mcp-serena@ai-plugins +``` + +### Kiro CLI + +Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 + +```bash +bash plugins/mcp/kiro/mcp-serena/install.sh +``` + +### 必要な環境変数 + +- `SERENA_HOME` + ## 提供機能 - **シンボル検索**: クラス、関数、メソッドの定義を検索 diff --git a/plugins/mcp-serena/docs/serena-guide.md b/plugins/mcp/claude/mcp-serena/docs/serena-guide.md similarity index 100% rename from plugins/mcp-serena/docs/serena-guide.md rename to plugins/mcp/claude/mcp-serena/docs/serena-guide.md diff --git a/plugins/mcp-serena/hooks/hooks.json b/plugins/mcp/claude/mcp-serena/hooks/hooks.json similarity index 100% rename from plugins/mcp-serena/hooks/hooks.json rename to plugins/mcp/claude/mcp-serena/hooks/hooks.json diff --git a/plugins/mcp/codex/mcp-aws-docs/.codex-plugin/plugin.json b/plugins/mcp/codex/mcp-aws-docs/.codex-plugin/plugin.json new file mode 100644 index 0000000..73fc149 --- /dev/null +++ b/plugins/mcp/codex/mcp-aws-docs/.codex-plugin/plugin.json @@ -0,0 +1,7 @@ +{ + "name": "mcp-aws-docs", + "version": "1.0.0", + "description": "AWS Documentation MCP server for accessing official AWS documentation", + "keywords": ["mcp", "aws", "documentation", "docs", "cloud"], + "mcpServers": "./.mcp.json" +} diff --git a/plugins/mcp/codex/mcp-aws-docs/.mcp.json b/plugins/mcp/codex/mcp-aws-docs/.mcp.json new file mode 100644 index 0000000..01ff167 --- /dev/null +++ b/plugins/mcp/codex/mcp-aws-docs/.mcp.json @@ -0,0 +1,13 @@ +{ + "mcpServers": { + "awslabs.aws-docs": { + "type": "stdio", + "command": "uvx", + "args": [ + "awslabs.aws-documentation-mcp-server@latest" + ], + "env": {}, + "envFile": "${workspaceFolder}/.env" + } + } +} diff --git a/plugins/mcp/codex/mcp-aws-docs/README.md b/plugins/mcp/codex/mcp-aws-docs/README.md new file mode 100644 index 0000000..d030a73 --- /dev/null +++ b/plugins/mcp/codex/mcp-aws-docs/README.md @@ -0,0 +1,77 @@ +# AWS Documentation MCP + +AWS公式ドキュメントにアクセスするためのMCPサーバープラグインです。 + +## 概要 + +このプラグインは、AWS公式ドキュメントを検索・取得する機能を提供します。 + +## 機能 + +- AWS公式ドキュメントの検索 +- ドキュメントページの取得 +- 関連ドキュメントの推薦 +- サービス別ドキュメントへのアクセス + +## インストール + +### Claude Code + +```bash +/plugin install mcp-aws-docs@ai-plugins +``` + +### Codex + +```bash +codex plugin add mcp-aws-docs@ai-plugins +``` + +### Kiro CLI + +Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 + +```bash +bash plugins/mcp/kiro/mcp-aws-docs/install.sh +``` + +### 必要な環境変数 + +- 追加の環境変数は不要です。 + +## 使用方法 + +### 基本的な使用例 + +```bash +# AWS Lambdaのドキュメントを検索 +mcp__plugin_aws-docs-mcp__awslabs.aws-docs__search_documentation "AWS Lambda best practices" + +# 特定のドキュメントページを読み込み +mcp__plugin_aws-docs-mcp__awslabs.aws-docs__read_documentation "https://docs.aws.amazon.com/lambda/..." +``` + +## 推奨される使用シーン + +- AWSサービスの調査 +- ベストプラクティスの確認 +- API仕様の参照 +- トラブルシューティング + +## ndf:researcherエージェントとの連携 + +AWS Docs MCPは、NDFプラグインの`ndf:researcher`エージェントと連携して使用することを推奨します。 + +```bash +# researcherエージェントにAWSドキュメント調査を依頼 +Task( + subagent_type="ndf:researcher", + prompt="Research AWS Lambda best practices for performance", + description="Research Lambda practices" +) +``` + +## 参考リンク + +- [aws-documentation-mcp-server](https://pypi.org/project/awslabs.aws-documentation-mcp-server/) +- [AWS Documentation](https://docs.aws.amazon.com/) diff --git a/plugins/mcp/codex/mcp-aws-docs/docs/aws-docs-guide.md b/plugins/mcp/codex/mcp-aws-docs/docs/aws-docs-guide.md new file mode 100644 index 0000000..57a2328 --- /dev/null +++ b/plugins/mcp/codex/mcp-aws-docs/docs/aws-docs-guide.md @@ -0,0 +1,29 @@ +# AWS Docs MCP ガイド + +AWS Documentation MCPサーバーでAWS公式ドキュメントを検索・参照します。 + +## 主要機能 + +- AWSサービスのドキュメント検索 +- ベストプラクティスの参照 +- API仕様の確認 +- トラブルシューティング情報の取得 + +## 用途 + +- **researcherエージェント**: AWS公式ドキュメントの調査、ベストプラクティスの確認 + +## 使用例 + +``` +# Lambda関数のベストプラクティスを検索 +mcp__plugin_mcp-aws-docs_awslabs.aws-docs__search query="Lambda best practices" + +# S3バケットポリシーのドキュメントを参照 +mcp__plugin_mcp-aws-docs_awslabs.aws-docs__search query="S3 bucket policy" +``` + +## 注意事項 + +- 認証情報は不要(公開ドキュメントへのアクセス) +- 静的な公式ドキュメントの参照に特化。動的コンテンツにはChrome DevTools MCPを使用 diff --git a/plugins/mcp/codex/mcp-bigquery/.codex-plugin/plugin.json b/plugins/mcp/codex/mcp-bigquery/.codex-plugin/plugin.json new file mode 100644 index 0000000..edd1138 --- /dev/null +++ b/plugins/mcp/codex/mcp-bigquery/.codex-plugin/plugin.json @@ -0,0 +1,7 @@ +{ + "name": "mcp-bigquery", + "version": "1.0.0", + "description": "BigQuery MCP server for data analysis and SQL queries", + "keywords": ["mcp", "bigquery", "sql", "data", "analysis", "gcp"], + "mcpServers": "./.mcp.json" +} diff --git a/plugins/mcp/codex/mcp-bigquery/.mcp.json b/plugins/mcp/codex/mcp-bigquery/.mcp.json new file mode 100644 index 0000000..ed2ecd4 --- /dev/null +++ b/plugins/mcp/codex/mcp-bigquery/.mcp.json @@ -0,0 +1,21 @@ +{ + "mcpServers": { + "bigquery": { + "type": "stdio", + "command": "uvx", + "args": [ + "mcp-server-bigquery@latest", + "--project", + "${BIGQUERY_PROJECT}", + "--location", + "${BIGQUERY_LOCATION}", + "--dataset", + "${BIGQUERY_DATASET}", + "--key-file", + "${BIGQUERY_KEY_FILE}" + ], + "env": {}, + "envFile": "${workspaceFolder}/.env" + } + } +} diff --git a/plugins/mcp/codex/mcp-bigquery/README.md b/plugins/mcp/codex/mcp-bigquery/README.md new file mode 100644 index 0000000..6608b5b --- /dev/null +++ b/plugins/mcp/codex/mcp-bigquery/README.md @@ -0,0 +1,105 @@ +# BigQuery MCP + +BigQuery MCPサーバーをClaude Codeで利用するためのプラグインです。 + +## 概要 + +このプラグインは、Google Cloud BigQueryへのアクセスを提供し、SQLクエリの実行やデータ分析を可能にします。 + +## 機能 + +- BigQueryテーブルの一覧取得 +- SQLクエリの実行 +- クエリ結果の取得 +- テーブルスキーマの取得 +- データセットの操作 + +## 前提条件 + +- Google Cloud Projectの作成 +- BigQuery APIの有効化 +- サービスアカウントキーの作成 + +## 環境変数の設定 + +プロジェクトルートに`.env`ファイルを作成し、以下の環境変数を設定してください: + +```bash +# BigQuery Project ID +BIGQUERY_PROJECT=your-project-id + +# BigQuery Location (例: asia-northeast1) +BIGQUERY_LOCATION=asia-northeast1 + +# 利用するデータセット(カンマ区切り) +BIGQUERY_DATASETS=dataset1,dataset2 + +# サービスアカウントキーファイルのパス +BIGQUERY_KEY_FILE=/path/to/service-account-key.json +``` + +## インストール + +### Claude Code + +```bash +/plugin install mcp-bigquery@ai-plugins +``` + +### Codex + +```bash +codex plugin add mcp-bigquery@ai-plugins +``` + +### Kiro CLI + +Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 + +```bash +bash plugins/mcp/kiro/mcp-bigquery/install.sh +``` + +### 必要な環境変数 + +- `BIGQUERY_DATASET` +- `BIGQUERY_KEY_FILE` +- `BIGQUERY_LOCATION` +- `BIGQUERY_PROJECT` + +## 使用方法 + +### 基本的な使用例 + +```bash +# テーブル一覧を取得 +mcp__plugin_bigquery-mcp__bigquery__list_tables + +# SQLクエリを実行 +mcp__plugin_bigquery-mcp__bigquery__execute_query "SELECT * FROM dataset.table LIMIT 10" +``` + +## 推奨される使用シーン + +- データ分析 +- レポート生成 +- SQLクエリの最適化 +- データ抽出 + +## ndf:data-analystエージェントとの連携 + +BigQuery MCPは、NDFプラグインの`ndf:data-analyst`エージェントと連携して使用することを推奨します。 + +```bash +# data-analystエージェントにBigQueryクエリを依頼 +Task( + subagent_type="ndf:data-analyst", + prompt="Analyze last month's sales data in BigQuery", + description="Analyze sales data" +) +``` + +## 参考リンク + +- [mcp-server-bigquery](https://pypi.org/project/mcp-server-bigquery/) +- [Google Cloud BigQuery](https://cloud.google.com/bigquery) diff --git a/plugins/mcp/codex/mcp-bigquery/docs/bigquery-guide.md b/plugins/mcp/codex/mcp-bigquery/docs/bigquery-guide.md new file mode 100644 index 0000000..2e7d1fd --- /dev/null +++ b/plugins/mcp/codex/mcp-bigquery/docs/bigquery-guide.md @@ -0,0 +1,31 @@ +# BigQuery MCP ガイド + +BigQuery MCPサーバーでGoogle BigQueryのデータ分析を行います。 + +## 環境変数(必須) + +| 変数 | 説明 | +|------|------| +| `BIGQUERY_PROJECT` | GCPプロジェクトID | +| `BIGQUERY_LOCATION` | データセットのロケーション(例: `asia-northeast1`) | +| `BIGQUERY_DATASET` | デフォルトデータセット名 | +| `BIGQUERY_KEY_FILE` | サービスアカウントキーファイルのパス | + +## 主要ツール + +- `execute-query` - SQLクエリを実行し結果を取得 +- `list-tables` - データセット内のテーブル一覧を取得 +- `describe-table` - テーブルのスキーマ情報を取得 + +## 使用例 + +``` +# テーブル一覧の取得 +mcp__plugin_mcp-bigquery_bigquery__list-tables + +# テーブルのスキーマ確認 +mcp__plugin_mcp-bigquery_bigquery__describe-table table_name="users" + +# SQLクエリ実行 +mcp__plugin_mcp-bigquery_bigquery__execute-query query="SELECT * FROM users LIMIT 10" +``` diff --git a/plugins/mcp/codex/mcp-chrome-devtools/.codex-plugin/plugin.json b/plugins/mcp/codex/mcp-chrome-devtools/.codex-plugin/plugin.json new file mode 100644 index 0000000..7c4d742 --- /dev/null +++ b/plugins/mcp/codex/mcp-chrome-devtools/.codex-plugin/plugin.json @@ -0,0 +1,7 @@ +{ + "name": "mcp-chrome-devtools", + "version": "1.0.0", + "description": "Chrome DevTools MCP server for browser automation and testing", + "keywords": ["mcp", "chrome", "devtools", "browser", "automation", "testing"], + "mcpServers": "./.mcp.json" +} diff --git a/plugins/mcp/codex/mcp-chrome-devtools/.mcp.json b/plugins/mcp/codex/mcp-chrome-devtools/.mcp.json new file mode 100644 index 0000000..88e4c76 --- /dev/null +++ b/plugins/mcp/codex/mcp-chrome-devtools/.mcp.json @@ -0,0 +1,17 @@ +{ + "mcpServers": { + "chrome-devtools": { + "type": "stdio", + "command": "npx", + "args": [ + "-y", + "chrome-devtools-mcp@latest", + "--isolated", + "--chromeArg=--no-sandbox", + "--chromeArg=--disable-setuid-sandbox", + "--chromeArg=--disable-dev-shm-usage" + ], + "envFile": "${workspaceFolder}/.env" + } + } +} diff --git a/plugins/mcp/codex/mcp-chrome-devtools/README.md b/plugins/mcp/codex/mcp-chrome-devtools/README.md new file mode 100644 index 0000000..b62f5a1 --- /dev/null +++ b/plugins/mcp/codex/mcp-chrome-devtools/README.md @@ -0,0 +1,69 @@ +# Chrome DevTools MCP + +Chrome DevTools MCPサーバーをClaude Codeで利用するためのプラグインです。 + +## 概要 + +このプラグインは、ブラウザ自動化とテストのためのChrome DevTools Protocol (CDP)へのアクセスを提供します。 + +## 機能 + +- ブラウザの自動操作 +- スクリーンショット撮影 +- ページナビゲーション +- JavaScriptの実行 +- ネットワークリクエストの監視 +- コンソールログの取得 + +## インストール + +### Claude Code + +```bash +/plugin install mcp-chrome-devtools@ai-plugins +``` + +### Codex + +```bash +codex plugin add mcp-chrome-devtools@ai-plugins +``` + +### Kiro CLI + +Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 + +```bash +bash plugins/mcp/kiro/mcp-chrome-devtools/install.sh +``` + +### 必要な環境変数 + +- 追加の環境変数は不要です。 + +## 使用方法 + +### 基本的な使用例 + +```bash +# ページにアクセスしてスクリーンショットを撮影 +mcp__plugin_chrome-devtools-mcp__chrome-devtools__navigate_page "https://example.com" +mcp__plugin_chrome-devtools-mcp__chrome-devtools__take_screenshot +``` + +## 推奨される使用シーン + +- Webアプリケーションのテスト +- スクレイピング +- パフォーマンス測定 +- UIの自動検証 + +## 注意事項 + +- Dockerコンテナ内で実行する場合、`--no-sandbox`オプションが必要です +- DinD/DooD環境では接続方法が異なる場合があります(`ndf:docker-container-access` Skillを参照) + +## 参考リンク + +- [chrome-devtools-mcp](https://www.npmjs.com/package/chrome-devtools-mcp) +- [Chrome DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/) diff --git a/plugins/mcp/codex/mcp-chrome-devtools/docs/chrome-devtools-guide.md b/plugins/mcp/codex/mcp-chrome-devtools/docs/chrome-devtools-guide.md new file mode 100644 index 0000000..466323f --- /dev/null +++ b/plugins/mcp/codex/mcp-chrome-devtools/docs/chrome-devtools-guide.md @@ -0,0 +1,21 @@ +# Chrome DevTools MCP ガイド + +Chrome DevTools MCPサーバーでブラウザの操作・デバッグ・パフォーマンス測定を行います。 + +## 主要機能 + +- ページナビゲーション・DOM操作 +- ネットワークリクエストの監視 +- コンソールログの取得 +- パフォーマンスプロファイリング +- スクリーンショット取得 + +## 用途 + +- **researcherエージェント**: JavaScript動的コンテンツの取得、Webスクレイピング +- **qaエージェント**: Webアプリケーションのパフォーマンス測定、UI検証 + +## 注意事項 + +- Docker環境(DinD/DooD)では`--no-sandbox`オプションが必要(設定済み) +- localhostへのアクセスはDocker環境に依存。詳細は `docker-container-access` スキルを参照 diff --git a/plugins/mcp/codex/mcp-dbhub/.codex-plugin/plugin.json b/plugins/mcp/codex/mcp-dbhub/.codex-plugin/plugin.json new file mode 100644 index 0000000..4cf67be --- /dev/null +++ b/plugins/mcp/codex/mcp-dbhub/.codex-plugin/plugin.json @@ -0,0 +1,7 @@ +{ + "name": "mcp-dbhub", + "version": "1.2.0", + "description": "DBHub MCP server for database operations and SQL queries", + "keywords": ["mcp", "database", "sql", "dbhub", "mysql", "postgres"], + "mcpServers": "./.mcp.json" +} diff --git a/plugins/mcp/codex/mcp-dbhub/.env.example b/plugins/mcp/codex/mcp-dbhub/.env.example new file mode 100644 index 0000000..007c192 --- /dev/null +++ b/plugins/mcp/codex/mcp-dbhub/.env.example @@ -0,0 +1,12 @@ +# .env - DBHub環境変数設定 +# このファイルを .env にコピーしてプロジェクトルートに配置してください。 +# dbhub.toml が存在しない場合のフォールバックとして使用されます。 + +# データベース接続文字列 +DBHUB_DSN=mysql://user:password@db-host:3306/dbname + +# SSH踏み台設定(必要な場合のみ) +# DBHUB_SSH_HOST=bastion.example.com +# DBHUB_SSH_PORT=22 +# DBHUB_SSH_USER=ubuntu +# DBHUB_SSH_KEY=~/.ssh/id_rsa diff --git a/plugins/mcp/codex/mcp-dbhub/.mcp.json b/plugins/mcp/codex/mcp-dbhub/.mcp.json new file mode 100644 index 0000000..dc078ac --- /dev/null +++ b/plugins/mcp/codex/mcp-dbhub/.mcp.json @@ -0,0 +1,12 @@ +{ + "mcpServers": { + "dbhub": { + "type": "stdio", + "command": "npx", + "args": [ + "--yes", + "@bytebase/dbhub" + ] + } + } +} diff --git a/plugins/mcp/codex/mcp-dbhub/README.md b/plugins/mcp/codex/mcp-dbhub/README.md new file mode 100644 index 0000000..32ea657 --- /dev/null +++ b/plugins/mcp/codex/mcp-dbhub/README.md @@ -0,0 +1,167 @@ +# DBHub MCP + +データベース操作とSQLクエリを実行するためのMCPサーバープラグインです。 + +## 概要 + +このプラグインは、MySQL、PostgreSQL、SQLiteなどの各種データベースへのアクセスを提供します。 + +## 機能 + +- データベース接続管理 +- SQLクエリの実行 +- テーブルスキーマの取得 +- データベース一覧の取得 +- 複数データベースへの同時接続(TOML設定) + +## インストール + +### Claude Code + +```bash +/plugin install mcp-dbhub@ai-plugins +``` + +### Codex + +```bash +codex plugin add mcp-dbhub@ai-plugins +``` + +### Kiro CLI + +Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 + +```bash +bash plugins/mcp/kiro/mcp-dbhub/install.sh +``` + +### 必要な環境変数 + +- 追加の環境変数は不要です。 + +## 設定 + +2つの設定方法があり、`dbhub.toml`が優先されます。 + +### 方法1: dbhub.toml(複数DB対応・推奨) + +プロジェクトルートに `dbhub.toml` を配置すると自動検出されます。 + +```toml +# 単一データベース +[[sources]] +id = "mydb" +description = "本番 MySQL" +dsn = "mysql://user:password@db-host:3306/dbname" +``` + +```toml +# 複数データベース +[[sources]] +id = "production" +description = "本番 MySQL" +dsn = "mysql://user:password@prod-db:3306/myapp" + +[[sources]] +id = "staging" +description = "ステージング MySQL" +dsn = "mysql://user:password@staging-db:3306/myapp_stg" +``` + +複数ソース定義時、ツール名に自動でサフィックスが付与されます(例: `execute_sql_production`, `execute_sql_staging`)。 + +#### SSH踏み台設定(TOML内) + +ソースごとにSSH踏み台を定義できます。 + +```toml +[[sources]] +id = "production" +description = "本番 MySQL(踏み台経由)" +dsn = "mysql://user:password@db.internal:3306/myapp" +ssh_host = "bastion.example.com" +ssh_port = 22 +ssh_user = "ubuntu" +ssh_key = "~/.ssh/id_rsa" +# ssh_passphrase = "鍵のパスフレーズ(暗号化されている場合)" +``` + +マルチホップSSH(多段踏み台)にも対応しています。 + +```toml +[[sources]] +id = "prod_multihop" +dsn = "postgres://user:password@10.0.1.100:5432/myapp" +ssh_host = "internal-server.company.com" +ssh_user = "deploy" +ssh_key = "~/.ssh/id_ed25519" +ssh_proxy_jump = "bastion.company.com,admin@jump2.internal:2222" +``` + +| フィールド | 必須 | 説明 | +|-----------|------|------| +| `ssh_host` | Yes | 踏み台ホスト名 | +| `ssh_port` | No | ポート(デフォルト: 22) | +| `ssh_user` | Yes | SSHユーザー名 | +| `ssh_key` | ※ | 秘密鍵パス(`~`展開可) | +| `ssh_password` | ※ | パスワード認証用 | +| `ssh_passphrase` | No | 秘密鍵のパスフレーズ | +| `ssh_proxy_jump` | No | マルチホップ(カンマ区切り) | + +※ `ssh_key` または `ssh_password` のいずれかが必須 + +### 方法2: .env(単一DB・簡易設定) + +`dbhub.toml`が存在しない場合、`.env`の環境変数にフォールバックします。 + +```bash +# データベース接続文字列 +DBHUB_DSN=mysql://user:password@db-host:3306/dbname + +# SSH踏み台(必要な場合) +DBHUB_SSH_HOST=bastion.example.com +DBHUB_SSH_PORT=22 +DBHUB_SSH_USER=ubuntu +DBHUB_SSH_KEY=~/.ssh/id_rsa +``` + +DSNのホスト名は踏み台から見た内部ホスト名を指定してください。 + +### 優先順位 + +1. `dbhub.toml`(プロジェクトルートに存在すれば自動読み込み) +2. `.env`の`DBHUB_DSN`環境変数(tomlが無い場合のフォールバック) + +## 使用例 + +```bash +# SQLクエリを実行 +mcp__plugin_mcp-dbhub_dbhub__execute_sql "SELECT * FROM users LIMIT 10" + +# テーブル一覧を取得 +mcp__plugin_mcp-dbhub_dbhub__search_objects --object_type table +``` + +## ndf:data-analystエージェントとの連携 + +DBHub MCPは、NDFプラグインの`ndf:data-analyst`エージェントと連携して使用することを推奨します。 + +```bash +Task( + subagent_type="ndf:data-analyst", + prompt="Analyze user activity in the local database", + description="Analyze user activity" +) +``` + +## 注意事項 + +- `dbhub.toml`と`.env`は`.gitignore`に追加し、認証情報をコミットしないでください +- SSH踏み台経由の場合、DSNのホスト名は踏み台から見た内部ホスト名を指定します + +## 参考リンク + +- [takemi-ohama/dbhub](https://github.com/takemi-ohama/dbhub) - 現在使用中のフォーク版(SSH keep-alive対応) +- [@bytebase/dbhub](https://www.npmjs.com/package/@bytebase/dbhub) - 本家パッケージ +- [Bytebase](https://www.bytebase.com/) diff --git a/plugins/mcp/codex/mcp-dbhub/dbhub.toml.example b/plugins/mcp/codex/mcp-dbhub/dbhub.toml.example new file mode 100644 index 0000000..4400680 --- /dev/null +++ b/plugins/mcp/codex/mcp-dbhub/dbhub.toml.example @@ -0,0 +1,38 @@ +# dbhub.toml - データベース接続設定 +# このファイルを dbhub.toml にコピーしてプロジェクトルートに配置してください。 +# dbhub.toml は .gitignore に追加し、認証情報をコミットしないでください。 + +# 単一データベース(SSH踏み台なし) +[[sources]] +id = "mydb" +description = "開発用 MySQL" +dsn = "mysql://user:password@localhost:3306/mydb" + +# 単一データベース(SSH踏み台経由) +# [[sources]] +# id = "production" +# description = "本番 MySQL(踏み台経由)" +# dsn = "mysql://user:password@db.internal:3306/myapp" +# ssh_host = "bastion.example.com" +# ssh_port = 22 +# ssh_user = "ubuntu" +# ssh_key = "~/.ssh/id_rsa" + +# 複数データベース +# [[sources]] +# id = "production" +# description = "本番 MySQL" +# dsn = "mysql://user:password@prod-db.internal:3306/myapp" +# ssh_host = "bastion.example.com" +# ssh_port = 22 +# ssh_user = "ubuntu" +# ssh_key = "~/.ssh/id_rsa" +# +# [[sources]] +# id = "staging" +# description = "ステージング MySQL" +# dsn = "mysql://user:password@staging-db.internal:3306/myapp_stg" +# ssh_host = "bastion.example.com" +# ssh_port = 22 +# ssh_user = "ubuntu" +# ssh_key = "~/.ssh/id_rsa" diff --git a/plugins/mcp/codex/mcp-dbhub/docs/dbhub-guide.md b/plugins/mcp/codex/mcp-dbhub/docs/dbhub-guide.md new file mode 100644 index 0000000..1fb3d8e --- /dev/null +++ b/plugins/mcp/codex/mcp-dbhub/docs/dbhub-guide.md @@ -0,0 +1,30 @@ +# DBHub MCP ガイド + +DBHub MCPサーバーで各種データベースへのSQL操作を行います。 + +## 接続設定 + +DBHubは接続文字列(DSN)でデータベースに接続します。 +環境変数またはツール引数で接続先を指定してください。 + +## 主要ツール + +- `execute_sql_{suffix}` - 指定環境でSQLクエリを実行 +- `search_objects_{suffix}` - データベースオブジェクト(テーブル、カラム等)を検索 + +suffixはインストール時の設定に依存します(例: `production`, `alpha`, `delta`)。 + +## 使用例 + +``` +# テーブル・カラムの検索 +mcp__plugin_mcp-dbhub_dbhub__search_objects_production keyword="users" + +# SQLクエリ実行 +mcp__plugin_mcp-dbhub_dbhub__execute_sql_production sql="SELECT * FROM users LIMIT 10" +``` + +## 注意事項 + +- 本番環境への書き込みクエリ(INSERT, UPDATE, DELETE)は慎重に実行してください +- 大量データの取得時はLIMIT句を使用してください diff --git a/plugins/mcp/codex/mcp-devin/.codex-plugin/plugin.json b/plugins/mcp/codex/mcp-devin/.codex-plugin/plugin.json new file mode 100644 index 0000000..cde6648 --- /dev/null +++ b/plugins/mcp/codex/mcp-devin/.codex-plugin/plugin.json @@ -0,0 +1,7 @@ +{ + "name": "mcp-devin", + "version": "1.0.0", + "description": "Devin MCP server for accessing repository documentation and code knowledge via DeepWiki", + "keywords": ["mcp", "devin", "deepwiki", "documentation", "repository", "wiki", "code-knowledge"], + "mcpServers": "./.mcp.json" +} diff --git a/plugins/mcp/codex/mcp-devin/.mcp.json b/plugins/mcp/codex/mcp-devin/.mcp.json new file mode 100644 index 0000000..fe323ee --- /dev/null +++ b/plugins/mcp/codex/mcp-devin/.mcp.json @@ -0,0 +1,15 @@ +{ + "mcpServers": { + "devin": { + "type": "http", + "url": "https://mcp.devin.ai/mcp", + "headers": { + "Authorization": "Bearer ${DEVIN_API_KEY}" + }, + "env": { + "DEVIN_API_KEY": "${DEVIN_API_KEY}" + }, + "envFile": "${workspaceFolder}/.env" + } + } +} diff --git a/plugins/mcp/codex/mcp-devin/README.md b/plugins/mcp/codex/mcp-devin/README.md new file mode 100644 index 0000000..3c1d032 --- /dev/null +++ b/plugins/mcp/codex/mcp-devin/README.md @@ -0,0 +1,104 @@ +# Devin MCP + +リポジトリのドキュメントとコード知識にアクセスするためのMCPサーバープラグインです。 + +## 概要 + +このプラグインは、[Devin MCP](https://mcp.devin.ai/mcp)サーバーを利用して、GitHubなどのリポジトリのドキュメント構造や内容をAIエージェントから直接参照できるようにします。Devin APIキー(`DEVIN_API_KEY`)が必要です。 + +## 機能 + +- **`read_wiki_structure`** - リポジトリのドキュメントトピック一覧を取得 +- **`read_wiki_contents`** - ドキュメントの内容を閲覧 +- **`ask_question`** - リポジトリに関するAI質問回答 + +## 前提条件 + +- Devin APIキー(環境変数 `DEVIN_API_KEY`) + +## 環境変数の設定 + +プロジェクトルートの`.env`ファイルに以下を設定してください: + +```bash +# Devin API Key +DEVIN_API_KEY=your-devin-api-key +``` + +## インストール + +### Claude Code + +```bash +/plugin install mcp-devin@ai-plugins +``` + +### Codex + +```bash +codex plugin add mcp-devin@ai-plugins +``` + +### Kiro CLI + +Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 + +```bash +bash plugins/mcp/kiro/mcp-devin/install.sh +``` + +### 必要な環境変数 + +- `DEVIN_API_KEY` + +## 使用方法 + +### 基本的な使用例 + +```bash +# リポジトリのドキュメント構造を取得 +mcp__plugin_mcp-devin__devin__read_wiki_structure "owner/repo" + +# ドキュメント内容を読み取り +mcp__plugin_mcp-devin__devin__read_wiki_contents "owner/repo" "topic" + +# リポジトリについて質問 +mcp__plugin_mcp-devin__devin__ask_question "owner/repo" "How does authentication work?" +``` + +### CLIで直接追加する場合 + +```bash +claude mcp add -s user -t http devin https://mcp.devin.ai/mcp --header "Authorization: Bearer $DEVIN_API_KEY" +``` + +## 推奨される使用シーン + +- OSSライブラリの仕様・アーキテクチャ調査 +- 依存パッケージの内部実装の理解 +- リポジトリのドキュメント横断検索 +- 技術選定時のコード比較調査 + +## NDFエージェントとの連携 + +DeepWiki MCPは、NDFプラグインの`ndf:researcher`エージェントと連携して使用することを推奨します。 + +```bash +Task( + subagent_type="ndf:researcher", + prompt="DeepWikiを使ってlangchain/langchainリポジトリのRAG実装を調査してください", + description="Research RAG implementation" +) +``` + +## 注意事項 + +- `DEVIN_API_KEY` の設定が必要です +- HTTPトランスポートを使用しています(Devin公式MCPサーバー `https://mcp.devin.ai/mcp`) +- `Authorization: Bearer {DEVIN_API_KEY}` ヘッダーで認証します +- レート制限がある場合があります + +## 参考リンク + +- [DeepWiki](https://deepwiki.com) +- [DeepWiki MCP ドキュメント](https://docs.devin.ai/ja/work-with-devin/deepwiki-mcp) diff --git a/plugins/mcp/codex/mcp-markitdown/.codex-plugin/plugin.json b/plugins/mcp/codex/mcp-markitdown/.codex-plugin/plugin.json new file mode 100644 index 0000000..9de3858 --- /dev/null +++ b/plugins/mcp/codex/mcp-markitdown/.codex-plugin/plugin.json @@ -0,0 +1,7 @@ +{ + "name": "mcp-markitdown", + "version": "1.0.0", + "description": "MarkItDown MCP server for converting documents (PDF, Office, images, etc.) to Markdown", + "keywords": ["mcp", "markitdown", "markdown", "pdf", "docx", "pptx", "xlsx", "images", "converter"], + "mcpServers": "./.mcp.json" +} diff --git a/plugins/mcp/codex/mcp-markitdown/.mcp.json b/plugins/mcp/codex/mcp-markitdown/.mcp.json new file mode 100644 index 0000000..844df81 --- /dev/null +++ b/plugins/mcp/codex/mcp-markitdown/.mcp.json @@ -0,0 +1,11 @@ +{ + "mcpServers": { + "markitdown": { + "type": "stdio", + "command": "uvx", + "args": [ + "markitdown-mcp" + ] + } + } +} diff --git a/plugins/mcp/codex/mcp-markitdown/README.md b/plugins/mcp/codex/mcp-markitdown/README.md new file mode 100644 index 0000000..5988fd2 --- /dev/null +++ b/plugins/mcp/codex/mcp-markitdown/README.md @@ -0,0 +1,71 @@ +# MarkItDown MCP + +各種ドキュメント(PDF、Office、画像など)をMarkdownに変換するMCPサーバープラグインです。 + +## 概要 + +[Microsoft MarkItDown](https://github.com/microsoft/markitdown) のMCPサーバーラッパーです。HTTP/HTTPS URL、ローカルファイル、Data URIを指定してドキュメントをMarkdownに変換できます。 + +## 機能 + +- `convert_to_markdown(uri)` ツールを提供 +- 対応フォーマット: PDF, Word (.docx), Excel (.xlsx), PowerPoint (.pptx), 画像, HTML, CSV, JSON, XML など +- HTTP/HTTPS URL、ローカルファイルパス(`file://`)、Data URI に対応 + +## インストール + +### Claude Code + +```bash +/plugin install mcp-markitdown@ai-plugins +``` + +### Codex + +```bash +codex plugin add mcp-markitdown@ai-plugins +``` + +### Kiro CLI + +Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 + +```bash +bash plugins/mcp/kiro/mcp-markitdown/install.sh +``` + +### 必要な環境変数 + +- 追加の環境変数は不要です。 + +## 使用例 + +```bash +# URLからドキュメントを変換 +mcp__plugin_mcp-markitdown_markitdown__convert_to_markdown uri="https://example.com/document.pdf" + +# ローカルファイルを変換 +mcp__plugin_mcp-markitdown_markitdown__convert_to_markdown uri="file:///path/to/document.docx" +``` + +## ndf:scannerエージェントとの連携 + +MarkItDown MCPは、NDFプラグインの`ndf:scanner`エージェントと連携して使用することを推奨します。 + +```bash +Task( + subagent_type="ndf:scanner", + prompt="Convert /path/to/document.pdf to Markdown and summarize key points.", + description="Convert and summarize PDF" +) +``` + +## 注意事項 + +- Python環境が必要です(`uvx` 経由で自動インストール) +- 大きなファイルの変換には時間がかかる場合があります + +## 参考リンク + +- [microsoft/markitdown](https://github.com/microsoft/markitdown) - 本家リポジトリ +- [markitdown-mcp (PyPI)](https://pypi.org/project/markitdown-mcp/) - PyPIパッケージ diff --git a/plugins/mcp/codex/mcp-markitdown/docs/markitdown-guide.md b/plugins/mcp/codex/mcp-markitdown/docs/markitdown-guide.md new file mode 100644 index 0000000..7ba0cf0 --- /dev/null +++ b/plugins/mcp/codex/mcp-markitdown/docs/markitdown-guide.md @@ -0,0 +1,30 @@ +# MarkItDown MCP ガイド + +MarkItDown MCPサーバーで各種ドキュメントをMarkdown形式に変換します。 + +## 対応フォーマット + +- PDF +- Microsoft Office(Word, Excel, PowerPoint) +- 画像(OCR) +- HTML +- その他のドキュメント形式 + +## 主要ツール + +- `convert_to_markdown` - ファイルをMarkdownに変換 + +## 使用例 + +``` +# PDFをMarkdownに変換 +mcp__plugin_mcp-markitdown_markitdown__convert_to_markdown uri="file:///path/to/document.pdf" + +# Excelファイルを変換 +mcp__plugin_mcp-markitdown_markitdown__convert_to_markdown uri="file:///path/to/data.xlsx" +``` + +## 使い分け + +- scannerエージェントがPDF/Office/画像ファイルの読み取りに使用 +- Read toolで直接読めないファイル形式の変換に有用 diff --git a/plugins/mcp/codex/mcp-notion/.codex-plugin/plugin.json b/plugins/mcp/codex/mcp-notion/.codex-plugin/plugin.json new file mode 100644 index 0000000..1ec5dde --- /dev/null +++ b/plugins/mcp/codex/mcp-notion/.codex-plugin/plugin.json @@ -0,0 +1,7 @@ +{ + "name": "mcp-notion", + "version": "1.0.0", + "description": "Notion MCP server for note management and knowledge base operations", + "keywords": ["mcp", "notion", "notes", "knowledge-base", "documentation"], + "mcpServers": "./.mcp.json" +} diff --git a/plugins/mcp/codex/mcp-notion/.mcp.json b/plugins/mcp/codex/mcp-notion/.mcp.json new file mode 100644 index 0000000..fc5b4de --- /dev/null +++ b/plugins/mcp/codex/mcp-notion/.mcp.json @@ -0,0 +1,10 @@ +{ + "mcpServers": { + "notion": { + "type": "http", + "url": "https://mcp.notion.com/mcp", + "env": {}, + "envFile": "${workspaceFolder}/.env" + } + } +} diff --git a/plugins/mcp/codex/mcp-notion/README.md b/plugins/mcp/codex/mcp-notion/README.md new file mode 100644 index 0000000..d6a2d6b --- /dev/null +++ b/plugins/mcp/codex/mcp-notion/README.md @@ -0,0 +1,89 @@ +# Notion MCP + +NotionワークスペースにアクセスするためのMCPサーバープラグインです。 + +## 概要 + +このプラグインは、Notionのページ、データベース、ブロックへのアクセスを提供します。 + +## 機能 + +- Notionページの作成・読み取り・更新 +- データベースのクエリ +- ブロックの操作 +- ページ階層の取得 +- コメントの追加 + +## 前提条件 + +- Notionアカウント +- Notion Integration(内部統合)の作成 +- 統合トークンの取得 + +## 環境変数の設定 + +プロジェクトルートに`.env`ファイルを作成し、以下の環境変数を設定してください: + +```bash +# Notion Integration Token +NOTION_TOKEN= +``` + +## インストール + +### Claude Code + +```bash +/plugin install mcp-notion@ai-plugins +``` + +### Codex + +```bash +codex plugin add mcp-notion@ai-plugins +``` + +### Kiro CLI + +Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 + +```bash +bash plugins/mcp/kiro/mcp-notion/install.sh +``` + +### 必要な環境変数 + +- 追加の環境変数は不要です。 + +## 使用方法 + +### 基本的な使用例 + +```bash +# ページを読み取り +mcp__plugin_notion-mcp__notion__read_page "page-id" + +# データベースをクエリ +mcp__plugin_notion-mcp__notion__query_database "database-id" + +# 新しいページを作成 +mcp__plugin_notion-mcp__notion__create_page "parent-page-id" "New Page Title" +``` + +## 推奨される使用シーン + +- ドキュメント管理 +- ナレッジベースの構築 +- タスク管理 +- プロジェクト情報の同期 + +## 注意事項 + +- Notion IntegrationをワークスペースやページにShareする必要があります +- HTTPトランスポートを使用しています(公式のNotion MCPサーバー) + +## 参考リンク + +- [Notion MCP Server](https://mcp.notion.com) +- [Notion API](https://developers.notion.com/) +- [Notion Integration Setup](https://www.notion.so/help/create-integrations-with-the-notion-api) diff --git a/plugins/mcp/codex/mcp-playwright/.codex-plugin/plugin.json b/plugins/mcp/codex/mcp-playwright/.codex-plugin/plugin.json new file mode 100644 index 0000000..5b43e2e --- /dev/null +++ b/plugins/mcp/codex/mcp-playwright/.codex-plugin/plugin.json @@ -0,0 +1,7 @@ +{ + "name": "mcp-playwright", + "version": "1.0.1", + "description": "Playwright MCPを自動セットアップするプラグイン。Chromiumブラウザの自動インストールとMCP設定を提供します。", + "keywords": ["mcp", "playwright", "browser", "automation", "testing"], + "mcpServers": "./.mcp.json" +} diff --git a/plugins/mcp/codex/mcp-playwright/.mcp.json b/plugins/mcp/codex/mcp-playwright/.mcp.json new file mode 100644 index 0000000..2313c0d --- /dev/null +++ b/plugins/mcp/codex/mcp-playwright/.mcp.json @@ -0,0 +1,20 @@ +{ + "mcpServers": { + "playwright": { + "type": "stdio", + "command": "npx", + "args": [ + "-y", + "@playwright/mcp@latest", + "--browser", + "chromium", + "--isolated", + "--no-sandbox" + ], + "env": { + "PLAYWRIGHT_BROWSERS_PATH": "${HOME}/.cache/ms-playwright" + }, + "envFile": "${workspaceFolder}/.env" + } + } +} diff --git a/plugins/mcp/codex/mcp-playwright/README.md b/plugins/mcp/codex/mcp-playwright/README.md new file mode 100644 index 0000000..8662f56 --- /dev/null +++ b/plugins/mcp/codex/mcp-playwright/README.md @@ -0,0 +1,178 @@ +# playwright Plugin + +Playwright MCPを自動的にセットアップし、ブラウザ自動化機能を提供するプラグインです。 + +## 概要 + +このプラグインは、Playwright MCPサーバーとChromiumブラウザを自動的にインストール・設定します。Claude Codeでブラウザ自動化タスク(Webスクレイピング、E2Eテスト、スクリーンショット取得など)を簡単に実行できるようになります。 + +## 機能 + +- **自動セットアップ**: 初回起動時にPlaywright Chromiumブラウザを自動インストール +- **バージョン互換性**: @playwright/mcpと互換性のあるPlaywrightバージョンを自動検出 +- **冪等性**: 既にインストール済みの場合はスキップ(高速起動) +- **環境変数対応**: PLAYWRIGHT_BROWSERS_PATHで共有キャッシュを利用 + +## インストール + +### Claude Code + +```bash +/plugin install mcp-playwright@ai-plugins +``` + +### Codex + +```bash +codex plugin add mcp-playwright@ai-plugins +``` + +### Kiro CLI + +Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 + +```bash +bash plugins/mcp/kiro/mcp-playwright/install.sh +``` + +### 必要な環境変数 + +- `HOME` + +## 使用方法 + +### 基本的な使い方 + +プラグインをインストールして、Claude Codeを起動するだけで自動的にセットアップが実行されます。 + +```bash +# Claude Codeを起動 +claude +``` + +初回起動時、以下のようなメッセージが表示されます: + +``` +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +🎭 Playwright MCP Plugin: 初回セットアップ +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +Playwright Chromiumブラウザをインストール中... +ネットワーク環境により1-2分かかる場合があります。 + +🔍 @playwright/mcpが使用するPlaywrightバージョンを確認中... +✓ Playwright 1.49.1 を使用します + +📦 Playwright 1.49.1 でChromiumをインストール中... +[インストールログ...] + +✅ セットアップ完了!Playwright Chromiumの準備ができました。 + Playwrightバージョン: 1.49.1 + ブラウザパス: ~/.cache/ms-playwright +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +``` + +### Playwright MCPツールの使用例 + +セットアップ完了後、以下のようなタスクが実行できます: + +``` +// Webページにアクセスしてスクリーンショットを取得 +mcp__plugin_playwright__browser_navigate(url: "https://example.com") +mcp__plugin_playwright__browser_take_screenshot() + +// フォームに入力してボタンをクリック +mcp__plugin_playwright__browser_fill(selector: "#email", value: "test@example.com") +mcp__plugin_playwright__browser_click(selector: "button[type='submit']") + +// ページのスナップショットを取得(アクセシビリティツリー) +mcp__plugin_playwright__browser_snapshot() +``` + +## 設定 + +### MCP設定(`.mcp.json`) + +プラグインは以下のMCP設定を提供します: + +```json +{ + "mcpServers": { + "playwright": { + "type": "stdio", + "command": "npx", + "args": [ + "-y", + "@playwright/mcp@latest", + "--browser", + "chromium", + "--isolated", + "--no-sandbox" + ], + "env": { + "PLAYWRIGHT_BROWSERS_PATH": "${HOME}/.cache/ms-playwright" + } + } + } +} +``` + +### ブラウザキャッシュパス + +デフォルトでは、Chromiumブラウザは `~/.cache/ms-playwright` にインストールされます。 + +別の場所を使用したい場合は、環境変数を設定してください: + +```bash +export PLAYWRIGHT_BROWSERS_PATH=/path/to/custom/location +``` + +## トラブルシューティング + +### インストールが失敗する場合 + +1. **手動インストール**: + ```bash + # 互換性のあるバージョンを確認 + npm view @playwright/mcp@latest dependencies + + # Chromiumをインストール + PLAYWRIGHT_BROWSERS_PATH=~/.cache/ms-playwright npx playwright@ install chromium + ``` + +2. **キャッシュをクリア**: + ```bash + rm ~/.claude-playwright-installed + ``` + +3. **ログを確認**: + プラグインは詳細なログを出力するので、エラーメッセージを確認してください。 + +### ブラウザが見つからない場合 + +環境変数 `PLAYWRIGHT_BROWSERS_PATH` が正しく設定されているか確認してください: + +```bash +echo $PLAYWRIGHT_BROWSERS_PATH +ls -la ~/.cache/ms-playwright +``` + +### タイムアウトエラー + +ネットワーク環境が遅い場合、インストールに時間がかかることがあります。 +デフォルトのタイムアウトは5分です。 + +## 参考資料 + +- [Playwright公式ドキュメント](https://playwright.dev/) +- [@playwright/mcp README](https://www.npmjs.com/package/@playwright/mcp) +- [Playwright Browser Management](https://playwright.dev/docs/browsers) + +## ライセンス + +MIT License + +## サポート + +問題が発生した場合は、GitHubリポジトリでissueを作成してください: +https://github.com/devbasex/ai-plugins/issues diff --git a/plugins/mcp/codex/mcp-playwright/hooks/hooks.json b/plugins/mcp/codex/mcp-playwright/hooks/hooks.json new file mode 100644 index 0000000..7b163ae --- /dev/null +++ b/plugins/mcp/codex/mcp-playwright/hooks/hooks.json @@ -0,0 +1,22 @@ +{ + "description": "Playwright MCP auto-setup hook", + "hooks": { + "SessionStart": [ + { + "description": "Ensure Playwright browser is installed", + "matcher": "startup|resume", + "priority": 100, + "enabled": true, + "hooks": [ + { + "type": "command", + "command": "node ${CLAUDE_PLUGIN_ROOT}/scripts/ensure-playwright.js", + "description": "Auto-install Playwright chromium on first use", + "continueOnError": false, + "suppressOutput": false + } + ] + } + ] + } +} diff --git a/plugins/mcp/codex/mcp-playwright/scripts/ensure-playwright.js b/plugins/mcp/codex/mcp-playwright/scripts/ensure-playwright.js new file mode 100755 index 0000000..1a4c98d --- /dev/null +++ b/plugins/mcp/codex/mcp-playwright/scripts/ensure-playwright.js @@ -0,0 +1,90 @@ +#!/usr/bin/env node + +const { execSync } = require('child_process'); +const fs = require('fs'); +const path = require('path'); +const os = require('os'); + +const PLUGIN_ROOT = process.env.CLAUDE_PLUGIN_ROOT || __dirname; +const FLAG_FILE = path.join(os.homedir(), '.claude-playwright-installed'); +const BROWSER_PATH = path.join(os.homedir(), '.cache', 'ms-playwright'); +const TIMEOUT_MS = 5 * 60 * 1000; // 5分タイムアウト + +// 既にインストール済みかチェック(冪等性) +if (fs.existsSync(FLAG_FILE)) { + process.exit(0); +} + +console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'); +console.log('🎭 Playwright MCP Plugin: 初回セットアップ'); +console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'); +console.log(''); +console.log('Playwright Chromiumブラウザをインストール中...'); +console.log('ネットワーク環境により1-2分かかる場合があります。'); +console.log(''); + +try { + // @playwright/mcpが依存するPlaywrightのバージョンを取得 + console.log('🔍 @playwright/mcpが使用するPlaywrightバージョンを確認中...'); + const depsOutput = execSync('npm view @playwright/mcp@latest dependencies --json', { + encoding: 'utf-8', + cwd: PLUGIN_ROOT, + timeout: 30000 + }); + + const deps = JSON.parse(depsOutput); + const playwrightVersion = deps.playwright || deps['playwright-core']; + + if (!playwrightVersion) { + throw new Error('@playwright/mcpの依存関係からPlaywrightバージョンを取得できませんでした'); + } + + console.log(`✓ Playwright ${playwrightVersion} を使用します`); + console.log(''); + + // @playwright/mcpと互換性のあるバージョンのChromiumをインストール + console.log(`📦 Playwright ${playwrightVersion} でChromiumをインストール中...`); + execSync(`npx -y playwright@${playwrightVersion} install chromium`, { + stdio: 'inherit', + cwd: PLUGIN_ROOT, + timeout: TIMEOUT_MS, + env: { + ...process.env, + PLAYWRIGHT_BROWSERS_PATH: BROWSER_PATH, + PLAYWRIGHT_SKIP_BROWSER_GC: '1' + } + }); + + // インストール成功フラグを作成 + const flagData = { + installed: new Date().toISOString(), + plugin: 'playwright', + browser: 'chromium', + browserPath: BROWSER_PATH, + playwrightVersion: playwrightVersion + }; + + fs.writeFileSync(FLAG_FILE, JSON.stringify(flagData, null, 2)); + + console.log(''); + console.log('✅ セットアップ完了!Playwright Chromiumの準備ができました。'); + console.log(` Playwrightバージョン: ${playwrightVersion}`); + console.log(` ブラウザパス: ${BROWSER_PATH}`); + console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'); + process.exit(0); + +} catch (error) { + console.error(''); + console.error('❌ Playwright Chromiumのインストールに失敗しました'); + console.error(''); + console.error('エラー:', error.message); + console.error(''); + console.error('手動でインストールするには以下を実行してください:'); + console.error(` npm view @playwright/mcp@latest dependencies`); + console.error(` PLAYWRIGHT_BROWSERS_PATH=${BROWSER_PATH} npx playwright@ install chromium`); + console.error(''); + console.error('トラブルシューティング:'); + console.error(' https://playwright.dev/docs/browsers'); + console.error('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'); + process.exit(1); +} diff --git a/plugins/mcp/codex/mcp-redash/.codex-plugin/plugin.json b/plugins/mcp/codex/mcp-redash/.codex-plugin/plugin.json new file mode 100644 index 0000000..7a191ff --- /dev/null +++ b/plugins/mcp/codex/mcp-redash/.codex-plugin/plugin.json @@ -0,0 +1,7 @@ +{ + "name": "mcp-redash", + "version": "1.0.0", + "description": "Redash MCP server with multi-environment support (arbitrary suffix)", + "keywords": ["mcp", "redash", "sql", "data", "visualization", "multi-environment"], + "mcpServers": "./.mcp.json" +} diff --git a/plugins/mcp/codex/mcp-redash/.env.example b/plugins/mcp/codex/mcp-redash/.env.example new file mode 100644 index 0000000..810b944 --- /dev/null +++ b/plugins/mcp/codex/mcp-redash/.env.example @@ -0,0 +1,16 @@ +# Redash MCP - 環境変数設定 +# +# デフォルト(必須) +REDASH_URL=https://redash.example.com +REDASH_API_KEY=your-api-key + +# 追加環境(/redash-add で追加した場合のみ必要) +# suffix を大文字にして REDASH_{SUFFIX}_URL, REDASH_{SUFFIX}_API_KEY の形式 +# +# 例: /redash-add dev +# REDASH_DEV_URL=https://redash-dev.example.com +# REDASH_DEV_API_KEY=your-dev-api-key +# +# 例: /redash-add stg +# REDASH_STG_URL=https://redash-stg.example.com +# REDASH_STG_API_KEY=your-stg-api-key diff --git a/plugins/mcp/codex/mcp-redash/.mcp.json b/plugins/mcp/codex/mcp-redash/.mcp.json new file mode 100644 index 0000000..80c370f --- /dev/null +++ b/plugins/mcp/codex/mcp-redash/.mcp.json @@ -0,0 +1,12 @@ +{ + "mcpServers": { + "redash": { + "command": "npx", + "args": ["-y", "@suthio/redash-mcp"], + "env": { + "REDASH_URL": "${REDASH_URL}", + "REDASH_API_KEY": "${REDASH_API_KEY}" + } + } + } +} diff --git a/plugins/mcp/codex/mcp-redash/README.md b/plugins/mcp/codex/mcp-redash/README.md new file mode 100644 index 0000000..532f5a4 --- /dev/null +++ b/plugins/mcp/codex/mcp-redash/README.md @@ -0,0 +1,160 @@ +# mcp-redash + +Redash MCP サーバーをマルチ環境対応で利用するための Claude Code プラグイン。 + +## 概要 + +[redash-mcp](https://github.com/suthio/redash-mcp) を Claude Code から利用するためのプラグインです。 + +- 1つだけ使う場合は最小設定(`REDASH_URL` と `REDASH_API_KEY` のみ) +- 必要になったら suffix 付きで環境を増やせる +- MCP 定義は必要になるまで作られない + +## 前提条件 + +- Claude Code +- Node.js(npx が使える環境) + +## インストール + +### Claude Code + +```bash +/plugin install mcp-redash@ai-plugins +``` + +### Codex + +```bash +codex plugin add mcp-redash@ai-plugins +``` + +### Kiro CLI + +Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 + +```bash +bash plugins/mcp/kiro/mcp-redash/install.sh +``` + +### 必要な環境変数 + +- `REDASH_API_KEY` +- `REDASH_URL` + +## 環境変数 + +プロジェクトの `.env` に設定してください。 + +```bash +REDASH_URL=https://redash.example.com +REDASH_API_KEY=your-api-key +``` + +## 使い方 + +### 基本(1環境) + +プラグインインストール後、`redash` MCP が自動的に有効になります。環境変数を設定するだけで利用開始できます。 + +### 複数環境 + +```bash +# dev 環境を追加 +/redash-add dev + +# .env に環境変数を設定 +# REDASH_DEV_URL=https://redash-dev.example.com +# REDASH_DEV_API_KEY=your-dev-api-key + +# 一覧確認 +/redash-list + +# 状態確認(環境変数の設定漏れチェック) +/redash-status + +# 不要になったら削除 +/redash-remove dev +``` + +## スラッシュコマンド + +| コマンド | 説明 | +|---------|------| +| `/redash-add ` | 任意 suffix の Redash MCP を project `.mcp.json` に追加 | +| `/redash-remove ` | 指定 suffix の Redash MCP を project `.mcp.json` から削除 | +| `/redash-list` | 有効な Redash MCP を一覧表示 | +| `/redash-status` | 設定状況の詳細確認(環境変数の未設定警告付き) | +| `/redash-guide` | 使い方ガイドを表示 | + +## suffix と環境変数の対応 + +| suffix | MCP 名 | 環境変数 | +|--------|--------|----------| +| (なし) | redash | REDASH_URL, REDASH_API_KEY | +| dev | redash-dev | REDASH_DEV_URL, REDASH_DEV_API_KEY | +| stg | redash-stg | REDASH_STG_URL, REDASH_STG_API_KEY | +| prod2 | redash-prod2 | REDASH_PROD2_URL, REDASH_PROD2_API_KEY | +| sandbox | redash-sandbox | REDASH_SANDBOX_URL, REDASH_SANDBOX_API_KEY | + +- suffix は英数字で自由に指定可能 +- `default` は予約語のため使用不可(plugin 同梱の `redash` が該当) + +## ファイル構成 + +``` +plugins/mcp/shared/mcp-redash/ +├── .claude-plugin/ +│ └── plugin.json # プラグインメタデータ +├── .mcp.json # MCP 設定(redash のみ同梱) +├── .env.example # 環境変数テンプレート +├── scripts/ +│ └── redash-mcp-config.js # JSON 編集スクリプト(Node.js) +├── skills/ +│ ├── redash-add/SKILL.md # /redash-add コマンド +│ ├── redash-remove/SKILL.md # /redash-remove コマンド +│ ├── redash-list/SKILL.md # /redash-list コマンド +│ ├── redash-status/SKILL.md # /redash-status コマンド +│ └── redash-guide/SKILL.md # 使い方ガイド +└── README.md +``` + +## 設計意図 + +> 本プラグインは +> 「1つだけ使う場合は最小設定」 +> 「必要になったら suffix 付きで増やす」 +> という運用を前提にしている。 +> +> そのため MCP 定義は **必要になるまで作られない**。 + +- plugin 同梱: `redash`(常に `/mcp` に表示) +- project `.mcp.json`: `/redash-add` で追加したもののみ表示 + +## トラブルシューティング + +### `/mcp` に redash が表示されない + +- プラグインが正しくインストールされているか確認 +- `/plugin list` で `mcp-redash@ai-plugins` が表示されるか確認 + +### 環境変数が反映されない + +- `.env` ファイルがプロジェクトルートにあるか確認 +- 変数名が正しい形式か確認(`REDASH_{SUFFIX}_URL`) +- `/redash-status` で設定状況を確認 + +### `/redash-add` でエラーが出る + +- `.mcp.json` の JSON が壊れていないか確認(手動編集した場合) +- `default` は予約語のため suffix に使用不可 + +### suffix 付き MCP が動かない + +- 対応する環境変数が `.env` に設定されているか `/redash-status` で確認 +- Redash の URL と API Key が正しいか確認 + +## 参考リンク + +- [redash-mcp](https://github.com/suthio/redash-mcp) - Redash MCP サーバー +- [Redash](https://redash.io/) - データ可視化ツール diff --git a/plugins/mcp/codex/mcp-redash/scripts/redash-mcp-config.js b/plugins/mcp/codex/mcp-redash/scripts/redash-mcp-config.js new file mode 100644 index 0000000..83ce0f6 --- /dev/null +++ b/plugins/mcp/codex/mcp-redash/scripts/redash-mcp-config.js @@ -0,0 +1,223 @@ +#!/usr/bin/env node + +/** + * redash-mcp-config.js + * + * project root の .mcp.json を操作して Redash MCP の追加・削除・一覧・状態確認を行う。 + * + * Usage: + * node redash-mcp-config.js add + * node redash-mcp-config.js remove + * node redash-mcp-config.js list + * node redash-mcp-config.js status + */ + +const fs = require('fs'); +const path = require('path'); + +const MCP_JSON_PATH = path.resolve(process.cwd(), '.mcp.json'); +const MCP_PACKAGE = '@suthio/redash-mcp'; + +// --- helpers --- + +function envName(suffix) { + const upper = suffix.toUpperCase(); + return { + url: `REDASH_${upper}_URL`, + key: `REDASH_${upper}_API_KEY`, + }; +} + +function mcpName(suffix) { + return `redash-${suffix}`; +} + +function mcpEntry(suffix) { + const env = envName(suffix); + return { + command: 'npx', + args: ['-y', MCP_PACKAGE], + env: { + REDASH_URL: `\${${env.url}}`, + REDASH_API_KEY: `\${${env.key}}`, + }, + }; +} + +function readMcpJson() { + if (!fs.existsSync(MCP_JSON_PATH)) { + return null; + } + const raw = fs.readFileSync(MCP_JSON_PATH, 'utf-8'); + try { + return JSON.parse(raw); + } catch { + return undefined; // 破損 + } +} + +function writeMcpJson(data) { + fs.writeFileSync(MCP_JSON_PATH, JSON.stringify(data, null, 2) + '\n', 'utf-8'); +} + +function isRedashServer(name) { + return name === 'redash' || name.startsWith('redash-'); +} + +// --- commands --- + +function cmdAdd(suffix) { + if (!suffix || suffix === 'default') { + console.error('エラー: デフォルトの redash は plugin 同梱のため追加できません。'); + console.error('suffix には dev, stg, prod2, sandbox などを指定してください。'); + process.exit(1); + } + + const name = mcpName(suffix); + let data = readMcpJson(); + + if (data === undefined) { + console.error('エラー: .mcp.json の JSON が壊れています。手動で修正してください。'); + process.exit(1); + } + + if (data === null) { + data = { mcpServers: {} }; + } + + if (!data.mcpServers) { + data.mcpServers = {}; + } + + if (data.mcpServers[name]) { + console.log(`${name} は既に登録されています。変更はありません。`); + process.exit(0); + } + + data.mcpServers[name] = mcpEntry(suffix); + writeMcpJson(data); + + const env = envName(suffix); + console.log(`${name} を .mcp.json に追加しました。`); + console.log(''); + console.log('必要な環境変数:'); + console.log(` ${env.url}`); + console.log(` ${env.key}`); + console.log(''); + console.log('プロジェクトの .env に設定してください。'); +} + +function cmdRemove(suffix) { + if (!suffix || suffix === 'default') { + console.error('エラー: デフォルトの redash は plugin 同梱のため削除できません。'); + process.exit(1); + } + + const name = mcpName(suffix); + let data = readMcpJson(); + + if (data === undefined) { + console.error('エラー: .mcp.json の JSON が壊れています。手動で修正してください。'); + process.exit(1); + } + + if (data === null || !data.mcpServers || !data.mcpServers[name]) { + console.log(`${name} は登録されていません。変更はありません。`); + process.exit(0); + } + + delete data.mcpServers[name]; + writeMcpJson(data); + + console.log(`${name} を .mcp.json から削除しました。`); +} + +function cmdList() { + // plugin 同梱分 + console.log('redash (plugin bundled)'); + + // project .mcp.json 分 + const data = readMcpJson(); + if (data === undefined) { + console.error('警告: .mcp.json の JSON が壊れています。'); + return; + } + if (data && data.mcpServers) { + const names = Object.keys(data.mcpServers) + .filter((n) => isRedashServer(n) && n !== 'redash') + .sort(); + for (const name of names) { + console.log(`${name.padEnd(14)}(project)`); + } + } +} + +function cmdStatus() { + console.log('=== Redash MCP Status ==='); + console.log(''); + + // plugin 同梱 + console.log('[redash] (plugin bundled)'); + console.log(' 環境変数: REDASH_URL, REDASH_API_KEY'); + printEnvWarnings(['REDASH_URL', 'REDASH_API_KEY']); + console.log(''); + + // project .mcp.json 分 + const data = readMcpJson(); + if (data === undefined) { + console.error('警告: .mcp.json の JSON が壊れています。'); + return; + } + if (data && data.mcpServers) { + const names = Object.keys(data.mcpServers) + .filter((n) => isRedashServer(n) && n !== 'redash') + .sort(); + for (const name of names) { + const suffix = name.replace('redash-', ''); + const env = envName(suffix); + console.log(`[${name}] (project)`); + console.log(` 環境変数: ${env.url}, ${env.key}`); + printEnvWarnings([env.url, env.key]); + console.log(''); + } + if (names.length === 0) { + console.log('追加の Redash MCP はありません。'); + console.log('/redash-add で追加できます。'); + } + } else { + console.log('追加の Redash MCP はありません。'); + console.log('/redash-add で追加できます。'); + } +} + +function printEnvWarnings(vars) { + const missing = vars.filter((v) => !process.env[v]); + if (missing.length > 0) { + for (const v of missing) { + console.log(` ⚠ ${v} が未設定です`); + } + } +} + +// --- main --- + +const [, , command, ...rest] = process.argv; +const suffix = rest[0] ? rest[0].toLowerCase() : ''; + +switch (command) { + case 'add': + cmdAdd(suffix); + break; + case 'remove': + cmdRemove(suffix); + break; + case 'list': + cmdList(); + break; + case 'status': + cmdStatus(); + break; + default: + console.error('Usage: redash-mcp-config.js [suffix]'); + process.exit(1); +} diff --git a/plugins/mcp/codex/mcp-redash/skills/redash-add/SKILL.md b/plugins/mcp/codex/mcp-redash/skills/redash-add/SKILL.md new file mode 100644 index 0000000..67b442e --- /dev/null +++ b/plugins/mcp/codex/mcp-redash/skills/redash-add/SKILL.md @@ -0,0 +1,27 @@ +--- +name: redash-add +description: 任意 suffix の Redash MCP を project .mcp.json に追加する +disable-model-invocation: true +user-invocable: true +arguments: + - name: suffix + description: "環境識別子(dev, stg, prod2, sandbox など)" +allowed-tools: + - Bash +--- + +# /redash-add + +任意 suffix の Redash MCP をプロジェクトの `.mcp.json` に追加します。 + +## 実行方法 + +以下のコマンドを実行してください。`$ARGUMENTS` にはユーザーが指定した suffix が入ります。 + +```bash +node "${CLAUDE_PLUGIN_ROOT}/scripts/redash-mcp-config.js" add $ARGUMENTS +``` + +## 実行後 + +コマンドの出力をそのままユーザーに表示してください。 diff --git a/plugins/mcp/codex/mcp-redash/skills/redash-guide/SKILL.md b/plugins/mcp/codex/mcp-redash/skills/redash-guide/SKILL.md new file mode 100644 index 0000000..5a134fe --- /dev/null +++ b/plugins/mcp/codex/mcp-redash/skills/redash-guide/SKILL.md @@ -0,0 +1,87 @@ +--- +name: redash-guide +description: Redash MCP プラグインの使い方ガイド +disable-model-invocation: false +user-invocable: true +allowed-tools: [] +--- + +# Redash MCP プラグイン ガイド + +## 基本設定(1環境のみ) + +Redash を1つだけ使う場合は、プロジェクトの `.env` に以下を設定するだけです。 + +```bash +REDASH_URL=https://redash.example.com +REDASH_API_KEY=your-api-key +``` + +プラグインインストール後、`/mcp` に `redash` が自動的に表示されます。 + +## 複数環境の追加 + +dev / stg / prod など複数の Redash を使う場合: + +### 1. 環境を追加 + +``` +/redash-add dev +/redash-add stg +``` + +### 2. 環境変数を設定 + +`.env` に追加分の変数を設定します。 + +```bash +# デフォルト +REDASH_URL=https://redash.example.com +REDASH_API_KEY=your-api-key + +# dev 環境 +REDASH_DEV_URL=https://redash-dev.example.com +REDASH_DEV_API_KEY=your-dev-api-key + +# stg 環境 +REDASH_STG_URL=https://redash-stg.example.com +REDASH_STG_API_KEY=your-stg-api-key +``` + +### 3. 確認 + +``` +/redash-list # 有効な MCP 一覧 +/redash-status # 環境変数の設定状況 +``` + +## suffix 命名ルール + +| suffix | MCP 名 | 環境変数 | +|--------|--------|----------| +| dev | redash-dev | REDASH_DEV_URL, REDASH_DEV_API_KEY | +| stg | redash-stg | REDASH_STG_URL, REDASH_STG_API_KEY | +| prod2 | redash-prod2 | REDASH_PROD2_URL, REDASH_PROD2_API_KEY | +| sandbox | redash-sandbox | REDASH_SANDBOX_URL, REDASH_SANDBOX_API_KEY | + +- suffix は英数字で自由に指定可能 +- `default` は予約語のため使用不可(plugin 同梱の `redash` が該当) + +## 環境の削除 + +不要になった環境は削除できます。 + +``` +/redash-remove dev +``` + +plugin 同梱の `redash` は削除できません。 + +## スラッシュコマンド一覧 + +| コマンド | 説明 | +|---------|------| +| `/redash-add ` | Redash MCP を追加 | +| `/redash-remove ` | Redash MCP を削除 | +| `/redash-list` | 有効な MCP 一覧 | +| `/redash-status` | 設定状況の詳細確認 | diff --git a/plugins/mcp/codex/mcp-redash/skills/redash-list/SKILL.md b/plugins/mcp/codex/mcp-redash/skills/redash-list/SKILL.md new file mode 100644 index 0000000..fe81518 --- /dev/null +++ b/plugins/mcp/codex/mcp-redash/skills/redash-list/SKILL.md @@ -0,0 +1,24 @@ +--- +name: redash-list +description: 現在有効な Redash MCP を一覧表示する +disable-model-invocation: true +user-invocable: true +allowed-tools: + - Bash +--- + +# /redash-list + +現在有効な Redash MCP の一覧を表示します。 + +## 実行方法 + +以下のコマンドを実行してください。 + +```bash +node "${CLAUDE_PLUGIN_ROOT}/scripts/redash-mcp-config.js" list +``` + +## 実行後 + +コマンドの出力をそのままユーザーに表示してください。 diff --git a/plugins/mcp/codex/mcp-redash/skills/redash-remove/SKILL.md b/plugins/mcp/codex/mcp-redash/skills/redash-remove/SKILL.md new file mode 100644 index 0000000..31a6270 --- /dev/null +++ b/plugins/mcp/codex/mcp-redash/skills/redash-remove/SKILL.md @@ -0,0 +1,27 @@ +--- +name: redash-remove +description: 指定 suffix の Redash MCP を project .mcp.json から削除する +disable-model-invocation: true +user-invocable: true +arguments: + - name: suffix + description: "削除する環境識別子(dev, stg, prod2, sandbox など)" +allowed-tools: + - Bash +--- + +# /redash-remove + +指定 suffix の Redash MCP をプロジェクトの `.mcp.json` から削除します。 + +## 実行方法 + +以下のコマンドを実行してください。`$ARGUMENTS` にはユーザーが指定した suffix が入ります。 + +```bash +node "${CLAUDE_PLUGIN_ROOT}/scripts/redash-mcp-config.js" remove $ARGUMENTS +``` + +## 実行後 + +コマンドの出力をそのままユーザーに表示してください。 diff --git a/plugins/mcp/codex/mcp-redash/skills/redash-status/SKILL.md b/plugins/mcp/codex/mcp-redash/skills/redash-status/SKILL.md new file mode 100644 index 0000000..2b1f909 --- /dev/null +++ b/plugins/mcp/codex/mcp-redash/skills/redash-status/SKILL.md @@ -0,0 +1,24 @@ +--- +name: redash-status +description: Redash MCP の設定状況と環境変数の確認 +disable-model-invocation: true +user-invocable: true +allowed-tools: + - Bash +--- + +# /redash-status + +Redash MCP の設定状況を詳細表示します。各 MCP が必要とする環境変数と、未設定の警告を確認できます。 + +## 実行方法 + +以下のコマンドを実行してください。 + +```bash +node "${CLAUDE_PLUGIN_ROOT}/scripts/redash-mcp-config.js" status +``` + +## 実行後 + +コマンドの出力をそのままユーザーに表示してください。 diff --git a/plugins/mcp/codex/mcp-serena/.codex-plugin/plugin.json b/plugins/mcp/codex/mcp-serena/.codex-plugin/plugin.json new file mode 100644 index 0000000..1400fe7 --- /dev/null +++ b/plugins/mcp/codex/mcp-serena/.codex-plugin/plugin.json @@ -0,0 +1,7 @@ +{ + "name": "mcp-serena", + "version": "1.0.0", + "description": "Serena MCP server for semantic code intelligence (symbol search, reference search, refactoring)", + "keywords": ["mcp", "serena", "lsp", "symbol-search", "refactoring", "code-intelligence"], + "mcpServers": "./.mcp.json" +} diff --git a/plugins/mcp/codex/mcp-serena/.mcp.json b/plugins/mcp/codex/mcp-serena/.mcp.json new file mode 100644 index 0000000..6ff356e --- /dev/null +++ b/plugins/mcp/codex/mcp-serena/.mcp.json @@ -0,0 +1,22 @@ +{ + "mcpServers": { + "serena": { + "type": "stdio", + "command": "uvx", + "args": [ + "--from", + "git+https://github.com/oraios/serena", + "serena", + "start-mcp-server", + "--context", + "ide-assistant", + "--enable-web-dashboard", + "False" + ], + "env": { + "SERENA_HOME": "${SERENA_HOME:-.serena}" + }, + "envFile": "${workspaceFolder}/.env" + } + } +} diff --git a/plugins/mcp/codex/mcp-serena/README.md b/plugins/mcp/codex/mcp-serena/README.md new file mode 100644 index 0000000..f8ebfe5 --- /dev/null +++ b/plugins/mcp/codex/mcp-serena/README.md @@ -0,0 +1,49 @@ +# mcp-serena + +Serena MCPサーバーを提供するプラグインです。セマンティックコードインテリジェンス機能(シンボル検索、リファレンス検索、安全なリファクタリング)を利用できます。 + +## インストール + +### Claude Code + +```bash +/plugin install mcp-serena@ai-plugins +``` + +### Codex + +```bash +codex plugin add mcp-serena@ai-plugins +``` + +### Kiro CLI + +Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 + +```bash +bash plugins/mcp/kiro/mcp-serena/install.sh +``` + +### 必要な環境変数 + +- `SERENA_HOME` + +## 提供機能 + +- **シンボル検索**: クラス、関数、メソッドの定義を検索 +- **リファレンス検索**: シンボルの参照箇所を特定 +- **シンボル概要**: ファイル内のシンボル一覧を取得(ファイル全体を読まずに構造を把握) +- **セマンティック編集**: シンボル単位でのコード置換・挿入 +- **パターン検索**: 正規表現によるコード検索 + +## 環境変数 + +| 変数 | 説明 | デフォルト | +|------|------|-----------| +| `SERENA_HOME` | Serena設定ディレクトリ | `.serena` | + +## 注意事項 + +- プロジェクトで使用する前に `activate_project` でアクティベートが必要です +- Serenaのメモリー機能は使用しません。知識は `docs/` に、手順は `skills/` に配置してください +- 詳細は `docs/serena-guide.md` を参照 diff --git a/plugins/mcp/codex/mcp-serena/docs/serena-guide.md b/plugins/mcp/codex/mcp-serena/docs/serena-guide.md new file mode 100644 index 0000000..3cd249c --- /dev/null +++ b/plugins/mcp/codex/mcp-serena/docs/serena-guide.md @@ -0,0 +1,73 @@ +# Serena MCP ガイド + +Serena MCPはセマンティックコードインテリジェンスツールです。 +コード操作専用。メモリー機能は使用しません。 + +## アクティベーション + +プロジェクトで使用する前にアクティベートが必要です。 + +``` +mcp__plugin_mcp-serena_serena__activate_project /path/to/project +mcp__plugin_mcp-serena_serena__check_onboarding_performed +``` + +## コード探索(推奨順序) + +### 1. ディレクトリ構造の確認 + +``` +mcp__plugin_mcp-serena_serena__list_dir relative_path="src/" recursive=false +``` + +### 2. シンボル概要の取得(ファイル全体を読む前に) + +``` +mcp__plugin_mcp-serena_serena__get_symbols_overview relative_path="path/to/file.py" +``` + +### 3. シンボル検索 + +``` +mcp__plugin_mcp-serena_serena__find_symbol name_path="/ClassName/method_name" relative_path="src/" include_body=true +``` + +### 4. パターン検索(シンボル名が不明な場合) + +``` +mcp__plugin_mcp-serena_serena__search_for_pattern substring_pattern="keyword" relative_path="src/" +``` + +### 5. リファレンス検索 + +``` +mcp__plugin_mcp-serena_serena__find_referencing_symbols name_path="/SymbolName" relative_path="src/" +``` + +## コード編集 + +### シンボル単位の置換 + +``` +mcp__plugin_mcp-serena_serena__replace_symbol_body name_path="/Class/method" relative_path="file.py" body="new code" +``` + +### シンボルの前後に挿入 + +``` +mcp__plugin_mcp-serena_serena__insert_before_symbol name_path="/FirstSymbol" relative_path="file.py" content="new code" +mcp__plugin_mcp-serena_serena__insert_after_symbol name_path="/LastSymbol" relative_path="file.py" content="new code" +``` + +### シンボル名の変更 + +``` +mcp__plugin_mcp-serena_serena__rename_symbol name_path="/OldName" relative_path="file.py" new_name="NewName" +``` + +## 使い分けの原則 + +- ファイル全体を読む前に `get_symbols_overview` で概要を確認 +- シンボル名が分かっている場合は `find_symbol` で直接アクセス +- シンボル名が不明な場合は `search_for_pattern` で候補を特定 +- 編集は `replace_symbol_body` でシンボル単位で行う(行ベース編集より安全) diff --git a/plugins/mcp/codex/mcp-serena/hooks/hooks.json b/plugins/mcp/codex/mcp-serena/hooks/hooks.json new file mode 100644 index 0000000..171ecaf --- /dev/null +++ b/plugins/mcp/codex/mcp-serena/hooks/hooks.json @@ -0,0 +1,19 @@ +{ + "description": "mcp-serena: Auto-activate Serena on session start", + "hooks": { + "SessionStart": [ + { + "description": "Remind to activate Serena project", + "hooks": [ + { + "type": "command", + "command": "echo '[mcp-serena] Serena MCPが利用可能です。activate_project でプロジェクトをアクティベートしてください。'", + "description": "Output Serena activation reminder", + "continueOnError": true, + "suppressOutput": false + } + ] + } + ] + } +} diff --git a/plugins/mcp/kiro/mcp-aws-docs/.mcp.json b/plugins/mcp/kiro/mcp-aws-docs/.mcp.json new file mode 100644 index 0000000..01ff167 --- /dev/null +++ b/plugins/mcp/kiro/mcp-aws-docs/.mcp.json @@ -0,0 +1,13 @@ +{ + "mcpServers": { + "awslabs.aws-docs": { + "type": "stdio", + "command": "uvx", + "args": [ + "awslabs.aws-documentation-mcp-server@latest" + ], + "env": {}, + "envFile": "${workspaceFolder}/.env" + } + } +} diff --git a/plugins/mcp/kiro/mcp-aws-docs/README.md b/plugins/mcp/kiro/mcp-aws-docs/README.md new file mode 100644 index 0000000..d030a73 --- /dev/null +++ b/plugins/mcp/kiro/mcp-aws-docs/README.md @@ -0,0 +1,77 @@ +# AWS Documentation MCP + +AWS公式ドキュメントにアクセスするためのMCPサーバープラグインです。 + +## 概要 + +このプラグインは、AWS公式ドキュメントを検索・取得する機能を提供します。 + +## 機能 + +- AWS公式ドキュメントの検索 +- ドキュメントページの取得 +- 関連ドキュメントの推薦 +- サービス別ドキュメントへのアクセス + +## インストール + +### Claude Code + +```bash +/plugin install mcp-aws-docs@ai-plugins +``` + +### Codex + +```bash +codex plugin add mcp-aws-docs@ai-plugins +``` + +### Kiro CLI + +Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 + +```bash +bash plugins/mcp/kiro/mcp-aws-docs/install.sh +``` + +### 必要な環境変数 + +- 追加の環境変数は不要です。 + +## 使用方法 + +### 基本的な使用例 + +```bash +# AWS Lambdaのドキュメントを検索 +mcp__plugin_aws-docs-mcp__awslabs.aws-docs__search_documentation "AWS Lambda best practices" + +# 特定のドキュメントページを読み込み +mcp__plugin_aws-docs-mcp__awslabs.aws-docs__read_documentation "https://docs.aws.amazon.com/lambda/..." +``` + +## 推奨される使用シーン + +- AWSサービスの調査 +- ベストプラクティスの確認 +- API仕様の参照 +- トラブルシューティング + +## ndf:researcherエージェントとの連携 + +AWS Docs MCPは、NDFプラグインの`ndf:researcher`エージェントと連携して使用することを推奨します。 + +```bash +# researcherエージェントにAWSドキュメント調査を依頼 +Task( + subagent_type="ndf:researcher", + prompt="Research AWS Lambda best practices for performance", + description="Research Lambda practices" +) +``` + +## 参考リンク + +- [aws-documentation-mcp-server](https://pypi.org/project/awslabs.aws-documentation-mcp-server/) +- [AWS Documentation](https://docs.aws.amazon.com/) diff --git a/plugins/mcp/kiro/mcp-aws-docs/docs/aws-docs-guide.md b/plugins/mcp/kiro/mcp-aws-docs/docs/aws-docs-guide.md new file mode 100644 index 0000000..57a2328 --- /dev/null +++ b/plugins/mcp/kiro/mcp-aws-docs/docs/aws-docs-guide.md @@ -0,0 +1,29 @@ +# AWS Docs MCP ガイド + +AWS Documentation MCPサーバーでAWS公式ドキュメントを検索・参照します。 + +## 主要機能 + +- AWSサービスのドキュメント検索 +- ベストプラクティスの参照 +- API仕様の確認 +- トラブルシューティング情報の取得 + +## 用途 + +- **researcherエージェント**: AWS公式ドキュメントの調査、ベストプラクティスの確認 + +## 使用例 + +``` +# Lambda関数のベストプラクティスを検索 +mcp__plugin_mcp-aws-docs_awslabs.aws-docs__search query="Lambda best practices" + +# S3バケットポリシーのドキュメントを参照 +mcp__plugin_mcp-aws-docs_awslabs.aws-docs__search query="S3 bucket policy" +``` + +## 注意事項 + +- 認証情報は不要(公開ドキュメントへのアクセス) +- 静的な公式ドキュメントの参照に特化。動的コンテンツにはChrome DevTools MCPを使用 diff --git a/plugins/mcp/kiro/mcp-aws-docs/install.sh b/plugins/mcp/kiro/mcp-aws-docs/install.sh new file mode 100755 index 0000000..af3c956 --- /dev/null +++ b/plugins/mcp/kiro/mcp-aws-docs/install.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +PROJECT_ROOT="$(pwd)" +TARGET_MCP="$PROJECT_ROOT/.mcp.json" +SOURCE_MCP="$SCRIPT_DIR/.mcp.json" +DRY_RUN=false + +usage() { + cat <<'USAGE' +Usage: bash install.sh [--dry-run] + +Install this MCP plugin into the current project's .mcp.json. +USAGE +} + +while [ "$#" -gt 0 ]; do + case "$1" in + --dry-run) DRY_RUN=true ;; + -h|--help) usage; exit 0 ;; + *) echo "Unknown option: $1" >&2; usage >&2; exit 2 ;; + esac + shift +done + +if [ ! -f "$SOURCE_MCP" ]; then + echo "ERROR: source .mcp.json not found: $SOURCE_MCP" >&2 + exit 1 +fi + +if [ "$DRY_RUN" = true ]; then + echo "Would merge $SOURCE_MCP into $TARGET_MCP" + exit 0 +fi + +python3 - "$SOURCE_MCP" "$TARGET_MCP" <<'PY' +import json +import sys +from pathlib import Path + +source_path = Path(sys.argv[1]) +target_path = Path(sys.argv[2]) +source = json.loads(source_path.read_text()) +target = json.loads(target_path.read_text()) if target_path.exists() else {} +source_servers = source.get("mcpServers", {}) +target.setdefault("mcpServers", {}) +target["mcpServers"].update(source_servers) +target_path.write_text(json.dumps(target, indent=2, ensure_ascii=False) + "\n") +print(f"Installed MCP servers: {', '.join(sorted(source_servers))}") +print(f"Updated: {target_path}") +PY diff --git a/plugins/mcp/kiro/mcp-bigquery/.mcp.json b/plugins/mcp/kiro/mcp-bigquery/.mcp.json new file mode 100644 index 0000000..ed2ecd4 --- /dev/null +++ b/plugins/mcp/kiro/mcp-bigquery/.mcp.json @@ -0,0 +1,21 @@ +{ + "mcpServers": { + "bigquery": { + "type": "stdio", + "command": "uvx", + "args": [ + "mcp-server-bigquery@latest", + "--project", + "${BIGQUERY_PROJECT}", + "--location", + "${BIGQUERY_LOCATION}", + "--dataset", + "${BIGQUERY_DATASET}", + "--key-file", + "${BIGQUERY_KEY_FILE}" + ], + "env": {}, + "envFile": "${workspaceFolder}/.env" + } + } +} diff --git a/plugins/mcp/kiro/mcp-bigquery/README.md b/plugins/mcp/kiro/mcp-bigquery/README.md new file mode 100644 index 0000000..6608b5b --- /dev/null +++ b/plugins/mcp/kiro/mcp-bigquery/README.md @@ -0,0 +1,105 @@ +# BigQuery MCP + +BigQuery MCPサーバーをClaude Codeで利用するためのプラグインです。 + +## 概要 + +このプラグインは、Google Cloud BigQueryへのアクセスを提供し、SQLクエリの実行やデータ分析を可能にします。 + +## 機能 + +- BigQueryテーブルの一覧取得 +- SQLクエリの実行 +- クエリ結果の取得 +- テーブルスキーマの取得 +- データセットの操作 + +## 前提条件 + +- Google Cloud Projectの作成 +- BigQuery APIの有効化 +- サービスアカウントキーの作成 + +## 環境変数の設定 + +プロジェクトルートに`.env`ファイルを作成し、以下の環境変数を設定してください: + +```bash +# BigQuery Project ID +BIGQUERY_PROJECT=your-project-id + +# BigQuery Location (例: asia-northeast1) +BIGQUERY_LOCATION=asia-northeast1 + +# 利用するデータセット(カンマ区切り) +BIGQUERY_DATASETS=dataset1,dataset2 + +# サービスアカウントキーファイルのパス +BIGQUERY_KEY_FILE=/path/to/service-account-key.json +``` + +## インストール + +### Claude Code + +```bash +/plugin install mcp-bigquery@ai-plugins +``` + +### Codex + +```bash +codex plugin add mcp-bigquery@ai-plugins +``` + +### Kiro CLI + +Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 + +```bash +bash plugins/mcp/kiro/mcp-bigquery/install.sh +``` + +### 必要な環境変数 + +- `BIGQUERY_DATASET` +- `BIGQUERY_KEY_FILE` +- `BIGQUERY_LOCATION` +- `BIGQUERY_PROJECT` + +## 使用方法 + +### 基本的な使用例 + +```bash +# テーブル一覧を取得 +mcp__plugin_bigquery-mcp__bigquery__list_tables + +# SQLクエリを実行 +mcp__plugin_bigquery-mcp__bigquery__execute_query "SELECT * FROM dataset.table LIMIT 10" +``` + +## 推奨される使用シーン + +- データ分析 +- レポート生成 +- SQLクエリの最適化 +- データ抽出 + +## ndf:data-analystエージェントとの連携 + +BigQuery MCPは、NDFプラグインの`ndf:data-analyst`エージェントと連携して使用することを推奨します。 + +```bash +# data-analystエージェントにBigQueryクエリを依頼 +Task( + subagent_type="ndf:data-analyst", + prompt="Analyze last month's sales data in BigQuery", + description="Analyze sales data" +) +``` + +## 参考リンク + +- [mcp-server-bigquery](https://pypi.org/project/mcp-server-bigquery/) +- [Google Cloud BigQuery](https://cloud.google.com/bigquery) diff --git a/plugins/mcp/kiro/mcp-bigquery/docs/bigquery-guide.md b/plugins/mcp/kiro/mcp-bigquery/docs/bigquery-guide.md new file mode 100644 index 0000000..2e7d1fd --- /dev/null +++ b/plugins/mcp/kiro/mcp-bigquery/docs/bigquery-guide.md @@ -0,0 +1,31 @@ +# BigQuery MCP ガイド + +BigQuery MCPサーバーでGoogle BigQueryのデータ分析を行います。 + +## 環境変数(必須) + +| 変数 | 説明 | +|------|------| +| `BIGQUERY_PROJECT` | GCPプロジェクトID | +| `BIGQUERY_LOCATION` | データセットのロケーション(例: `asia-northeast1`) | +| `BIGQUERY_DATASET` | デフォルトデータセット名 | +| `BIGQUERY_KEY_FILE` | サービスアカウントキーファイルのパス | + +## 主要ツール + +- `execute-query` - SQLクエリを実行し結果を取得 +- `list-tables` - データセット内のテーブル一覧を取得 +- `describe-table` - テーブルのスキーマ情報を取得 + +## 使用例 + +``` +# テーブル一覧の取得 +mcp__plugin_mcp-bigquery_bigquery__list-tables + +# テーブルのスキーマ確認 +mcp__plugin_mcp-bigquery_bigquery__describe-table table_name="users" + +# SQLクエリ実行 +mcp__plugin_mcp-bigquery_bigquery__execute-query query="SELECT * FROM users LIMIT 10" +``` diff --git a/plugins/mcp/kiro/mcp-bigquery/install.sh b/plugins/mcp/kiro/mcp-bigquery/install.sh new file mode 100755 index 0000000..af3c956 --- /dev/null +++ b/plugins/mcp/kiro/mcp-bigquery/install.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +PROJECT_ROOT="$(pwd)" +TARGET_MCP="$PROJECT_ROOT/.mcp.json" +SOURCE_MCP="$SCRIPT_DIR/.mcp.json" +DRY_RUN=false + +usage() { + cat <<'USAGE' +Usage: bash install.sh [--dry-run] + +Install this MCP plugin into the current project's .mcp.json. +USAGE +} + +while [ "$#" -gt 0 ]; do + case "$1" in + --dry-run) DRY_RUN=true ;; + -h|--help) usage; exit 0 ;; + *) echo "Unknown option: $1" >&2; usage >&2; exit 2 ;; + esac + shift +done + +if [ ! -f "$SOURCE_MCP" ]; then + echo "ERROR: source .mcp.json not found: $SOURCE_MCP" >&2 + exit 1 +fi + +if [ "$DRY_RUN" = true ]; then + echo "Would merge $SOURCE_MCP into $TARGET_MCP" + exit 0 +fi + +python3 - "$SOURCE_MCP" "$TARGET_MCP" <<'PY' +import json +import sys +from pathlib import Path + +source_path = Path(sys.argv[1]) +target_path = Path(sys.argv[2]) +source = json.loads(source_path.read_text()) +target = json.loads(target_path.read_text()) if target_path.exists() else {} +source_servers = source.get("mcpServers", {}) +target.setdefault("mcpServers", {}) +target["mcpServers"].update(source_servers) +target_path.write_text(json.dumps(target, indent=2, ensure_ascii=False) + "\n") +print(f"Installed MCP servers: {', '.join(sorted(source_servers))}") +print(f"Updated: {target_path}") +PY diff --git a/plugins/mcp/kiro/mcp-chrome-devtools/.mcp.json b/plugins/mcp/kiro/mcp-chrome-devtools/.mcp.json new file mode 100644 index 0000000..88e4c76 --- /dev/null +++ b/plugins/mcp/kiro/mcp-chrome-devtools/.mcp.json @@ -0,0 +1,17 @@ +{ + "mcpServers": { + "chrome-devtools": { + "type": "stdio", + "command": "npx", + "args": [ + "-y", + "chrome-devtools-mcp@latest", + "--isolated", + "--chromeArg=--no-sandbox", + "--chromeArg=--disable-setuid-sandbox", + "--chromeArg=--disable-dev-shm-usage" + ], + "envFile": "${workspaceFolder}/.env" + } + } +} diff --git a/plugins/mcp/kiro/mcp-chrome-devtools/README.md b/plugins/mcp/kiro/mcp-chrome-devtools/README.md new file mode 100644 index 0000000..b62f5a1 --- /dev/null +++ b/plugins/mcp/kiro/mcp-chrome-devtools/README.md @@ -0,0 +1,69 @@ +# Chrome DevTools MCP + +Chrome DevTools MCPサーバーをClaude Codeで利用するためのプラグインです。 + +## 概要 + +このプラグインは、ブラウザ自動化とテストのためのChrome DevTools Protocol (CDP)へのアクセスを提供します。 + +## 機能 + +- ブラウザの自動操作 +- スクリーンショット撮影 +- ページナビゲーション +- JavaScriptの実行 +- ネットワークリクエストの監視 +- コンソールログの取得 + +## インストール + +### Claude Code + +```bash +/plugin install mcp-chrome-devtools@ai-plugins +``` + +### Codex + +```bash +codex plugin add mcp-chrome-devtools@ai-plugins +``` + +### Kiro CLI + +Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 + +```bash +bash plugins/mcp/kiro/mcp-chrome-devtools/install.sh +``` + +### 必要な環境変数 + +- 追加の環境変数は不要です。 + +## 使用方法 + +### 基本的な使用例 + +```bash +# ページにアクセスしてスクリーンショットを撮影 +mcp__plugin_chrome-devtools-mcp__chrome-devtools__navigate_page "https://example.com" +mcp__plugin_chrome-devtools-mcp__chrome-devtools__take_screenshot +``` + +## 推奨される使用シーン + +- Webアプリケーションのテスト +- スクレイピング +- パフォーマンス測定 +- UIの自動検証 + +## 注意事項 + +- Dockerコンテナ内で実行する場合、`--no-sandbox`オプションが必要です +- DinD/DooD環境では接続方法が異なる場合があります(`ndf:docker-container-access` Skillを参照) + +## 参考リンク + +- [chrome-devtools-mcp](https://www.npmjs.com/package/chrome-devtools-mcp) +- [Chrome DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/) diff --git a/plugins/mcp/kiro/mcp-chrome-devtools/docs/chrome-devtools-guide.md b/plugins/mcp/kiro/mcp-chrome-devtools/docs/chrome-devtools-guide.md new file mode 100644 index 0000000..466323f --- /dev/null +++ b/plugins/mcp/kiro/mcp-chrome-devtools/docs/chrome-devtools-guide.md @@ -0,0 +1,21 @@ +# Chrome DevTools MCP ガイド + +Chrome DevTools MCPサーバーでブラウザの操作・デバッグ・パフォーマンス測定を行います。 + +## 主要機能 + +- ページナビゲーション・DOM操作 +- ネットワークリクエストの監視 +- コンソールログの取得 +- パフォーマンスプロファイリング +- スクリーンショット取得 + +## 用途 + +- **researcherエージェント**: JavaScript動的コンテンツの取得、Webスクレイピング +- **qaエージェント**: Webアプリケーションのパフォーマンス測定、UI検証 + +## 注意事項 + +- Docker環境(DinD/DooD)では`--no-sandbox`オプションが必要(設定済み) +- localhostへのアクセスはDocker環境に依存。詳細は `docker-container-access` スキルを参照 diff --git a/plugins/mcp/kiro/mcp-chrome-devtools/install.sh b/plugins/mcp/kiro/mcp-chrome-devtools/install.sh new file mode 100755 index 0000000..af3c956 --- /dev/null +++ b/plugins/mcp/kiro/mcp-chrome-devtools/install.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +PROJECT_ROOT="$(pwd)" +TARGET_MCP="$PROJECT_ROOT/.mcp.json" +SOURCE_MCP="$SCRIPT_DIR/.mcp.json" +DRY_RUN=false + +usage() { + cat <<'USAGE' +Usage: bash install.sh [--dry-run] + +Install this MCP plugin into the current project's .mcp.json. +USAGE +} + +while [ "$#" -gt 0 ]; do + case "$1" in + --dry-run) DRY_RUN=true ;; + -h|--help) usage; exit 0 ;; + *) echo "Unknown option: $1" >&2; usage >&2; exit 2 ;; + esac + shift +done + +if [ ! -f "$SOURCE_MCP" ]; then + echo "ERROR: source .mcp.json not found: $SOURCE_MCP" >&2 + exit 1 +fi + +if [ "$DRY_RUN" = true ]; then + echo "Would merge $SOURCE_MCP into $TARGET_MCP" + exit 0 +fi + +python3 - "$SOURCE_MCP" "$TARGET_MCP" <<'PY' +import json +import sys +from pathlib import Path + +source_path = Path(sys.argv[1]) +target_path = Path(sys.argv[2]) +source = json.loads(source_path.read_text()) +target = json.loads(target_path.read_text()) if target_path.exists() else {} +source_servers = source.get("mcpServers", {}) +target.setdefault("mcpServers", {}) +target["mcpServers"].update(source_servers) +target_path.write_text(json.dumps(target, indent=2, ensure_ascii=False) + "\n") +print(f"Installed MCP servers: {', '.join(sorted(source_servers))}") +print(f"Updated: {target_path}") +PY diff --git a/plugins/mcp/kiro/mcp-dbhub/.env.example b/plugins/mcp/kiro/mcp-dbhub/.env.example new file mode 100644 index 0000000..007c192 --- /dev/null +++ b/plugins/mcp/kiro/mcp-dbhub/.env.example @@ -0,0 +1,12 @@ +# .env - DBHub環境変数設定 +# このファイルを .env にコピーしてプロジェクトルートに配置してください。 +# dbhub.toml が存在しない場合のフォールバックとして使用されます。 + +# データベース接続文字列 +DBHUB_DSN=mysql://user:password@db-host:3306/dbname + +# SSH踏み台設定(必要な場合のみ) +# DBHUB_SSH_HOST=bastion.example.com +# DBHUB_SSH_PORT=22 +# DBHUB_SSH_USER=ubuntu +# DBHUB_SSH_KEY=~/.ssh/id_rsa diff --git a/plugins/mcp/kiro/mcp-dbhub/.mcp.json b/plugins/mcp/kiro/mcp-dbhub/.mcp.json new file mode 100644 index 0000000..dc078ac --- /dev/null +++ b/plugins/mcp/kiro/mcp-dbhub/.mcp.json @@ -0,0 +1,12 @@ +{ + "mcpServers": { + "dbhub": { + "type": "stdio", + "command": "npx", + "args": [ + "--yes", + "@bytebase/dbhub" + ] + } + } +} diff --git a/plugins/mcp/kiro/mcp-dbhub/README.md b/plugins/mcp/kiro/mcp-dbhub/README.md new file mode 100644 index 0000000..32ea657 --- /dev/null +++ b/plugins/mcp/kiro/mcp-dbhub/README.md @@ -0,0 +1,167 @@ +# DBHub MCP + +データベース操作とSQLクエリを実行するためのMCPサーバープラグインです。 + +## 概要 + +このプラグインは、MySQL、PostgreSQL、SQLiteなどの各種データベースへのアクセスを提供します。 + +## 機能 + +- データベース接続管理 +- SQLクエリの実行 +- テーブルスキーマの取得 +- データベース一覧の取得 +- 複数データベースへの同時接続(TOML設定) + +## インストール + +### Claude Code + +```bash +/plugin install mcp-dbhub@ai-plugins +``` + +### Codex + +```bash +codex plugin add mcp-dbhub@ai-plugins +``` + +### Kiro CLI + +Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 + +```bash +bash plugins/mcp/kiro/mcp-dbhub/install.sh +``` + +### 必要な環境変数 + +- 追加の環境変数は不要です。 + +## 設定 + +2つの設定方法があり、`dbhub.toml`が優先されます。 + +### 方法1: dbhub.toml(複数DB対応・推奨) + +プロジェクトルートに `dbhub.toml` を配置すると自動検出されます。 + +```toml +# 単一データベース +[[sources]] +id = "mydb" +description = "本番 MySQL" +dsn = "mysql://user:password@db-host:3306/dbname" +``` + +```toml +# 複数データベース +[[sources]] +id = "production" +description = "本番 MySQL" +dsn = "mysql://user:password@prod-db:3306/myapp" + +[[sources]] +id = "staging" +description = "ステージング MySQL" +dsn = "mysql://user:password@staging-db:3306/myapp_stg" +``` + +複数ソース定義時、ツール名に自動でサフィックスが付与されます(例: `execute_sql_production`, `execute_sql_staging`)。 + +#### SSH踏み台設定(TOML内) + +ソースごとにSSH踏み台を定義できます。 + +```toml +[[sources]] +id = "production" +description = "本番 MySQL(踏み台経由)" +dsn = "mysql://user:password@db.internal:3306/myapp" +ssh_host = "bastion.example.com" +ssh_port = 22 +ssh_user = "ubuntu" +ssh_key = "~/.ssh/id_rsa" +# ssh_passphrase = "鍵のパスフレーズ(暗号化されている場合)" +``` + +マルチホップSSH(多段踏み台)にも対応しています。 + +```toml +[[sources]] +id = "prod_multihop" +dsn = "postgres://user:password@10.0.1.100:5432/myapp" +ssh_host = "internal-server.company.com" +ssh_user = "deploy" +ssh_key = "~/.ssh/id_ed25519" +ssh_proxy_jump = "bastion.company.com,admin@jump2.internal:2222" +``` + +| フィールド | 必須 | 説明 | +|-----------|------|------| +| `ssh_host` | Yes | 踏み台ホスト名 | +| `ssh_port` | No | ポート(デフォルト: 22) | +| `ssh_user` | Yes | SSHユーザー名 | +| `ssh_key` | ※ | 秘密鍵パス(`~`展開可) | +| `ssh_password` | ※ | パスワード認証用 | +| `ssh_passphrase` | No | 秘密鍵のパスフレーズ | +| `ssh_proxy_jump` | No | マルチホップ(カンマ区切り) | + +※ `ssh_key` または `ssh_password` のいずれかが必須 + +### 方法2: .env(単一DB・簡易設定) + +`dbhub.toml`が存在しない場合、`.env`の環境変数にフォールバックします。 + +```bash +# データベース接続文字列 +DBHUB_DSN=mysql://user:password@db-host:3306/dbname + +# SSH踏み台(必要な場合) +DBHUB_SSH_HOST=bastion.example.com +DBHUB_SSH_PORT=22 +DBHUB_SSH_USER=ubuntu +DBHUB_SSH_KEY=~/.ssh/id_rsa +``` + +DSNのホスト名は踏み台から見た内部ホスト名を指定してください。 + +### 優先順位 + +1. `dbhub.toml`(プロジェクトルートに存在すれば自動読み込み) +2. `.env`の`DBHUB_DSN`環境変数(tomlが無い場合のフォールバック) + +## 使用例 + +```bash +# SQLクエリを実行 +mcp__plugin_mcp-dbhub_dbhub__execute_sql "SELECT * FROM users LIMIT 10" + +# テーブル一覧を取得 +mcp__plugin_mcp-dbhub_dbhub__search_objects --object_type table +``` + +## ndf:data-analystエージェントとの連携 + +DBHub MCPは、NDFプラグインの`ndf:data-analyst`エージェントと連携して使用することを推奨します。 + +```bash +Task( + subagent_type="ndf:data-analyst", + prompt="Analyze user activity in the local database", + description="Analyze user activity" +) +``` + +## 注意事項 + +- `dbhub.toml`と`.env`は`.gitignore`に追加し、認証情報をコミットしないでください +- SSH踏み台経由の場合、DSNのホスト名は踏み台から見た内部ホスト名を指定します + +## 参考リンク + +- [takemi-ohama/dbhub](https://github.com/takemi-ohama/dbhub) - 現在使用中のフォーク版(SSH keep-alive対応) +- [@bytebase/dbhub](https://www.npmjs.com/package/@bytebase/dbhub) - 本家パッケージ +- [Bytebase](https://www.bytebase.com/) diff --git a/plugins/mcp/kiro/mcp-dbhub/dbhub.toml.example b/plugins/mcp/kiro/mcp-dbhub/dbhub.toml.example new file mode 100644 index 0000000..4400680 --- /dev/null +++ b/plugins/mcp/kiro/mcp-dbhub/dbhub.toml.example @@ -0,0 +1,38 @@ +# dbhub.toml - データベース接続設定 +# このファイルを dbhub.toml にコピーしてプロジェクトルートに配置してください。 +# dbhub.toml は .gitignore に追加し、認証情報をコミットしないでください。 + +# 単一データベース(SSH踏み台なし) +[[sources]] +id = "mydb" +description = "開発用 MySQL" +dsn = "mysql://user:password@localhost:3306/mydb" + +# 単一データベース(SSH踏み台経由) +# [[sources]] +# id = "production" +# description = "本番 MySQL(踏み台経由)" +# dsn = "mysql://user:password@db.internal:3306/myapp" +# ssh_host = "bastion.example.com" +# ssh_port = 22 +# ssh_user = "ubuntu" +# ssh_key = "~/.ssh/id_rsa" + +# 複数データベース +# [[sources]] +# id = "production" +# description = "本番 MySQL" +# dsn = "mysql://user:password@prod-db.internal:3306/myapp" +# ssh_host = "bastion.example.com" +# ssh_port = 22 +# ssh_user = "ubuntu" +# ssh_key = "~/.ssh/id_rsa" +# +# [[sources]] +# id = "staging" +# description = "ステージング MySQL" +# dsn = "mysql://user:password@staging-db.internal:3306/myapp_stg" +# ssh_host = "bastion.example.com" +# ssh_port = 22 +# ssh_user = "ubuntu" +# ssh_key = "~/.ssh/id_rsa" diff --git a/plugins/mcp/kiro/mcp-dbhub/docs/dbhub-guide.md b/plugins/mcp/kiro/mcp-dbhub/docs/dbhub-guide.md new file mode 100644 index 0000000..1fb3d8e --- /dev/null +++ b/plugins/mcp/kiro/mcp-dbhub/docs/dbhub-guide.md @@ -0,0 +1,30 @@ +# DBHub MCP ガイド + +DBHub MCPサーバーで各種データベースへのSQL操作を行います。 + +## 接続設定 + +DBHubは接続文字列(DSN)でデータベースに接続します。 +環境変数またはツール引数で接続先を指定してください。 + +## 主要ツール + +- `execute_sql_{suffix}` - 指定環境でSQLクエリを実行 +- `search_objects_{suffix}` - データベースオブジェクト(テーブル、カラム等)を検索 + +suffixはインストール時の設定に依存します(例: `production`, `alpha`, `delta`)。 + +## 使用例 + +``` +# テーブル・カラムの検索 +mcp__plugin_mcp-dbhub_dbhub__search_objects_production keyword="users" + +# SQLクエリ実行 +mcp__plugin_mcp-dbhub_dbhub__execute_sql_production sql="SELECT * FROM users LIMIT 10" +``` + +## 注意事項 + +- 本番環境への書き込みクエリ(INSERT, UPDATE, DELETE)は慎重に実行してください +- 大量データの取得時はLIMIT句を使用してください diff --git a/plugins/mcp/kiro/mcp-dbhub/install.sh b/plugins/mcp/kiro/mcp-dbhub/install.sh new file mode 100755 index 0000000..af3c956 --- /dev/null +++ b/plugins/mcp/kiro/mcp-dbhub/install.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +PROJECT_ROOT="$(pwd)" +TARGET_MCP="$PROJECT_ROOT/.mcp.json" +SOURCE_MCP="$SCRIPT_DIR/.mcp.json" +DRY_RUN=false + +usage() { + cat <<'USAGE' +Usage: bash install.sh [--dry-run] + +Install this MCP plugin into the current project's .mcp.json. +USAGE +} + +while [ "$#" -gt 0 ]; do + case "$1" in + --dry-run) DRY_RUN=true ;; + -h|--help) usage; exit 0 ;; + *) echo "Unknown option: $1" >&2; usage >&2; exit 2 ;; + esac + shift +done + +if [ ! -f "$SOURCE_MCP" ]; then + echo "ERROR: source .mcp.json not found: $SOURCE_MCP" >&2 + exit 1 +fi + +if [ "$DRY_RUN" = true ]; then + echo "Would merge $SOURCE_MCP into $TARGET_MCP" + exit 0 +fi + +python3 - "$SOURCE_MCP" "$TARGET_MCP" <<'PY' +import json +import sys +from pathlib import Path + +source_path = Path(sys.argv[1]) +target_path = Path(sys.argv[2]) +source = json.loads(source_path.read_text()) +target = json.loads(target_path.read_text()) if target_path.exists() else {} +source_servers = source.get("mcpServers", {}) +target.setdefault("mcpServers", {}) +target["mcpServers"].update(source_servers) +target_path.write_text(json.dumps(target, indent=2, ensure_ascii=False) + "\n") +print(f"Installed MCP servers: {', '.join(sorted(source_servers))}") +print(f"Updated: {target_path}") +PY diff --git a/plugins/mcp/kiro/mcp-devin/.mcp.json b/plugins/mcp/kiro/mcp-devin/.mcp.json new file mode 100644 index 0000000..fe323ee --- /dev/null +++ b/plugins/mcp/kiro/mcp-devin/.mcp.json @@ -0,0 +1,15 @@ +{ + "mcpServers": { + "devin": { + "type": "http", + "url": "https://mcp.devin.ai/mcp", + "headers": { + "Authorization": "Bearer ${DEVIN_API_KEY}" + }, + "env": { + "DEVIN_API_KEY": "${DEVIN_API_KEY}" + }, + "envFile": "${workspaceFolder}/.env" + } + } +} diff --git a/plugins/mcp/kiro/mcp-devin/README.md b/plugins/mcp/kiro/mcp-devin/README.md new file mode 100644 index 0000000..3c1d032 --- /dev/null +++ b/plugins/mcp/kiro/mcp-devin/README.md @@ -0,0 +1,104 @@ +# Devin MCP + +リポジトリのドキュメントとコード知識にアクセスするためのMCPサーバープラグインです。 + +## 概要 + +このプラグインは、[Devin MCP](https://mcp.devin.ai/mcp)サーバーを利用して、GitHubなどのリポジトリのドキュメント構造や内容をAIエージェントから直接参照できるようにします。Devin APIキー(`DEVIN_API_KEY`)が必要です。 + +## 機能 + +- **`read_wiki_structure`** - リポジトリのドキュメントトピック一覧を取得 +- **`read_wiki_contents`** - ドキュメントの内容を閲覧 +- **`ask_question`** - リポジトリに関するAI質問回答 + +## 前提条件 + +- Devin APIキー(環境変数 `DEVIN_API_KEY`) + +## 環境変数の設定 + +プロジェクトルートの`.env`ファイルに以下を設定してください: + +```bash +# Devin API Key +DEVIN_API_KEY=your-devin-api-key +``` + +## インストール + +### Claude Code + +```bash +/plugin install mcp-devin@ai-plugins +``` + +### Codex + +```bash +codex plugin add mcp-devin@ai-plugins +``` + +### Kiro CLI + +Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 + +```bash +bash plugins/mcp/kiro/mcp-devin/install.sh +``` + +### 必要な環境変数 + +- `DEVIN_API_KEY` + +## 使用方法 + +### 基本的な使用例 + +```bash +# リポジトリのドキュメント構造を取得 +mcp__plugin_mcp-devin__devin__read_wiki_structure "owner/repo" + +# ドキュメント内容を読み取り +mcp__plugin_mcp-devin__devin__read_wiki_contents "owner/repo" "topic" + +# リポジトリについて質問 +mcp__plugin_mcp-devin__devin__ask_question "owner/repo" "How does authentication work?" +``` + +### CLIで直接追加する場合 + +```bash +claude mcp add -s user -t http devin https://mcp.devin.ai/mcp --header "Authorization: Bearer $DEVIN_API_KEY" +``` + +## 推奨される使用シーン + +- OSSライブラリの仕様・アーキテクチャ調査 +- 依存パッケージの内部実装の理解 +- リポジトリのドキュメント横断検索 +- 技術選定時のコード比較調査 + +## NDFエージェントとの連携 + +DeepWiki MCPは、NDFプラグインの`ndf:researcher`エージェントと連携して使用することを推奨します。 + +```bash +Task( + subagent_type="ndf:researcher", + prompt="DeepWikiを使ってlangchain/langchainリポジトリのRAG実装を調査してください", + description="Research RAG implementation" +) +``` + +## 注意事項 + +- `DEVIN_API_KEY` の設定が必要です +- HTTPトランスポートを使用しています(Devin公式MCPサーバー `https://mcp.devin.ai/mcp`) +- `Authorization: Bearer {DEVIN_API_KEY}` ヘッダーで認証します +- レート制限がある場合があります + +## 参考リンク + +- [DeepWiki](https://deepwiki.com) +- [DeepWiki MCP ドキュメント](https://docs.devin.ai/ja/work-with-devin/deepwiki-mcp) diff --git a/plugins/mcp/kiro/mcp-devin/install.sh b/plugins/mcp/kiro/mcp-devin/install.sh new file mode 100755 index 0000000..af3c956 --- /dev/null +++ b/plugins/mcp/kiro/mcp-devin/install.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +PROJECT_ROOT="$(pwd)" +TARGET_MCP="$PROJECT_ROOT/.mcp.json" +SOURCE_MCP="$SCRIPT_DIR/.mcp.json" +DRY_RUN=false + +usage() { + cat <<'USAGE' +Usage: bash install.sh [--dry-run] + +Install this MCP plugin into the current project's .mcp.json. +USAGE +} + +while [ "$#" -gt 0 ]; do + case "$1" in + --dry-run) DRY_RUN=true ;; + -h|--help) usage; exit 0 ;; + *) echo "Unknown option: $1" >&2; usage >&2; exit 2 ;; + esac + shift +done + +if [ ! -f "$SOURCE_MCP" ]; then + echo "ERROR: source .mcp.json not found: $SOURCE_MCP" >&2 + exit 1 +fi + +if [ "$DRY_RUN" = true ]; then + echo "Would merge $SOURCE_MCP into $TARGET_MCP" + exit 0 +fi + +python3 - "$SOURCE_MCP" "$TARGET_MCP" <<'PY' +import json +import sys +from pathlib import Path + +source_path = Path(sys.argv[1]) +target_path = Path(sys.argv[2]) +source = json.loads(source_path.read_text()) +target = json.loads(target_path.read_text()) if target_path.exists() else {} +source_servers = source.get("mcpServers", {}) +target.setdefault("mcpServers", {}) +target["mcpServers"].update(source_servers) +target_path.write_text(json.dumps(target, indent=2, ensure_ascii=False) + "\n") +print(f"Installed MCP servers: {', '.join(sorted(source_servers))}") +print(f"Updated: {target_path}") +PY diff --git a/plugins/mcp/kiro/mcp-markitdown/.mcp.json b/plugins/mcp/kiro/mcp-markitdown/.mcp.json new file mode 100644 index 0000000..844df81 --- /dev/null +++ b/plugins/mcp/kiro/mcp-markitdown/.mcp.json @@ -0,0 +1,11 @@ +{ + "mcpServers": { + "markitdown": { + "type": "stdio", + "command": "uvx", + "args": [ + "markitdown-mcp" + ] + } + } +} diff --git a/plugins/mcp/kiro/mcp-markitdown/README.md b/plugins/mcp/kiro/mcp-markitdown/README.md new file mode 100644 index 0000000..5988fd2 --- /dev/null +++ b/plugins/mcp/kiro/mcp-markitdown/README.md @@ -0,0 +1,71 @@ +# MarkItDown MCP + +各種ドキュメント(PDF、Office、画像など)をMarkdownに変換するMCPサーバープラグインです。 + +## 概要 + +[Microsoft MarkItDown](https://github.com/microsoft/markitdown) のMCPサーバーラッパーです。HTTP/HTTPS URL、ローカルファイル、Data URIを指定してドキュメントをMarkdownに変換できます。 + +## 機能 + +- `convert_to_markdown(uri)` ツールを提供 +- 対応フォーマット: PDF, Word (.docx), Excel (.xlsx), PowerPoint (.pptx), 画像, HTML, CSV, JSON, XML など +- HTTP/HTTPS URL、ローカルファイルパス(`file://`)、Data URI に対応 + +## インストール + +### Claude Code + +```bash +/plugin install mcp-markitdown@ai-plugins +``` + +### Codex + +```bash +codex plugin add mcp-markitdown@ai-plugins +``` + +### Kiro CLI + +Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 + +```bash +bash plugins/mcp/kiro/mcp-markitdown/install.sh +``` + +### 必要な環境変数 + +- 追加の環境変数は不要です。 + +## 使用例 + +```bash +# URLからドキュメントを変換 +mcp__plugin_mcp-markitdown_markitdown__convert_to_markdown uri="https://example.com/document.pdf" + +# ローカルファイルを変換 +mcp__plugin_mcp-markitdown_markitdown__convert_to_markdown uri="file:///path/to/document.docx" +``` + +## ndf:scannerエージェントとの連携 + +MarkItDown MCPは、NDFプラグインの`ndf:scanner`エージェントと連携して使用することを推奨します。 + +```bash +Task( + subagent_type="ndf:scanner", + prompt="Convert /path/to/document.pdf to Markdown and summarize key points.", + description="Convert and summarize PDF" +) +``` + +## 注意事項 + +- Python環境が必要です(`uvx` 経由で自動インストール) +- 大きなファイルの変換には時間がかかる場合があります + +## 参考リンク + +- [microsoft/markitdown](https://github.com/microsoft/markitdown) - 本家リポジトリ +- [markitdown-mcp (PyPI)](https://pypi.org/project/markitdown-mcp/) - PyPIパッケージ diff --git a/plugins/mcp/kiro/mcp-markitdown/docs/markitdown-guide.md b/plugins/mcp/kiro/mcp-markitdown/docs/markitdown-guide.md new file mode 100644 index 0000000..7ba0cf0 --- /dev/null +++ b/plugins/mcp/kiro/mcp-markitdown/docs/markitdown-guide.md @@ -0,0 +1,30 @@ +# MarkItDown MCP ガイド + +MarkItDown MCPサーバーで各種ドキュメントをMarkdown形式に変換します。 + +## 対応フォーマット + +- PDF +- Microsoft Office(Word, Excel, PowerPoint) +- 画像(OCR) +- HTML +- その他のドキュメント形式 + +## 主要ツール + +- `convert_to_markdown` - ファイルをMarkdownに変換 + +## 使用例 + +``` +# PDFをMarkdownに変換 +mcp__plugin_mcp-markitdown_markitdown__convert_to_markdown uri="file:///path/to/document.pdf" + +# Excelファイルを変換 +mcp__plugin_mcp-markitdown_markitdown__convert_to_markdown uri="file:///path/to/data.xlsx" +``` + +## 使い分け + +- scannerエージェントがPDF/Office/画像ファイルの読み取りに使用 +- Read toolで直接読めないファイル形式の変換に有用 diff --git a/plugins/mcp/kiro/mcp-markitdown/install.sh b/plugins/mcp/kiro/mcp-markitdown/install.sh new file mode 100755 index 0000000..af3c956 --- /dev/null +++ b/plugins/mcp/kiro/mcp-markitdown/install.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +PROJECT_ROOT="$(pwd)" +TARGET_MCP="$PROJECT_ROOT/.mcp.json" +SOURCE_MCP="$SCRIPT_DIR/.mcp.json" +DRY_RUN=false + +usage() { + cat <<'USAGE' +Usage: bash install.sh [--dry-run] + +Install this MCP plugin into the current project's .mcp.json. +USAGE +} + +while [ "$#" -gt 0 ]; do + case "$1" in + --dry-run) DRY_RUN=true ;; + -h|--help) usage; exit 0 ;; + *) echo "Unknown option: $1" >&2; usage >&2; exit 2 ;; + esac + shift +done + +if [ ! -f "$SOURCE_MCP" ]; then + echo "ERROR: source .mcp.json not found: $SOURCE_MCP" >&2 + exit 1 +fi + +if [ "$DRY_RUN" = true ]; then + echo "Would merge $SOURCE_MCP into $TARGET_MCP" + exit 0 +fi + +python3 - "$SOURCE_MCP" "$TARGET_MCP" <<'PY' +import json +import sys +from pathlib import Path + +source_path = Path(sys.argv[1]) +target_path = Path(sys.argv[2]) +source = json.loads(source_path.read_text()) +target = json.loads(target_path.read_text()) if target_path.exists() else {} +source_servers = source.get("mcpServers", {}) +target.setdefault("mcpServers", {}) +target["mcpServers"].update(source_servers) +target_path.write_text(json.dumps(target, indent=2, ensure_ascii=False) + "\n") +print(f"Installed MCP servers: {', '.join(sorted(source_servers))}") +print(f"Updated: {target_path}") +PY diff --git a/plugins/mcp/kiro/mcp-notion/.mcp.json b/plugins/mcp/kiro/mcp-notion/.mcp.json new file mode 100644 index 0000000..fc5b4de --- /dev/null +++ b/plugins/mcp/kiro/mcp-notion/.mcp.json @@ -0,0 +1,10 @@ +{ + "mcpServers": { + "notion": { + "type": "http", + "url": "https://mcp.notion.com/mcp", + "env": {}, + "envFile": "${workspaceFolder}/.env" + } + } +} diff --git a/plugins/mcp/kiro/mcp-notion/README.md b/plugins/mcp/kiro/mcp-notion/README.md new file mode 100644 index 0000000..d6a2d6b --- /dev/null +++ b/plugins/mcp/kiro/mcp-notion/README.md @@ -0,0 +1,89 @@ +# Notion MCP + +NotionワークスペースにアクセスするためのMCPサーバープラグインです。 + +## 概要 + +このプラグインは、Notionのページ、データベース、ブロックへのアクセスを提供します。 + +## 機能 + +- Notionページの作成・読み取り・更新 +- データベースのクエリ +- ブロックの操作 +- ページ階層の取得 +- コメントの追加 + +## 前提条件 + +- Notionアカウント +- Notion Integration(内部統合)の作成 +- 統合トークンの取得 + +## 環境変数の設定 + +プロジェクトルートに`.env`ファイルを作成し、以下の環境変数を設定してください: + +```bash +# Notion Integration Token +NOTION_TOKEN= +``` + +## インストール + +### Claude Code + +```bash +/plugin install mcp-notion@ai-plugins +``` + +### Codex + +```bash +codex plugin add mcp-notion@ai-plugins +``` + +### Kiro CLI + +Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 + +```bash +bash plugins/mcp/kiro/mcp-notion/install.sh +``` + +### 必要な環境変数 + +- 追加の環境変数は不要です。 + +## 使用方法 + +### 基本的な使用例 + +```bash +# ページを読み取り +mcp__plugin_notion-mcp__notion__read_page "page-id" + +# データベースをクエリ +mcp__plugin_notion-mcp__notion__query_database "database-id" + +# 新しいページを作成 +mcp__plugin_notion-mcp__notion__create_page "parent-page-id" "New Page Title" +``` + +## 推奨される使用シーン + +- ドキュメント管理 +- ナレッジベースの構築 +- タスク管理 +- プロジェクト情報の同期 + +## 注意事項 + +- Notion IntegrationをワークスペースやページにShareする必要があります +- HTTPトランスポートを使用しています(公式のNotion MCPサーバー) + +## 参考リンク + +- [Notion MCP Server](https://mcp.notion.com) +- [Notion API](https://developers.notion.com/) +- [Notion Integration Setup](https://www.notion.so/help/create-integrations-with-the-notion-api) diff --git a/plugins/mcp/kiro/mcp-notion/install.sh b/plugins/mcp/kiro/mcp-notion/install.sh new file mode 100755 index 0000000..af3c956 --- /dev/null +++ b/plugins/mcp/kiro/mcp-notion/install.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +PROJECT_ROOT="$(pwd)" +TARGET_MCP="$PROJECT_ROOT/.mcp.json" +SOURCE_MCP="$SCRIPT_DIR/.mcp.json" +DRY_RUN=false + +usage() { + cat <<'USAGE' +Usage: bash install.sh [--dry-run] + +Install this MCP plugin into the current project's .mcp.json. +USAGE +} + +while [ "$#" -gt 0 ]; do + case "$1" in + --dry-run) DRY_RUN=true ;; + -h|--help) usage; exit 0 ;; + *) echo "Unknown option: $1" >&2; usage >&2; exit 2 ;; + esac + shift +done + +if [ ! -f "$SOURCE_MCP" ]; then + echo "ERROR: source .mcp.json not found: $SOURCE_MCP" >&2 + exit 1 +fi + +if [ "$DRY_RUN" = true ]; then + echo "Would merge $SOURCE_MCP into $TARGET_MCP" + exit 0 +fi + +python3 - "$SOURCE_MCP" "$TARGET_MCP" <<'PY' +import json +import sys +from pathlib import Path + +source_path = Path(sys.argv[1]) +target_path = Path(sys.argv[2]) +source = json.loads(source_path.read_text()) +target = json.loads(target_path.read_text()) if target_path.exists() else {} +source_servers = source.get("mcpServers", {}) +target.setdefault("mcpServers", {}) +target["mcpServers"].update(source_servers) +target_path.write_text(json.dumps(target, indent=2, ensure_ascii=False) + "\n") +print(f"Installed MCP servers: {', '.join(sorted(source_servers))}") +print(f"Updated: {target_path}") +PY diff --git a/plugins/mcp/kiro/mcp-playwright/.mcp.json b/plugins/mcp/kiro/mcp-playwright/.mcp.json new file mode 100644 index 0000000..2313c0d --- /dev/null +++ b/plugins/mcp/kiro/mcp-playwright/.mcp.json @@ -0,0 +1,20 @@ +{ + "mcpServers": { + "playwright": { + "type": "stdio", + "command": "npx", + "args": [ + "-y", + "@playwright/mcp@latest", + "--browser", + "chromium", + "--isolated", + "--no-sandbox" + ], + "env": { + "PLAYWRIGHT_BROWSERS_PATH": "${HOME}/.cache/ms-playwright" + }, + "envFile": "${workspaceFolder}/.env" + } + } +} diff --git a/plugins/mcp/kiro/mcp-playwright/README.md b/plugins/mcp/kiro/mcp-playwright/README.md new file mode 100644 index 0000000..8662f56 --- /dev/null +++ b/plugins/mcp/kiro/mcp-playwright/README.md @@ -0,0 +1,178 @@ +# playwright Plugin + +Playwright MCPを自動的にセットアップし、ブラウザ自動化機能を提供するプラグインです。 + +## 概要 + +このプラグインは、Playwright MCPサーバーとChromiumブラウザを自動的にインストール・設定します。Claude Codeでブラウザ自動化タスク(Webスクレイピング、E2Eテスト、スクリーンショット取得など)を簡単に実行できるようになります。 + +## 機能 + +- **自動セットアップ**: 初回起動時にPlaywright Chromiumブラウザを自動インストール +- **バージョン互換性**: @playwright/mcpと互換性のあるPlaywrightバージョンを自動検出 +- **冪等性**: 既にインストール済みの場合はスキップ(高速起動) +- **環境変数対応**: PLAYWRIGHT_BROWSERS_PATHで共有キャッシュを利用 + +## インストール + +### Claude Code + +```bash +/plugin install mcp-playwright@ai-plugins +``` + +### Codex + +```bash +codex plugin add mcp-playwright@ai-plugins +``` + +### Kiro CLI + +Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 + +```bash +bash plugins/mcp/kiro/mcp-playwright/install.sh +``` + +### 必要な環境変数 + +- `HOME` + +## 使用方法 + +### 基本的な使い方 + +プラグインをインストールして、Claude Codeを起動するだけで自動的にセットアップが実行されます。 + +```bash +# Claude Codeを起動 +claude +``` + +初回起動時、以下のようなメッセージが表示されます: + +``` +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +🎭 Playwright MCP Plugin: 初回セットアップ +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +Playwright Chromiumブラウザをインストール中... +ネットワーク環境により1-2分かかる場合があります。 + +🔍 @playwright/mcpが使用するPlaywrightバージョンを確認中... +✓ Playwright 1.49.1 を使用します + +📦 Playwright 1.49.1 でChromiumをインストール中... +[インストールログ...] + +✅ セットアップ完了!Playwright Chromiumの準備ができました。 + Playwrightバージョン: 1.49.1 + ブラウザパス: ~/.cache/ms-playwright +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +``` + +### Playwright MCPツールの使用例 + +セットアップ完了後、以下のようなタスクが実行できます: + +``` +// Webページにアクセスしてスクリーンショットを取得 +mcp__plugin_playwright__browser_navigate(url: "https://example.com") +mcp__plugin_playwright__browser_take_screenshot() + +// フォームに入力してボタンをクリック +mcp__plugin_playwright__browser_fill(selector: "#email", value: "test@example.com") +mcp__plugin_playwright__browser_click(selector: "button[type='submit']") + +// ページのスナップショットを取得(アクセシビリティツリー) +mcp__plugin_playwright__browser_snapshot() +``` + +## 設定 + +### MCP設定(`.mcp.json`) + +プラグインは以下のMCP設定を提供します: + +```json +{ + "mcpServers": { + "playwright": { + "type": "stdio", + "command": "npx", + "args": [ + "-y", + "@playwright/mcp@latest", + "--browser", + "chromium", + "--isolated", + "--no-sandbox" + ], + "env": { + "PLAYWRIGHT_BROWSERS_PATH": "${HOME}/.cache/ms-playwright" + } + } + } +} +``` + +### ブラウザキャッシュパス + +デフォルトでは、Chromiumブラウザは `~/.cache/ms-playwright` にインストールされます。 + +別の場所を使用したい場合は、環境変数を設定してください: + +```bash +export PLAYWRIGHT_BROWSERS_PATH=/path/to/custom/location +``` + +## トラブルシューティング + +### インストールが失敗する場合 + +1. **手動インストール**: + ```bash + # 互換性のあるバージョンを確認 + npm view @playwright/mcp@latest dependencies + + # Chromiumをインストール + PLAYWRIGHT_BROWSERS_PATH=~/.cache/ms-playwright npx playwright@ install chromium + ``` + +2. **キャッシュをクリア**: + ```bash + rm ~/.claude-playwright-installed + ``` + +3. **ログを確認**: + プラグインは詳細なログを出力するので、エラーメッセージを確認してください。 + +### ブラウザが見つからない場合 + +環境変数 `PLAYWRIGHT_BROWSERS_PATH` が正しく設定されているか確認してください: + +```bash +echo $PLAYWRIGHT_BROWSERS_PATH +ls -la ~/.cache/ms-playwright +``` + +### タイムアウトエラー + +ネットワーク環境が遅い場合、インストールに時間がかかることがあります。 +デフォルトのタイムアウトは5分です。 + +## 参考資料 + +- [Playwright公式ドキュメント](https://playwright.dev/) +- [@playwright/mcp README](https://www.npmjs.com/package/@playwright/mcp) +- [Playwright Browser Management](https://playwright.dev/docs/browsers) + +## ライセンス + +MIT License + +## サポート + +問題が発生した場合は、GitHubリポジトリでissueを作成してください: +https://github.com/devbasex/ai-plugins/issues diff --git a/plugins/mcp/kiro/mcp-playwright/hooks/hooks.json b/plugins/mcp/kiro/mcp-playwright/hooks/hooks.json new file mode 100644 index 0000000..7b163ae --- /dev/null +++ b/plugins/mcp/kiro/mcp-playwright/hooks/hooks.json @@ -0,0 +1,22 @@ +{ + "description": "Playwright MCP auto-setup hook", + "hooks": { + "SessionStart": [ + { + "description": "Ensure Playwright browser is installed", + "matcher": "startup|resume", + "priority": 100, + "enabled": true, + "hooks": [ + { + "type": "command", + "command": "node ${CLAUDE_PLUGIN_ROOT}/scripts/ensure-playwright.js", + "description": "Auto-install Playwright chromium on first use", + "continueOnError": false, + "suppressOutput": false + } + ] + } + ] + } +} diff --git a/plugins/mcp/kiro/mcp-playwright/install.sh b/plugins/mcp/kiro/mcp-playwright/install.sh new file mode 100755 index 0000000..af3c956 --- /dev/null +++ b/plugins/mcp/kiro/mcp-playwright/install.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +PROJECT_ROOT="$(pwd)" +TARGET_MCP="$PROJECT_ROOT/.mcp.json" +SOURCE_MCP="$SCRIPT_DIR/.mcp.json" +DRY_RUN=false + +usage() { + cat <<'USAGE' +Usage: bash install.sh [--dry-run] + +Install this MCP plugin into the current project's .mcp.json. +USAGE +} + +while [ "$#" -gt 0 ]; do + case "$1" in + --dry-run) DRY_RUN=true ;; + -h|--help) usage; exit 0 ;; + *) echo "Unknown option: $1" >&2; usage >&2; exit 2 ;; + esac + shift +done + +if [ ! -f "$SOURCE_MCP" ]; then + echo "ERROR: source .mcp.json not found: $SOURCE_MCP" >&2 + exit 1 +fi + +if [ "$DRY_RUN" = true ]; then + echo "Would merge $SOURCE_MCP into $TARGET_MCP" + exit 0 +fi + +python3 - "$SOURCE_MCP" "$TARGET_MCP" <<'PY' +import json +import sys +from pathlib import Path + +source_path = Path(sys.argv[1]) +target_path = Path(sys.argv[2]) +source = json.loads(source_path.read_text()) +target = json.loads(target_path.read_text()) if target_path.exists() else {} +source_servers = source.get("mcpServers", {}) +target.setdefault("mcpServers", {}) +target["mcpServers"].update(source_servers) +target_path.write_text(json.dumps(target, indent=2, ensure_ascii=False) + "\n") +print(f"Installed MCP servers: {', '.join(sorted(source_servers))}") +print(f"Updated: {target_path}") +PY diff --git a/plugins/mcp/kiro/mcp-playwright/scripts/ensure-playwright.js b/plugins/mcp/kiro/mcp-playwright/scripts/ensure-playwright.js new file mode 100755 index 0000000..1a4c98d --- /dev/null +++ b/plugins/mcp/kiro/mcp-playwright/scripts/ensure-playwright.js @@ -0,0 +1,90 @@ +#!/usr/bin/env node + +const { execSync } = require('child_process'); +const fs = require('fs'); +const path = require('path'); +const os = require('os'); + +const PLUGIN_ROOT = process.env.CLAUDE_PLUGIN_ROOT || __dirname; +const FLAG_FILE = path.join(os.homedir(), '.claude-playwright-installed'); +const BROWSER_PATH = path.join(os.homedir(), '.cache', 'ms-playwright'); +const TIMEOUT_MS = 5 * 60 * 1000; // 5分タイムアウト + +// 既にインストール済みかチェック(冪等性) +if (fs.existsSync(FLAG_FILE)) { + process.exit(0); +} + +console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'); +console.log('🎭 Playwright MCP Plugin: 初回セットアップ'); +console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'); +console.log(''); +console.log('Playwright Chromiumブラウザをインストール中...'); +console.log('ネットワーク環境により1-2分かかる場合があります。'); +console.log(''); + +try { + // @playwright/mcpが依存するPlaywrightのバージョンを取得 + console.log('🔍 @playwright/mcpが使用するPlaywrightバージョンを確認中...'); + const depsOutput = execSync('npm view @playwright/mcp@latest dependencies --json', { + encoding: 'utf-8', + cwd: PLUGIN_ROOT, + timeout: 30000 + }); + + const deps = JSON.parse(depsOutput); + const playwrightVersion = deps.playwright || deps['playwright-core']; + + if (!playwrightVersion) { + throw new Error('@playwright/mcpの依存関係からPlaywrightバージョンを取得できませんでした'); + } + + console.log(`✓ Playwright ${playwrightVersion} を使用します`); + console.log(''); + + // @playwright/mcpと互換性のあるバージョンのChromiumをインストール + console.log(`📦 Playwright ${playwrightVersion} でChromiumをインストール中...`); + execSync(`npx -y playwright@${playwrightVersion} install chromium`, { + stdio: 'inherit', + cwd: PLUGIN_ROOT, + timeout: TIMEOUT_MS, + env: { + ...process.env, + PLAYWRIGHT_BROWSERS_PATH: BROWSER_PATH, + PLAYWRIGHT_SKIP_BROWSER_GC: '1' + } + }); + + // インストール成功フラグを作成 + const flagData = { + installed: new Date().toISOString(), + plugin: 'playwright', + browser: 'chromium', + browserPath: BROWSER_PATH, + playwrightVersion: playwrightVersion + }; + + fs.writeFileSync(FLAG_FILE, JSON.stringify(flagData, null, 2)); + + console.log(''); + console.log('✅ セットアップ完了!Playwright Chromiumの準備ができました。'); + console.log(` Playwrightバージョン: ${playwrightVersion}`); + console.log(` ブラウザパス: ${BROWSER_PATH}`); + console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'); + process.exit(0); + +} catch (error) { + console.error(''); + console.error('❌ Playwright Chromiumのインストールに失敗しました'); + console.error(''); + console.error('エラー:', error.message); + console.error(''); + console.error('手動でインストールするには以下を実行してください:'); + console.error(` npm view @playwright/mcp@latest dependencies`); + console.error(` PLAYWRIGHT_BROWSERS_PATH=${BROWSER_PATH} npx playwright@ install chromium`); + console.error(''); + console.error('トラブルシューティング:'); + console.error(' https://playwright.dev/docs/browsers'); + console.error('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'); + process.exit(1); +} diff --git a/plugins/mcp/kiro/mcp-redash/.env.example b/plugins/mcp/kiro/mcp-redash/.env.example new file mode 100644 index 0000000..810b944 --- /dev/null +++ b/plugins/mcp/kiro/mcp-redash/.env.example @@ -0,0 +1,16 @@ +# Redash MCP - 環境変数設定 +# +# デフォルト(必須) +REDASH_URL=https://redash.example.com +REDASH_API_KEY=your-api-key + +# 追加環境(/redash-add で追加した場合のみ必要) +# suffix を大文字にして REDASH_{SUFFIX}_URL, REDASH_{SUFFIX}_API_KEY の形式 +# +# 例: /redash-add dev +# REDASH_DEV_URL=https://redash-dev.example.com +# REDASH_DEV_API_KEY=your-dev-api-key +# +# 例: /redash-add stg +# REDASH_STG_URL=https://redash-stg.example.com +# REDASH_STG_API_KEY=your-stg-api-key diff --git a/plugins/mcp/kiro/mcp-redash/.mcp.json b/plugins/mcp/kiro/mcp-redash/.mcp.json new file mode 100644 index 0000000..80c370f --- /dev/null +++ b/plugins/mcp/kiro/mcp-redash/.mcp.json @@ -0,0 +1,12 @@ +{ + "mcpServers": { + "redash": { + "command": "npx", + "args": ["-y", "@suthio/redash-mcp"], + "env": { + "REDASH_URL": "${REDASH_URL}", + "REDASH_API_KEY": "${REDASH_API_KEY}" + } + } + } +} diff --git a/plugins/mcp/kiro/mcp-redash/README.md b/plugins/mcp/kiro/mcp-redash/README.md new file mode 100644 index 0000000..532f5a4 --- /dev/null +++ b/plugins/mcp/kiro/mcp-redash/README.md @@ -0,0 +1,160 @@ +# mcp-redash + +Redash MCP サーバーをマルチ環境対応で利用するための Claude Code プラグイン。 + +## 概要 + +[redash-mcp](https://github.com/suthio/redash-mcp) を Claude Code から利用するためのプラグインです。 + +- 1つだけ使う場合は最小設定(`REDASH_URL` と `REDASH_API_KEY` のみ) +- 必要になったら suffix 付きで環境を増やせる +- MCP 定義は必要になるまで作られない + +## 前提条件 + +- Claude Code +- Node.js(npx が使える環境) + +## インストール + +### Claude Code + +```bash +/plugin install mcp-redash@ai-plugins +``` + +### Codex + +```bash +codex plugin add mcp-redash@ai-plugins +``` + +### Kiro CLI + +Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 + +```bash +bash plugins/mcp/kiro/mcp-redash/install.sh +``` + +### 必要な環境変数 + +- `REDASH_API_KEY` +- `REDASH_URL` + +## 環境変数 + +プロジェクトの `.env` に設定してください。 + +```bash +REDASH_URL=https://redash.example.com +REDASH_API_KEY=your-api-key +``` + +## 使い方 + +### 基本(1環境) + +プラグインインストール後、`redash` MCP が自動的に有効になります。環境変数を設定するだけで利用開始できます。 + +### 複数環境 + +```bash +# dev 環境を追加 +/redash-add dev + +# .env に環境変数を設定 +# REDASH_DEV_URL=https://redash-dev.example.com +# REDASH_DEV_API_KEY=your-dev-api-key + +# 一覧確認 +/redash-list + +# 状態確認(環境変数の設定漏れチェック) +/redash-status + +# 不要になったら削除 +/redash-remove dev +``` + +## スラッシュコマンド + +| コマンド | 説明 | +|---------|------| +| `/redash-add ` | 任意 suffix の Redash MCP を project `.mcp.json` に追加 | +| `/redash-remove ` | 指定 suffix の Redash MCP を project `.mcp.json` から削除 | +| `/redash-list` | 有効な Redash MCP を一覧表示 | +| `/redash-status` | 設定状況の詳細確認(環境変数の未設定警告付き) | +| `/redash-guide` | 使い方ガイドを表示 | + +## suffix と環境変数の対応 + +| suffix | MCP 名 | 環境変数 | +|--------|--------|----------| +| (なし) | redash | REDASH_URL, REDASH_API_KEY | +| dev | redash-dev | REDASH_DEV_URL, REDASH_DEV_API_KEY | +| stg | redash-stg | REDASH_STG_URL, REDASH_STG_API_KEY | +| prod2 | redash-prod2 | REDASH_PROD2_URL, REDASH_PROD2_API_KEY | +| sandbox | redash-sandbox | REDASH_SANDBOX_URL, REDASH_SANDBOX_API_KEY | + +- suffix は英数字で自由に指定可能 +- `default` は予約語のため使用不可(plugin 同梱の `redash` が該当) + +## ファイル構成 + +``` +plugins/mcp/shared/mcp-redash/ +├── .claude-plugin/ +│ └── plugin.json # プラグインメタデータ +├── .mcp.json # MCP 設定(redash のみ同梱) +├── .env.example # 環境変数テンプレート +├── scripts/ +│ └── redash-mcp-config.js # JSON 編集スクリプト(Node.js) +├── skills/ +│ ├── redash-add/SKILL.md # /redash-add コマンド +│ ├── redash-remove/SKILL.md # /redash-remove コマンド +│ ├── redash-list/SKILL.md # /redash-list コマンド +│ ├── redash-status/SKILL.md # /redash-status コマンド +│ └── redash-guide/SKILL.md # 使い方ガイド +└── README.md +``` + +## 設計意図 + +> 本プラグインは +> 「1つだけ使う場合は最小設定」 +> 「必要になったら suffix 付きで増やす」 +> という運用を前提にしている。 +> +> そのため MCP 定義は **必要になるまで作られない**。 + +- plugin 同梱: `redash`(常に `/mcp` に表示) +- project `.mcp.json`: `/redash-add` で追加したもののみ表示 + +## トラブルシューティング + +### `/mcp` に redash が表示されない + +- プラグインが正しくインストールされているか確認 +- `/plugin list` で `mcp-redash@ai-plugins` が表示されるか確認 + +### 環境変数が反映されない + +- `.env` ファイルがプロジェクトルートにあるか確認 +- 変数名が正しい形式か確認(`REDASH_{SUFFIX}_URL`) +- `/redash-status` で設定状況を確認 + +### `/redash-add` でエラーが出る + +- `.mcp.json` の JSON が壊れていないか確認(手動編集した場合) +- `default` は予約語のため suffix に使用不可 + +### suffix 付き MCP が動かない + +- 対応する環境変数が `.env` に設定されているか `/redash-status` で確認 +- Redash の URL と API Key が正しいか確認 + +## 参考リンク + +- [redash-mcp](https://github.com/suthio/redash-mcp) - Redash MCP サーバー +- [Redash](https://redash.io/) - データ可視化ツール diff --git a/plugins/mcp/kiro/mcp-redash/install.sh b/plugins/mcp/kiro/mcp-redash/install.sh new file mode 100755 index 0000000..af3c956 --- /dev/null +++ b/plugins/mcp/kiro/mcp-redash/install.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +PROJECT_ROOT="$(pwd)" +TARGET_MCP="$PROJECT_ROOT/.mcp.json" +SOURCE_MCP="$SCRIPT_DIR/.mcp.json" +DRY_RUN=false + +usage() { + cat <<'USAGE' +Usage: bash install.sh [--dry-run] + +Install this MCP plugin into the current project's .mcp.json. +USAGE +} + +while [ "$#" -gt 0 ]; do + case "$1" in + --dry-run) DRY_RUN=true ;; + -h|--help) usage; exit 0 ;; + *) echo "Unknown option: $1" >&2; usage >&2; exit 2 ;; + esac + shift +done + +if [ ! -f "$SOURCE_MCP" ]; then + echo "ERROR: source .mcp.json not found: $SOURCE_MCP" >&2 + exit 1 +fi + +if [ "$DRY_RUN" = true ]; then + echo "Would merge $SOURCE_MCP into $TARGET_MCP" + exit 0 +fi + +python3 - "$SOURCE_MCP" "$TARGET_MCP" <<'PY' +import json +import sys +from pathlib import Path + +source_path = Path(sys.argv[1]) +target_path = Path(sys.argv[2]) +source = json.loads(source_path.read_text()) +target = json.loads(target_path.read_text()) if target_path.exists() else {} +source_servers = source.get("mcpServers", {}) +target.setdefault("mcpServers", {}) +target["mcpServers"].update(source_servers) +target_path.write_text(json.dumps(target, indent=2, ensure_ascii=False) + "\n") +print(f"Installed MCP servers: {', '.join(sorted(source_servers))}") +print(f"Updated: {target_path}") +PY diff --git a/plugins/mcp/kiro/mcp-redash/scripts/redash-mcp-config.js b/plugins/mcp/kiro/mcp-redash/scripts/redash-mcp-config.js new file mode 100644 index 0000000..83ce0f6 --- /dev/null +++ b/plugins/mcp/kiro/mcp-redash/scripts/redash-mcp-config.js @@ -0,0 +1,223 @@ +#!/usr/bin/env node + +/** + * redash-mcp-config.js + * + * project root の .mcp.json を操作して Redash MCP の追加・削除・一覧・状態確認を行う。 + * + * Usage: + * node redash-mcp-config.js add + * node redash-mcp-config.js remove + * node redash-mcp-config.js list + * node redash-mcp-config.js status + */ + +const fs = require('fs'); +const path = require('path'); + +const MCP_JSON_PATH = path.resolve(process.cwd(), '.mcp.json'); +const MCP_PACKAGE = '@suthio/redash-mcp'; + +// --- helpers --- + +function envName(suffix) { + const upper = suffix.toUpperCase(); + return { + url: `REDASH_${upper}_URL`, + key: `REDASH_${upper}_API_KEY`, + }; +} + +function mcpName(suffix) { + return `redash-${suffix}`; +} + +function mcpEntry(suffix) { + const env = envName(suffix); + return { + command: 'npx', + args: ['-y', MCP_PACKAGE], + env: { + REDASH_URL: `\${${env.url}}`, + REDASH_API_KEY: `\${${env.key}}`, + }, + }; +} + +function readMcpJson() { + if (!fs.existsSync(MCP_JSON_PATH)) { + return null; + } + const raw = fs.readFileSync(MCP_JSON_PATH, 'utf-8'); + try { + return JSON.parse(raw); + } catch { + return undefined; // 破損 + } +} + +function writeMcpJson(data) { + fs.writeFileSync(MCP_JSON_PATH, JSON.stringify(data, null, 2) + '\n', 'utf-8'); +} + +function isRedashServer(name) { + return name === 'redash' || name.startsWith('redash-'); +} + +// --- commands --- + +function cmdAdd(suffix) { + if (!suffix || suffix === 'default') { + console.error('エラー: デフォルトの redash は plugin 同梱のため追加できません。'); + console.error('suffix には dev, stg, prod2, sandbox などを指定してください。'); + process.exit(1); + } + + const name = mcpName(suffix); + let data = readMcpJson(); + + if (data === undefined) { + console.error('エラー: .mcp.json の JSON が壊れています。手動で修正してください。'); + process.exit(1); + } + + if (data === null) { + data = { mcpServers: {} }; + } + + if (!data.mcpServers) { + data.mcpServers = {}; + } + + if (data.mcpServers[name]) { + console.log(`${name} は既に登録されています。変更はありません。`); + process.exit(0); + } + + data.mcpServers[name] = mcpEntry(suffix); + writeMcpJson(data); + + const env = envName(suffix); + console.log(`${name} を .mcp.json に追加しました。`); + console.log(''); + console.log('必要な環境変数:'); + console.log(` ${env.url}`); + console.log(` ${env.key}`); + console.log(''); + console.log('プロジェクトの .env に設定してください。'); +} + +function cmdRemove(suffix) { + if (!suffix || suffix === 'default') { + console.error('エラー: デフォルトの redash は plugin 同梱のため削除できません。'); + process.exit(1); + } + + const name = mcpName(suffix); + let data = readMcpJson(); + + if (data === undefined) { + console.error('エラー: .mcp.json の JSON が壊れています。手動で修正してください。'); + process.exit(1); + } + + if (data === null || !data.mcpServers || !data.mcpServers[name]) { + console.log(`${name} は登録されていません。変更はありません。`); + process.exit(0); + } + + delete data.mcpServers[name]; + writeMcpJson(data); + + console.log(`${name} を .mcp.json から削除しました。`); +} + +function cmdList() { + // plugin 同梱分 + console.log('redash (plugin bundled)'); + + // project .mcp.json 分 + const data = readMcpJson(); + if (data === undefined) { + console.error('警告: .mcp.json の JSON が壊れています。'); + return; + } + if (data && data.mcpServers) { + const names = Object.keys(data.mcpServers) + .filter((n) => isRedashServer(n) && n !== 'redash') + .sort(); + for (const name of names) { + console.log(`${name.padEnd(14)}(project)`); + } + } +} + +function cmdStatus() { + console.log('=== Redash MCP Status ==='); + console.log(''); + + // plugin 同梱 + console.log('[redash] (plugin bundled)'); + console.log(' 環境変数: REDASH_URL, REDASH_API_KEY'); + printEnvWarnings(['REDASH_URL', 'REDASH_API_KEY']); + console.log(''); + + // project .mcp.json 分 + const data = readMcpJson(); + if (data === undefined) { + console.error('警告: .mcp.json の JSON が壊れています。'); + return; + } + if (data && data.mcpServers) { + const names = Object.keys(data.mcpServers) + .filter((n) => isRedashServer(n) && n !== 'redash') + .sort(); + for (const name of names) { + const suffix = name.replace('redash-', ''); + const env = envName(suffix); + console.log(`[${name}] (project)`); + console.log(` 環境変数: ${env.url}, ${env.key}`); + printEnvWarnings([env.url, env.key]); + console.log(''); + } + if (names.length === 0) { + console.log('追加の Redash MCP はありません。'); + console.log('/redash-add で追加できます。'); + } + } else { + console.log('追加の Redash MCP はありません。'); + console.log('/redash-add で追加できます。'); + } +} + +function printEnvWarnings(vars) { + const missing = vars.filter((v) => !process.env[v]); + if (missing.length > 0) { + for (const v of missing) { + console.log(` ⚠ ${v} が未設定です`); + } + } +} + +// --- main --- + +const [, , command, ...rest] = process.argv; +const suffix = rest[0] ? rest[0].toLowerCase() : ''; + +switch (command) { + case 'add': + cmdAdd(suffix); + break; + case 'remove': + cmdRemove(suffix); + break; + case 'list': + cmdList(); + break; + case 'status': + cmdStatus(); + break; + default: + console.error('Usage: redash-mcp-config.js [suffix]'); + process.exit(1); +} diff --git a/plugins/mcp/kiro/mcp-redash/skills/redash-add/SKILL.md b/plugins/mcp/kiro/mcp-redash/skills/redash-add/SKILL.md new file mode 100644 index 0000000..67b442e --- /dev/null +++ b/plugins/mcp/kiro/mcp-redash/skills/redash-add/SKILL.md @@ -0,0 +1,27 @@ +--- +name: redash-add +description: 任意 suffix の Redash MCP を project .mcp.json に追加する +disable-model-invocation: true +user-invocable: true +arguments: + - name: suffix + description: "環境識別子(dev, stg, prod2, sandbox など)" +allowed-tools: + - Bash +--- + +# /redash-add + +任意 suffix の Redash MCP をプロジェクトの `.mcp.json` に追加します。 + +## 実行方法 + +以下のコマンドを実行してください。`$ARGUMENTS` にはユーザーが指定した suffix が入ります。 + +```bash +node "${CLAUDE_PLUGIN_ROOT}/scripts/redash-mcp-config.js" add $ARGUMENTS +``` + +## 実行後 + +コマンドの出力をそのままユーザーに表示してください。 diff --git a/plugins/mcp/kiro/mcp-redash/skills/redash-guide/SKILL.md b/plugins/mcp/kiro/mcp-redash/skills/redash-guide/SKILL.md new file mode 100644 index 0000000..5a134fe --- /dev/null +++ b/plugins/mcp/kiro/mcp-redash/skills/redash-guide/SKILL.md @@ -0,0 +1,87 @@ +--- +name: redash-guide +description: Redash MCP プラグインの使い方ガイド +disable-model-invocation: false +user-invocable: true +allowed-tools: [] +--- + +# Redash MCP プラグイン ガイド + +## 基本設定(1環境のみ) + +Redash を1つだけ使う場合は、プロジェクトの `.env` に以下を設定するだけです。 + +```bash +REDASH_URL=https://redash.example.com +REDASH_API_KEY=your-api-key +``` + +プラグインインストール後、`/mcp` に `redash` が自動的に表示されます。 + +## 複数環境の追加 + +dev / stg / prod など複数の Redash を使う場合: + +### 1. 環境を追加 + +``` +/redash-add dev +/redash-add stg +``` + +### 2. 環境変数を設定 + +`.env` に追加分の変数を設定します。 + +```bash +# デフォルト +REDASH_URL=https://redash.example.com +REDASH_API_KEY=your-api-key + +# dev 環境 +REDASH_DEV_URL=https://redash-dev.example.com +REDASH_DEV_API_KEY=your-dev-api-key + +# stg 環境 +REDASH_STG_URL=https://redash-stg.example.com +REDASH_STG_API_KEY=your-stg-api-key +``` + +### 3. 確認 + +``` +/redash-list # 有効な MCP 一覧 +/redash-status # 環境変数の設定状況 +``` + +## suffix 命名ルール + +| suffix | MCP 名 | 環境変数 | +|--------|--------|----------| +| dev | redash-dev | REDASH_DEV_URL, REDASH_DEV_API_KEY | +| stg | redash-stg | REDASH_STG_URL, REDASH_STG_API_KEY | +| prod2 | redash-prod2 | REDASH_PROD2_URL, REDASH_PROD2_API_KEY | +| sandbox | redash-sandbox | REDASH_SANDBOX_URL, REDASH_SANDBOX_API_KEY | + +- suffix は英数字で自由に指定可能 +- `default` は予約語のため使用不可(plugin 同梱の `redash` が該当) + +## 環境の削除 + +不要になった環境は削除できます。 + +``` +/redash-remove dev +``` + +plugin 同梱の `redash` は削除できません。 + +## スラッシュコマンド一覧 + +| コマンド | 説明 | +|---------|------| +| `/redash-add ` | Redash MCP を追加 | +| `/redash-remove ` | Redash MCP を削除 | +| `/redash-list` | 有効な MCP 一覧 | +| `/redash-status` | 設定状況の詳細確認 | diff --git a/plugins/mcp/kiro/mcp-redash/skills/redash-list/SKILL.md b/plugins/mcp/kiro/mcp-redash/skills/redash-list/SKILL.md new file mode 100644 index 0000000..fe81518 --- /dev/null +++ b/plugins/mcp/kiro/mcp-redash/skills/redash-list/SKILL.md @@ -0,0 +1,24 @@ +--- +name: redash-list +description: 現在有効な Redash MCP を一覧表示する +disable-model-invocation: true +user-invocable: true +allowed-tools: + - Bash +--- + +# /redash-list + +現在有効な Redash MCP の一覧を表示します。 + +## 実行方法 + +以下のコマンドを実行してください。 + +```bash +node "${CLAUDE_PLUGIN_ROOT}/scripts/redash-mcp-config.js" list +``` + +## 実行後 + +コマンドの出力をそのままユーザーに表示してください。 diff --git a/plugins/mcp/kiro/mcp-redash/skills/redash-remove/SKILL.md b/plugins/mcp/kiro/mcp-redash/skills/redash-remove/SKILL.md new file mode 100644 index 0000000..31a6270 --- /dev/null +++ b/plugins/mcp/kiro/mcp-redash/skills/redash-remove/SKILL.md @@ -0,0 +1,27 @@ +--- +name: redash-remove +description: 指定 suffix の Redash MCP を project .mcp.json から削除する +disable-model-invocation: true +user-invocable: true +arguments: + - name: suffix + description: "削除する環境識別子(dev, stg, prod2, sandbox など)" +allowed-tools: + - Bash +--- + +# /redash-remove + +指定 suffix の Redash MCP をプロジェクトの `.mcp.json` から削除します。 + +## 実行方法 + +以下のコマンドを実行してください。`$ARGUMENTS` にはユーザーが指定した suffix が入ります。 + +```bash +node "${CLAUDE_PLUGIN_ROOT}/scripts/redash-mcp-config.js" remove $ARGUMENTS +``` + +## 実行後 + +コマンドの出力をそのままユーザーに表示してください。 diff --git a/plugins/mcp/kiro/mcp-redash/skills/redash-status/SKILL.md b/plugins/mcp/kiro/mcp-redash/skills/redash-status/SKILL.md new file mode 100644 index 0000000..2b1f909 --- /dev/null +++ b/plugins/mcp/kiro/mcp-redash/skills/redash-status/SKILL.md @@ -0,0 +1,24 @@ +--- +name: redash-status +description: Redash MCP の設定状況と環境変数の確認 +disable-model-invocation: true +user-invocable: true +allowed-tools: + - Bash +--- + +# /redash-status + +Redash MCP の設定状況を詳細表示します。各 MCP が必要とする環境変数と、未設定の警告を確認できます。 + +## 実行方法 + +以下のコマンドを実行してください。 + +```bash +node "${CLAUDE_PLUGIN_ROOT}/scripts/redash-mcp-config.js" status +``` + +## 実行後 + +コマンドの出力をそのままユーザーに表示してください。 diff --git a/plugins/mcp/kiro/mcp-serena/.mcp.json b/plugins/mcp/kiro/mcp-serena/.mcp.json new file mode 100644 index 0000000..6ff356e --- /dev/null +++ b/plugins/mcp/kiro/mcp-serena/.mcp.json @@ -0,0 +1,22 @@ +{ + "mcpServers": { + "serena": { + "type": "stdio", + "command": "uvx", + "args": [ + "--from", + "git+https://github.com/oraios/serena", + "serena", + "start-mcp-server", + "--context", + "ide-assistant", + "--enable-web-dashboard", + "False" + ], + "env": { + "SERENA_HOME": "${SERENA_HOME:-.serena}" + }, + "envFile": "${workspaceFolder}/.env" + } + } +} diff --git a/plugins/mcp/kiro/mcp-serena/README.md b/plugins/mcp/kiro/mcp-serena/README.md new file mode 100644 index 0000000..f8ebfe5 --- /dev/null +++ b/plugins/mcp/kiro/mcp-serena/README.md @@ -0,0 +1,49 @@ +# mcp-serena + +Serena MCPサーバーを提供するプラグインです。セマンティックコードインテリジェンス機能(シンボル検索、リファレンス検索、安全なリファクタリング)を利用できます。 + +## インストール + +### Claude Code + +```bash +/plugin install mcp-serena@ai-plugins +``` + +### Codex + +```bash +codex plugin add mcp-serena@ai-plugins +``` + +### Kiro CLI + +Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 + +```bash +bash plugins/mcp/kiro/mcp-serena/install.sh +``` + +### 必要な環境変数 + +- `SERENA_HOME` + +## 提供機能 + +- **シンボル検索**: クラス、関数、メソッドの定義を検索 +- **リファレンス検索**: シンボルの参照箇所を特定 +- **シンボル概要**: ファイル内のシンボル一覧を取得(ファイル全体を読まずに構造を把握) +- **セマンティック編集**: シンボル単位でのコード置換・挿入 +- **パターン検索**: 正規表現によるコード検索 + +## 環境変数 + +| 変数 | 説明 | デフォルト | +|------|------|-----------| +| `SERENA_HOME` | Serena設定ディレクトリ | `.serena` | + +## 注意事項 + +- プロジェクトで使用する前に `activate_project` でアクティベートが必要です +- Serenaのメモリー機能は使用しません。知識は `docs/` に、手順は `skills/` に配置してください +- 詳細は `docs/serena-guide.md` を参照 diff --git a/plugins/mcp/kiro/mcp-serena/docs/serena-guide.md b/plugins/mcp/kiro/mcp-serena/docs/serena-guide.md new file mode 100644 index 0000000..3cd249c --- /dev/null +++ b/plugins/mcp/kiro/mcp-serena/docs/serena-guide.md @@ -0,0 +1,73 @@ +# Serena MCP ガイド + +Serena MCPはセマンティックコードインテリジェンスツールです。 +コード操作専用。メモリー機能は使用しません。 + +## アクティベーション + +プロジェクトで使用する前にアクティベートが必要です。 + +``` +mcp__plugin_mcp-serena_serena__activate_project /path/to/project +mcp__plugin_mcp-serena_serena__check_onboarding_performed +``` + +## コード探索(推奨順序) + +### 1. ディレクトリ構造の確認 + +``` +mcp__plugin_mcp-serena_serena__list_dir relative_path="src/" recursive=false +``` + +### 2. シンボル概要の取得(ファイル全体を読む前に) + +``` +mcp__plugin_mcp-serena_serena__get_symbols_overview relative_path="path/to/file.py" +``` + +### 3. シンボル検索 + +``` +mcp__plugin_mcp-serena_serena__find_symbol name_path="/ClassName/method_name" relative_path="src/" include_body=true +``` + +### 4. パターン検索(シンボル名が不明な場合) + +``` +mcp__plugin_mcp-serena_serena__search_for_pattern substring_pattern="keyword" relative_path="src/" +``` + +### 5. リファレンス検索 + +``` +mcp__plugin_mcp-serena_serena__find_referencing_symbols name_path="/SymbolName" relative_path="src/" +``` + +## コード編集 + +### シンボル単位の置換 + +``` +mcp__plugin_mcp-serena_serena__replace_symbol_body name_path="/Class/method" relative_path="file.py" body="new code" +``` + +### シンボルの前後に挿入 + +``` +mcp__plugin_mcp-serena_serena__insert_before_symbol name_path="/FirstSymbol" relative_path="file.py" content="new code" +mcp__plugin_mcp-serena_serena__insert_after_symbol name_path="/LastSymbol" relative_path="file.py" content="new code" +``` + +### シンボル名の変更 + +``` +mcp__plugin_mcp-serena_serena__rename_symbol name_path="/OldName" relative_path="file.py" new_name="NewName" +``` + +## 使い分けの原則 + +- ファイル全体を読む前に `get_symbols_overview` で概要を確認 +- シンボル名が分かっている場合は `find_symbol` で直接アクセス +- シンボル名が不明な場合は `search_for_pattern` で候補を特定 +- 編集は `replace_symbol_body` でシンボル単位で行う(行ベース編集より安全) diff --git a/plugins/mcp/kiro/mcp-serena/hooks/hooks.json b/plugins/mcp/kiro/mcp-serena/hooks/hooks.json new file mode 100644 index 0000000..171ecaf --- /dev/null +++ b/plugins/mcp/kiro/mcp-serena/hooks/hooks.json @@ -0,0 +1,19 @@ +{ + "description": "mcp-serena: Auto-activate Serena on session start", + "hooks": { + "SessionStart": [ + { + "description": "Remind to activate Serena project", + "hooks": [ + { + "type": "command", + "command": "echo '[mcp-serena] Serena MCPが利用可能です。activate_project でプロジェクトをアクティベートしてください。'", + "description": "Output Serena activation reminder", + "continueOnError": true, + "suppressOutput": false + } + ] + } + ] + } +} diff --git a/plugins/mcp/kiro/mcp-serena/install.sh b/plugins/mcp/kiro/mcp-serena/install.sh new file mode 100755 index 0000000..af3c956 --- /dev/null +++ b/plugins/mcp/kiro/mcp-serena/install.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +PROJECT_ROOT="$(pwd)" +TARGET_MCP="$PROJECT_ROOT/.mcp.json" +SOURCE_MCP="$SCRIPT_DIR/.mcp.json" +DRY_RUN=false + +usage() { + cat <<'USAGE' +Usage: bash install.sh [--dry-run] + +Install this MCP plugin into the current project's .mcp.json. +USAGE +} + +while [ "$#" -gt 0 ]; do + case "$1" in + --dry-run) DRY_RUN=true ;; + -h|--help) usage; exit 0 ;; + *) echo "Unknown option: $1" >&2; usage >&2; exit 2 ;; + esac + shift +done + +if [ ! -f "$SOURCE_MCP" ]; then + echo "ERROR: source .mcp.json not found: $SOURCE_MCP" >&2 + exit 1 +fi + +if [ "$DRY_RUN" = true ]; then + echo "Would merge $SOURCE_MCP into $TARGET_MCP" + exit 0 +fi + +python3 - "$SOURCE_MCP" "$TARGET_MCP" <<'PY' +import json +import sys +from pathlib import Path + +source_path = Path(sys.argv[1]) +target_path = Path(sys.argv[2]) +source = json.loads(source_path.read_text()) +target = json.loads(target_path.read_text()) if target_path.exists() else {} +source_servers = source.get("mcpServers", {}) +target.setdefault("mcpServers", {}) +target["mcpServers"].update(source_servers) +target_path.write_text(json.dumps(target, indent=2, ensure_ascii=False) + "\n") +print(f"Installed MCP servers: {', '.join(sorted(source_servers))}") +print(f"Updated: {target_path}") +PY diff --git a/plugins/mcp/shared/mcp-aws-docs/.claude-plugin/plugin.json b/plugins/mcp/shared/mcp-aws-docs/.claude-plugin/plugin.json new file mode 100644 index 0000000..849646c --- /dev/null +++ b/plugins/mcp/shared/mcp-aws-docs/.claude-plugin/plugin.json @@ -0,0 +1,10 @@ +{ + "name": "mcp-aws-docs", + "version": "1.0.0", + "description": "AWS Documentation MCP server for accessing official AWS documentation", + "author": { + "name": "takemi-ohama", + "url": "https://github.com/takemi-ohama" + }, + "keywords": ["mcp", "aws", "documentation", "docs", "cloud"] +} diff --git a/plugins/mcp/shared/mcp-aws-docs/.mcp.json b/plugins/mcp/shared/mcp-aws-docs/.mcp.json new file mode 100644 index 0000000..01ff167 --- /dev/null +++ b/plugins/mcp/shared/mcp-aws-docs/.mcp.json @@ -0,0 +1,13 @@ +{ + "mcpServers": { + "awslabs.aws-docs": { + "type": "stdio", + "command": "uvx", + "args": [ + "awslabs.aws-documentation-mcp-server@latest" + ], + "env": {}, + "envFile": "${workspaceFolder}/.env" + } + } +} diff --git a/plugins/mcp/shared/mcp-aws-docs/README.md b/plugins/mcp/shared/mcp-aws-docs/README.md new file mode 100644 index 0000000..d030a73 --- /dev/null +++ b/plugins/mcp/shared/mcp-aws-docs/README.md @@ -0,0 +1,77 @@ +# AWS Documentation MCP + +AWS公式ドキュメントにアクセスするためのMCPサーバープラグインです。 + +## 概要 + +このプラグインは、AWS公式ドキュメントを検索・取得する機能を提供します。 + +## 機能 + +- AWS公式ドキュメントの検索 +- ドキュメントページの取得 +- 関連ドキュメントの推薦 +- サービス別ドキュメントへのアクセス + +## インストール + +### Claude Code + +```bash +/plugin install mcp-aws-docs@ai-plugins +``` + +### Codex + +```bash +codex plugin add mcp-aws-docs@ai-plugins +``` + +### Kiro CLI + +Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 + +```bash +bash plugins/mcp/kiro/mcp-aws-docs/install.sh +``` + +### 必要な環境変数 + +- 追加の環境変数は不要です。 + +## 使用方法 + +### 基本的な使用例 + +```bash +# AWS Lambdaのドキュメントを検索 +mcp__plugin_aws-docs-mcp__awslabs.aws-docs__search_documentation "AWS Lambda best practices" + +# 特定のドキュメントページを読み込み +mcp__plugin_aws-docs-mcp__awslabs.aws-docs__read_documentation "https://docs.aws.amazon.com/lambda/..." +``` + +## 推奨される使用シーン + +- AWSサービスの調査 +- ベストプラクティスの確認 +- API仕様の参照 +- トラブルシューティング + +## ndf:researcherエージェントとの連携 + +AWS Docs MCPは、NDFプラグインの`ndf:researcher`エージェントと連携して使用することを推奨します。 + +```bash +# researcherエージェントにAWSドキュメント調査を依頼 +Task( + subagent_type="ndf:researcher", + prompt="Research AWS Lambda best practices for performance", + description="Research Lambda practices" +) +``` + +## 参考リンク + +- [aws-documentation-mcp-server](https://pypi.org/project/awslabs.aws-documentation-mcp-server/) +- [AWS Documentation](https://docs.aws.amazon.com/) diff --git a/plugins/mcp/shared/mcp-aws-docs/docs/aws-docs-guide.md b/plugins/mcp/shared/mcp-aws-docs/docs/aws-docs-guide.md new file mode 100644 index 0000000..57a2328 --- /dev/null +++ b/plugins/mcp/shared/mcp-aws-docs/docs/aws-docs-guide.md @@ -0,0 +1,29 @@ +# AWS Docs MCP ガイド + +AWS Documentation MCPサーバーでAWS公式ドキュメントを検索・参照します。 + +## 主要機能 + +- AWSサービスのドキュメント検索 +- ベストプラクティスの参照 +- API仕様の確認 +- トラブルシューティング情報の取得 + +## 用途 + +- **researcherエージェント**: AWS公式ドキュメントの調査、ベストプラクティスの確認 + +## 使用例 + +``` +# Lambda関数のベストプラクティスを検索 +mcp__plugin_mcp-aws-docs_awslabs.aws-docs__search query="Lambda best practices" + +# S3バケットポリシーのドキュメントを参照 +mcp__plugin_mcp-aws-docs_awslabs.aws-docs__search query="S3 bucket policy" +``` + +## 注意事項 + +- 認証情報は不要(公開ドキュメントへのアクセス) +- 静的な公式ドキュメントの参照に特化。動的コンテンツにはChrome DevTools MCPを使用 diff --git a/plugins/mcp/shared/mcp-bigquery/.claude-plugin/plugin.json b/plugins/mcp/shared/mcp-bigquery/.claude-plugin/plugin.json new file mode 100644 index 0000000..179920b --- /dev/null +++ b/plugins/mcp/shared/mcp-bigquery/.claude-plugin/plugin.json @@ -0,0 +1,10 @@ +{ + "name": "mcp-bigquery", + "version": "1.0.0", + "description": "BigQuery MCP server for data analysis and SQL queries", + "author": { + "name": "takemi-ohama", + "url": "https://github.com/takemi-ohama" + }, + "keywords": ["mcp", "bigquery", "sql", "data", "analysis", "gcp"] +} diff --git a/plugins/mcp/shared/mcp-bigquery/.mcp.json b/plugins/mcp/shared/mcp-bigquery/.mcp.json new file mode 100644 index 0000000..ed2ecd4 --- /dev/null +++ b/plugins/mcp/shared/mcp-bigquery/.mcp.json @@ -0,0 +1,21 @@ +{ + "mcpServers": { + "bigquery": { + "type": "stdio", + "command": "uvx", + "args": [ + "mcp-server-bigquery@latest", + "--project", + "${BIGQUERY_PROJECT}", + "--location", + "${BIGQUERY_LOCATION}", + "--dataset", + "${BIGQUERY_DATASET}", + "--key-file", + "${BIGQUERY_KEY_FILE}" + ], + "env": {}, + "envFile": "${workspaceFolder}/.env" + } + } +} diff --git a/plugins/mcp/shared/mcp-bigquery/README.md b/plugins/mcp/shared/mcp-bigquery/README.md new file mode 100644 index 0000000..6608b5b --- /dev/null +++ b/plugins/mcp/shared/mcp-bigquery/README.md @@ -0,0 +1,105 @@ +# BigQuery MCP + +BigQuery MCPサーバーをClaude Codeで利用するためのプラグインです。 + +## 概要 + +このプラグインは、Google Cloud BigQueryへのアクセスを提供し、SQLクエリの実行やデータ分析を可能にします。 + +## 機能 + +- BigQueryテーブルの一覧取得 +- SQLクエリの実行 +- クエリ結果の取得 +- テーブルスキーマの取得 +- データセットの操作 + +## 前提条件 + +- Google Cloud Projectの作成 +- BigQuery APIの有効化 +- サービスアカウントキーの作成 + +## 環境変数の設定 + +プロジェクトルートに`.env`ファイルを作成し、以下の環境変数を設定してください: + +```bash +# BigQuery Project ID +BIGQUERY_PROJECT=your-project-id + +# BigQuery Location (例: asia-northeast1) +BIGQUERY_LOCATION=asia-northeast1 + +# 利用するデータセット(カンマ区切り) +BIGQUERY_DATASETS=dataset1,dataset2 + +# サービスアカウントキーファイルのパス +BIGQUERY_KEY_FILE=/path/to/service-account-key.json +``` + +## インストール + +### Claude Code + +```bash +/plugin install mcp-bigquery@ai-plugins +``` + +### Codex + +```bash +codex plugin add mcp-bigquery@ai-plugins +``` + +### Kiro CLI + +Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 + +```bash +bash plugins/mcp/kiro/mcp-bigquery/install.sh +``` + +### 必要な環境変数 + +- `BIGQUERY_DATASET` +- `BIGQUERY_KEY_FILE` +- `BIGQUERY_LOCATION` +- `BIGQUERY_PROJECT` + +## 使用方法 + +### 基本的な使用例 + +```bash +# テーブル一覧を取得 +mcp__plugin_bigquery-mcp__bigquery__list_tables + +# SQLクエリを実行 +mcp__plugin_bigquery-mcp__bigquery__execute_query "SELECT * FROM dataset.table LIMIT 10" +``` + +## 推奨される使用シーン + +- データ分析 +- レポート生成 +- SQLクエリの最適化 +- データ抽出 + +## ndf:data-analystエージェントとの連携 + +BigQuery MCPは、NDFプラグインの`ndf:data-analyst`エージェントと連携して使用することを推奨します。 + +```bash +# data-analystエージェントにBigQueryクエリを依頼 +Task( + subagent_type="ndf:data-analyst", + prompt="Analyze last month's sales data in BigQuery", + description="Analyze sales data" +) +``` + +## 参考リンク + +- [mcp-server-bigquery](https://pypi.org/project/mcp-server-bigquery/) +- [Google Cloud BigQuery](https://cloud.google.com/bigquery) diff --git a/plugins/mcp/shared/mcp-bigquery/docs/bigquery-guide.md b/plugins/mcp/shared/mcp-bigquery/docs/bigquery-guide.md new file mode 100644 index 0000000..2e7d1fd --- /dev/null +++ b/plugins/mcp/shared/mcp-bigquery/docs/bigquery-guide.md @@ -0,0 +1,31 @@ +# BigQuery MCP ガイド + +BigQuery MCPサーバーでGoogle BigQueryのデータ分析を行います。 + +## 環境変数(必須) + +| 変数 | 説明 | +|------|------| +| `BIGQUERY_PROJECT` | GCPプロジェクトID | +| `BIGQUERY_LOCATION` | データセットのロケーション(例: `asia-northeast1`) | +| `BIGQUERY_DATASET` | デフォルトデータセット名 | +| `BIGQUERY_KEY_FILE` | サービスアカウントキーファイルのパス | + +## 主要ツール + +- `execute-query` - SQLクエリを実行し結果を取得 +- `list-tables` - データセット内のテーブル一覧を取得 +- `describe-table` - テーブルのスキーマ情報を取得 + +## 使用例 + +``` +# テーブル一覧の取得 +mcp__plugin_mcp-bigquery_bigquery__list-tables + +# テーブルのスキーマ確認 +mcp__plugin_mcp-bigquery_bigquery__describe-table table_name="users" + +# SQLクエリ実行 +mcp__plugin_mcp-bigquery_bigquery__execute-query query="SELECT * FROM users LIMIT 10" +``` diff --git a/plugins/mcp/shared/mcp-chrome-devtools/.claude-plugin/plugin.json b/plugins/mcp/shared/mcp-chrome-devtools/.claude-plugin/plugin.json new file mode 100644 index 0000000..45fc51f --- /dev/null +++ b/plugins/mcp/shared/mcp-chrome-devtools/.claude-plugin/plugin.json @@ -0,0 +1,10 @@ +{ + "name": "mcp-chrome-devtools", + "version": "1.0.0", + "description": "Chrome DevTools MCP server for browser automation and testing", + "author": { + "name": "takemi-ohama", + "url": "https://github.com/takemi-ohama" + }, + "keywords": ["mcp", "chrome", "devtools", "browser", "automation", "testing"] +} diff --git a/plugins/mcp/shared/mcp-chrome-devtools/.mcp.json b/plugins/mcp/shared/mcp-chrome-devtools/.mcp.json new file mode 100644 index 0000000..88e4c76 --- /dev/null +++ b/plugins/mcp/shared/mcp-chrome-devtools/.mcp.json @@ -0,0 +1,17 @@ +{ + "mcpServers": { + "chrome-devtools": { + "type": "stdio", + "command": "npx", + "args": [ + "-y", + "chrome-devtools-mcp@latest", + "--isolated", + "--chromeArg=--no-sandbox", + "--chromeArg=--disable-setuid-sandbox", + "--chromeArg=--disable-dev-shm-usage" + ], + "envFile": "${workspaceFolder}/.env" + } + } +} diff --git a/plugins/mcp/shared/mcp-chrome-devtools/README.md b/plugins/mcp/shared/mcp-chrome-devtools/README.md new file mode 100644 index 0000000..b62f5a1 --- /dev/null +++ b/plugins/mcp/shared/mcp-chrome-devtools/README.md @@ -0,0 +1,69 @@ +# Chrome DevTools MCP + +Chrome DevTools MCPサーバーをClaude Codeで利用するためのプラグインです。 + +## 概要 + +このプラグインは、ブラウザ自動化とテストのためのChrome DevTools Protocol (CDP)へのアクセスを提供します。 + +## 機能 + +- ブラウザの自動操作 +- スクリーンショット撮影 +- ページナビゲーション +- JavaScriptの実行 +- ネットワークリクエストの監視 +- コンソールログの取得 + +## インストール + +### Claude Code + +```bash +/plugin install mcp-chrome-devtools@ai-plugins +``` + +### Codex + +```bash +codex plugin add mcp-chrome-devtools@ai-plugins +``` + +### Kiro CLI + +Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 + +```bash +bash plugins/mcp/kiro/mcp-chrome-devtools/install.sh +``` + +### 必要な環境変数 + +- 追加の環境変数は不要です。 + +## 使用方法 + +### 基本的な使用例 + +```bash +# ページにアクセスしてスクリーンショットを撮影 +mcp__plugin_chrome-devtools-mcp__chrome-devtools__navigate_page "https://example.com" +mcp__plugin_chrome-devtools-mcp__chrome-devtools__take_screenshot +``` + +## 推奨される使用シーン + +- Webアプリケーションのテスト +- スクレイピング +- パフォーマンス測定 +- UIの自動検証 + +## 注意事項 + +- Dockerコンテナ内で実行する場合、`--no-sandbox`オプションが必要です +- DinD/DooD環境では接続方法が異なる場合があります(`ndf:docker-container-access` Skillを参照) + +## 参考リンク + +- [chrome-devtools-mcp](https://www.npmjs.com/package/chrome-devtools-mcp) +- [Chrome DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/) diff --git a/plugins/mcp/shared/mcp-chrome-devtools/docs/chrome-devtools-guide.md b/plugins/mcp/shared/mcp-chrome-devtools/docs/chrome-devtools-guide.md new file mode 100644 index 0000000..466323f --- /dev/null +++ b/plugins/mcp/shared/mcp-chrome-devtools/docs/chrome-devtools-guide.md @@ -0,0 +1,21 @@ +# Chrome DevTools MCP ガイド + +Chrome DevTools MCPサーバーでブラウザの操作・デバッグ・パフォーマンス測定を行います。 + +## 主要機能 + +- ページナビゲーション・DOM操作 +- ネットワークリクエストの監視 +- コンソールログの取得 +- パフォーマンスプロファイリング +- スクリーンショット取得 + +## 用途 + +- **researcherエージェント**: JavaScript動的コンテンツの取得、Webスクレイピング +- **qaエージェント**: Webアプリケーションのパフォーマンス測定、UI検証 + +## 注意事項 + +- Docker環境(DinD/DooD)では`--no-sandbox`オプションが必要(設定済み) +- localhostへのアクセスはDocker環境に依存。詳細は `docker-container-access` スキルを参照 diff --git a/plugins/mcp/shared/mcp-dbhub/.claude-plugin/plugin.json b/plugins/mcp/shared/mcp-dbhub/.claude-plugin/plugin.json new file mode 100644 index 0000000..8c80622 --- /dev/null +++ b/plugins/mcp/shared/mcp-dbhub/.claude-plugin/plugin.json @@ -0,0 +1,10 @@ +{ + "name": "mcp-dbhub", + "version": "1.2.0", + "description": "DBHub MCP server for database operations and SQL queries", + "author": { + "name": "takemi-ohama", + "url": "https://github.com/takemi-ohama" + }, + "keywords": ["mcp", "database", "sql", "dbhub", "mysql", "postgres"] +} diff --git a/plugins/mcp/shared/mcp-dbhub/.env.example b/plugins/mcp/shared/mcp-dbhub/.env.example new file mode 100644 index 0000000..007c192 --- /dev/null +++ b/plugins/mcp/shared/mcp-dbhub/.env.example @@ -0,0 +1,12 @@ +# .env - DBHub環境変数設定 +# このファイルを .env にコピーしてプロジェクトルートに配置してください。 +# dbhub.toml が存在しない場合のフォールバックとして使用されます。 + +# データベース接続文字列 +DBHUB_DSN=mysql://user:password@db-host:3306/dbname + +# SSH踏み台設定(必要な場合のみ) +# DBHUB_SSH_HOST=bastion.example.com +# DBHUB_SSH_PORT=22 +# DBHUB_SSH_USER=ubuntu +# DBHUB_SSH_KEY=~/.ssh/id_rsa diff --git a/plugins/mcp/shared/mcp-dbhub/.mcp.json b/plugins/mcp/shared/mcp-dbhub/.mcp.json new file mode 100644 index 0000000..dc078ac --- /dev/null +++ b/plugins/mcp/shared/mcp-dbhub/.mcp.json @@ -0,0 +1,12 @@ +{ + "mcpServers": { + "dbhub": { + "type": "stdio", + "command": "npx", + "args": [ + "--yes", + "@bytebase/dbhub" + ] + } + } +} diff --git a/plugins/mcp/shared/mcp-dbhub/README.md b/plugins/mcp/shared/mcp-dbhub/README.md new file mode 100644 index 0000000..32ea657 --- /dev/null +++ b/plugins/mcp/shared/mcp-dbhub/README.md @@ -0,0 +1,167 @@ +# DBHub MCP + +データベース操作とSQLクエリを実行するためのMCPサーバープラグインです。 + +## 概要 + +このプラグインは、MySQL、PostgreSQL、SQLiteなどの各種データベースへのアクセスを提供します。 + +## 機能 + +- データベース接続管理 +- SQLクエリの実行 +- テーブルスキーマの取得 +- データベース一覧の取得 +- 複数データベースへの同時接続(TOML設定) + +## インストール + +### Claude Code + +```bash +/plugin install mcp-dbhub@ai-plugins +``` + +### Codex + +```bash +codex plugin add mcp-dbhub@ai-plugins +``` + +### Kiro CLI + +Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 + +```bash +bash plugins/mcp/kiro/mcp-dbhub/install.sh +``` + +### 必要な環境変数 + +- 追加の環境変数は不要です。 + +## 設定 + +2つの設定方法があり、`dbhub.toml`が優先されます。 + +### 方法1: dbhub.toml(複数DB対応・推奨) + +プロジェクトルートに `dbhub.toml` を配置すると自動検出されます。 + +```toml +# 単一データベース +[[sources]] +id = "mydb" +description = "本番 MySQL" +dsn = "mysql://user:password@db-host:3306/dbname" +``` + +```toml +# 複数データベース +[[sources]] +id = "production" +description = "本番 MySQL" +dsn = "mysql://user:password@prod-db:3306/myapp" + +[[sources]] +id = "staging" +description = "ステージング MySQL" +dsn = "mysql://user:password@staging-db:3306/myapp_stg" +``` + +複数ソース定義時、ツール名に自動でサフィックスが付与されます(例: `execute_sql_production`, `execute_sql_staging`)。 + +#### SSH踏み台設定(TOML内) + +ソースごとにSSH踏み台を定義できます。 + +```toml +[[sources]] +id = "production" +description = "本番 MySQL(踏み台経由)" +dsn = "mysql://user:password@db.internal:3306/myapp" +ssh_host = "bastion.example.com" +ssh_port = 22 +ssh_user = "ubuntu" +ssh_key = "~/.ssh/id_rsa" +# ssh_passphrase = "鍵のパスフレーズ(暗号化されている場合)" +``` + +マルチホップSSH(多段踏み台)にも対応しています。 + +```toml +[[sources]] +id = "prod_multihop" +dsn = "postgres://user:password@10.0.1.100:5432/myapp" +ssh_host = "internal-server.company.com" +ssh_user = "deploy" +ssh_key = "~/.ssh/id_ed25519" +ssh_proxy_jump = "bastion.company.com,admin@jump2.internal:2222" +``` + +| フィールド | 必須 | 説明 | +|-----------|------|------| +| `ssh_host` | Yes | 踏み台ホスト名 | +| `ssh_port` | No | ポート(デフォルト: 22) | +| `ssh_user` | Yes | SSHユーザー名 | +| `ssh_key` | ※ | 秘密鍵パス(`~`展開可) | +| `ssh_password` | ※ | パスワード認証用 | +| `ssh_passphrase` | No | 秘密鍵のパスフレーズ | +| `ssh_proxy_jump` | No | マルチホップ(カンマ区切り) | + +※ `ssh_key` または `ssh_password` のいずれかが必須 + +### 方法2: .env(単一DB・簡易設定) + +`dbhub.toml`が存在しない場合、`.env`の環境変数にフォールバックします。 + +```bash +# データベース接続文字列 +DBHUB_DSN=mysql://user:password@db-host:3306/dbname + +# SSH踏み台(必要な場合) +DBHUB_SSH_HOST=bastion.example.com +DBHUB_SSH_PORT=22 +DBHUB_SSH_USER=ubuntu +DBHUB_SSH_KEY=~/.ssh/id_rsa +``` + +DSNのホスト名は踏み台から見た内部ホスト名を指定してください。 + +### 優先順位 + +1. `dbhub.toml`(プロジェクトルートに存在すれば自動読み込み) +2. `.env`の`DBHUB_DSN`環境変数(tomlが無い場合のフォールバック) + +## 使用例 + +```bash +# SQLクエリを実行 +mcp__plugin_mcp-dbhub_dbhub__execute_sql "SELECT * FROM users LIMIT 10" + +# テーブル一覧を取得 +mcp__plugin_mcp-dbhub_dbhub__search_objects --object_type table +``` + +## ndf:data-analystエージェントとの連携 + +DBHub MCPは、NDFプラグインの`ndf:data-analyst`エージェントと連携して使用することを推奨します。 + +```bash +Task( + subagent_type="ndf:data-analyst", + prompt="Analyze user activity in the local database", + description="Analyze user activity" +) +``` + +## 注意事項 + +- `dbhub.toml`と`.env`は`.gitignore`に追加し、認証情報をコミットしないでください +- SSH踏み台経由の場合、DSNのホスト名は踏み台から見た内部ホスト名を指定します + +## 参考リンク + +- [takemi-ohama/dbhub](https://github.com/takemi-ohama/dbhub) - 現在使用中のフォーク版(SSH keep-alive対応) +- [@bytebase/dbhub](https://www.npmjs.com/package/@bytebase/dbhub) - 本家パッケージ +- [Bytebase](https://www.bytebase.com/) diff --git a/plugins/mcp/shared/mcp-dbhub/dbhub.toml.example b/plugins/mcp/shared/mcp-dbhub/dbhub.toml.example new file mode 100644 index 0000000..4400680 --- /dev/null +++ b/plugins/mcp/shared/mcp-dbhub/dbhub.toml.example @@ -0,0 +1,38 @@ +# dbhub.toml - データベース接続設定 +# このファイルを dbhub.toml にコピーしてプロジェクトルートに配置してください。 +# dbhub.toml は .gitignore に追加し、認証情報をコミットしないでください。 + +# 単一データベース(SSH踏み台なし) +[[sources]] +id = "mydb" +description = "開発用 MySQL" +dsn = "mysql://user:password@localhost:3306/mydb" + +# 単一データベース(SSH踏み台経由) +# [[sources]] +# id = "production" +# description = "本番 MySQL(踏み台経由)" +# dsn = "mysql://user:password@db.internal:3306/myapp" +# ssh_host = "bastion.example.com" +# ssh_port = 22 +# ssh_user = "ubuntu" +# ssh_key = "~/.ssh/id_rsa" + +# 複数データベース +# [[sources]] +# id = "production" +# description = "本番 MySQL" +# dsn = "mysql://user:password@prod-db.internal:3306/myapp" +# ssh_host = "bastion.example.com" +# ssh_port = 22 +# ssh_user = "ubuntu" +# ssh_key = "~/.ssh/id_rsa" +# +# [[sources]] +# id = "staging" +# description = "ステージング MySQL" +# dsn = "mysql://user:password@staging-db.internal:3306/myapp_stg" +# ssh_host = "bastion.example.com" +# ssh_port = 22 +# ssh_user = "ubuntu" +# ssh_key = "~/.ssh/id_rsa" diff --git a/plugins/mcp/shared/mcp-dbhub/docs/dbhub-guide.md b/plugins/mcp/shared/mcp-dbhub/docs/dbhub-guide.md new file mode 100644 index 0000000..1fb3d8e --- /dev/null +++ b/plugins/mcp/shared/mcp-dbhub/docs/dbhub-guide.md @@ -0,0 +1,30 @@ +# DBHub MCP ガイド + +DBHub MCPサーバーで各種データベースへのSQL操作を行います。 + +## 接続設定 + +DBHubは接続文字列(DSN)でデータベースに接続します。 +環境変数またはツール引数で接続先を指定してください。 + +## 主要ツール + +- `execute_sql_{suffix}` - 指定環境でSQLクエリを実行 +- `search_objects_{suffix}` - データベースオブジェクト(テーブル、カラム等)を検索 + +suffixはインストール時の設定に依存します(例: `production`, `alpha`, `delta`)。 + +## 使用例 + +``` +# テーブル・カラムの検索 +mcp__plugin_mcp-dbhub_dbhub__search_objects_production keyword="users" + +# SQLクエリ実行 +mcp__plugin_mcp-dbhub_dbhub__execute_sql_production sql="SELECT * FROM users LIMIT 10" +``` + +## 注意事項 + +- 本番環境への書き込みクエリ(INSERT, UPDATE, DELETE)は慎重に実行してください +- 大量データの取得時はLIMIT句を使用してください diff --git a/plugins/mcp/shared/mcp-devin/.claude-plugin/plugin.json b/plugins/mcp/shared/mcp-devin/.claude-plugin/plugin.json new file mode 100644 index 0000000..f994c84 --- /dev/null +++ b/plugins/mcp/shared/mcp-devin/.claude-plugin/plugin.json @@ -0,0 +1,10 @@ +{ + "name": "mcp-devin", + "version": "1.0.0", + "description": "Devin MCP server for accessing repository documentation and code knowledge via DeepWiki", + "author": { + "name": "takemi-ohama", + "url": "https://github.com/takemi-ohama" + }, + "keywords": ["mcp", "devin", "deepwiki", "documentation", "repository", "wiki", "code-knowledge"] +} diff --git a/plugins/mcp/shared/mcp-devin/.mcp.json b/plugins/mcp/shared/mcp-devin/.mcp.json new file mode 100644 index 0000000..fe323ee --- /dev/null +++ b/plugins/mcp/shared/mcp-devin/.mcp.json @@ -0,0 +1,15 @@ +{ + "mcpServers": { + "devin": { + "type": "http", + "url": "https://mcp.devin.ai/mcp", + "headers": { + "Authorization": "Bearer ${DEVIN_API_KEY}" + }, + "env": { + "DEVIN_API_KEY": "${DEVIN_API_KEY}" + }, + "envFile": "${workspaceFolder}/.env" + } + } +} diff --git a/plugins/mcp/shared/mcp-devin/README.md b/plugins/mcp/shared/mcp-devin/README.md new file mode 100644 index 0000000..3c1d032 --- /dev/null +++ b/plugins/mcp/shared/mcp-devin/README.md @@ -0,0 +1,104 @@ +# Devin MCP + +リポジトリのドキュメントとコード知識にアクセスするためのMCPサーバープラグインです。 + +## 概要 + +このプラグインは、[Devin MCP](https://mcp.devin.ai/mcp)サーバーを利用して、GitHubなどのリポジトリのドキュメント構造や内容をAIエージェントから直接参照できるようにします。Devin APIキー(`DEVIN_API_KEY`)が必要です。 + +## 機能 + +- **`read_wiki_structure`** - リポジトリのドキュメントトピック一覧を取得 +- **`read_wiki_contents`** - ドキュメントの内容を閲覧 +- **`ask_question`** - リポジトリに関するAI質問回答 + +## 前提条件 + +- Devin APIキー(環境変数 `DEVIN_API_KEY`) + +## 環境変数の設定 + +プロジェクトルートの`.env`ファイルに以下を設定してください: + +```bash +# Devin API Key +DEVIN_API_KEY=your-devin-api-key +``` + +## インストール + +### Claude Code + +```bash +/plugin install mcp-devin@ai-plugins +``` + +### Codex + +```bash +codex plugin add mcp-devin@ai-plugins +``` + +### Kiro CLI + +Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 + +```bash +bash plugins/mcp/kiro/mcp-devin/install.sh +``` + +### 必要な環境変数 + +- `DEVIN_API_KEY` + +## 使用方法 + +### 基本的な使用例 + +```bash +# リポジトリのドキュメント構造を取得 +mcp__plugin_mcp-devin__devin__read_wiki_structure "owner/repo" + +# ドキュメント内容を読み取り +mcp__plugin_mcp-devin__devin__read_wiki_contents "owner/repo" "topic" + +# リポジトリについて質問 +mcp__plugin_mcp-devin__devin__ask_question "owner/repo" "How does authentication work?" +``` + +### CLIで直接追加する場合 + +```bash +claude mcp add -s user -t http devin https://mcp.devin.ai/mcp --header "Authorization: Bearer $DEVIN_API_KEY" +``` + +## 推奨される使用シーン + +- OSSライブラリの仕様・アーキテクチャ調査 +- 依存パッケージの内部実装の理解 +- リポジトリのドキュメント横断検索 +- 技術選定時のコード比較調査 + +## NDFエージェントとの連携 + +DeepWiki MCPは、NDFプラグインの`ndf:researcher`エージェントと連携して使用することを推奨します。 + +```bash +Task( + subagent_type="ndf:researcher", + prompt="DeepWikiを使ってlangchain/langchainリポジトリのRAG実装を調査してください", + description="Research RAG implementation" +) +``` + +## 注意事項 + +- `DEVIN_API_KEY` の設定が必要です +- HTTPトランスポートを使用しています(Devin公式MCPサーバー `https://mcp.devin.ai/mcp`) +- `Authorization: Bearer {DEVIN_API_KEY}` ヘッダーで認証します +- レート制限がある場合があります + +## 参考リンク + +- [DeepWiki](https://deepwiki.com) +- [DeepWiki MCP ドキュメント](https://docs.devin.ai/ja/work-with-devin/deepwiki-mcp) diff --git a/plugins/mcp/shared/mcp-markitdown/.claude-plugin/plugin.json b/plugins/mcp/shared/mcp-markitdown/.claude-plugin/plugin.json new file mode 100644 index 0000000..96f0f42 --- /dev/null +++ b/plugins/mcp/shared/mcp-markitdown/.claude-plugin/plugin.json @@ -0,0 +1,10 @@ +{ + "name": "mcp-markitdown", + "version": "1.0.0", + "description": "MarkItDown MCP server for converting documents (PDF, Office, images, etc.) to Markdown", + "author": { + "name": "takemi-ohama", + "url": "https://github.com/takemi-ohama" + }, + "keywords": ["mcp", "markitdown", "markdown", "pdf", "docx", "pptx", "xlsx", "images", "converter"] +} diff --git a/plugins/mcp/shared/mcp-markitdown/.mcp.json b/plugins/mcp/shared/mcp-markitdown/.mcp.json new file mode 100644 index 0000000..844df81 --- /dev/null +++ b/plugins/mcp/shared/mcp-markitdown/.mcp.json @@ -0,0 +1,11 @@ +{ + "mcpServers": { + "markitdown": { + "type": "stdio", + "command": "uvx", + "args": [ + "markitdown-mcp" + ] + } + } +} diff --git a/plugins/mcp/shared/mcp-markitdown/README.md b/plugins/mcp/shared/mcp-markitdown/README.md new file mode 100644 index 0000000..5988fd2 --- /dev/null +++ b/plugins/mcp/shared/mcp-markitdown/README.md @@ -0,0 +1,71 @@ +# MarkItDown MCP + +各種ドキュメント(PDF、Office、画像など)をMarkdownに変換するMCPサーバープラグインです。 + +## 概要 + +[Microsoft MarkItDown](https://github.com/microsoft/markitdown) のMCPサーバーラッパーです。HTTP/HTTPS URL、ローカルファイル、Data URIを指定してドキュメントをMarkdownに変換できます。 + +## 機能 + +- `convert_to_markdown(uri)` ツールを提供 +- 対応フォーマット: PDF, Word (.docx), Excel (.xlsx), PowerPoint (.pptx), 画像, HTML, CSV, JSON, XML など +- HTTP/HTTPS URL、ローカルファイルパス(`file://`)、Data URI に対応 + +## インストール + +### Claude Code + +```bash +/plugin install mcp-markitdown@ai-plugins +``` + +### Codex + +```bash +codex plugin add mcp-markitdown@ai-plugins +``` + +### Kiro CLI + +Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 + +```bash +bash plugins/mcp/kiro/mcp-markitdown/install.sh +``` + +### 必要な環境変数 + +- 追加の環境変数は不要です。 + +## 使用例 + +```bash +# URLからドキュメントを変換 +mcp__plugin_mcp-markitdown_markitdown__convert_to_markdown uri="https://example.com/document.pdf" + +# ローカルファイルを変換 +mcp__plugin_mcp-markitdown_markitdown__convert_to_markdown uri="file:///path/to/document.docx" +``` + +## ndf:scannerエージェントとの連携 + +MarkItDown MCPは、NDFプラグインの`ndf:scanner`エージェントと連携して使用することを推奨します。 + +```bash +Task( + subagent_type="ndf:scanner", + prompt="Convert /path/to/document.pdf to Markdown and summarize key points.", + description="Convert and summarize PDF" +) +``` + +## 注意事項 + +- Python環境が必要です(`uvx` 経由で自動インストール) +- 大きなファイルの変換には時間がかかる場合があります + +## 参考リンク + +- [microsoft/markitdown](https://github.com/microsoft/markitdown) - 本家リポジトリ +- [markitdown-mcp (PyPI)](https://pypi.org/project/markitdown-mcp/) - PyPIパッケージ diff --git a/plugins/mcp/shared/mcp-markitdown/docs/markitdown-guide.md b/plugins/mcp/shared/mcp-markitdown/docs/markitdown-guide.md new file mode 100644 index 0000000..7ba0cf0 --- /dev/null +++ b/plugins/mcp/shared/mcp-markitdown/docs/markitdown-guide.md @@ -0,0 +1,30 @@ +# MarkItDown MCP ガイド + +MarkItDown MCPサーバーで各種ドキュメントをMarkdown形式に変換します。 + +## 対応フォーマット + +- PDF +- Microsoft Office(Word, Excel, PowerPoint) +- 画像(OCR) +- HTML +- その他のドキュメント形式 + +## 主要ツール + +- `convert_to_markdown` - ファイルをMarkdownに変換 + +## 使用例 + +``` +# PDFをMarkdownに変換 +mcp__plugin_mcp-markitdown_markitdown__convert_to_markdown uri="file:///path/to/document.pdf" + +# Excelファイルを変換 +mcp__plugin_mcp-markitdown_markitdown__convert_to_markdown uri="file:///path/to/data.xlsx" +``` + +## 使い分け + +- scannerエージェントがPDF/Office/画像ファイルの読み取りに使用 +- Read toolで直接読めないファイル形式の変換に有用 diff --git a/plugins/mcp/shared/mcp-notion/.claude-plugin/plugin.json b/plugins/mcp/shared/mcp-notion/.claude-plugin/plugin.json new file mode 100644 index 0000000..dc75247 --- /dev/null +++ b/plugins/mcp/shared/mcp-notion/.claude-plugin/plugin.json @@ -0,0 +1,10 @@ +{ + "name": "mcp-notion", + "version": "1.0.0", + "description": "Notion MCP server for note management and knowledge base operations", + "author": { + "name": "takemi-ohama", + "url": "https://github.com/takemi-ohama" + }, + "keywords": ["mcp", "notion", "notes", "knowledge-base", "documentation"] +} diff --git a/plugins/mcp/shared/mcp-notion/.mcp.json b/plugins/mcp/shared/mcp-notion/.mcp.json new file mode 100644 index 0000000..fc5b4de --- /dev/null +++ b/plugins/mcp/shared/mcp-notion/.mcp.json @@ -0,0 +1,10 @@ +{ + "mcpServers": { + "notion": { + "type": "http", + "url": "https://mcp.notion.com/mcp", + "env": {}, + "envFile": "${workspaceFolder}/.env" + } + } +} diff --git a/plugins/mcp/shared/mcp-notion/README.md b/plugins/mcp/shared/mcp-notion/README.md new file mode 100644 index 0000000..d6a2d6b --- /dev/null +++ b/plugins/mcp/shared/mcp-notion/README.md @@ -0,0 +1,89 @@ +# Notion MCP + +NotionワークスペースにアクセスするためのMCPサーバープラグインです。 + +## 概要 + +このプラグインは、Notionのページ、データベース、ブロックへのアクセスを提供します。 + +## 機能 + +- Notionページの作成・読み取り・更新 +- データベースのクエリ +- ブロックの操作 +- ページ階層の取得 +- コメントの追加 + +## 前提条件 + +- Notionアカウント +- Notion Integration(内部統合)の作成 +- 統合トークンの取得 + +## 環境変数の設定 + +プロジェクトルートに`.env`ファイルを作成し、以下の環境変数を設定してください: + +```bash +# Notion Integration Token +NOTION_TOKEN= +``` + +## インストール + +### Claude Code + +```bash +/plugin install mcp-notion@ai-plugins +``` + +### Codex + +```bash +codex plugin add mcp-notion@ai-plugins +``` + +### Kiro CLI + +Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 + +```bash +bash plugins/mcp/kiro/mcp-notion/install.sh +``` + +### 必要な環境変数 + +- 追加の環境変数は不要です。 + +## 使用方法 + +### 基本的な使用例 + +```bash +# ページを読み取り +mcp__plugin_notion-mcp__notion__read_page "page-id" + +# データベースをクエリ +mcp__plugin_notion-mcp__notion__query_database "database-id" + +# 新しいページを作成 +mcp__plugin_notion-mcp__notion__create_page "parent-page-id" "New Page Title" +``` + +## 推奨される使用シーン + +- ドキュメント管理 +- ナレッジベースの構築 +- タスク管理 +- プロジェクト情報の同期 + +## 注意事項 + +- Notion IntegrationをワークスペースやページにShareする必要があります +- HTTPトランスポートを使用しています(公式のNotion MCPサーバー) + +## 参考リンク + +- [Notion MCP Server](https://mcp.notion.com) +- [Notion API](https://developers.notion.com/) +- [Notion Integration Setup](https://www.notion.so/help/create-integrations-with-the-notion-api) diff --git a/plugins/mcp/shared/mcp-playwright/.claude-plugin/plugin.json b/plugins/mcp/shared/mcp-playwright/.claude-plugin/plugin.json new file mode 100644 index 0000000..cca6d67 --- /dev/null +++ b/plugins/mcp/shared/mcp-playwright/.claude-plugin/plugin.json @@ -0,0 +1,10 @@ +{ + "name": "mcp-playwright", + "version": "1.0.1", + "description": "Playwright MCPを自動セットアップするプラグイン。Chromiumブラウザの自動インストールとMCP設定を提供します。", + "author": { + "name": "NDF Team", + "url": "https://github.com/devbasex/ai-plugins" + }, + "keywords": ["mcp", "playwright", "browser", "automation", "testing"] +} diff --git a/plugins/mcp/shared/mcp-playwright/.mcp.json b/plugins/mcp/shared/mcp-playwright/.mcp.json new file mode 100644 index 0000000..2313c0d --- /dev/null +++ b/plugins/mcp/shared/mcp-playwright/.mcp.json @@ -0,0 +1,20 @@ +{ + "mcpServers": { + "playwright": { + "type": "stdio", + "command": "npx", + "args": [ + "-y", + "@playwright/mcp@latest", + "--browser", + "chromium", + "--isolated", + "--no-sandbox" + ], + "env": { + "PLAYWRIGHT_BROWSERS_PATH": "${HOME}/.cache/ms-playwright" + }, + "envFile": "${workspaceFolder}/.env" + } + } +} diff --git a/plugins/mcp/shared/mcp-playwright/README.md b/plugins/mcp/shared/mcp-playwright/README.md new file mode 100644 index 0000000..8662f56 --- /dev/null +++ b/plugins/mcp/shared/mcp-playwright/README.md @@ -0,0 +1,178 @@ +# playwright Plugin + +Playwright MCPを自動的にセットアップし、ブラウザ自動化機能を提供するプラグインです。 + +## 概要 + +このプラグインは、Playwright MCPサーバーとChromiumブラウザを自動的にインストール・設定します。Claude Codeでブラウザ自動化タスク(Webスクレイピング、E2Eテスト、スクリーンショット取得など)を簡単に実行できるようになります。 + +## 機能 + +- **自動セットアップ**: 初回起動時にPlaywright Chromiumブラウザを自動インストール +- **バージョン互換性**: @playwright/mcpと互換性のあるPlaywrightバージョンを自動検出 +- **冪等性**: 既にインストール済みの場合はスキップ(高速起動) +- **環境変数対応**: PLAYWRIGHT_BROWSERS_PATHで共有キャッシュを利用 + +## インストール + +### Claude Code + +```bash +/plugin install mcp-playwright@ai-plugins +``` + +### Codex + +```bash +codex plugin add mcp-playwright@ai-plugins +``` + +### Kiro CLI + +Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 + +```bash +bash plugins/mcp/kiro/mcp-playwright/install.sh +``` + +### 必要な環境変数 + +- `HOME` + +## 使用方法 + +### 基本的な使い方 + +プラグインをインストールして、Claude Codeを起動するだけで自動的にセットアップが実行されます。 + +```bash +# Claude Codeを起動 +claude +``` + +初回起動時、以下のようなメッセージが表示されます: + +``` +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +🎭 Playwright MCP Plugin: 初回セットアップ +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +Playwright Chromiumブラウザをインストール中... +ネットワーク環境により1-2分かかる場合があります。 + +🔍 @playwright/mcpが使用するPlaywrightバージョンを確認中... +✓ Playwright 1.49.1 を使用します + +📦 Playwright 1.49.1 でChromiumをインストール中... +[インストールログ...] + +✅ セットアップ完了!Playwright Chromiumの準備ができました。 + Playwrightバージョン: 1.49.1 + ブラウザパス: ~/.cache/ms-playwright +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +``` + +### Playwright MCPツールの使用例 + +セットアップ完了後、以下のようなタスクが実行できます: + +``` +// Webページにアクセスしてスクリーンショットを取得 +mcp__plugin_playwright__browser_navigate(url: "https://example.com") +mcp__plugin_playwright__browser_take_screenshot() + +// フォームに入力してボタンをクリック +mcp__plugin_playwright__browser_fill(selector: "#email", value: "test@example.com") +mcp__plugin_playwright__browser_click(selector: "button[type='submit']") + +// ページのスナップショットを取得(アクセシビリティツリー) +mcp__plugin_playwright__browser_snapshot() +``` + +## 設定 + +### MCP設定(`.mcp.json`) + +プラグインは以下のMCP設定を提供します: + +```json +{ + "mcpServers": { + "playwright": { + "type": "stdio", + "command": "npx", + "args": [ + "-y", + "@playwright/mcp@latest", + "--browser", + "chromium", + "--isolated", + "--no-sandbox" + ], + "env": { + "PLAYWRIGHT_BROWSERS_PATH": "${HOME}/.cache/ms-playwright" + } + } + } +} +``` + +### ブラウザキャッシュパス + +デフォルトでは、Chromiumブラウザは `~/.cache/ms-playwright` にインストールされます。 + +別の場所を使用したい場合は、環境変数を設定してください: + +```bash +export PLAYWRIGHT_BROWSERS_PATH=/path/to/custom/location +``` + +## トラブルシューティング + +### インストールが失敗する場合 + +1. **手動インストール**: + ```bash + # 互換性のあるバージョンを確認 + npm view @playwright/mcp@latest dependencies + + # Chromiumをインストール + PLAYWRIGHT_BROWSERS_PATH=~/.cache/ms-playwright npx playwright@ install chromium + ``` + +2. **キャッシュをクリア**: + ```bash + rm ~/.claude-playwright-installed + ``` + +3. **ログを確認**: + プラグインは詳細なログを出力するので、エラーメッセージを確認してください。 + +### ブラウザが見つからない場合 + +環境変数 `PLAYWRIGHT_BROWSERS_PATH` が正しく設定されているか確認してください: + +```bash +echo $PLAYWRIGHT_BROWSERS_PATH +ls -la ~/.cache/ms-playwright +``` + +### タイムアウトエラー + +ネットワーク環境が遅い場合、インストールに時間がかかることがあります。 +デフォルトのタイムアウトは5分です。 + +## 参考資料 + +- [Playwright公式ドキュメント](https://playwright.dev/) +- [@playwright/mcp README](https://www.npmjs.com/package/@playwright/mcp) +- [Playwright Browser Management](https://playwright.dev/docs/browsers) + +## ライセンス + +MIT License + +## サポート + +問題が発生した場合は、GitHubリポジトリでissueを作成してください: +https://github.com/devbasex/ai-plugins/issues diff --git a/plugins/mcp/shared/mcp-playwright/hooks/hooks.json b/plugins/mcp/shared/mcp-playwright/hooks/hooks.json new file mode 100644 index 0000000..7b163ae --- /dev/null +++ b/plugins/mcp/shared/mcp-playwright/hooks/hooks.json @@ -0,0 +1,22 @@ +{ + "description": "Playwright MCP auto-setup hook", + "hooks": { + "SessionStart": [ + { + "description": "Ensure Playwright browser is installed", + "matcher": "startup|resume", + "priority": 100, + "enabled": true, + "hooks": [ + { + "type": "command", + "command": "node ${CLAUDE_PLUGIN_ROOT}/scripts/ensure-playwright.js", + "description": "Auto-install Playwright chromium on first use", + "continueOnError": false, + "suppressOutput": false + } + ] + } + ] + } +} diff --git a/plugins/mcp/shared/mcp-playwright/scripts/ensure-playwright.js b/plugins/mcp/shared/mcp-playwright/scripts/ensure-playwright.js new file mode 100755 index 0000000..1a4c98d --- /dev/null +++ b/plugins/mcp/shared/mcp-playwright/scripts/ensure-playwright.js @@ -0,0 +1,90 @@ +#!/usr/bin/env node + +const { execSync } = require('child_process'); +const fs = require('fs'); +const path = require('path'); +const os = require('os'); + +const PLUGIN_ROOT = process.env.CLAUDE_PLUGIN_ROOT || __dirname; +const FLAG_FILE = path.join(os.homedir(), '.claude-playwright-installed'); +const BROWSER_PATH = path.join(os.homedir(), '.cache', 'ms-playwright'); +const TIMEOUT_MS = 5 * 60 * 1000; // 5分タイムアウト + +// 既にインストール済みかチェック(冪等性) +if (fs.existsSync(FLAG_FILE)) { + process.exit(0); +} + +console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'); +console.log('🎭 Playwright MCP Plugin: 初回セットアップ'); +console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'); +console.log(''); +console.log('Playwright Chromiumブラウザをインストール中...'); +console.log('ネットワーク環境により1-2分かかる場合があります。'); +console.log(''); + +try { + // @playwright/mcpが依存するPlaywrightのバージョンを取得 + console.log('🔍 @playwright/mcpが使用するPlaywrightバージョンを確認中...'); + const depsOutput = execSync('npm view @playwright/mcp@latest dependencies --json', { + encoding: 'utf-8', + cwd: PLUGIN_ROOT, + timeout: 30000 + }); + + const deps = JSON.parse(depsOutput); + const playwrightVersion = deps.playwright || deps['playwright-core']; + + if (!playwrightVersion) { + throw new Error('@playwright/mcpの依存関係からPlaywrightバージョンを取得できませんでした'); + } + + console.log(`✓ Playwright ${playwrightVersion} を使用します`); + console.log(''); + + // @playwright/mcpと互換性のあるバージョンのChromiumをインストール + console.log(`📦 Playwright ${playwrightVersion} でChromiumをインストール中...`); + execSync(`npx -y playwright@${playwrightVersion} install chromium`, { + stdio: 'inherit', + cwd: PLUGIN_ROOT, + timeout: TIMEOUT_MS, + env: { + ...process.env, + PLAYWRIGHT_BROWSERS_PATH: BROWSER_PATH, + PLAYWRIGHT_SKIP_BROWSER_GC: '1' + } + }); + + // インストール成功フラグを作成 + const flagData = { + installed: new Date().toISOString(), + plugin: 'playwright', + browser: 'chromium', + browserPath: BROWSER_PATH, + playwrightVersion: playwrightVersion + }; + + fs.writeFileSync(FLAG_FILE, JSON.stringify(flagData, null, 2)); + + console.log(''); + console.log('✅ セットアップ完了!Playwright Chromiumの準備ができました。'); + console.log(` Playwrightバージョン: ${playwrightVersion}`); + console.log(` ブラウザパス: ${BROWSER_PATH}`); + console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'); + process.exit(0); + +} catch (error) { + console.error(''); + console.error('❌ Playwright Chromiumのインストールに失敗しました'); + console.error(''); + console.error('エラー:', error.message); + console.error(''); + console.error('手動でインストールするには以下を実行してください:'); + console.error(` npm view @playwright/mcp@latest dependencies`); + console.error(` PLAYWRIGHT_BROWSERS_PATH=${BROWSER_PATH} npx playwright@ install chromium`); + console.error(''); + console.error('トラブルシューティング:'); + console.error(' https://playwright.dev/docs/browsers'); + console.error('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'); + process.exit(1); +} diff --git a/plugins/mcp/shared/mcp-redash/.claude-plugin/plugin.json b/plugins/mcp/shared/mcp-redash/.claude-plugin/plugin.json new file mode 100644 index 0000000..0066b10 --- /dev/null +++ b/plugins/mcp/shared/mcp-redash/.claude-plugin/plugin.json @@ -0,0 +1,17 @@ +{ + "name": "mcp-redash", + "version": "1.0.0", + "description": "Redash MCP server with multi-environment support (arbitrary suffix)", + "author": { + "name": "takemi-ohama", + "url": "https://github.com/takemi-ohama" + }, + "keywords": ["mcp", "redash", "sql", "data", "visualization", "multi-environment"], + "skills": [ + "./skills/redash-add", + "./skills/redash-remove", + "./skills/redash-list", + "./skills/redash-status", + "./skills/redash-guide" + ] +} diff --git a/plugins/mcp/shared/mcp-redash/.env.example b/plugins/mcp/shared/mcp-redash/.env.example new file mode 100644 index 0000000..810b944 --- /dev/null +++ b/plugins/mcp/shared/mcp-redash/.env.example @@ -0,0 +1,16 @@ +# Redash MCP - 環境変数設定 +# +# デフォルト(必須) +REDASH_URL=https://redash.example.com +REDASH_API_KEY=your-api-key + +# 追加環境(/redash-add で追加した場合のみ必要) +# suffix を大文字にして REDASH_{SUFFIX}_URL, REDASH_{SUFFIX}_API_KEY の形式 +# +# 例: /redash-add dev +# REDASH_DEV_URL=https://redash-dev.example.com +# REDASH_DEV_API_KEY=your-dev-api-key +# +# 例: /redash-add stg +# REDASH_STG_URL=https://redash-stg.example.com +# REDASH_STG_API_KEY=your-stg-api-key diff --git a/plugins/mcp/shared/mcp-redash/.mcp.json b/plugins/mcp/shared/mcp-redash/.mcp.json new file mode 100644 index 0000000..80c370f --- /dev/null +++ b/plugins/mcp/shared/mcp-redash/.mcp.json @@ -0,0 +1,12 @@ +{ + "mcpServers": { + "redash": { + "command": "npx", + "args": ["-y", "@suthio/redash-mcp"], + "env": { + "REDASH_URL": "${REDASH_URL}", + "REDASH_API_KEY": "${REDASH_API_KEY}" + } + } + } +} diff --git a/plugins/mcp/shared/mcp-redash/README.md b/plugins/mcp/shared/mcp-redash/README.md new file mode 100644 index 0000000..532f5a4 --- /dev/null +++ b/plugins/mcp/shared/mcp-redash/README.md @@ -0,0 +1,160 @@ +# mcp-redash + +Redash MCP サーバーをマルチ環境対応で利用するための Claude Code プラグイン。 + +## 概要 + +[redash-mcp](https://github.com/suthio/redash-mcp) を Claude Code から利用するためのプラグインです。 + +- 1つだけ使う場合は最小設定(`REDASH_URL` と `REDASH_API_KEY` のみ) +- 必要になったら suffix 付きで環境を増やせる +- MCP 定義は必要になるまで作られない + +## 前提条件 + +- Claude Code +- Node.js(npx が使える環境) + +## インストール + +### Claude Code + +```bash +/plugin install mcp-redash@ai-plugins +``` + +### Codex + +```bash +codex plugin add mcp-redash@ai-plugins +``` + +### Kiro CLI + +Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 + +```bash +bash plugins/mcp/kiro/mcp-redash/install.sh +``` + +### 必要な環境変数 + +- `REDASH_API_KEY` +- `REDASH_URL` + +## 環境変数 + +プロジェクトの `.env` に設定してください。 + +```bash +REDASH_URL=https://redash.example.com +REDASH_API_KEY=your-api-key +``` + +## 使い方 + +### 基本(1環境) + +プラグインインストール後、`redash` MCP が自動的に有効になります。環境変数を設定するだけで利用開始できます。 + +### 複数環境 + +```bash +# dev 環境を追加 +/redash-add dev + +# .env に環境変数を設定 +# REDASH_DEV_URL=https://redash-dev.example.com +# REDASH_DEV_API_KEY=your-dev-api-key + +# 一覧確認 +/redash-list + +# 状態確認(環境変数の設定漏れチェック) +/redash-status + +# 不要になったら削除 +/redash-remove dev +``` + +## スラッシュコマンド + +| コマンド | 説明 | +|---------|------| +| `/redash-add ` | 任意 suffix の Redash MCP を project `.mcp.json` に追加 | +| `/redash-remove ` | 指定 suffix の Redash MCP を project `.mcp.json` から削除 | +| `/redash-list` | 有効な Redash MCP を一覧表示 | +| `/redash-status` | 設定状況の詳細確認(環境変数の未設定警告付き) | +| `/redash-guide` | 使い方ガイドを表示 | + +## suffix と環境変数の対応 + +| suffix | MCP 名 | 環境変数 | +|--------|--------|----------| +| (なし) | redash | REDASH_URL, REDASH_API_KEY | +| dev | redash-dev | REDASH_DEV_URL, REDASH_DEV_API_KEY | +| stg | redash-stg | REDASH_STG_URL, REDASH_STG_API_KEY | +| prod2 | redash-prod2 | REDASH_PROD2_URL, REDASH_PROD2_API_KEY | +| sandbox | redash-sandbox | REDASH_SANDBOX_URL, REDASH_SANDBOX_API_KEY | + +- suffix は英数字で自由に指定可能 +- `default` は予約語のため使用不可(plugin 同梱の `redash` が該当) + +## ファイル構成 + +``` +plugins/mcp/shared/mcp-redash/ +├── .claude-plugin/ +│ └── plugin.json # プラグインメタデータ +├── .mcp.json # MCP 設定(redash のみ同梱) +├── .env.example # 環境変数テンプレート +├── scripts/ +│ └── redash-mcp-config.js # JSON 編集スクリプト(Node.js) +├── skills/ +│ ├── redash-add/SKILL.md # /redash-add コマンド +│ ├── redash-remove/SKILL.md # /redash-remove コマンド +│ ├── redash-list/SKILL.md # /redash-list コマンド +│ ├── redash-status/SKILL.md # /redash-status コマンド +│ └── redash-guide/SKILL.md # 使い方ガイド +└── README.md +``` + +## 設計意図 + +> 本プラグインは +> 「1つだけ使う場合は最小設定」 +> 「必要になったら suffix 付きで増やす」 +> という運用を前提にしている。 +> +> そのため MCP 定義は **必要になるまで作られない**。 + +- plugin 同梱: `redash`(常に `/mcp` に表示) +- project `.mcp.json`: `/redash-add` で追加したもののみ表示 + +## トラブルシューティング + +### `/mcp` に redash が表示されない + +- プラグインが正しくインストールされているか確認 +- `/plugin list` で `mcp-redash@ai-plugins` が表示されるか確認 + +### 環境変数が反映されない + +- `.env` ファイルがプロジェクトルートにあるか確認 +- 変数名が正しい形式か確認(`REDASH_{SUFFIX}_URL`) +- `/redash-status` で設定状況を確認 + +### `/redash-add` でエラーが出る + +- `.mcp.json` の JSON が壊れていないか確認(手動編集した場合) +- `default` は予約語のため suffix に使用不可 + +### suffix 付き MCP が動かない + +- 対応する環境変数が `.env` に設定されているか `/redash-status` で確認 +- Redash の URL と API Key が正しいか確認 + +## 参考リンク + +- [redash-mcp](https://github.com/suthio/redash-mcp) - Redash MCP サーバー +- [Redash](https://redash.io/) - データ可視化ツール diff --git a/plugins/mcp/shared/mcp-redash/scripts/redash-mcp-config.js b/plugins/mcp/shared/mcp-redash/scripts/redash-mcp-config.js new file mode 100644 index 0000000..83ce0f6 --- /dev/null +++ b/plugins/mcp/shared/mcp-redash/scripts/redash-mcp-config.js @@ -0,0 +1,223 @@ +#!/usr/bin/env node + +/** + * redash-mcp-config.js + * + * project root の .mcp.json を操作して Redash MCP の追加・削除・一覧・状態確認を行う。 + * + * Usage: + * node redash-mcp-config.js add + * node redash-mcp-config.js remove + * node redash-mcp-config.js list + * node redash-mcp-config.js status + */ + +const fs = require('fs'); +const path = require('path'); + +const MCP_JSON_PATH = path.resolve(process.cwd(), '.mcp.json'); +const MCP_PACKAGE = '@suthio/redash-mcp'; + +// --- helpers --- + +function envName(suffix) { + const upper = suffix.toUpperCase(); + return { + url: `REDASH_${upper}_URL`, + key: `REDASH_${upper}_API_KEY`, + }; +} + +function mcpName(suffix) { + return `redash-${suffix}`; +} + +function mcpEntry(suffix) { + const env = envName(suffix); + return { + command: 'npx', + args: ['-y', MCP_PACKAGE], + env: { + REDASH_URL: `\${${env.url}}`, + REDASH_API_KEY: `\${${env.key}}`, + }, + }; +} + +function readMcpJson() { + if (!fs.existsSync(MCP_JSON_PATH)) { + return null; + } + const raw = fs.readFileSync(MCP_JSON_PATH, 'utf-8'); + try { + return JSON.parse(raw); + } catch { + return undefined; // 破損 + } +} + +function writeMcpJson(data) { + fs.writeFileSync(MCP_JSON_PATH, JSON.stringify(data, null, 2) + '\n', 'utf-8'); +} + +function isRedashServer(name) { + return name === 'redash' || name.startsWith('redash-'); +} + +// --- commands --- + +function cmdAdd(suffix) { + if (!suffix || suffix === 'default') { + console.error('エラー: デフォルトの redash は plugin 同梱のため追加できません。'); + console.error('suffix には dev, stg, prod2, sandbox などを指定してください。'); + process.exit(1); + } + + const name = mcpName(suffix); + let data = readMcpJson(); + + if (data === undefined) { + console.error('エラー: .mcp.json の JSON が壊れています。手動で修正してください。'); + process.exit(1); + } + + if (data === null) { + data = { mcpServers: {} }; + } + + if (!data.mcpServers) { + data.mcpServers = {}; + } + + if (data.mcpServers[name]) { + console.log(`${name} は既に登録されています。変更はありません。`); + process.exit(0); + } + + data.mcpServers[name] = mcpEntry(suffix); + writeMcpJson(data); + + const env = envName(suffix); + console.log(`${name} を .mcp.json に追加しました。`); + console.log(''); + console.log('必要な環境変数:'); + console.log(` ${env.url}`); + console.log(` ${env.key}`); + console.log(''); + console.log('プロジェクトの .env に設定してください。'); +} + +function cmdRemove(suffix) { + if (!suffix || suffix === 'default') { + console.error('エラー: デフォルトの redash は plugin 同梱のため削除できません。'); + process.exit(1); + } + + const name = mcpName(suffix); + let data = readMcpJson(); + + if (data === undefined) { + console.error('エラー: .mcp.json の JSON が壊れています。手動で修正してください。'); + process.exit(1); + } + + if (data === null || !data.mcpServers || !data.mcpServers[name]) { + console.log(`${name} は登録されていません。変更はありません。`); + process.exit(0); + } + + delete data.mcpServers[name]; + writeMcpJson(data); + + console.log(`${name} を .mcp.json から削除しました。`); +} + +function cmdList() { + // plugin 同梱分 + console.log('redash (plugin bundled)'); + + // project .mcp.json 分 + const data = readMcpJson(); + if (data === undefined) { + console.error('警告: .mcp.json の JSON が壊れています。'); + return; + } + if (data && data.mcpServers) { + const names = Object.keys(data.mcpServers) + .filter((n) => isRedashServer(n) && n !== 'redash') + .sort(); + for (const name of names) { + console.log(`${name.padEnd(14)}(project)`); + } + } +} + +function cmdStatus() { + console.log('=== Redash MCP Status ==='); + console.log(''); + + // plugin 同梱 + console.log('[redash] (plugin bundled)'); + console.log(' 環境変数: REDASH_URL, REDASH_API_KEY'); + printEnvWarnings(['REDASH_URL', 'REDASH_API_KEY']); + console.log(''); + + // project .mcp.json 分 + const data = readMcpJson(); + if (data === undefined) { + console.error('警告: .mcp.json の JSON が壊れています。'); + return; + } + if (data && data.mcpServers) { + const names = Object.keys(data.mcpServers) + .filter((n) => isRedashServer(n) && n !== 'redash') + .sort(); + for (const name of names) { + const suffix = name.replace('redash-', ''); + const env = envName(suffix); + console.log(`[${name}] (project)`); + console.log(` 環境変数: ${env.url}, ${env.key}`); + printEnvWarnings([env.url, env.key]); + console.log(''); + } + if (names.length === 0) { + console.log('追加の Redash MCP はありません。'); + console.log('/redash-add で追加できます。'); + } + } else { + console.log('追加の Redash MCP はありません。'); + console.log('/redash-add で追加できます。'); + } +} + +function printEnvWarnings(vars) { + const missing = vars.filter((v) => !process.env[v]); + if (missing.length > 0) { + for (const v of missing) { + console.log(` ⚠ ${v} が未設定です`); + } + } +} + +// --- main --- + +const [, , command, ...rest] = process.argv; +const suffix = rest[0] ? rest[0].toLowerCase() : ''; + +switch (command) { + case 'add': + cmdAdd(suffix); + break; + case 'remove': + cmdRemove(suffix); + break; + case 'list': + cmdList(); + break; + case 'status': + cmdStatus(); + break; + default: + console.error('Usage: redash-mcp-config.js [suffix]'); + process.exit(1); +} diff --git a/plugins/mcp/shared/mcp-redash/skills/redash-add/SKILL.md b/plugins/mcp/shared/mcp-redash/skills/redash-add/SKILL.md new file mode 100644 index 0000000..67b442e --- /dev/null +++ b/plugins/mcp/shared/mcp-redash/skills/redash-add/SKILL.md @@ -0,0 +1,27 @@ +--- +name: redash-add +description: 任意 suffix の Redash MCP を project .mcp.json に追加する +disable-model-invocation: true +user-invocable: true +arguments: + - name: suffix + description: "環境識別子(dev, stg, prod2, sandbox など)" +allowed-tools: + - Bash +--- + +# /redash-add + +任意 suffix の Redash MCP をプロジェクトの `.mcp.json` に追加します。 + +## 実行方法 + +以下のコマンドを実行してください。`$ARGUMENTS` にはユーザーが指定した suffix が入ります。 + +```bash +node "${CLAUDE_PLUGIN_ROOT}/scripts/redash-mcp-config.js" add $ARGUMENTS +``` + +## 実行後 + +コマンドの出力をそのままユーザーに表示してください。 diff --git a/plugins/mcp/shared/mcp-redash/skills/redash-guide/SKILL.md b/plugins/mcp/shared/mcp-redash/skills/redash-guide/SKILL.md new file mode 100644 index 0000000..5a134fe --- /dev/null +++ b/plugins/mcp/shared/mcp-redash/skills/redash-guide/SKILL.md @@ -0,0 +1,87 @@ +--- +name: redash-guide +description: Redash MCP プラグインの使い方ガイド +disable-model-invocation: false +user-invocable: true +allowed-tools: [] +--- + +# Redash MCP プラグイン ガイド + +## 基本設定(1環境のみ) + +Redash を1つだけ使う場合は、プロジェクトの `.env` に以下を設定するだけです。 + +```bash +REDASH_URL=https://redash.example.com +REDASH_API_KEY=your-api-key +``` + +プラグインインストール後、`/mcp` に `redash` が自動的に表示されます。 + +## 複数環境の追加 + +dev / stg / prod など複数の Redash を使う場合: + +### 1. 環境を追加 + +``` +/redash-add dev +/redash-add stg +``` + +### 2. 環境変数を設定 + +`.env` に追加分の変数を設定します。 + +```bash +# デフォルト +REDASH_URL=https://redash.example.com +REDASH_API_KEY=your-api-key + +# dev 環境 +REDASH_DEV_URL=https://redash-dev.example.com +REDASH_DEV_API_KEY=your-dev-api-key + +# stg 環境 +REDASH_STG_URL=https://redash-stg.example.com +REDASH_STG_API_KEY=your-stg-api-key +``` + +### 3. 確認 + +``` +/redash-list # 有効な MCP 一覧 +/redash-status # 環境変数の設定状況 +``` + +## suffix 命名ルール + +| suffix | MCP 名 | 環境変数 | +|--------|--------|----------| +| dev | redash-dev | REDASH_DEV_URL, REDASH_DEV_API_KEY | +| stg | redash-stg | REDASH_STG_URL, REDASH_STG_API_KEY | +| prod2 | redash-prod2 | REDASH_PROD2_URL, REDASH_PROD2_API_KEY | +| sandbox | redash-sandbox | REDASH_SANDBOX_URL, REDASH_SANDBOX_API_KEY | + +- suffix は英数字で自由に指定可能 +- `default` は予約語のため使用不可(plugin 同梱の `redash` が該当) + +## 環境の削除 + +不要になった環境は削除できます。 + +``` +/redash-remove dev +``` + +plugin 同梱の `redash` は削除できません。 + +## スラッシュコマンド一覧 + +| コマンド | 説明 | +|---------|------| +| `/redash-add ` | Redash MCP を追加 | +| `/redash-remove ` | Redash MCP を削除 | +| `/redash-list` | 有効な MCP 一覧 | +| `/redash-status` | 設定状況の詳細確認 | diff --git a/plugins/mcp/shared/mcp-redash/skills/redash-list/SKILL.md b/plugins/mcp/shared/mcp-redash/skills/redash-list/SKILL.md new file mode 100644 index 0000000..fe81518 --- /dev/null +++ b/plugins/mcp/shared/mcp-redash/skills/redash-list/SKILL.md @@ -0,0 +1,24 @@ +--- +name: redash-list +description: 現在有効な Redash MCP を一覧表示する +disable-model-invocation: true +user-invocable: true +allowed-tools: + - Bash +--- + +# /redash-list + +現在有効な Redash MCP の一覧を表示します。 + +## 実行方法 + +以下のコマンドを実行してください。 + +```bash +node "${CLAUDE_PLUGIN_ROOT}/scripts/redash-mcp-config.js" list +``` + +## 実行後 + +コマンドの出力をそのままユーザーに表示してください。 diff --git a/plugins/mcp/shared/mcp-redash/skills/redash-remove/SKILL.md b/plugins/mcp/shared/mcp-redash/skills/redash-remove/SKILL.md new file mode 100644 index 0000000..31a6270 --- /dev/null +++ b/plugins/mcp/shared/mcp-redash/skills/redash-remove/SKILL.md @@ -0,0 +1,27 @@ +--- +name: redash-remove +description: 指定 suffix の Redash MCP を project .mcp.json から削除する +disable-model-invocation: true +user-invocable: true +arguments: + - name: suffix + description: "削除する環境識別子(dev, stg, prod2, sandbox など)" +allowed-tools: + - Bash +--- + +# /redash-remove + +指定 suffix の Redash MCP をプロジェクトの `.mcp.json` から削除します。 + +## 実行方法 + +以下のコマンドを実行してください。`$ARGUMENTS` にはユーザーが指定した suffix が入ります。 + +```bash +node "${CLAUDE_PLUGIN_ROOT}/scripts/redash-mcp-config.js" remove $ARGUMENTS +``` + +## 実行後 + +コマンドの出力をそのままユーザーに表示してください。 diff --git a/plugins/mcp/shared/mcp-redash/skills/redash-status/SKILL.md b/plugins/mcp/shared/mcp-redash/skills/redash-status/SKILL.md new file mode 100644 index 0000000..2b1f909 --- /dev/null +++ b/plugins/mcp/shared/mcp-redash/skills/redash-status/SKILL.md @@ -0,0 +1,24 @@ +--- +name: redash-status +description: Redash MCP の設定状況と環境変数の確認 +disable-model-invocation: true +user-invocable: true +allowed-tools: + - Bash +--- + +# /redash-status + +Redash MCP の設定状況を詳細表示します。各 MCP が必要とする環境変数と、未設定の警告を確認できます。 + +## 実行方法 + +以下のコマンドを実行してください。 + +```bash +node "${CLAUDE_PLUGIN_ROOT}/scripts/redash-mcp-config.js" status +``` + +## 実行後 + +コマンドの出力をそのままユーザーに表示してください。 diff --git a/plugins/mcp/shared/mcp-serena/.claude-plugin/plugin.json b/plugins/mcp/shared/mcp-serena/.claude-plugin/plugin.json new file mode 100644 index 0000000..fce6136 --- /dev/null +++ b/plugins/mcp/shared/mcp-serena/.claude-plugin/plugin.json @@ -0,0 +1,10 @@ +{ + "name": "mcp-serena", + "version": "1.0.0", + "description": "Serena MCP server for semantic code intelligence (symbol search, reference search, refactoring)", + "author": { + "name": "takemi-ohama", + "url": "https://github.com/takemi-ohama" + }, + "keywords": ["mcp", "serena", "lsp", "symbol-search", "refactoring", "code-intelligence"] +} diff --git a/plugins/mcp/shared/mcp-serena/.mcp.json b/plugins/mcp/shared/mcp-serena/.mcp.json new file mode 100644 index 0000000..6ff356e --- /dev/null +++ b/plugins/mcp/shared/mcp-serena/.mcp.json @@ -0,0 +1,22 @@ +{ + "mcpServers": { + "serena": { + "type": "stdio", + "command": "uvx", + "args": [ + "--from", + "git+https://github.com/oraios/serena", + "serena", + "start-mcp-server", + "--context", + "ide-assistant", + "--enable-web-dashboard", + "False" + ], + "env": { + "SERENA_HOME": "${SERENA_HOME:-.serena}" + }, + "envFile": "${workspaceFolder}/.env" + } + } +} diff --git a/plugins/mcp/shared/mcp-serena/README.md b/plugins/mcp/shared/mcp-serena/README.md new file mode 100644 index 0000000..f8ebfe5 --- /dev/null +++ b/plugins/mcp/shared/mcp-serena/README.md @@ -0,0 +1,49 @@ +# mcp-serena + +Serena MCPサーバーを提供するプラグインです。セマンティックコードインテリジェンス機能(シンボル検索、リファレンス検索、安全なリファクタリング)を利用できます。 + +## インストール + +### Claude Code + +```bash +/plugin install mcp-serena@ai-plugins +``` + +### Codex + +```bash +codex plugin add mcp-serena@ai-plugins +``` + +### Kiro CLI + +Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 + +```bash +bash plugins/mcp/kiro/mcp-serena/install.sh +``` + +### 必要な環境変数 + +- `SERENA_HOME` + +## 提供機能 + +- **シンボル検索**: クラス、関数、メソッドの定義を検索 +- **リファレンス検索**: シンボルの参照箇所を特定 +- **シンボル概要**: ファイル内のシンボル一覧を取得(ファイル全体を読まずに構造を把握) +- **セマンティック編集**: シンボル単位でのコード置換・挿入 +- **パターン検索**: 正規表現によるコード検索 + +## 環境変数 + +| 変数 | 説明 | デフォルト | +|------|------|-----------| +| `SERENA_HOME` | Serena設定ディレクトリ | `.serena` | + +## 注意事項 + +- プロジェクトで使用する前に `activate_project` でアクティベートが必要です +- Serenaのメモリー機能は使用しません。知識は `docs/` に、手順は `skills/` に配置してください +- 詳細は `docs/serena-guide.md` を参照 diff --git a/plugins/mcp/shared/mcp-serena/docs/serena-guide.md b/plugins/mcp/shared/mcp-serena/docs/serena-guide.md new file mode 100644 index 0000000..3cd249c --- /dev/null +++ b/plugins/mcp/shared/mcp-serena/docs/serena-guide.md @@ -0,0 +1,73 @@ +# Serena MCP ガイド + +Serena MCPはセマンティックコードインテリジェンスツールです。 +コード操作専用。メモリー機能は使用しません。 + +## アクティベーション + +プロジェクトで使用する前にアクティベートが必要です。 + +``` +mcp__plugin_mcp-serena_serena__activate_project /path/to/project +mcp__plugin_mcp-serena_serena__check_onboarding_performed +``` + +## コード探索(推奨順序) + +### 1. ディレクトリ構造の確認 + +``` +mcp__plugin_mcp-serena_serena__list_dir relative_path="src/" recursive=false +``` + +### 2. シンボル概要の取得(ファイル全体を読む前に) + +``` +mcp__plugin_mcp-serena_serena__get_symbols_overview relative_path="path/to/file.py" +``` + +### 3. シンボル検索 + +``` +mcp__plugin_mcp-serena_serena__find_symbol name_path="/ClassName/method_name" relative_path="src/" include_body=true +``` + +### 4. パターン検索(シンボル名が不明な場合) + +``` +mcp__plugin_mcp-serena_serena__search_for_pattern substring_pattern="keyword" relative_path="src/" +``` + +### 5. リファレンス検索 + +``` +mcp__plugin_mcp-serena_serena__find_referencing_symbols name_path="/SymbolName" relative_path="src/" +``` + +## コード編集 + +### シンボル単位の置換 + +``` +mcp__plugin_mcp-serena_serena__replace_symbol_body name_path="/Class/method" relative_path="file.py" body="new code" +``` + +### シンボルの前後に挿入 + +``` +mcp__plugin_mcp-serena_serena__insert_before_symbol name_path="/FirstSymbol" relative_path="file.py" content="new code" +mcp__plugin_mcp-serena_serena__insert_after_symbol name_path="/LastSymbol" relative_path="file.py" content="new code" +``` + +### シンボル名の変更 + +``` +mcp__plugin_mcp-serena_serena__rename_symbol name_path="/OldName" relative_path="file.py" new_name="NewName" +``` + +## 使い分けの原則 + +- ファイル全体を読む前に `get_symbols_overview` で概要を確認 +- シンボル名が分かっている場合は `find_symbol` で直接アクセス +- シンボル名が不明な場合は `search_for_pattern` で候補を特定 +- 編集は `replace_symbol_body` でシンボル単位で行う(行ベース編集より安全) diff --git a/plugins/mcp/shared/mcp-serena/hooks/hooks.json b/plugins/mcp/shared/mcp-serena/hooks/hooks.json new file mode 100644 index 0000000..171ecaf --- /dev/null +++ b/plugins/mcp/shared/mcp-serena/hooks/hooks.json @@ -0,0 +1,19 @@ +{ + "description": "mcp-serena: Auto-activate Serena on session start", + "hooks": { + "SessionStart": [ + { + "description": "Remind to activate Serena project", + "hooks": [ + { + "type": "command", + "command": "echo '[mcp-serena] Serena MCPが利用可能です。activate_project でプロジェクトをアクティベートしてください。'", + "description": "Output Serena activation reminder", + "continueOnError": true, + "suppressOutput": false + } + ] + } + ] + } +} diff --git a/scripts/build-runtime-plugins.sh b/scripts/build-runtime-plugins.sh index ac769e5..84154fc 100755 --- a/scripts/build-runtime-plugins.sh +++ b/scripts/build-runtime-plugins.sh @@ -8,7 +8,7 @@ usage() { cat <<'EOF' Usage: bash scripts/build-runtime-plugins.sh [--check] -Synchronize runtime plugin generated files from plugins/ndf-shared. +Synchronize runtime plugin generated files from shared plugin sources. Options: --check Compare generated output with the working tree and fail on drift. @@ -26,11 +26,13 @@ while [ "$#" -gt 0 ]; do done SHARED_DIR="$ROOT_DIR/plugins/ndf-shared" +MCP_SHARED_DIR="$ROOT_DIR/plugins/mcp/shared" copy_tree() { local source_dir="$1" local dest_dir="$2" local tmp_dir + local diff_file if [ ! -d "$source_dir" ]; then echo "ERROR: source directory not found: $source_dir" >&2 @@ -53,12 +55,15 @@ copy_tree() { rm -rf "$tmp_dir" return 1 fi - if ! diff -ruN "$tmp_dir" "$dest_dir" >"$tmp_dir/check.diff"; then + diff_file="$(mktemp)" + if ! diff -ruN "$tmp_dir" "$dest_dir" >"$diff_file"; then echo "Generated directory is out of date: ${dest_dir#$ROOT_DIR/}" >&2 - cat "$tmp_dir/check.diff" >&2 + cat "$diff_file" >&2 + rm -f "$diff_file" rm -rf "$tmp_dir" return 1 fi + rm -f "$diff_file" rm -rf "$tmp_dir" else rm -rf "$dest_dir" @@ -67,6 +72,10 @@ copy_tree() { fi } +json_string() { + python3 -c 'import json,sys; print(json.dumps(sys.argv[1], ensure_ascii=False))' "$1" +} + rewrite_codex_skill_paths() { local skills_dir="$1" local script_dir="$2" @@ -127,6 +136,7 @@ sync_skills() { local dest_dir="$3" local variant="${4:-}" local tmp_dir + local diff_file local skill if [ ! -f "$manifest" ]; then @@ -183,12 +193,15 @@ sync_skills() { rm -rf "$tmp_dir" return 1 fi - if ! diff -ruN "$tmp_dir" "$dest_dir" >"$tmp_dir/check.diff"; then + diff_file="$(mktemp)" + if ! diff -ruN "$tmp_dir" "$dest_dir" >"$diff_file"; then echo "Generated directory is out of date: ${dest_dir#$ROOT_DIR/}" >&2 - cat "$tmp_dir/check.diff" >&2 + cat "$diff_file" >&2 + rm -f "$diff_file" rm -rf "$tmp_dir" return 1 fi + rm -f "$diff_file" rm -rf "$tmp_dir" else rm -rf "$dest_dir" @@ -223,10 +236,177 @@ sync_runtime_if_present() { copy_tree "$SHARED_DIR/scripts" "$plugin_dir/scripts" } +write_codex_mcp_manifest() { + local plugin_dir="$1" + local claude_manifest="$plugin_dir/.claude-plugin/plugin.json" + local codex_manifest="$plugin_dir/.codex-plugin/plugin.json" + local name version description keywords + + if [ ! -f "$claude_manifest" ]; then + echo "ERROR: Claude manifest not found: $claude_manifest" >&2 + exit 1 + fi + + name="$(python3 -c 'import json,sys; print(json.load(open(sys.argv[1]))["name"])' "$claude_manifest")" + version="$(python3 -c 'import json,sys; print(json.load(open(sys.argv[1])).get("version","1.0.0"))' "$claude_manifest")" + description="$(python3 -c 'import json,sys; print(json.load(open(sys.argv[1])).get("description",""))' "$claude_manifest")" + keywords="$(python3 -c 'import json,sys; print(json.dumps(json.load(open(sys.argv[1])).get("keywords", []), ensure_ascii=False))' "$claude_manifest")" + + mkdir -p "$(dirname "$codex_manifest")" + cat > "$codex_manifest" < "$installer" <<'EOF' +#!/usr/bin/env bash +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +PROJECT_ROOT="$(pwd)" +TARGET_MCP="$PROJECT_ROOT/.mcp.json" +SOURCE_MCP="$SCRIPT_DIR/.mcp.json" +DRY_RUN=false + +usage() { + cat <<'USAGE' +Usage: bash install.sh [--dry-run] + +Install this MCP plugin into the current project's .mcp.json. +USAGE +} + +while [ "$#" -gt 0 ]; do + case "$1" in + --dry-run) DRY_RUN=true ;; + -h|--help) usage; exit 0 ;; + *) echo "Unknown option: $1" >&2; usage >&2; exit 2 ;; + esac + shift +done + +if [ ! -f "$SOURCE_MCP" ]; then + echo "ERROR: source .mcp.json not found: $SOURCE_MCP" >&2 + exit 1 +fi + +if [ "$DRY_RUN" = true ]; then + echo "Would merge $SOURCE_MCP into $TARGET_MCP" + exit 0 +fi + +python3 - "$SOURCE_MCP" "$TARGET_MCP" <<'PY' +import json +import sys +from pathlib import Path + +source_path = Path(sys.argv[1]) +target_path = Path(sys.argv[2]) +source = json.loads(source_path.read_text()) +target = json.loads(target_path.read_text()) if target_path.exists() else {} +source_servers = source.get("mcpServers", {}) +target.setdefault("mcpServers", {}) +target["mcpServers"].update(source_servers) +target_path.write_text(json.dumps(target, indent=2, ensure_ascii=False) + "\n") +print(f"Installed MCP servers: {', '.join(sorted(source_servers))}") +print(f"Updated: {target_path}") +PY +EOF + chmod +x "$installer" +} + +sync_mcp_runtime() { + local runtime="$1" + local source_dir="$2" + local dest_dir="$3" + local tmp_dir + local diff_file + + if [ ! -d "$source_dir" ]; then + echo "ERROR: source directory not found: $source_dir" >&2 + exit 1 + fi + + tmp_dir="$(mktemp -d)" + cp -a "$source_dir/." "$tmp_dir/" + find "$tmp_dir" \( \ + -name .venv -o \ + -name .pytest_cache -o \ + -name __pycache__ -o \ + -name '*.pyc' -o \ + -name '*.pyo' \ + \) -exec rm -rf {} + 2>/dev/null || true + + case "$runtime" in + claude) + rm -rf "$tmp_dir/.codex-plugin" + ;; + codex) + write_codex_mcp_manifest "$tmp_dir" + rm -rf "$tmp_dir/.claude-plugin" + ;; + kiro) + rm -rf "$tmp_dir/.claude-plugin" "$tmp_dir/.codex-plugin" + write_kiro_mcp_installer "$tmp_dir" + ;; + *) + echo "ERROR: unknown MCP runtime: $runtime" >&2 + rm -rf "$tmp_dir" + exit 1 + ;; + esac + + if [ "$CHECK" = true ]; then + if [ ! -d "$dest_dir" ]; then + echo "Generated directory missing: ${dest_dir#$ROOT_DIR/}" >&2 + rm -rf "$tmp_dir" + return 1 + fi + diff_file="$(mktemp)" + if ! diff -ruN "$tmp_dir" "$dest_dir" >"$diff_file"; then + echo "Generated directory is out of date: ${dest_dir#$ROOT_DIR/}" >&2 + cat "$diff_file" >&2 + rm -f "$diff_file" + rm -rf "$tmp_dir" + return 1 + fi + rm -f "$diff_file" + rm -rf "$tmp_dir" + else + rm -rf "$dest_dir" + mkdir -p "$(dirname "$dest_dir")" + mv "$tmp_dir" "$dest_dir" + fi +} + +sync_mcp_plugins() { + local plugin_dir plugin_name + + [ -d "$MCP_SHARED_DIR" ] || return 0 + for plugin_dir in "$MCP_SHARED_DIR"/*; do + [ -d "$plugin_dir" ] || continue + plugin_name="$(basename "$plugin_dir")" + sync_mcp_runtime claude "$plugin_dir" "$ROOT_DIR/plugins/mcp/claude/$plugin_name" + sync_mcp_runtime codex "$plugin_dir" "$ROOT_DIR/plugins/mcp/codex/$plugin_name" + sync_mcp_runtime kiro "$plugin_dir" "$ROOT_DIR/plugins/mcp/kiro/$plugin_name" + done +} + sync_legacy_ndf sync_runtime_if_present claude "$SHARED_DIR/manifests/claude-skills.txt" sync_runtime_if_present codex "$SHARED_DIR/manifests/codex-skills.txt" sync_runtime_if_present kiro "$SHARED_DIR/manifests/kiro-skills.txt" +sync_mcp_plugins if [ "$CHECK" = true ]; then echo "runtime plugin generated files are up to date" From 76a42dd16e8d14c2d26d4dadd59f808150c1455f Mon Sep 17 00:00:00 2001 From: "takemi.ohama" Date: Tue, 7 Jul 2026 04:02:54 +0000 Subject: [PATCH 03/10] =?UTF-8?q?Fix:=20Codex=20MCP=E8=A8=AD=E5=AE=9A?= =?UTF-8?q?=E3=82=92direct=20map=E5=BD=A2=E5=BC=8F=E3=81=A7=E7=94=9F?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/mcp/codex/mcp-aws-docs/.mcp.json | 18 +++++----- plugins/mcp/codex/mcp-bigquery/.mcp.json | 34 +++++++++--------- .../mcp/codex/mcp-chrome-devtools/.mcp.json | 26 +++++++------- plugins/mcp/codex/mcp-dbhub/.mcp.json | 16 ++++----- plugins/mcp/codex/mcp-devin/.mcp.json | 22 ++++++------ plugins/mcp/codex/mcp-markitdown/.mcp.json | 14 ++++---- plugins/mcp/codex/mcp-notion/.mcp.json | 12 +++---- plugins/mcp/codex/mcp-playwright/.mcp.json | 32 ++++++++--------- plugins/mcp/codex/mcp-redash/.mcp.json | 17 ++++----- plugins/mcp/codex/mcp-serena/.mcp.json | 36 +++++++++---------- scripts/build-runtime-plugins.sh | 25 +++++++++++++ 11 files changed, 130 insertions(+), 122 deletions(-) diff --git a/plugins/mcp/codex/mcp-aws-docs/.mcp.json b/plugins/mcp/codex/mcp-aws-docs/.mcp.json index 01ff167..4cceb0c 100644 --- a/plugins/mcp/codex/mcp-aws-docs/.mcp.json +++ b/plugins/mcp/codex/mcp-aws-docs/.mcp.json @@ -1,13 +1,11 @@ { - "mcpServers": { - "awslabs.aws-docs": { - "type": "stdio", - "command": "uvx", - "args": [ - "awslabs.aws-documentation-mcp-server@latest" - ], - "env": {}, - "envFile": "${workspaceFolder}/.env" - } + "awslabs.aws-docs": { + "type": "stdio", + "command": "uvx", + "args": [ + "awslabs.aws-documentation-mcp-server@latest" + ], + "env": {}, + "envFile": "${workspaceFolder}/.env" } } diff --git a/plugins/mcp/codex/mcp-bigquery/.mcp.json b/plugins/mcp/codex/mcp-bigquery/.mcp.json index ed2ecd4..cd6647d 100644 --- a/plugins/mcp/codex/mcp-bigquery/.mcp.json +++ b/plugins/mcp/codex/mcp-bigquery/.mcp.json @@ -1,21 +1,19 @@ { - "mcpServers": { - "bigquery": { - "type": "stdio", - "command": "uvx", - "args": [ - "mcp-server-bigquery@latest", - "--project", - "${BIGQUERY_PROJECT}", - "--location", - "${BIGQUERY_LOCATION}", - "--dataset", - "${BIGQUERY_DATASET}", - "--key-file", - "${BIGQUERY_KEY_FILE}" - ], - "env": {}, - "envFile": "${workspaceFolder}/.env" - } + "bigquery": { + "type": "stdio", + "command": "uvx", + "args": [ + "mcp-server-bigquery@latest", + "--project", + "${BIGQUERY_PROJECT}", + "--location", + "${BIGQUERY_LOCATION}", + "--dataset", + "${BIGQUERY_DATASET}", + "--key-file", + "${BIGQUERY_KEY_FILE}" + ], + "env": {}, + "envFile": "${workspaceFolder}/.env" } } diff --git a/plugins/mcp/codex/mcp-chrome-devtools/.mcp.json b/plugins/mcp/codex/mcp-chrome-devtools/.mcp.json index 88e4c76..e02eb65 100644 --- a/plugins/mcp/codex/mcp-chrome-devtools/.mcp.json +++ b/plugins/mcp/codex/mcp-chrome-devtools/.mcp.json @@ -1,17 +1,15 @@ { - "mcpServers": { - "chrome-devtools": { - "type": "stdio", - "command": "npx", - "args": [ - "-y", - "chrome-devtools-mcp@latest", - "--isolated", - "--chromeArg=--no-sandbox", - "--chromeArg=--disable-setuid-sandbox", - "--chromeArg=--disable-dev-shm-usage" - ], - "envFile": "${workspaceFolder}/.env" - } + "chrome-devtools": { + "type": "stdio", + "command": "npx", + "args": [ + "-y", + "chrome-devtools-mcp@latest", + "--isolated", + "--chromeArg=--no-sandbox", + "--chromeArg=--disable-setuid-sandbox", + "--chromeArg=--disable-dev-shm-usage" + ], + "envFile": "${workspaceFolder}/.env" } } diff --git a/plugins/mcp/codex/mcp-dbhub/.mcp.json b/plugins/mcp/codex/mcp-dbhub/.mcp.json index dc078ac..b070fd0 100644 --- a/plugins/mcp/codex/mcp-dbhub/.mcp.json +++ b/plugins/mcp/codex/mcp-dbhub/.mcp.json @@ -1,12 +1,10 @@ { - "mcpServers": { - "dbhub": { - "type": "stdio", - "command": "npx", - "args": [ - "--yes", - "@bytebase/dbhub" - ] - } + "dbhub": { + "type": "stdio", + "command": "npx", + "args": [ + "--yes", + "@bytebase/dbhub" + ] } } diff --git a/plugins/mcp/codex/mcp-devin/.mcp.json b/plugins/mcp/codex/mcp-devin/.mcp.json index fe323ee..8d2f5d2 100644 --- a/plugins/mcp/codex/mcp-devin/.mcp.json +++ b/plugins/mcp/codex/mcp-devin/.mcp.json @@ -1,15 +1,13 @@ { - "mcpServers": { - "devin": { - "type": "http", - "url": "https://mcp.devin.ai/mcp", - "headers": { - "Authorization": "Bearer ${DEVIN_API_KEY}" - }, - "env": { - "DEVIN_API_KEY": "${DEVIN_API_KEY}" - }, - "envFile": "${workspaceFolder}/.env" - } + "devin": { + "type": "http", + "url": "https://mcp.devin.ai/mcp", + "headers": { + "Authorization": "Bearer ${DEVIN_API_KEY}" + }, + "env": { + "DEVIN_API_KEY": "${DEVIN_API_KEY}" + }, + "envFile": "${workspaceFolder}/.env" } } diff --git a/plugins/mcp/codex/mcp-markitdown/.mcp.json b/plugins/mcp/codex/mcp-markitdown/.mcp.json index 844df81..e4cdea6 100644 --- a/plugins/mcp/codex/mcp-markitdown/.mcp.json +++ b/plugins/mcp/codex/mcp-markitdown/.mcp.json @@ -1,11 +1,9 @@ { - "mcpServers": { - "markitdown": { - "type": "stdio", - "command": "uvx", - "args": [ - "markitdown-mcp" - ] - } + "markitdown": { + "type": "stdio", + "command": "uvx", + "args": [ + "markitdown-mcp" + ] } } diff --git a/plugins/mcp/codex/mcp-notion/.mcp.json b/plugins/mcp/codex/mcp-notion/.mcp.json index fc5b4de..6be6e00 100644 --- a/plugins/mcp/codex/mcp-notion/.mcp.json +++ b/plugins/mcp/codex/mcp-notion/.mcp.json @@ -1,10 +1,8 @@ { - "mcpServers": { - "notion": { - "type": "http", - "url": "https://mcp.notion.com/mcp", - "env": {}, - "envFile": "${workspaceFolder}/.env" - } + "notion": { + "type": "http", + "url": "https://mcp.notion.com/mcp", + "env": {}, + "envFile": "${workspaceFolder}/.env" } } diff --git a/plugins/mcp/codex/mcp-playwright/.mcp.json b/plugins/mcp/codex/mcp-playwright/.mcp.json index 2313c0d..5da8fab 100644 --- a/plugins/mcp/codex/mcp-playwright/.mcp.json +++ b/plugins/mcp/codex/mcp-playwright/.mcp.json @@ -1,20 +1,18 @@ { - "mcpServers": { - "playwright": { - "type": "stdio", - "command": "npx", - "args": [ - "-y", - "@playwright/mcp@latest", - "--browser", - "chromium", - "--isolated", - "--no-sandbox" - ], - "env": { - "PLAYWRIGHT_BROWSERS_PATH": "${HOME}/.cache/ms-playwright" - }, - "envFile": "${workspaceFolder}/.env" - } + "playwright": { + "type": "stdio", + "command": "npx", + "args": [ + "-y", + "@playwright/mcp@latest", + "--browser", + "chromium", + "--isolated", + "--no-sandbox" + ], + "env": { + "PLAYWRIGHT_BROWSERS_PATH": "${HOME}/.cache/ms-playwright" + }, + "envFile": "${workspaceFolder}/.env" } } diff --git a/plugins/mcp/codex/mcp-redash/.mcp.json b/plugins/mcp/codex/mcp-redash/.mcp.json index 80c370f..8930d6d 100644 --- a/plugins/mcp/codex/mcp-redash/.mcp.json +++ b/plugins/mcp/codex/mcp-redash/.mcp.json @@ -1,12 +1,13 @@ { - "mcpServers": { - "redash": { - "command": "npx", - "args": ["-y", "@suthio/redash-mcp"], - "env": { - "REDASH_URL": "${REDASH_URL}", - "REDASH_API_KEY": "${REDASH_API_KEY}" - } + "redash": { + "command": "npx", + "args": [ + "-y", + "@suthio/redash-mcp" + ], + "env": { + "REDASH_URL": "${REDASH_URL}", + "REDASH_API_KEY": "${REDASH_API_KEY}" } } } diff --git a/plugins/mcp/codex/mcp-serena/.mcp.json b/plugins/mcp/codex/mcp-serena/.mcp.json index 6ff356e..ad9c0e4 100644 --- a/plugins/mcp/codex/mcp-serena/.mcp.json +++ b/plugins/mcp/codex/mcp-serena/.mcp.json @@ -1,22 +1,20 @@ { - "mcpServers": { - "serena": { - "type": "stdio", - "command": "uvx", - "args": [ - "--from", - "git+https://github.com/oraios/serena", - "serena", - "start-mcp-server", - "--context", - "ide-assistant", - "--enable-web-dashboard", - "False" - ], - "env": { - "SERENA_HOME": "${SERENA_HOME:-.serena}" - }, - "envFile": "${workspaceFolder}/.env" - } + "serena": { + "type": "stdio", + "command": "uvx", + "args": [ + "--from", + "git+https://github.com/oraios/serena", + "serena", + "start-mcp-server", + "--context", + "ide-assistant", + "--enable-web-dashboard", + "False" + ], + "env": { + "SERENA_HOME": "${SERENA_HOME:-.serena}" + }, + "envFile": "${workspaceFolder}/.env" } } diff --git a/scripts/build-runtime-plugins.sh b/scripts/build-runtime-plugins.sh index 84154fc..e50d6b6 100755 --- a/scripts/build-runtime-plugins.sh +++ b/scripts/build-runtime-plugins.sh @@ -264,6 +264,30 @@ write_codex_mcp_manifest() { EOF } +write_codex_mcp_config() { + local plugin_dir="$1" + local mcp_config="$plugin_dir/.mcp.json" + + if [ ! -f "$mcp_config" ]; then + echo "ERROR: MCP config not found: $mcp_config" >&2 + exit 1 + fi + + python3 - "$mcp_config" <<'PY' +import json +import sys +from pathlib import Path + +config_path = Path(sys.argv[1]) +config = json.loads(config_path.read_text()) +servers = config.get("mcpServers") +if not isinstance(servers, dict): + raise SystemExit(f"ERROR: mcpServers object not found: {config_path}") + +config_path.write_text(json.dumps(servers, indent=2, ensure_ascii=False) + "\n") +PY +} + write_kiro_mcp_installer() { local plugin_dir="$1" local installer="$plugin_dir/install.sh" @@ -353,6 +377,7 @@ sync_mcp_runtime() { ;; codex) write_codex_mcp_manifest "$tmp_dir" + write_codex_mcp_config "$tmp_dir" rm -rf "$tmp_dir/.claude-plugin" ;; kiro) From 96967e7ee26d612c2465e1bd20cf5f5fe34fc1c9 Mon Sep 17 00:00:00 2001 From: "takemi.ohama" Date: Tue, 7 Jul 2026 04:10:35 +0000 Subject: [PATCH 04/10] =?UTF-8?q?Fix:=20MCP=20runtime=E7=94=9F=E6=88=90?= =?UTF-8?q?=E3=81=AECodex=E5=8F=82=E7=85=A7=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../claude/mcp-playwright/hooks/hooks.json | 2 +- .../scripts/ensure-playwright.js | 2 +- .../mcp-redash/skills/redash-add/SKILL.md | 2 +- .../mcp-redash/skills/redash-list/SKILL.md | 2 +- .../mcp-redash/skills/redash-remove/SKILL.md | 2 +- .../mcp-redash/skills/redash-status/SKILL.md | 2 +- .../mcp-aws-docs/.codex-plugin/plugin.json | 12 ++++++- .../mcp-bigquery/.codex-plugin/plugin.json | 13 +++++++- .../.codex-plugin/plugin.json | 13 +++++++- .../codex/mcp-dbhub/.codex-plugin/plugin.json | 13 +++++++- .../codex/mcp-devin/.codex-plugin/plugin.json | 14 +++++++- .../mcp-markitdown/.codex-plugin/plugin.json | 16 ++++++++- .../mcp-notion/.codex-plugin/plugin.json | 12 ++++++- .../mcp-playwright/.codex-plugin/plugin.json | 15 +++++++-- .../mcp/codex/mcp-playwright/hooks/hooks.json | 2 +- .../scripts/ensure-playwright.js | 2 +- .../mcp-redash/.codex-plugin/plugin.json | 14 +++++++- .../mcp-redash/skills/redash-add/SKILL.md | 2 +- .../mcp-redash/skills/redash-list/SKILL.md | 2 +- .../mcp-redash/skills/redash-remove/SKILL.md | 2 +- .../mcp-redash/skills/redash-status/SKILL.md | 2 +- .../mcp-serena/.codex-plugin/plugin.json | 16 +++++++-- .../mcp/kiro/mcp-playwright/hooks/hooks.json | 2 +- .../scripts/ensure-playwright.js | 2 +- .../mcp-redash/skills/redash-add/SKILL.md | 2 +- .../mcp-redash/skills/redash-list/SKILL.md | 2 +- .../mcp-redash/skills/redash-remove/SKILL.md | 2 +- .../mcp-redash/skills/redash-status/SKILL.md | 2 +- .../shared/mcp-playwright/hooks/hooks.json | 2 +- .../scripts/ensure-playwright.js | 2 +- .../mcp-redash/skills/redash-add/SKILL.md | 2 +- .../mcp-redash/skills/redash-list/SKILL.md | 2 +- .../mcp-redash/skills/redash-remove/SKILL.md | 2 +- .../mcp-redash/skills/redash-status/SKILL.md | 2 +- scripts/build-runtime-plugins.sh | 33 ++++++++++--------- 35 files changed, 168 insertions(+), 51 deletions(-) diff --git a/plugins/mcp/claude/mcp-playwright/hooks/hooks.json b/plugins/mcp/claude/mcp-playwright/hooks/hooks.json index 7b163ae..5e7d5ca 100644 --- a/plugins/mcp/claude/mcp-playwright/hooks/hooks.json +++ b/plugins/mcp/claude/mcp-playwright/hooks/hooks.json @@ -10,7 +10,7 @@ "hooks": [ { "type": "command", - "command": "node ${CLAUDE_PLUGIN_ROOT}/scripts/ensure-playwright.js", + "command": "node ${PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}}/scripts/ensure-playwright.js", "description": "Auto-install Playwright chromium on first use", "continueOnError": false, "suppressOutput": false diff --git a/plugins/mcp/claude/mcp-playwright/scripts/ensure-playwright.js b/plugins/mcp/claude/mcp-playwright/scripts/ensure-playwright.js index 1a4c98d..57f602b 100755 --- a/plugins/mcp/claude/mcp-playwright/scripts/ensure-playwright.js +++ b/plugins/mcp/claude/mcp-playwright/scripts/ensure-playwright.js @@ -5,7 +5,7 @@ const fs = require('fs'); const path = require('path'); const os = require('os'); -const PLUGIN_ROOT = process.env.CLAUDE_PLUGIN_ROOT || __dirname; +const PLUGIN_ROOT = process.env.PLUGIN_ROOT || process.env.CODEX_PLUGIN_ROOT || process.env.CLAUDE_PLUGIN_ROOT || __dirname; const FLAG_FILE = path.join(os.homedir(), '.claude-playwright-installed'); const BROWSER_PATH = path.join(os.homedir(), '.cache', 'ms-playwright'); const TIMEOUT_MS = 5 * 60 * 1000; // 5分タイムアウト diff --git a/plugins/mcp/claude/mcp-redash/skills/redash-add/SKILL.md b/plugins/mcp/claude/mcp-redash/skills/redash-add/SKILL.md index 67b442e..f91167b 100644 --- a/plugins/mcp/claude/mcp-redash/skills/redash-add/SKILL.md +++ b/plugins/mcp/claude/mcp-redash/skills/redash-add/SKILL.md @@ -19,7 +19,7 @@ allowed-tools: 以下のコマンドを実行してください。`$ARGUMENTS` にはユーザーが指定した suffix が入ります。 ```bash -node "${CLAUDE_PLUGIN_ROOT}/scripts/redash-mcp-config.js" add $ARGUMENTS +node "${PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}}/scripts/redash-mcp-config.js" add $ARGUMENTS ``` ## 実行後 diff --git a/plugins/mcp/claude/mcp-redash/skills/redash-list/SKILL.md b/plugins/mcp/claude/mcp-redash/skills/redash-list/SKILL.md index fe81518..798754e 100644 --- a/plugins/mcp/claude/mcp-redash/skills/redash-list/SKILL.md +++ b/plugins/mcp/claude/mcp-redash/skills/redash-list/SKILL.md @@ -16,7 +16,7 @@ allowed-tools: 以下のコマンドを実行してください。 ```bash -node "${CLAUDE_PLUGIN_ROOT}/scripts/redash-mcp-config.js" list +node "${PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}}/scripts/redash-mcp-config.js" list ``` ## 実行後 diff --git a/plugins/mcp/claude/mcp-redash/skills/redash-remove/SKILL.md b/plugins/mcp/claude/mcp-redash/skills/redash-remove/SKILL.md index 31a6270..93d8a10 100644 --- a/plugins/mcp/claude/mcp-redash/skills/redash-remove/SKILL.md +++ b/plugins/mcp/claude/mcp-redash/skills/redash-remove/SKILL.md @@ -19,7 +19,7 @@ allowed-tools: 以下のコマンドを実行してください。`$ARGUMENTS` にはユーザーが指定した suffix が入ります。 ```bash -node "${CLAUDE_PLUGIN_ROOT}/scripts/redash-mcp-config.js" remove $ARGUMENTS +node "${PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}}/scripts/redash-mcp-config.js" remove $ARGUMENTS ``` ## 実行後 diff --git a/plugins/mcp/claude/mcp-redash/skills/redash-status/SKILL.md b/plugins/mcp/claude/mcp-redash/skills/redash-status/SKILL.md index 2b1f909..45a4034 100644 --- a/plugins/mcp/claude/mcp-redash/skills/redash-status/SKILL.md +++ b/plugins/mcp/claude/mcp-redash/skills/redash-status/SKILL.md @@ -16,7 +16,7 @@ Redash MCP の設定状況を詳細表示します。各 MCP が必要とする 以下のコマンドを実行してください。 ```bash -node "${CLAUDE_PLUGIN_ROOT}/scripts/redash-mcp-config.js" status +node "${PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}}/scripts/redash-mcp-config.js" status ``` ## 実行後 diff --git a/plugins/mcp/codex/mcp-aws-docs/.codex-plugin/plugin.json b/plugins/mcp/codex/mcp-aws-docs/.codex-plugin/plugin.json index 73fc149..05e0e4e 100644 --- a/plugins/mcp/codex/mcp-aws-docs/.codex-plugin/plugin.json +++ b/plugins/mcp/codex/mcp-aws-docs/.codex-plugin/plugin.json @@ -2,6 +2,16 @@ "name": "mcp-aws-docs", "version": "1.0.0", "description": "AWS Documentation MCP server for accessing official AWS documentation", - "keywords": ["mcp", "aws", "documentation", "docs", "cloud"], + "author": { + "name": "takemi-ohama", + "url": "https://github.com/takemi-ohama" + }, + "keywords": [ + "mcp", + "aws", + "documentation", + "docs", + "cloud" + ], "mcpServers": "./.mcp.json" } diff --git a/plugins/mcp/codex/mcp-bigquery/.codex-plugin/plugin.json b/plugins/mcp/codex/mcp-bigquery/.codex-plugin/plugin.json index edd1138..e867e7c 100644 --- a/plugins/mcp/codex/mcp-bigquery/.codex-plugin/plugin.json +++ b/plugins/mcp/codex/mcp-bigquery/.codex-plugin/plugin.json @@ -2,6 +2,17 @@ "name": "mcp-bigquery", "version": "1.0.0", "description": "BigQuery MCP server for data analysis and SQL queries", - "keywords": ["mcp", "bigquery", "sql", "data", "analysis", "gcp"], + "author": { + "name": "takemi-ohama", + "url": "https://github.com/takemi-ohama" + }, + "keywords": [ + "mcp", + "bigquery", + "sql", + "data", + "analysis", + "gcp" + ], "mcpServers": "./.mcp.json" } diff --git a/plugins/mcp/codex/mcp-chrome-devtools/.codex-plugin/plugin.json b/plugins/mcp/codex/mcp-chrome-devtools/.codex-plugin/plugin.json index 7c4d742..7b6c830 100644 --- a/plugins/mcp/codex/mcp-chrome-devtools/.codex-plugin/plugin.json +++ b/plugins/mcp/codex/mcp-chrome-devtools/.codex-plugin/plugin.json @@ -2,6 +2,17 @@ "name": "mcp-chrome-devtools", "version": "1.0.0", "description": "Chrome DevTools MCP server for browser automation and testing", - "keywords": ["mcp", "chrome", "devtools", "browser", "automation", "testing"], + "author": { + "name": "takemi-ohama", + "url": "https://github.com/takemi-ohama" + }, + "keywords": [ + "mcp", + "chrome", + "devtools", + "browser", + "automation", + "testing" + ], "mcpServers": "./.mcp.json" } diff --git a/plugins/mcp/codex/mcp-dbhub/.codex-plugin/plugin.json b/plugins/mcp/codex/mcp-dbhub/.codex-plugin/plugin.json index 4cf67be..edd420e 100644 --- a/plugins/mcp/codex/mcp-dbhub/.codex-plugin/plugin.json +++ b/plugins/mcp/codex/mcp-dbhub/.codex-plugin/plugin.json @@ -2,6 +2,17 @@ "name": "mcp-dbhub", "version": "1.2.0", "description": "DBHub MCP server for database operations and SQL queries", - "keywords": ["mcp", "database", "sql", "dbhub", "mysql", "postgres"], + "author": { + "name": "takemi-ohama", + "url": "https://github.com/takemi-ohama" + }, + "keywords": [ + "mcp", + "database", + "sql", + "dbhub", + "mysql", + "postgres" + ], "mcpServers": "./.mcp.json" } diff --git a/plugins/mcp/codex/mcp-devin/.codex-plugin/plugin.json b/plugins/mcp/codex/mcp-devin/.codex-plugin/plugin.json index cde6648..ad76b7e 100644 --- a/plugins/mcp/codex/mcp-devin/.codex-plugin/plugin.json +++ b/plugins/mcp/codex/mcp-devin/.codex-plugin/plugin.json @@ -2,6 +2,18 @@ "name": "mcp-devin", "version": "1.0.0", "description": "Devin MCP server for accessing repository documentation and code knowledge via DeepWiki", - "keywords": ["mcp", "devin", "deepwiki", "documentation", "repository", "wiki", "code-knowledge"], + "author": { + "name": "takemi-ohama", + "url": "https://github.com/takemi-ohama" + }, + "keywords": [ + "mcp", + "devin", + "deepwiki", + "documentation", + "repository", + "wiki", + "code-knowledge" + ], "mcpServers": "./.mcp.json" } diff --git a/plugins/mcp/codex/mcp-markitdown/.codex-plugin/plugin.json b/plugins/mcp/codex/mcp-markitdown/.codex-plugin/plugin.json index 9de3858..8fcc244 100644 --- a/plugins/mcp/codex/mcp-markitdown/.codex-plugin/plugin.json +++ b/plugins/mcp/codex/mcp-markitdown/.codex-plugin/plugin.json @@ -2,6 +2,20 @@ "name": "mcp-markitdown", "version": "1.0.0", "description": "MarkItDown MCP server for converting documents (PDF, Office, images, etc.) to Markdown", - "keywords": ["mcp", "markitdown", "markdown", "pdf", "docx", "pptx", "xlsx", "images", "converter"], + "author": { + "name": "takemi-ohama", + "url": "https://github.com/takemi-ohama" + }, + "keywords": [ + "mcp", + "markitdown", + "markdown", + "pdf", + "docx", + "pptx", + "xlsx", + "images", + "converter" + ], "mcpServers": "./.mcp.json" } diff --git a/plugins/mcp/codex/mcp-notion/.codex-plugin/plugin.json b/plugins/mcp/codex/mcp-notion/.codex-plugin/plugin.json index 1ec5dde..e0c51f0 100644 --- a/plugins/mcp/codex/mcp-notion/.codex-plugin/plugin.json +++ b/plugins/mcp/codex/mcp-notion/.codex-plugin/plugin.json @@ -2,6 +2,16 @@ "name": "mcp-notion", "version": "1.0.0", "description": "Notion MCP server for note management and knowledge base operations", - "keywords": ["mcp", "notion", "notes", "knowledge-base", "documentation"], + "author": { + "name": "takemi-ohama", + "url": "https://github.com/takemi-ohama" + }, + "keywords": [ + "mcp", + "notion", + "notes", + "knowledge-base", + "documentation" + ], "mcpServers": "./.mcp.json" } diff --git a/plugins/mcp/codex/mcp-playwright/.codex-plugin/plugin.json b/plugins/mcp/codex/mcp-playwright/.codex-plugin/plugin.json index 5b43e2e..3aa2c15 100644 --- a/plugins/mcp/codex/mcp-playwright/.codex-plugin/plugin.json +++ b/plugins/mcp/codex/mcp-playwright/.codex-plugin/plugin.json @@ -2,6 +2,17 @@ "name": "mcp-playwright", "version": "1.0.1", "description": "Playwright MCPを自動セットアップするプラグイン。Chromiumブラウザの自動インストールとMCP設定を提供します。", - "keywords": ["mcp", "playwright", "browser", "automation", "testing"], - "mcpServers": "./.mcp.json" + "author": { + "name": "NDF Team", + "url": "https://github.com/devbasex/ai-plugins" + }, + "keywords": [ + "mcp", + "playwright", + "browser", + "automation", + "testing" + ], + "mcpServers": "./.mcp.json", + "hooks": "./hooks/hooks.json" } diff --git a/plugins/mcp/codex/mcp-playwright/hooks/hooks.json b/plugins/mcp/codex/mcp-playwright/hooks/hooks.json index 7b163ae..5e7d5ca 100644 --- a/plugins/mcp/codex/mcp-playwright/hooks/hooks.json +++ b/plugins/mcp/codex/mcp-playwright/hooks/hooks.json @@ -10,7 +10,7 @@ "hooks": [ { "type": "command", - "command": "node ${CLAUDE_PLUGIN_ROOT}/scripts/ensure-playwright.js", + "command": "node ${PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}}/scripts/ensure-playwright.js", "description": "Auto-install Playwright chromium on first use", "continueOnError": false, "suppressOutput": false diff --git a/plugins/mcp/codex/mcp-playwright/scripts/ensure-playwright.js b/plugins/mcp/codex/mcp-playwright/scripts/ensure-playwright.js index 1a4c98d..57f602b 100755 --- a/plugins/mcp/codex/mcp-playwright/scripts/ensure-playwright.js +++ b/plugins/mcp/codex/mcp-playwright/scripts/ensure-playwright.js @@ -5,7 +5,7 @@ const fs = require('fs'); const path = require('path'); const os = require('os'); -const PLUGIN_ROOT = process.env.CLAUDE_PLUGIN_ROOT || __dirname; +const PLUGIN_ROOT = process.env.PLUGIN_ROOT || process.env.CODEX_PLUGIN_ROOT || process.env.CLAUDE_PLUGIN_ROOT || __dirname; const FLAG_FILE = path.join(os.homedir(), '.claude-playwright-installed'); const BROWSER_PATH = path.join(os.homedir(), '.cache', 'ms-playwright'); const TIMEOUT_MS = 5 * 60 * 1000; // 5分タイムアウト diff --git a/plugins/mcp/codex/mcp-redash/.codex-plugin/plugin.json b/plugins/mcp/codex/mcp-redash/.codex-plugin/plugin.json index 7a191ff..c6fc88f 100644 --- a/plugins/mcp/codex/mcp-redash/.codex-plugin/plugin.json +++ b/plugins/mcp/codex/mcp-redash/.codex-plugin/plugin.json @@ -2,6 +2,18 @@ "name": "mcp-redash", "version": "1.0.0", "description": "Redash MCP server with multi-environment support (arbitrary suffix)", - "keywords": ["mcp", "redash", "sql", "data", "visualization", "multi-environment"], + "author": { + "name": "takemi-ohama", + "url": "https://github.com/takemi-ohama" + }, + "keywords": [ + "mcp", + "redash", + "sql", + "data", + "visualization", + "multi-environment" + ], + "skills": "./skills/", "mcpServers": "./.mcp.json" } diff --git a/plugins/mcp/codex/mcp-redash/skills/redash-add/SKILL.md b/plugins/mcp/codex/mcp-redash/skills/redash-add/SKILL.md index 67b442e..f91167b 100644 --- a/plugins/mcp/codex/mcp-redash/skills/redash-add/SKILL.md +++ b/plugins/mcp/codex/mcp-redash/skills/redash-add/SKILL.md @@ -19,7 +19,7 @@ allowed-tools: 以下のコマンドを実行してください。`$ARGUMENTS` にはユーザーが指定した suffix が入ります。 ```bash -node "${CLAUDE_PLUGIN_ROOT}/scripts/redash-mcp-config.js" add $ARGUMENTS +node "${PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}}/scripts/redash-mcp-config.js" add $ARGUMENTS ``` ## 実行後 diff --git a/plugins/mcp/codex/mcp-redash/skills/redash-list/SKILL.md b/plugins/mcp/codex/mcp-redash/skills/redash-list/SKILL.md index fe81518..798754e 100644 --- a/plugins/mcp/codex/mcp-redash/skills/redash-list/SKILL.md +++ b/plugins/mcp/codex/mcp-redash/skills/redash-list/SKILL.md @@ -16,7 +16,7 @@ allowed-tools: 以下のコマンドを実行してください。 ```bash -node "${CLAUDE_PLUGIN_ROOT}/scripts/redash-mcp-config.js" list +node "${PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}}/scripts/redash-mcp-config.js" list ``` ## 実行後 diff --git a/plugins/mcp/codex/mcp-redash/skills/redash-remove/SKILL.md b/plugins/mcp/codex/mcp-redash/skills/redash-remove/SKILL.md index 31a6270..93d8a10 100644 --- a/plugins/mcp/codex/mcp-redash/skills/redash-remove/SKILL.md +++ b/plugins/mcp/codex/mcp-redash/skills/redash-remove/SKILL.md @@ -19,7 +19,7 @@ allowed-tools: 以下のコマンドを実行してください。`$ARGUMENTS` にはユーザーが指定した suffix が入ります。 ```bash -node "${CLAUDE_PLUGIN_ROOT}/scripts/redash-mcp-config.js" remove $ARGUMENTS +node "${PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}}/scripts/redash-mcp-config.js" remove $ARGUMENTS ``` ## 実行後 diff --git a/plugins/mcp/codex/mcp-redash/skills/redash-status/SKILL.md b/plugins/mcp/codex/mcp-redash/skills/redash-status/SKILL.md index 2b1f909..45a4034 100644 --- a/plugins/mcp/codex/mcp-redash/skills/redash-status/SKILL.md +++ b/plugins/mcp/codex/mcp-redash/skills/redash-status/SKILL.md @@ -16,7 +16,7 @@ Redash MCP の設定状況を詳細表示します。各 MCP が必要とする 以下のコマンドを実行してください。 ```bash -node "${CLAUDE_PLUGIN_ROOT}/scripts/redash-mcp-config.js" status +node "${PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}}/scripts/redash-mcp-config.js" status ``` ## 実行後 diff --git a/plugins/mcp/codex/mcp-serena/.codex-plugin/plugin.json b/plugins/mcp/codex/mcp-serena/.codex-plugin/plugin.json index 1400fe7..f47d957 100644 --- a/plugins/mcp/codex/mcp-serena/.codex-plugin/plugin.json +++ b/plugins/mcp/codex/mcp-serena/.codex-plugin/plugin.json @@ -2,6 +2,18 @@ "name": "mcp-serena", "version": "1.0.0", "description": "Serena MCP server for semantic code intelligence (symbol search, reference search, refactoring)", - "keywords": ["mcp", "serena", "lsp", "symbol-search", "refactoring", "code-intelligence"], - "mcpServers": "./.mcp.json" + "author": { + "name": "takemi-ohama", + "url": "https://github.com/takemi-ohama" + }, + "keywords": [ + "mcp", + "serena", + "lsp", + "symbol-search", + "refactoring", + "code-intelligence" + ], + "mcpServers": "./.mcp.json", + "hooks": "./hooks/hooks.json" } diff --git a/plugins/mcp/kiro/mcp-playwright/hooks/hooks.json b/plugins/mcp/kiro/mcp-playwright/hooks/hooks.json index 7b163ae..5e7d5ca 100644 --- a/plugins/mcp/kiro/mcp-playwright/hooks/hooks.json +++ b/plugins/mcp/kiro/mcp-playwright/hooks/hooks.json @@ -10,7 +10,7 @@ "hooks": [ { "type": "command", - "command": "node ${CLAUDE_PLUGIN_ROOT}/scripts/ensure-playwright.js", + "command": "node ${PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}}/scripts/ensure-playwright.js", "description": "Auto-install Playwright chromium on first use", "continueOnError": false, "suppressOutput": false diff --git a/plugins/mcp/kiro/mcp-playwright/scripts/ensure-playwright.js b/plugins/mcp/kiro/mcp-playwright/scripts/ensure-playwright.js index 1a4c98d..57f602b 100755 --- a/plugins/mcp/kiro/mcp-playwright/scripts/ensure-playwright.js +++ b/plugins/mcp/kiro/mcp-playwright/scripts/ensure-playwright.js @@ -5,7 +5,7 @@ const fs = require('fs'); const path = require('path'); const os = require('os'); -const PLUGIN_ROOT = process.env.CLAUDE_PLUGIN_ROOT || __dirname; +const PLUGIN_ROOT = process.env.PLUGIN_ROOT || process.env.CODEX_PLUGIN_ROOT || process.env.CLAUDE_PLUGIN_ROOT || __dirname; const FLAG_FILE = path.join(os.homedir(), '.claude-playwright-installed'); const BROWSER_PATH = path.join(os.homedir(), '.cache', 'ms-playwright'); const TIMEOUT_MS = 5 * 60 * 1000; // 5分タイムアウト diff --git a/plugins/mcp/kiro/mcp-redash/skills/redash-add/SKILL.md b/plugins/mcp/kiro/mcp-redash/skills/redash-add/SKILL.md index 67b442e..f91167b 100644 --- a/plugins/mcp/kiro/mcp-redash/skills/redash-add/SKILL.md +++ b/plugins/mcp/kiro/mcp-redash/skills/redash-add/SKILL.md @@ -19,7 +19,7 @@ allowed-tools: 以下のコマンドを実行してください。`$ARGUMENTS` にはユーザーが指定した suffix が入ります。 ```bash -node "${CLAUDE_PLUGIN_ROOT}/scripts/redash-mcp-config.js" add $ARGUMENTS +node "${PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}}/scripts/redash-mcp-config.js" add $ARGUMENTS ``` ## 実行後 diff --git a/plugins/mcp/kiro/mcp-redash/skills/redash-list/SKILL.md b/plugins/mcp/kiro/mcp-redash/skills/redash-list/SKILL.md index fe81518..798754e 100644 --- a/plugins/mcp/kiro/mcp-redash/skills/redash-list/SKILL.md +++ b/plugins/mcp/kiro/mcp-redash/skills/redash-list/SKILL.md @@ -16,7 +16,7 @@ allowed-tools: 以下のコマンドを実行してください。 ```bash -node "${CLAUDE_PLUGIN_ROOT}/scripts/redash-mcp-config.js" list +node "${PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}}/scripts/redash-mcp-config.js" list ``` ## 実行後 diff --git a/plugins/mcp/kiro/mcp-redash/skills/redash-remove/SKILL.md b/plugins/mcp/kiro/mcp-redash/skills/redash-remove/SKILL.md index 31a6270..93d8a10 100644 --- a/plugins/mcp/kiro/mcp-redash/skills/redash-remove/SKILL.md +++ b/plugins/mcp/kiro/mcp-redash/skills/redash-remove/SKILL.md @@ -19,7 +19,7 @@ allowed-tools: 以下のコマンドを実行してください。`$ARGUMENTS` にはユーザーが指定した suffix が入ります。 ```bash -node "${CLAUDE_PLUGIN_ROOT}/scripts/redash-mcp-config.js" remove $ARGUMENTS +node "${PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}}/scripts/redash-mcp-config.js" remove $ARGUMENTS ``` ## 実行後 diff --git a/plugins/mcp/kiro/mcp-redash/skills/redash-status/SKILL.md b/plugins/mcp/kiro/mcp-redash/skills/redash-status/SKILL.md index 2b1f909..45a4034 100644 --- a/plugins/mcp/kiro/mcp-redash/skills/redash-status/SKILL.md +++ b/plugins/mcp/kiro/mcp-redash/skills/redash-status/SKILL.md @@ -16,7 +16,7 @@ Redash MCP の設定状況を詳細表示します。各 MCP が必要とする 以下のコマンドを実行してください。 ```bash -node "${CLAUDE_PLUGIN_ROOT}/scripts/redash-mcp-config.js" status +node "${PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}}/scripts/redash-mcp-config.js" status ``` ## 実行後 diff --git a/plugins/mcp/shared/mcp-playwright/hooks/hooks.json b/plugins/mcp/shared/mcp-playwright/hooks/hooks.json index 7b163ae..5e7d5ca 100644 --- a/plugins/mcp/shared/mcp-playwright/hooks/hooks.json +++ b/plugins/mcp/shared/mcp-playwright/hooks/hooks.json @@ -10,7 +10,7 @@ "hooks": [ { "type": "command", - "command": "node ${CLAUDE_PLUGIN_ROOT}/scripts/ensure-playwright.js", + "command": "node ${PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}}/scripts/ensure-playwright.js", "description": "Auto-install Playwright chromium on first use", "continueOnError": false, "suppressOutput": false diff --git a/plugins/mcp/shared/mcp-playwright/scripts/ensure-playwright.js b/plugins/mcp/shared/mcp-playwright/scripts/ensure-playwright.js index 1a4c98d..57f602b 100755 --- a/plugins/mcp/shared/mcp-playwright/scripts/ensure-playwright.js +++ b/plugins/mcp/shared/mcp-playwright/scripts/ensure-playwright.js @@ -5,7 +5,7 @@ const fs = require('fs'); const path = require('path'); const os = require('os'); -const PLUGIN_ROOT = process.env.CLAUDE_PLUGIN_ROOT || __dirname; +const PLUGIN_ROOT = process.env.PLUGIN_ROOT || process.env.CODEX_PLUGIN_ROOT || process.env.CLAUDE_PLUGIN_ROOT || __dirname; const FLAG_FILE = path.join(os.homedir(), '.claude-playwright-installed'); const BROWSER_PATH = path.join(os.homedir(), '.cache', 'ms-playwright'); const TIMEOUT_MS = 5 * 60 * 1000; // 5分タイムアウト diff --git a/plugins/mcp/shared/mcp-redash/skills/redash-add/SKILL.md b/plugins/mcp/shared/mcp-redash/skills/redash-add/SKILL.md index 67b442e..f91167b 100644 --- a/plugins/mcp/shared/mcp-redash/skills/redash-add/SKILL.md +++ b/plugins/mcp/shared/mcp-redash/skills/redash-add/SKILL.md @@ -19,7 +19,7 @@ allowed-tools: 以下のコマンドを実行してください。`$ARGUMENTS` にはユーザーが指定した suffix が入ります。 ```bash -node "${CLAUDE_PLUGIN_ROOT}/scripts/redash-mcp-config.js" add $ARGUMENTS +node "${PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}}/scripts/redash-mcp-config.js" add $ARGUMENTS ``` ## 実行後 diff --git a/plugins/mcp/shared/mcp-redash/skills/redash-list/SKILL.md b/plugins/mcp/shared/mcp-redash/skills/redash-list/SKILL.md index fe81518..798754e 100644 --- a/plugins/mcp/shared/mcp-redash/skills/redash-list/SKILL.md +++ b/plugins/mcp/shared/mcp-redash/skills/redash-list/SKILL.md @@ -16,7 +16,7 @@ allowed-tools: 以下のコマンドを実行してください。 ```bash -node "${CLAUDE_PLUGIN_ROOT}/scripts/redash-mcp-config.js" list +node "${PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}}/scripts/redash-mcp-config.js" list ``` ## 実行後 diff --git a/plugins/mcp/shared/mcp-redash/skills/redash-remove/SKILL.md b/plugins/mcp/shared/mcp-redash/skills/redash-remove/SKILL.md index 31a6270..93d8a10 100644 --- a/plugins/mcp/shared/mcp-redash/skills/redash-remove/SKILL.md +++ b/plugins/mcp/shared/mcp-redash/skills/redash-remove/SKILL.md @@ -19,7 +19,7 @@ allowed-tools: 以下のコマンドを実行してください。`$ARGUMENTS` にはユーザーが指定した suffix が入ります。 ```bash -node "${CLAUDE_PLUGIN_ROOT}/scripts/redash-mcp-config.js" remove $ARGUMENTS +node "${PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}}/scripts/redash-mcp-config.js" remove $ARGUMENTS ``` ## 実行後 diff --git a/plugins/mcp/shared/mcp-redash/skills/redash-status/SKILL.md b/plugins/mcp/shared/mcp-redash/skills/redash-status/SKILL.md index 2b1f909..45a4034 100644 --- a/plugins/mcp/shared/mcp-redash/skills/redash-status/SKILL.md +++ b/plugins/mcp/shared/mcp-redash/skills/redash-status/SKILL.md @@ -16,7 +16,7 @@ Redash MCP の設定状況を詳細表示します。各 MCP が必要とする 以下のコマンドを実行してください。 ```bash -node "${CLAUDE_PLUGIN_ROOT}/scripts/redash-mcp-config.js" status +node "${PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}}/scripts/redash-mcp-config.js" status ``` ## 実行後 diff --git a/scripts/build-runtime-plugins.sh b/scripts/build-runtime-plugins.sh index e50d6b6..4148685 100755 --- a/scripts/build-runtime-plugins.sh +++ b/scripts/build-runtime-plugins.sh @@ -240,28 +240,31 @@ write_codex_mcp_manifest() { local plugin_dir="$1" local claude_manifest="$plugin_dir/.claude-plugin/plugin.json" local codex_manifest="$plugin_dir/.codex-plugin/plugin.json" - local name version description keywords if [ ! -f "$claude_manifest" ]; then echo "ERROR: Claude manifest not found: $claude_manifest" >&2 exit 1 fi - name="$(python3 -c 'import json,sys; print(json.load(open(sys.argv[1]))["name"])' "$claude_manifest")" - version="$(python3 -c 'import json,sys; print(json.load(open(sys.argv[1])).get("version","1.0.0"))' "$claude_manifest")" - description="$(python3 -c 'import json,sys; print(json.load(open(sys.argv[1])).get("description",""))' "$claude_manifest")" - keywords="$(python3 -c 'import json,sys; print(json.dumps(json.load(open(sys.argv[1])).get("keywords", []), ensure_ascii=False))' "$claude_manifest")" - mkdir -p "$(dirname "$codex_manifest")" - cat > "$codex_manifest" < Date: Tue, 7 Jul 2026 04:20:26 +0000 Subject: [PATCH 05/10] =?UTF-8?q?Fix:=20Kiro=20MCP=20runtime=E7=94=9F?= =?UTF-8?q?=E6=88=90=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/mcp/kiro/mcp-aws-docs/install.sh | 82 +++++++++++- plugins/mcp/kiro/mcp-bigquery/install.sh | 82 +++++++++++- .../mcp/kiro/mcp-chrome-devtools/install.sh | 82 +++++++++++- plugins/mcp/kiro/mcp-dbhub/install.sh | 82 +++++++++++- plugins/mcp/kiro/mcp-devin/install.sh | 82 +++++++++++- plugins/mcp/kiro/mcp-markitdown/install.sh | 82 +++++++++++- plugins/mcp/kiro/mcp-notion/install.sh | 82 +++++++++++- .../mcp/kiro/mcp-playwright/hooks/hooks.json | 2 +- plugins/mcp/kiro/mcp-playwright/install.sh | 82 +++++++++++- plugins/mcp/kiro/mcp-redash/install.sh | 82 +++++++++++- .../mcp-redash/skills/redash-add/SKILL.md | 2 +- .../mcp-redash/skills/redash-list/SKILL.md | 2 +- .../mcp-redash/skills/redash-remove/SKILL.md | 2 +- .../mcp-redash/skills/redash-status/SKILL.md | 2 +- plugins/mcp/kiro/mcp-serena/install.sh | 82 +++++++++++- scripts/build-runtime-plugins.sh | 122 +++++++++++++++++- 16 files changed, 924 insertions(+), 28 deletions(-) diff --git a/plugins/mcp/kiro/mcp-aws-docs/install.sh b/plugins/mcp/kiro/mcp-aws-docs/install.sh index af3c956..a364724 100755 --- a/plugins/mcp/kiro/mcp-aws-docs/install.sh +++ b/plugins/mcp/kiro/mcp-aws-docs/install.sh @@ -2,16 +2,23 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +PLUGIN_NAME="$(basename "$SCRIPT_DIR")" PROJECT_ROOT="$(pwd)" +KIRO_DIR="$PROJECT_ROOT/.kiro" +KIRO_AGENT_FILE="$KIRO_DIR/agents/default.json" +KIRO_PLUGIN_LINK="$KIRO_DIR/plugins/$PLUGIN_NAME" +KIRO_SKILLS_DIR="$KIRO_DIR/skills" TARGET_MCP="$PROJECT_ROOT/.mcp.json" SOURCE_MCP="$SCRIPT_DIR/.mcp.json" +SOURCE_HOOKS="$SCRIPT_DIR/hooks/hooks.json" +SOURCE_SKILLS="$SCRIPT_DIR/skills" DRY_RUN=false usage() { cat <<'USAGE' Usage: bash install.sh [--dry-run] -Install this MCP plugin into the current project's .mcp.json. +Install this MCP plugin into the current project's Kiro settings. USAGE } @@ -31,22 +38,93 @@ fi if [ "$DRY_RUN" = true ]; then echo "Would merge $SOURCE_MCP into $TARGET_MCP" + echo "Would link plugin runtime into $KIRO_PLUGIN_LINK" + if [ -d "$SOURCE_SKILLS" ]; then + echo "Would link skills from $SOURCE_SKILLS into $KIRO_SKILLS_DIR" + fi + if [ -f "$SOURCE_HOOKS" ]; then + echo "Would merge hooks from $SOURCE_HOOKS into $KIRO_AGENT_FILE" + fi exit 0 fi -python3 - "$SOURCE_MCP" "$TARGET_MCP" <<'PY' +mkdir -p "$KIRO_DIR/plugins" "$KIRO_SKILLS_DIR" "$(dirname "$KIRO_AGENT_FILE")" +if [ -e "$KIRO_PLUGIN_LINK" ] && [ ! -L "$KIRO_PLUGIN_LINK" ]; then + echo "ERROR: $KIRO_PLUGIN_LINK already exists and is not a symlink" >&2 + exit 1 +fi +ln -sfn "../../plugins/mcp/kiro/$PLUGIN_NAME" "$KIRO_PLUGIN_LINK" + +if [ -d "$SOURCE_SKILLS" ]; then + find "$SOURCE_SKILLS" -mindepth 1 -maxdepth 1 -type d | sort | while IFS= read -r skill_dir; do + skill_name="$(basename "$skill_dir")" + skill_link="$KIRO_SKILLS_DIR/$skill_name" + [ -f "$skill_dir/SKILL.md" ] || continue + if [ -e "$skill_link" ] && [ ! -L "$skill_link" ]; then + echo "ERROR: $skill_link already exists and is not a symlink" >&2 + exit 1 + fi + ln -sfn "../plugins/$PLUGIN_NAME/skills/$skill_name" "$skill_link" + echo "Linked Kiro skill: $skill_name" + done +fi + +python3 - "$SOURCE_MCP" "$TARGET_MCP" "$SOURCE_HOOKS" "$KIRO_AGENT_FILE" <<'PY' import json import sys from pathlib import Path source_path = Path(sys.argv[1]) target_path = Path(sys.argv[2]) +hooks_path = Path(sys.argv[3]) +agent_path = Path(sys.argv[4]) source = json.loads(source_path.read_text()) target = json.loads(target_path.read_text()) if target_path.exists() else {} source_servers = source.get("mcpServers", {}) target.setdefault("mcpServers", {}) target["mcpServers"].update(source_servers) target_path.write_text(json.dumps(target, indent=2, ensure_ascii=False) + "\n") + +if agent_path.exists(): + agent = json.loads(agent_path.read_text()) +else: + agent = { + "name": "default", + "resources": ["skill://.kiro/skills/**/SKILL.md"], + } + +agent.setdefault("mcpServers", {}) +agent["mcpServers"].update(source_servers) + +if hooks_path.exists(): + source_hooks = json.loads(hooks_path.read_text()).get("hooks", {}) + target_hooks = agent.setdefault("hooks", {}) + event_map = { + "SessionStart": "agentSpawn", + "Stop": "stop", + } + for source_event, groups in source_hooks.items(): + target_event = event_map.get(source_event, source_event) + target_list = target_hooks.setdefault(target_event, []) + existing = { + entry.get("command") + for entry in target_list + if isinstance(entry, dict) + } + for group in groups: + for hook in group.get("hooks", []): + command = hook.get("command") + if not command or command in existing: + continue + entry = {"command": command} + if "timeout_ms" in hook: + entry["timeout_ms"] = hook["timeout_ms"] + target_list.append(entry) + existing.add(command) + +agent_path.write_text(json.dumps(agent, indent=2, ensure_ascii=False) + "\n") + print(f"Installed MCP servers: {', '.join(sorted(source_servers))}") print(f"Updated: {target_path}") +print(f"Updated: {agent_path}") PY diff --git a/plugins/mcp/kiro/mcp-bigquery/install.sh b/plugins/mcp/kiro/mcp-bigquery/install.sh index af3c956..a364724 100755 --- a/plugins/mcp/kiro/mcp-bigquery/install.sh +++ b/plugins/mcp/kiro/mcp-bigquery/install.sh @@ -2,16 +2,23 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +PLUGIN_NAME="$(basename "$SCRIPT_DIR")" PROJECT_ROOT="$(pwd)" +KIRO_DIR="$PROJECT_ROOT/.kiro" +KIRO_AGENT_FILE="$KIRO_DIR/agents/default.json" +KIRO_PLUGIN_LINK="$KIRO_DIR/plugins/$PLUGIN_NAME" +KIRO_SKILLS_DIR="$KIRO_DIR/skills" TARGET_MCP="$PROJECT_ROOT/.mcp.json" SOURCE_MCP="$SCRIPT_DIR/.mcp.json" +SOURCE_HOOKS="$SCRIPT_DIR/hooks/hooks.json" +SOURCE_SKILLS="$SCRIPT_DIR/skills" DRY_RUN=false usage() { cat <<'USAGE' Usage: bash install.sh [--dry-run] -Install this MCP plugin into the current project's .mcp.json. +Install this MCP plugin into the current project's Kiro settings. USAGE } @@ -31,22 +38,93 @@ fi if [ "$DRY_RUN" = true ]; then echo "Would merge $SOURCE_MCP into $TARGET_MCP" + echo "Would link plugin runtime into $KIRO_PLUGIN_LINK" + if [ -d "$SOURCE_SKILLS" ]; then + echo "Would link skills from $SOURCE_SKILLS into $KIRO_SKILLS_DIR" + fi + if [ -f "$SOURCE_HOOKS" ]; then + echo "Would merge hooks from $SOURCE_HOOKS into $KIRO_AGENT_FILE" + fi exit 0 fi -python3 - "$SOURCE_MCP" "$TARGET_MCP" <<'PY' +mkdir -p "$KIRO_DIR/plugins" "$KIRO_SKILLS_DIR" "$(dirname "$KIRO_AGENT_FILE")" +if [ -e "$KIRO_PLUGIN_LINK" ] && [ ! -L "$KIRO_PLUGIN_LINK" ]; then + echo "ERROR: $KIRO_PLUGIN_LINK already exists and is not a symlink" >&2 + exit 1 +fi +ln -sfn "../../plugins/mcp/kiro/$PLUGIN_NAME" "$KIRO_PLUGIN_LINK" + +if [ -d "$SOURCE_SKILLS" ]; then + find "$SOURCE_SKILLS" -mindepth 1 -maxdepth 1 -type d | sort | while IFS= read -r skill_dir; do + skill_name="$(basename "$skill_dir")" + skill_link="$KIRO_SKILLS_DIR/$skill_name" + [ -f "$skill_dir/SKILL.md" ] || continue + if [ -e "$skill_link" ] && [ ! -L "$skill_link" ]; then + echo "ERROR: $skill_link already exists and is not a symlink" >&2 + exit 1 + fi + ln -sfn "../plugins/$PLUGIN_NAME/skills/$skill_name" "$skill_link" + echo "Linked Kiro skill: $skill_name" + done +fi + +python3 - "$SOURCE_MCP" "$TARGET_MCP" "$SOURCE_HOOKS" "$KIRO_AGENT_FILE" <<'PY' import json import sys from pathlib import Path source_path = Path(sys.argv[1]) target_path = Path(sys.argv[2]) +hooks_path = Path(sys.argv[3]) +agent_path = Path(sys.argv[4]) source = json.loads(source_path.read_text()) target = json.loads(target_path.read_text()) if target_path.exists() else {} source_servers = source.get("mcpServers", {}) target.setdefault("mcpServers", {}) target["mcpServers"].update(source_servers) target_path.write_text(json.dumps(target, indent=2, ensure_ascii=False) + "\n") + +if agent_path.exists(): + agent = json.loads(agent_path.read_text()) +else: + agent = { + "name": "default", + "resources": ["skill://.kiro/skills/**/SKILL.md"], + } + +agent.setdefault("mcpServers", {}) +agent["mcpServers"].update(source_servers) + +if hooks_path.exists(): + source_hooks = json.loads(hooks_path.read_text()).get("hooks", {}) + target_hooks = agent.setdefault("hooks", {}) + event_map = { + "SessionStart": "agentSpawn", + "Stop": "stop", + } + for source_event, groups in source_hooks.items(): + target_event = event_map.get(source_event, source_event) + target_list = target_hooks.setdefault(target_event, []) + existing = { + entry.get("command") + for entry in target_list + if isinstance(entry, dict) + } + for group in groups: + for hook in group.get("hooks", []): + command = hook.get("command") + if not command or command in existing: + continue + entry = {"command": command} + if "timeout_ms" in hook: + entry["timeout_ms"] = hook["timeout_ms"] + target_list.append(entry) + existing.add(command) + +agent_path.write_text(json.dumps(agent, indent=2, ensure_ascii=False) + "\n") + print(f"Installed MCP servers: {', '.join(sorted(source_servers))}") print(f"Updated: {target_path}") +print(f"Updated: {agent_path}") PY diff --git a/plugins/mcp/kiro/mcp-chrome-devtools/install.sh b/plugins/mcp/kiro/mcp-chrome-devtools/install.sh index af3c956..a364724 100755 --- a/plugins/mcp/kiro/mcp-chrome-devtools/install.sh +++ b/plugins/mcp/kiro/mcp-chrome-devtools/install.sh @@ -2,16 +2,23 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +PLUGIN_NAME="$(basename "$SCRIPT_DIR")" PROJECT_ROOT="$(pwd)" +KIRO_DIR="$PROJECT_ROOT/.kiro" +KIRO_AGENT_FILE="$KIRO_DIR/agents/default.json" +KIRO_PLUGIN_LINK="$KIRO_DIR/plugins/$PLUGIN_NAME" +KIRO_SKILLS_DIR="$KIRO_DIR/skills" TARGET_MCP="$PROJECT_ROOT/.mcp.json" SOURCE_MCP="$SCRIPT_DIR/.mcp.json" +SOURCE_HOOKS="$SCRIPT_DIR/hooks/hooks.json" +SOURCE_SKILLS="$SCRIPT_DIR/skills" DRY_RUN=false usage() { cat <<'USAGE' Usage: bash install.sh [--dry-run] -Install this MCP plugin into the current project's .mcp.json. +Install this MCP plugin into the current project's Kiro settings. USAGE } @@ -31,22 +38,93 @@ fi if [ "$DRY_RUN" = true ]; then echo "Would merge $SOURCE_MCP into $TARGET_MCP" + echo "Would link plugin runtime into $KIRO_PLUGIN_LINK" + if [ -d "$SOURCE_SKILLS" ]; then + echo "Would link skills from $SOURCE_SKILLS into $KIRO_SKILLS_DIR" + fi + if [ -f "$SOURCE_HOOKS" ]; then + echo "Would merge hooks from $SOURCE_HOOKS into $KIRO_AGENT_FILE" + fi exit 0 fi -python3 - "$SOURCE_MCP" "$TARGET_MCP" <<'PY' +mkdir -p "$KIRO_DIR/plugins" "$KIRO_SKILLS_DIR" "$(dirname "$KIRO_AGENT_FILE")" +if [ -e "$KIRO_PLUGIN_LINK" ] && [ ! -L "$KIRO_PLUGIN_LINK" ]; then + echo "ERROR: $KIRO_PLUGIN_LINK already exists and is not a symlink" >&2 + exit 1 +fi +ln -sfn "../../plugins/mcp/kiro/$PLUGIN_NAME" "$KIRO_PLUGIN_LINK" + +if [ -d "$SOURCE_SKILLS" ]; then + find "$SOURCE_SKILLS" -mindepth 1 -maxdepth 1 -type d | sort | while IFS= read -r skill_dir; do + skill_name="$(basename "$skill_dir")" + skill_link="$KIRO_SKILLS_DIR/$skill_name" + [ -f "$skill_dir/SKILL.md" ] || continue + if [ -e "$skill_link" ] && [ ! -L "$skill_link" ]; then + echo "ERROR: $skill_link already exists and is not a symlink" >&2 + exit 1 + fi + ln -sfn "../plugins/$PLUGIN_NAME/skills/$skill_name" "$skill_link" + echo "Linked Kiro skill: $skill_name" + done +fi + +python3 - "$SOURCE_MCP" "$TARGET_MCP" "$SOURCE_HOOKS" "$KIRO_AGENT_FILE" <<'PY' import json import sys from pathlib import Path source_path = Path(sys.argv[1]) target_path = Path(sys.argv[2]) +hooks_path = Path(sys.argv[3]) +agent_path = Path(sys.argv[4]) source = json.loads(source_path.read_text()) target = json.loads(target_path.read_text()) if target_path.exists() else {} source_servers = source.get("mcpServers", {}) target.setdefault("mcpServers", {}) target["mcpServers"].update(source_servers) target_path.write_text(json.dumps(target, indent=2, ensure_ascii=False) + "\n") + +if agent_path.exists(): + agent = json.loads(agent_path.read_text()) +else: + agent = { + "name": "default", + "resources": ["skill://.kiro/skills/**/SKILL.md"], + } + +agent.setdefault("mcpServers", {}) +agent["mcpServers"].update(source_servers) + +if hooks_path.exists(): + source_hooks = json.loads(hooks_path.read_text()).get("hooks", {}) + target_hooks = agent.setdefault("hooks", {}) + event_map = { + "SessionStart": "agentSpawn", + "Stop": "stop", + } + for source_event, groups in source_hooks.items(): + target_event = event_map.get(source_event, source_event) + target_list = target_hooks.setdefault(target_event, []) + existing = { + entry.get("command") + for entry in target_list + if isinstance(entry, dict) + } + for group in groups: + for hook in group.get("hooks", []): + command = hook.get("command") + if not command or command in existing: + continue + entry = {"command": command} + if "timeout_ms" in hook: + entry["timeout_ms"] = hook["timeout_ms"] + target_list.append(entry) + existing.add(command) + +agent_path.write_text(json.dumps(agent, indent=2, ensure_ascii=False) + "\n") + print(f"Installed MCP servers: {', '.join(sorted(source_servers))}") print(f"Updated: {target_path}") +print(f"Updated: {agent_path}") PY diff --git a/plugins/mcp/kiro/mcp-dbhub/install.sh b/plugins/mcp/kiro/mcp-dbhub/install.sh index af3c956..a364724 100755 --- a/plugins/mcp/kiro/mcp-dbhub/install.sh +++ b/plugins/mcp/kiro/mcp-dbhub/install.sh @@ -2,16 +2,23 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +PLUGIN_NAME="$(basename "$SCRIPT_DIR")" PROJECT_ROOT="$(pwd)" +KIRO_DIR="$PROJECT_ROOT/.kiro" +KIRO_AGENT_FILE="$KIRO_DIR/agents/default.json" +KIRO_PLUGIN_LINK="$KIRO_DIR/plugins/$PLUGIN_NAME" +KIRO_SKILLS_DIR="$KIRO_DIR/skills" TARGET_MCP="$PROJECT_ROOT/.mcp.json" SOURCE_MCP="$SCRIPT_DIR/.mcp.json" +SOURCE_HOOKS="$SCRIPT_DIR/hooks/hooks.json" +SOURCE_SKILLS="$SCRIPT_DIR/skills" DRY_RUN=false usage() { cat <<'USAGE' Usage: bash install.sh [--dry-run] -Install this MCP plugin into the current project's .mcp.json. +Install this MCP plugin into the current project's Kiro settings. USAGE } @@ -31,22 +38,93 @@ fi if [ "$DRY_RUN" = true ]; then echo "Would merge $SOURCE_MCP into $TARGET_MCP" + echo "Would link plugin runtime into $KIRO_PLUGIN_LINK" + if [ -d "$SOURCE_SKILLS" ]; then + echo "Would link skills from $SOURCE_SKILLS into $KIRO_SKILLS_DIR" + fi + if [ -f "$SOURCE_HOOKS" ]; then + echo "Would merge hooks from $SOURCE_HOOKS into $KIRO_AGENT_FILE" + fi exit 0 fi -python3 - "$SOURCE_MCP" "$TARGET_MCP" <<'PY' +mkdir -p "$KIRO_DIR/plugins" "$KIRO_SKILLS_DIR" "$(dirname "$KIRO_AGENT_FILE")" +if [ -e "$KIRO_PLUGIN_LINK" ] && [ ! -L "$KIRO_PLUGIN_LINK" ]; then + echo "ERROR: $KIRO_PLUGIN_LINK already exists and is not a symlink" >&2 + exit 1 +fi +ln -sfn "../../plugins/mcp/kiro/$PLUGIN_NAME" "$KIRO_PLUGIN_LINK" + +if [ -d "$SOURCE_SKILLS" ]; then + find "$SOURCE_SKILLS" -mindepth 1 -maxdepth 1 -type d | sort | while IFS= read -r skill_dir; do + skill_name="$(basename "$skill_dir")" + skill_link="$KIRO_SKILLS_DIR/$skill_name" + [ -f "$skill_dir/SKILL.md" ] || continue + if [ -e "$skill_link" ] && [ ! -L "$skill_link" ]; then + echo "ERROR: $skill_link already exists and is not a symlink" >&2 + exit 1 + fi + ln -sfn "../plugins/$PLUGIN_NAME/skills/$skill_name" "$skill_link" + echo "Linked Kiro skill: $skill_name" + done +fi + +python3 - "$SOURCE_MCP" "$TARGET_MCP" "$SOURCE_HOOKS" "$KIRO_AGENT_FILE" <<'PY' import json import sys from pathlib import Path source_path = Path(sys.argv[1]) target_path = Path(sys.argv[2]) +hooks_path = Path(sys.argv[3]) +agent_path = Path(sys.argv[4]) source = json.loads(source_path.read_text()) target = json.loads(target_path.read_text()) if target_path.exists() else {} source_servers = source.get("mcpServers", {}) target.setdefault("mcpServers", {}) target["mcpServers"].update(source_servers) target_path.write_text(json.dumps(target, indent=2, ensure_ascii=False) + "\n") + +if agent_path.exists(): + agent = json.loads(agent_path.read_text()) +else: + agent = { + "name": "default", + "resources": ["skill://.kiro/skills/**/SKILL.md"], + } + +agent.setdefault("mcpServers", {}) +agent["mcpServers"].update(source_servers) + +if hooks_path.exists(): + source_hooks = json.loads(hooks_path.read_text()).get("hooks", {}) + target_hooks = agent.setdefault("hooks", {}) + event_map = { + "SessionStart": "agentSpawn", + "Stop": "stop", + } + for source_event, groups in source_hooks.items(): + target_event = event_map.get(source_event, source_event) + target_list = target_hooks.setdefault(target_event, []) + existing = { + entry.get("command") + for entry in target_list + if isinstance(entry, dict) + } + for group in groups: + for hook in group.get("hooks", []): + command = hook.get("command") + if not command or command in existing: + continue + entry = {"command": command} + if "timeout_ms" in hook: + entry["timeout_ms"] = hook["timeout_ms"] + target_list.append(entry) + existing.add(command) + +agent_path.write_text(json.dumps(agent, indent=2, ensure_ascii=False) + "\n") + print(f"Installed MCP servers: {', '.join(sorted(source_servers))}") print(f"Updated: {target_path}") +print(f"Updated: {agent_path}") PY diff --git a/plugins/mcp/kiro/mcp-devin/install.sh b/plugins/mcp/kiro/mcp-devin/install.sh index af3c956..a364724 100755 --- a/plugins/mcp/kiro/mcp-devin/install.sh +++ b/plugins/mcp/kiro/mcp-devin/install.sh @@ -2,16 +2,23 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +PLUGIN_NAME="$(basename "$SCRIPT_DIR")" PROJECT_ROOT="$(pwd)" +KIRO_DIR="$PROJECT_ROOT/.kiro" +KIRO_AGENT_FILE="$KIRO_DIR/agents/default.json" +KIRO_PLUGIN_LINK="$KIRO_DIR/plugins/$PLUGIN_NAME" +KIRO_SKILLS_DIR="$KIRO_DIR/skills" TARGET_MCP="$PROJECT_ROOT/.mcp.json" SOURCE_MCP="$SCRIPT_DIR/.mcp.json" +SOURCE_HOOKS="$SCRIPT_DIR/hooks/hooks.json" +SOURCE_SKILLS="$SCRIPT_DIR/skills" DRY_RUN=false usage() { cat <<'USAGE' Usage: bash install.sh [--dry-run] -Install this MCP plugin into the current project's .mcp.json. +Install this MCP plugin into the current project's Kiro settings. USAGE } @@ -31,22 +38,93 @@ fi if [ "$DRY_RUN" = true ]; then echo "Would merge $SOURCE_MCP into $TARGET_MCP" + echo "Would link plugin runtime into $KIRO_PLUGIN_LINK" + if [ -d "$SOURCE_SKILLS" ]; then + echo "Would link skills from $SOURCE_SKILLS into $KIRO_SKILLS_DIR" + fi + if [ -f "$SOURCE_HOOKS" ]; then + echo "Would merge hooks from $SOURCE_HOOKS into $KIRO_AGENT_FILE" + fi exit 0 fi -python3 - "$SOURCE_MCP" "$TARGET_MCP" <<'PY' +mkdir -p "$KIRO_DIR/plugins" "$KIRO_SKILLS_DIR" "$(dirname "$KIRO_AGENT_FILE")" +if [ -e "$KIRO_PLUGIN_LINK" ] && [ ! -L "$KIRO_PLUGIN_LINK" ]; then + echo "ERROR: $KIRO_PLUGIN_LINK already exists and is not a symlink" >&2 + exit 1 +fi +ln -sfn "../../plugins/mcp/kiro/$PLUGIN_NAME" "$KIRO_PLUGIN_LINK" + +if [ -d "$SOURCE_SKILLS" ]; then + find "$SOURCE_SKILLS" -mindepth 1 -maxdepth 1 -type d | sort | while IFS= read -r skill_dir; do + skill_name="$(basename "$skill_dir")" + skill_link="$KIRO_SKILLS_DIR/$skill_name" + [ -f "$skill_dir/SKILL.md" ] || continue + if [ -e "$skill_link" ] && [ ! -L "$skill_link" ]; then + echo "ERROR: $skill_link already exists and is not a symlink" >&2 + exit 1 + fi + ln -sfn "../plugins/$PLUGIN_NAME/skills/$skill_name" "$skill_link" + echo "Linked Kiro skill: $skill_name" + done +fi + +python3 - "$SOURCE_MCP" "$TARGET_MCP" "$SOURCE_HOOKS" "$KIRO_AGENT_FILE" <<'PY' import json import sys from pathlib import Path source_path = Path(sys.argv[1]) target_path = Path(sys.argv[2]) +hooks_path = Path(sys.argv[3]) +agent_path = Path(sys.argv[4]) source = json.loads(source_path.read_text()) target = json.loads(target_path.read_text()) if target_path.exists() else {} source_servers = source.get("mcpServers", {}) target.setdefault("mcpServers", {}) target["mcpServers"].update(source_servers) target_path.write_text(json.dumps(target, indent=2, ensure_ascii=False) + "\n") + +if agent_path.exists(): + agent = json.loads(agent_path.read_text()) +else: + agent = { + "name": "default", + "resources": ["skill://.kiro/skills/**/SKILL.md"], + } + +agent.setdefault("mcpServers", {}) +agent["mcpServers"].update(source_servers) + +if hooks_path.exists(): + source_hooks = json.loads(hooks_path.read_text()).get("hooks", {}) + target_hooks = agent.setdefault("hooks", {}) + event_map = { + "SessionStart": "agentSpawn", + "Stop": "stop", + } + for source_event, groups in source_hooks.items(): + target_event = event_map.get(source_event, source_event) + target_list = target_hooks.setdefault(target_event, []) + existing = { + entry.get("command") + for entry in target_list + if isinstance(entry, dict) + } + for group in groups: + for hook in group.get("hooks", []): + command = hook.get("command") + if not command or command in existing: + continue + entry = {"command": command} + if "timeout_ms" in hook: + entry["timeout_ms"] = hook["timeout_ms"] + target_list.append(entry) + existing.add(command) + +agent_path.write_text(json.dumps(agent, indent=2, ensure_ascii=False) + "\n") + print(f"Installed MCP servers: {', '.join(sorted(source_servers))}") print(f"Updated: {target_path}") +print(f"Updated: {agent_path}") PY diff --git a/plugins/mcp/kiro/mcp-markitdown/install.sh b/plugins/mcp/kiro/mcp-markitdown/install.sh index af3c956..a364724 100755 --- a/plugins/mcp/kiro/mcp-markitdown/install.sh +++ b/plugins/mcp/kiro/mcp-markitdown/install.sh @@ -2,16 +2,23 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +PLUGIN_NAME="$(basename "$SCRIPT_DIR")" PROJECT_ROOT="$(pwd)" +KIRO_DIR="$PROJECT_ROOT/.kiro" +KIRO_AGENT_FILE="$KIRO_DIR/agents/default.json" +KIRO_PLUGIN_LINK="$KIRO_DIR/plugins/$PLUGIN_NAME" +KIRO_SKILLS_DIR="$KIRO_DIR/skills" TARGET_MCP="$PROJECT_ROOT/.mcp.json" SOURCE_MCP="$SCRIPT_DIR/.mcp.json" +SOURCE_HOOKS="$SCRIPT_DIR/hooks/hooks.json" +SOURCE_SKILLS="$SCRIPT_DIR/skills" DRY_RUN=false usage() { cat <<'USAGE' Usage: bash install.sh [--dry-run] -Install this MCP plugin into the current project's .mcp.json. +Install this MCP plugin into the current project's Kiro settings. USAGE } @@ -31,22 +38,93 @@ fi if [ "$DRY_RUN" = true ]; then echo "Would merge $SOURCE_MCP into $TARGET_MCP" + echo "Would link plugin runtime into $KIRO_PLUGIN_LINK" + if [ -d "$SOURCE_SKILLS" ]; then + echo "Would link skills from $SOURCE_SKILLS into $KIRO_SKILLS_DIR" + fi + if [ -f "$SOURCE_HOOKS" ]; then + echo "Would merge hooks from $SOURCE_HOOKS into $KIRO_AGENT_FILE" + fi exit 0 fi -python3 - "$SOURCE_MCP" "$TARGET_MCP" <<'PY' +mkdir -p "$KIRO_DIR/plugins" "$KIRO_SKILLS_DIR" "$(dirname "$KIRO_AGENT_FILE")" +if [ -e "$KIRO_PLUGIN_LINK" ] && [ ! -L "$KIRO_PLUGIN_LINK" ]; then + echo "ERROR: $KIRO_PLUGIN_LINK already exists and is not a symlink" >&2 + exit 1 +fi +ln -sfn "../../plugins/mcp/kiro/$PLUGIN_NAME" "$KIRO_PLUGIN_LINK" + +if [ -d "$SOURCE_SKILLS" ]; then + find "$SOURCE_SKILLS" -mindepth 1 -maxdepth 1 -type d | sort | while IFS= read -r skill_dir; do + skill_name="$(basename "$skill_dir")" + skill_link="$KIRO_SKILLS_DIR/$skill_name" + [ -f "$skill_dir/SKILL.md" ] || continue + if [ -e "$skill_link" ] && [ ! -L "$skill_link" ]; then + echo "ERROR: $skill_link already exists and is not a symlink" >&2 + exit 1 + fi + ln -sfn "../plugins/$PLUGIN_NAME/skills/$skill_name" "$skill_link" + echo "Linked Kiro skill: $skill_name" + done +fi + +python3 - "$SOURCE_MCP" "$TARGET_MCP" "$SOURCE_HOOKS" "$KIRO_AGENT_FILE" <<'PY' import json import sys from pathlib import Path source_path = Path(sys.argv[1]) target_path = Path(sys.argv[2]) +hooks_path = Path(sys.argv[3]) +agent_path = Path(sys.argv[4]) source = json.loads(source_path.read_text()) target = json.loads(target_path.read_text()) if target_path.exists() else {} source_servers = source.get("mcpServers", {}) target.setdefault("mcpServers", {}) target["mcpServers"].update(source_servers) target_path.write_text(json.dumps(target, indent=2, ensure_ascii=False) + "\n") + +if agent_path.exists(): + agent = json.loads(agent_path.read_text()) +else: + agent = { + "name": "default", + "resources": ["skill://.kiro/skills/**/SKILL.md"], + } + +agent.setdefault("mcpServers", {}) +agent["mcpServers"].update(source_servers) + +if hooks_path.exists(): + source_hooks = json.loads(hooks_path.read_text()).get("hooks", {}) + target_hooks = agent.setdefault("hooks", {}) + event_map = { + "SessionStart": "agentSpawn", + "Stop": "stop", + } + for source_event, groups in source_hooks.items(): + target_event = event_map.get(source_event, source_event) + target_list = target_hooks.setdefault(target_event, []) + existing = { + entry.get("command") + for entry in target_list + if isinstance(entry, dict) + } + for group in groups: + for hook in group.get("hooks", []): + command = hook.get("command") + if not command or command in existing: + continue + entry = {"command": command} + if "timeout_ms" in hook: + entry["timeout_ms"] = hook["timeout_ms"] + target_list.append(entry) + existing.add(command) + +agent_path.write_text(json.dumps(agent, indent=2, ensure_ascii=False) + "\n") + print(f"Installed MCP servers: {', '.join(sorted(source_servers))}") print(f"Updated: {target_path}") +print(f"Updated: {agent_path}") PY diff --git a/plugins/mcp/kiro/mcp-notion/install.sh b/plugins/mcp/kiro/mcp-notion/install.sh index af3c956..a364724 100755 --- a/plugins/mcp/kiro/mcp-notion/install.sh +++ b/plugins/mcp/kiro/mcp-notion/install.sh @@ -2,16 +2,23 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +PLUGIN_NAME="$(basename "$SCRIPT_DIR")" PROJECT_ROOT="$(pwd)" +KIRO_DIR="$PROJECT_ROOT/.kiro" +KIRO_AGENT_FILE="$KIRO_DIR/agents/default.json" +KIRO_PLUGIN_LINK="$KIRO_DIR/plugins/$PLUGIN_NAME" +KIRO_SKILLS_DIR="$KIRO_DIR/skills" TARGET_MCP="$PROJECT_ROOT/.mcp.json" SOURCE_MCP="$SCRIPT_DIR/.mcp.json" +SOURCE_HOOKS="$SCRIPT_DIR/hooks/hooks.json" +SOURCE_SKILLS="$SCRIPT_DIR/skills" DRY_RUN=false usage() { cat <<'USAGE' Usage: bash install.sh [--dry-run] -Install this MCP plugin into the current project's .mcp.json. +Install this MCP plugin into the current project's Kiro settings. USAGE } @@ -31,22 +38,93 @@ fi if [ "$DRY_RUN" = true ]; then echo "Would merge $SOURCE_MCP into $TARGET_MCP" + echo "Would link plugin runtime into $KIRO_PLUGIN_LINK" + if [ -d "$SOURCE_SKILLS" ]; then + echo "Would link skills from $SOURCE_SKILLS into $KIRO_SKILLS_DIR" + fi + if [ -f "$SOURCE_HOOKS" ]; then + echo "Would merge hooks from $SOURCE_HOOKS into $KIRO_AGENT_FILE" + fi exit 0 fi -python3 - "$SOURCE_MCP" "$TARGET_MCP" <<'PY' +mkdir -p "$KIRO_DIR/plugins" "$KIRO_SKILLS_DIR" "$(dirname "$KIRO_AGENT_FILE")" +if [ -e "$KIRO_PLUGIN_LINK" ] && [ ! -L "$KIRO_PLUGIN_LINK" ]; then + echo "ERROR: $KIRO_PLUGIN_LINK already exists and is not a symlink" >&2 + exit 1 +fi +ln -sfn "../../plugins/mcp/kiro/$PLUGIN_NAME" "$KIRO_PLUGIN_LINK" + +if [ -d "$SOURCE_SKILLS" ]; then + find "$SOURCE_SKILLS" -mindepth 1 -maxdepth 1 -type d | sort | while IFS= read -r skill_dir; do + skill_name="$(basename "$skill_dir")" + skill_link="$KIRO_SKILLS_DIR/$skill_name" + [ -f "$skill_dir/SKILL.md" ] || continue + if [ -e "$skill_link" ] && [ ! -L "$skill_link" ]; then + echo "ERROR: $skill_link already exists and is not a symlink" >&2 + exit 1 + fi + ln -sfn "../plugins/$PLUGIN_NAME/skills/$skill_name" "$skill_link" + echo "Linked Kiro skill: $skill_name" + done +fi + +python3 - "$SOURCE_MCP" "$TARGET_MCP" "$SOURCE_HOOKS" "$KIRO_AGENT_FILE" <<'PY' import json import sys from pathlib import Path source_path = Path(sys.argv[1]) target_path = Path(sys.argv[2]) +hooks_path = Path(sys.argv[3]) +agent_path = Path(sys.argv[4]) source = json.loads(source_path.read_text()) target = json.loads(target_path.read_text()) if target_path.exists() else {} source_servers = source.get("mcpServers", {}) target.setdefault("mcpServers", {}) target["mcpServers"].update(source_servers) target_path.write_text(json.dumps(target, indent=2, ensure_ascii=False) + "\n") + +if agent_path.exists(): + agent = json.loads(agent_path.read_text()) +else: + agent = { + "name": "default", + "resources": ["skill://.kiro/skills/**/SKILL.md"], + } + +agent.setdefault("mcpServers", {}) +agent["mcpServers"].update(source_servers) + +if hooks_path.exists(): + source_hooks = json.loads(hooks_path.read_text()).get("hooks", {}) + target_hooks = agent.setdefault("hooks", {}) + event_map = { + "SessionStart": "agentSpawn", + "Stop": "stop", + } + for source_event, groups in source_hooks.items(): + target_event = event_map.get(source_event, source_event) + target_list = target_hooks.setdefault(target_event, []) + existing = { + entry.get("command") + for entry in target_list + if isinstance(entry, dict) + } + for group in groups: + for hook in group.get("hooks", []): + command = hook.get("command") + if not command or command in existing: + continue + entry = {"command": command} + if "timeout_ms" in hook: + entry["timeout_ms"] = hook["timeout_ms"] + target_list.append(entry) + existing.add(command) + +agent_path.write_text(json.dumps(agent, indent=2, ensure_ascii=False) + "\n") + print(f"Installed MCP servers: {', '.join(sorted(source_servers))}") print(f"Updated: {target_path}") +print(f"Updated: {agent_path}") PY diff --git a/plugins/mcp/kiro/mcp-playwright/hooks/hooks.json b/plugins/mcp/kiro/mcp-playwright/hooks/hooks.json index 5e7d5ca..c248d8f 100644 --- a/plugins/mcp/kiro/mcp-playwright/hooks/hooks.json +++ b/plugins/mcp/kiro/mcp-playwright/hooks/hooks.json @@ -10,7 +10,7 @@ "hooks": [ { "type": "command", - "command": "node ${PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}}/scripts/ensure-playwright.js", + "command": "node ${PLUGIN_ROOT:-.kiro/plugins/mcp-playwright}/scripts/ensure-playwright.js", "description": "Auto-install Playwright chromium on first use", "continueOnError": false, "suppressOutput": false diff --git a/plugins/mcp/kiro/mcp-playwright/install.sh b/plugins/mcp/kiro/mcp-playwright/install.sh index af3c956..a364724 100755 --- a/plugins/mcp/kiro/mcp-playwright/install.sh +++ b/plugins/mcp/kiro/mcp-playwright/install.sh @@ -2,16 +2,23 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +PLUGIN_NAME="$(basename "$SCRIPT_DIR")" PROJECT_ROOT="$(pwd)" +KIRO_DIR="$PROJECT_ROOT/.kiro" +KIRO_AGENT_FILE="$KIRO_DIR/agents/default.json" +KIRO_PLUGIN_LINK="$KIRO_DIR/plugins/$PLUGIN_NAME" +KIRO_SKILLS_DIR="$KIRO_DIR/skills" TARGET_MCP="$PROJECT_ROOT/.mcp.json" SOURCE_MCP="$SCRIPT_DIR/.mcp.json" +SOURCE_HOOKS="$SCRIPT_DIR/hooks/hooks.json" +SOURCE_SKILLS="$SCRIPT_DIR/skills" DRY_RUN=false usage() { cat <<'USAGE' Usage: bash install.sh [--dry-run] -Install this MCP plugin into the current project's .mcp.json. +Install this MCP plugin into the current project's Kiro settings. USAGE } @@ -31,22 +38,93 @@ fi if [ "$DRY_RUN" = true ]; then echo "Would merge $SOURCE_MCP into $TARGET_MCP" + echo "Would link plugin runtime into $KIRO_PLUGIN_LINK" + if [ -d "$SOURCE_SKILLS" ]; then + echo "Would link skills from $SOURCE_SKILLS into $KIRO_SKILLS_DIR" + fi + if [ -f "$SOURCE_HOOKS" ]; then + echo "Would merge hooks from $SOURCE_HOOKS into $KIRO_AGENT_FILE" + fi exit 0 fi -python3 - "$SOURCE_MCP" "$TARGET_MCP" <<'PY' +mkdir -p "$KIRO_DIR/plugins" "$KIRO_SKILLS_DIR" "$(dirname "$KIRO_AGENT_FILE")" +if [ -e "$KIRO_PLUGIN_LINK" ] && [ ! -L "$KIRO_PLUGIN_LINK" ]; then + echo "ERROR: $KIRO_PLUGIN_LINK already exists and is not a symlink" >&2 + exit 1 +fi +ln -sfn "../../plugins/mcp/kiro/$PLUGIN_NAME" "$KIRO_PLUGIN_LINK" + +if [ -d "$SOURCE_SKILLS" ]; then + find "$SOURCE_SKILLS" -mindepth 1 -maxdepth 1 -type d | sort | while IFS= read -r skill_dir; do + skill_name="$(basename "$skill_dir")" + skill_link="$KIRO_SKILLS_DIR/$skill_name" + [ -f "$skill_dir/SKILL.md" ] || continue + if [ -e "$skill_link" ] && [ ! -L "$skill_link" ]; then + echo "ERROR: $skill_link already exists and is not a symlink" >&2 + exit 1 + fi + ln -sfn "../plugins/$PLUGIN_NAME/skills/$skill_name" "$skill_link" + echo "Linked Kiro skill: $skill_name" + done +fi + +python3 - "$SOURCE_MCP" "$TARGET_MCP" "$SOURCE_HOOKS" "$KIRO_AGENT_FILE" <<'PY' import json import sys from pathlib import Path source_path = Path(sys.argv[1]) target_path = Path(sys.argv[2]) +hooks_path = Path(sys.argv[3]) +agent_path = Path(sys.argv[4]) source = json.loads(source_path.read_text()) target = json.loads(target_path.read_text()) if target_path.exists() else {} source_servers = source.get("mcpServers", {}) target.setdefault("mcpServers", {}) target["mcpServers"].update(source_servers) target_path.write_text(json.dumps(target, indent=2, ensure_ascii=False) + "\n") + +if agent_path.exists(): + agent = json.loads(agent_path.read_text()) +else: + agent = { + "name": "default", + "resources": ["skill://.kiro/skills/**/SKILL.md"], + } + +agent.setdefault("mcpServers", {}) +agent["mcpServers"].update(source_servers) + +if hooks_path.exists(): + source_hooks = json.loads(hooks_path.read_text()).get("hooks", {}) + target_hooks = agent.setdefault("hooks", {}) + event_map = { + "SessionStart": "agentSpawn", + "Stop": "stop", + } + for source_event, groups in source_hooks.items(): + target_event = event_map.get(source_event, source_event) + target_list = target_hooks.setdefault(target_event, []) + existing = { + entry.get("command") + for entry in target_list + if isinstance(entry, dict) + } + for group in groups: + for hook in group.get("hooks", []): + command = hook.get("command") + if not command or command in existing: + continue + entry = {"command": command} + if "timeout_ms" in hook: + entry["timeout_ms"] = hook["timeout_ms"] + target_list.append(entry) + existing.add(command) + +agent_path.write_text(json.dumps(agent, indent=2, ensure_ascii=False) + "\n") + print(f"Installed MCP servers: {', '.join(sorted(source_servers))}") print(f"Updated: {target_path}") +print(f"Updated: {agent_path}") PY diff --git a/plugins/mcp/kiro/mcp-redash/install.sh b/plugins/mcp/kiro/mcp-redash/install.sh index af3c956..a364724 100755 --- a/plugins/mcp/kiro/mcp-redash/install.sh +++ b/plugins/mcp/kiro/mcp-redash/install.sh @@ -2,16 +2,23 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +PLUGIN_NAME="$(basename "$SCRIPT_DIR")" PROJECT_ROOT="$(pwd)" +KIRO_DIR="$PROJECT_ROOT/.kiro" +KIRO_AGENT_FILE="$KIRO_DIR/agents/default.json" +KIRO_PLUGIN_LINK="$KIRO_DIR/plugins/$PLUGIN_NAME" +KIRO_SKILLS_DIR="$KIRO_DIR/skills" TARGET_MCP="$PROJECT_ROOT/.mcp.json" SOURCE_MCP="$SCRIPT_DIR/.mcp.json" +SOURCE_HOOKS="$SCRIPT_DIR/hooks/hooks.json" +SOURCE_SKILLS="$SCRIPT_DIR/skills" DRY_RUN=false usage() { cat <<'USAGE' Usage: bash install.sh [--dry-run] -Install this MCP plugin into the current project's .mcp.json. +Install this MCP plugin into the current project's Kiro settings. USAGE } @@ -31,22 +38,93 @@ fi if [ "$DRY_RUN" = true ]; then echo "Would merge $SOURCE_MCP into $TARGET_MCP" + echo "Would link plugin runtime into $KIRO_PLUGIN_LINK" + if [ -d "$SOURCE_SKILLS" ]; then + echo "Would link skills from $SOURCE_SKILLS into $KIRO_SKILLS_DIR" + fi + if [ -f "$SOURCE_HOOKS" ]; then + echo "Would merge hooks from $SOURCE_HOOKS into $KIRO_AGENT_FILE" + fi exit 0 fi -python3 - "$SOURCE_MCP" "$TARGET_MCP" <<'PY' +mkdir -p "$KIRO_DIR/plugins" "$KIRO_SKILLS_DIR" "$(dirname "$KIRO_AGENT_FILE")" +if [ -e "$KIRO_PLUGIN_LINK" ] && [ ! -L "$KIRO_PLUGIN_LINK" ]; then + echo "ERROR: $KIRO_PLUGIN_LINK already exists and is not a symlink" >&2 + exit 1 +fi +ln -sfn "../../plugins/mcp/kiro/$PLUGIN_NAME" "$KIRO_PLUGIN_LINK" + +if [ -d "$SOURCE_SKILLS" ]; then + find "$SOURCE_SKILLS" -mindepth 1 -maxdepth 1 -type d | sort | while IFS= read -r skill_dir; do + skill_name="$(basename "$skill_dir")" + skill_link="$KIRO_SKILLS_DIR/$skill_name" + [ -f "$skill_dir/SKILL.md" ] || continue + if [ -e "$skill_link" ] && [ ! -L "$skill_link" ]; then + echo "ERROR: $skill_link already exists and is not a symlink" >&2 + exit 1 + fi + ln -sfn "../plugins/$PLUGIN_NAME/skills/$skill_name" "$skill_link" + echo "Linked Kiro skill: $skill_name" + done +fi + +python3 - "$SOURCE_MCP" "$TARGET_MCP" "$SOURCE_HOOKS" "$KIRO_AGENT_FILE" <<'PY' import json import sys from pathlib import Path source_path = Path(sys.argv[1]) target_path = Path(sys.argv[2]) +hooks_path = Path(sys.argv[3]) +agent_path = Path(sys.argv[4]) source = json.loads(source_path.read_text()) target = json.loads(target_path.read_text()) if target_path.exists() else {} source_servers = source.get("mcpServers", {}) target.setdefault("mcpServers", {}) target["mcpServers"].update(source_servers) target_path.write_text(json.dumps(target, indent=2, ensure_ascii=False) + "\n") + +if agent_path.exists(): + agent = json.loads(agent_path.read_text()) +else: + agent = { + "name": "default", + "resources": ["skill://.kiro/skills/**/SKILL.md"], + } + +agent.setdefault("mcpServers", {}) +agent["mcpServers"].update(source_servers) + +if hooks_path.exists(): + source_hooks = json.loads(hooks_path.read_text()).get("hooks", {}) + target_hooks = agent.setdefault("hooks", {}) + event_map = { + "SessionStart": "agentSpawn", + "Stop": "stop", + } + for source_event, groups in source_hooks.items(): + target_event = event_map.get(source_event, source_event) + target_list = target_hooks.setdefault(target_event, []) + existing = { + entry.get("command") + for entry in target_list + if isinstance(entry, dict) + } + for group in groups: + for hook in group.get("hooks", []): + command = hook.get("command") + if not command or command in existing: + continue + entry = {"command": command} + if "timeout_ms" in hook: + entry["timeout_ms"] = hook["timeout_ms"] + target_list.append(entry) + existing.add(command) + +agent_path.write_text(json.dumps(agent, indent=2, ensure_ascii=False) + "\n") + print(f"Installed MCP servers: {', '.join(sorted(source_servers))}") print(f"Updated: {target_path}") +print(f"Updated: {agent_path}") PY diff --git a/plugins/mcp/kiro/mcp-redash/skills/redash-add/SKILL.md b/plugins/mcp/kiro/mcp-redash/skills/redash-add/SKILL.md index f91167b..2fc8ef7 100644 --- a/plugins/mcp/kiro/mcp-redash/skills/redash-add/SKILL.md +++ b/plugins/mcp/kiro/mcp-redash/skills/redash-add/SKILL.md @@ -19,7 +19,7 @@ allowed-tools: 以下のコマンドを実行してください。`$ARGUMENTS` にはユーザーが指定した suffix が入ります。 ```bash -node "${PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}}/scripts/redash-mcp-config.js" add $ARGUMENTS +node "${PLUGIN_ROOT:-.kiro/plugins/mcp-redash}/scripts/redash-mcp-config.js" add $ARGUMENTS ``` ## 実行後 diff --git a/plugins/mcp/kiro/mcp-redash/skills/redash-list/SKILL.md b/plugins/mcp/kiro/mcp-redash/skills/redash-list/SKILL.md index 798754e..f3be2ff 100644 --- a/plugins/mcp/kiro/mcp-redash/skills/redash-list/SKILL.md +++ b/plugins/mcp/kiro/mcp-redash/skills/redash-list/SKILL.md @@ -16,7 +16,7 @@ allowed-tools: 以下のコマンドを実行してください。 ```bash -node "${PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}}/scripts/redash-mcp-config.js" list +node "${PLUGIN_ROOT:-.kiro/plugins/mcp-redash}/scripts/redash-mcp-config.js" list ``` ## 実行後 diff --git a/plugins/mcp/kiro/mcp-redash/skills/redash-remove/SKILL.md b/plugins/mcp/kiro/mcp-redash/skills/redash-remove/SKILL.md index 93d8a10..0ce9608 100644 --- a/plugins/mcp/kiro/mcp-redash/skills/redash-remove/SKILL.md +++ b/plugins/mcp/kiro/mcp-redash/skills/redash-remove/SKILL.md @@ -19,7 +19,7 @@ allowed-tools: 以下のコマンドを実行してください。`$ARGUMENTS` にはユーザーが指定した suffix が入ります。 ```bash -node "${PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}}/scripts/redash-mcp-config.js" remove $ARGUMENTS +node "${PLUGIN_ROOT:-.kiro/plugins/mcp-redash}/scripts/redash-mcp-config.js" remove $ARGUMENTS ``` ## 実行後 diff --git a/plugins/mcp/kiro/mcp-redash/skills/redash-status/SKILL.md b/plugins/mcp/kiro/mcp-redash/skills/redash-status/SKILL.md index 45a4034..705300a 100644 --- a/plugins/mcp/kiro/mcp-redash/skills/redash-status/SKILL.md +++ b/plugins/mcp/kiro/mcp-redash/skills/redash-status/SKILL.md @@ -16,7 +16,7 @@ Redash MCP の設定状況を詳細表示します。各 MCP が必要とする 以下のコマンドを実行してください。 ```bash -node "${PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}}/scripts/redash-mcp-config.js" status +node "${PLUGIN_ROOT:-.kiro/plugins/mcp-redash}/scripts/redash-mcp-config.js" status ``` ## 実行後 diff --git a/plugins/mcp/kiro/mcp-serena/install.sh b/plugins/mcp/kiro/mcp-serena/install.sh index af3c956..a364724 100755 --- a/plugins/mcp/kiro/mcp-serena/install.sh +++ b/plugins/mcp/kiro/mcp-serena/install.sh @@ -2,16 +2,23 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +PLUGIN_NAME="$(basename "$SCRIPT_DIR")" PROJECT_ROOT="$(pwd)" +KIRO_DIR="$PROJECT_ROOT/.kiro" +KIRO_AGENT_FILE="$KIRO_DIR/agents/default.json" +KIRO_PLUGIN_LINK="$KIRO_DIR/plugins/$PLUGIN_NAME" +KIRO_SKILLS_DIR="$KIRO_DIR/skills" TARGET_MCP="$PROJECT_ROOT/.mcp.json" SOURCE_MCP="$SCRIPT_DIR/.mcp.json" +SOURCE_HOOKS="$SCRIPT_DIR/hooks/hooks.json" +SOURCE_SKILLS="$SCRIPT_DIR/skills" DRY_RUN=false usage() { cat <<'USAGE' Usage: bash install.sh [--dry-run] -Install this MCP plugin into the current project's .mcp.json. +Install this MCP plugin into the current project's Kiro settings. USAGE } @@ -31,22 +38,93 @@ fi if [ "$DRY_RUN" = true ]; then echo "Would merge $SOURCE_MCP into $TARGET_MCP" + echo "Would link plugin runtime into $KIRO_PLUGIN_LINK" + if [ -d "$SOURCE_SKILLS" ]; then + echo "Would link skills from $SOURCE_SKILLS into $KIRO_SKILLS_DIR" + fi + if [ -f "$SOURCE_HOOKS" ]; then + echo "Would merge hooks from $SOURCE_HOOKS into $KIRO_AGENT_FILE" + fi exit 0 fi -python3 - "$SOURCE_MCP" "$TARGET_MCP" <<'PY' +mkdir -p "$KIRO_DIR/plugins" "$KIRO_SKILLS_DIR" "$(dirname "$KIRO_AGENT_FILE")" +if [ -e "$KIRO_PLUGIN_LINK" ] && [ ! -L "$KIRO_PLUGIN_LINK" ]; then + echo "ERROR: $KIRO_PLUGIN_LINK already exists and is not a symlink" >&2 + exit 1 +fi +ln -sfn "../../plugins/mcp/kiro/$PLUGIN_NAME" "$KIRO_PLUGIN_LINK" + +if [ -d "$SOURCE_SKILLS" ]; then + find "$SOURCE_SKILLS" -mindepth 1 -maxdepth 1 -type d | sort | while IFS= read -r skill_dir; do + skill_name="$(basename "$skill_dir")" + skill_link="$KIRO_SKILLS_DIR/$skill_name" + [ -f "$skill_dir/SKILL.md" ] || continue + if [ -e "$skill_link" ] && [ ! -L "$skill_link" ]; then + echo "ERROR: $skill_link already exists and is not a symlink" >&2 + exit 1 + fi + ln -sfn "../plugins/$PLUGIN_NAME/skills/$skill_name" "$skill_link" + echo "Linked Kiro skill: $skill_name" + done +fi + +python3 - "$SOURCE_MCP" "$TARGET_MCP" "$SOURCE_HOOKS" "$KIRO_AGENT_FILE" <<'PY' import json import sys from pathlib import Path source_path = Path(sys.argv[1]) target_path = Path(sys.argv[2]) +hooks_path = Path(sys.argv[3]) +agent_path = Path(sys.argv[4]) source = json.loads(source_path.read_text()) target = json.loads(target_path.read_text()) if target_path.exists() else {} source_servers = source.get("mcpServers", {}) target.setdefault("mcpServers", {}) target["mcpServers"].update(source_servers) target_path.write_text(json.dumps(target, indent=2, ensure_ascii=False) + "\n") + +if agent_path.exists(): + agent = json.loads(agent_path.read_text()) +else: + agent = { + "name": "default", + "resources": ["skill://.kiro/skills/**/SKILL.md"], + } + +agent.setdefault("mcpServers", {}) +agent["mcpServers"].update(source_servers) + +if hooks_path.exists(): + source_hooks = json.loads(hooks_path.read_text()).get("hooks", {}) + target_hooks = agent.setdefault("hooks", {}) + event_map = { + "SessionStart": "agentSpawn", + "Stop": "stop", + } + for source_event, groups in source_hooks.items(): + target_event = event_map.get(source_event, source_event) + target_list = target_hooks.setdefault(target_event, []) + existing = { + entry.get("command") + for entry in target_list + if isinstance(entry, dict) + } + for group in groups: + for hook in group.get("hooks", []): + command = hook.get("command") + if not command or command in existing: + continue + entry = {"command": command} + if "timeout_ms" in hook: + entry["timeout_ms"] = hook["timeout_ms"] + target_list.append(entry) + existing.add(command) + +agent_path.write_text(json.dumps(agent, indent=2, ensure_ascii=False) + "\n") + print(f"Installed MCP servers: {', '.join(sorted(source_servers))}") print(f"Updated: {target_path}") +print(f"Updated: {agent_path}") PY diff --git a/scripts/build-runtime-plugins.sh b/scripts/build-runtime-plugins.sh index 4148685..a35c2bc 100755 --- a/scripts/build-runtime-plugins.sh +++ b/scripts/build-runtime-plugins.sh @@ -291,8 +291,22 @@ config_path.write_text(json.dumps(servers, indent=2, ensure_ascii=False) + "\n") PY } +rewrite_kiro_mcp_paths() { + local plugin_dir="$1" + local plugin_name="$2" + local root_expr="\${PLUGIN_ROOT:-.kiro/plugins/$plugin_name}" + local file + + while IFS= read -r file; do + sed "s#\${PLUGIN_ROOT:-\${CODEX_PLUGIN_ROOT:-\${CLAUDE_PLUGIN_ROOT}}}#$root_expr#g" \ + "$file" >"$file.tmp" + mv "$file.tmp" "$file" + done < <(find "$plugin_dir" -type f \( -name 'SKILL.md' -o -name 'hooks.json' \)) +} + write_kiro_mcp_installer() { local plugin_dir="$1" + local plugin_name="$2" local installer="$plugin_dir/install.sh" cat > "$installer" <<'EOF' @@ -300,16 +314,23 @@ write_kiro_mcp_installer() { set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +PLUGIN_NAME="$(basename "$SCRIPT_DIR")" PROJECT_ROOT="$(pwd)" +KIRO_DIR="$PROJECT_ROOT/.kiro" +KIRO_AGENT_FILE="$KIRO_DIR/agents/default.json" +KIRO_PLUGIN_LINK="$KIRO_DIR/plugins/$PLUGIN_NAME" +KIRO_SKILLS_DIR="$KIRO_DIR/skills" TARGET_MCP="$PROJECT_ROOT/.mcp.json" SOURCE_MCP="$SCRIPT_DIR/.mcp.json" +SOURCE_HOOKS="$SCRIPT_DIR/hooks/hooks.json" +SOURCE_SKILLS="$SCRIPT_DIR/skills" DRY_RUN=false usage() { cat <<'USAGE' Usage: bash install.sh [--dry-run] -Install this MCP plugin into the current project's .mcp.json. +Install this MCP plugin into the current project's Kiro settings. USAGE } @@ -329,24 +350,95 @@ fi if [ "$DRY_RUN" = true ]; then echo "Would merge $SOURCE_MCP into $TARGET_MCP" + echo "Would link plugin runtime into $KIRO_PLUGIN_LINK" + if [ -d "$SOURCE_SKILLS" ]; then + echo "Would link skills from $SOURCE_SKILLS into $KIRO_SKILLS_DIR" + fi + if [ -f "$SOURCE_HOOKS" ]; then + echo "Would merge hooks from $SOURCE_HOOKS into $KIRO_AGENT_FILE" + fi exit 0 fi -python3 - "$SOURCE_MCP" "$TARGET_MCP" <<'PY' +mkdir -p "$KIRO_DIR/plugins" "$KIRO_SKILLS_DIR" "$(dirname "$KIRO_AGENT_FILE")" +if [ -e "$KIRO_PLUGIN_LINK" ] && [ ! -L "$KIRO_PLUGIN_LINK" ]; then + echo "ERROR: $KIRO_PLUGIN_LINK already exists and is not a symlink" >&2 + exit 1 +fi +ln -sfn "../../plugins/mcp/kiro/$PLUGIN_NAME" "$KIRO_PLUGIN_LINK" + +if [ -d "$SOURCE_SKILLS" ]; then + find "$SOURCE_SKILLS" -mindepth 1 -maxdepth 1 -type d | sort | while IFS= read -r skill_dir; do + skill_name="$(basename "$skill_dir")" + skill_link="$KIRO_SKILLS_DIR/$skill_name" + [ -f "$skill_dir/SKILL.md" ] || continue + if [ -e "$skill_link" ] && [ ! -L "$skill_link" ]; then + echo "ERROR: $skill_link already exists and is not a symlink" >&2 + exit 1 + fi + ln -sfn "../plugins/$PLUGIN_NAME/skills/$skill_name" "$skill_link" + echo "Linked Kiro skill: $skill_name" + done +fi + +python3 - "$SOURCE_MCP" "$TARGET_MCP" "$SOURCE_HOOKS" "$KIRO_AGENT_FILE" <<'PY' import json import sys from pathlib import Path source_path = Path(sys.argv[1]) target_path = Path(sys.argv[2]) +hooks_path = Path(sys.argv[3]) +agent_path = Path(sys.argv[4]) source = json.loads(source_path.read_text()) target = json.loads(target_path.read_text()) if target_path.exists() else {} source_servers = source.get("mcpServers", {}) target.setdefault("mcpServers", {}) target["mcpServers"].update(source_servers) target_path.write_text(json.dumps(target, indent=2, ensure_ascii=False) + "\n") + +if agent_path.exists(): + agent = json.loads(agent_path.read_text()) +else: + agent = { + "name": "default", + "resources": ["skill://.kiro/skills/**/SKILL.md"], + } + +agent.setdefault("mcpServers", {}) +agent["mcpServers"].update(source_servers) + +if hooks_path.exists(): + source_hooks = json.loads(hooks_path.read_text()).get("hooks", {}) + target_hooks = agent.setdefault("hooks", {}) + event_map = { + "SessionStart": "agentSpawn", + "Stop": "stop", + } + for source_event, groups in source_hooks.items(): + target_event = event_map.get(source_event, source_event) + target_list = target_hooks.setdefault(target_event, []) + existing = { + entry.get("command") + for entry in target_list + if isinstance(entry, dict) + } + for group in groups: + for hook in group.get("hooks", []): + command = hook.get("command") + if not command or command in existing: + continue + entry = {"command": command} + if "timeout_ms" in hook: + entry["timeout_ms"] = hook["timeout_ms"] + target_list.append(entry) + existing.add(command) + +agent_path.write_text(json.dumps(agent, indent=2, ensure_ascii=False) + "\n") + print(f"Installed MCP servers: {', '.join(sorted(source_servers))}") print(f"Updated: {target_path}") +print(f"Updated: {agent_path}") PY EOF chmod +x "$installer" @@ -385,7 +477,8 @@ sync_mcp_runtime() { ;; kiro) rm -rf "$tmp_dir/.claude-plugin" "$tmp_dir/.codex-plugin" - write_kiro_mcp_installer "$tmp_dir" + rewrite_kiro_mcp_paths "$tmp_dir" "$(basename "$dest_dir")" + write_kiro_mcp_installer "$tmp_dir" "$(basename "$dest_dir")" ;; *) echo "ERROR: unknown MCP runtime: $runtime" >&2 @@ -417,10 +510,33 @@ sync_mcp_runtime() { fi } +clean_mcp_runtime_outputs() { + local runtime="$1" + local runtime_dir="$ROOT_DIR/plugins/mcp/$runtime" + local plugin_dir plugin_name + + [ -d "$runtime_dir" ] || return 0 + for plugin_dir in "$runtime_dir"/*; do + [ -d "$plugin_dir" ] || continue + plugin_name="$(basename "$plugin_dir")" + [ -d "$MCP_SHARED_DIR/$plugin_name" ] && continue + + if [ "$CHECK" = true ]; then + echo "Generated plugin directory is stale: ${plugin_dir#$ROOT_DIR/}" >&2 + return 1 + fi + rm -rf "$plugin_dir" + done +} + sync_mcp_plugins() { local plugin_dir plugin_name [ -d "$MCP_SHARED_DIR" ] || return 0 + clean_mcp_runtime_outputs claude + clean_mcp_runtime_outputs codex + clean_mcp_runtime_outputs kiro + for plugin_dir in "$MCP_SHARED_DIR"/*; do [ -d "$plugin_dir" ] || continue plugin_name="$(basename "$plugin_dir")" From e91a6f73847f3751f537261ab29d32a3e970c230 Mon Sep 17 00:00:00 2001 From: "takemi.ohama" Date: Tue, 7 Jul 2026 04:27:27 +0000 Subject: [PATCH 06/10] =?UTF-8?q?Fix:=20MCP=20runtime=20=E3=81=AE=20Redash?= =?UTF-8?q?=20=E8=A8=AD=E5=AE=9A=E5=87=A6=E7=90=86=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mcp-redash/scripts/redash-mcp-config.js | 98 ++++++++++++++++--- plugins/mcp/claude/mcp-serena/.mcp.json | 3 +- .../mcp-redash/scripts/redash-mcp-config.js | 98 ++++++++++++++++--- plugins/mcp/codex/mcp-serena/.mcp.json | 3 +- .../mcp-redash/scripts/redash-mcp-config.js | 98 ++++++++++++++++--- plugins/mcp/kiro/mcp-serena/.mcp.json | 3 +- .../mcp-redash/scripts/redash-mcp-config.js | 98 ++++++++++++++++--- plugins/mcp/shared/mcp-serena/.mcp.json | 3 +- scripts/build-runtime-plugins.sh | 4 - 9 files changed, 348 insertions(+), 60 deletions(-) diff --git a/plugins/mcp/claude/mcp-redash/scripts/redash-mcp-config.js b/plugins/mcp/claude/mcp-redash/scripts/redash-mcp-config.js index 83ce0f6..a7a16e3 100644 --- a/plugins/mcp/claude/mcp-redash/scripts/redash-mcp-config.js +++ b/plugins/mcp/claude/mcp-redash/scripts/redash-mcp-config.js @@ -15,8 +15,8 @@ const fs = require('fs'); const path = require('path'); -const MCP_JSON_PATH = path.resolve(process.cwd(), '.mcp.json'); const MCP_PACKAGE = '@suthio/redash-mcp'; +const MCP_JSON_PATH = path.join(resolveProjectRoot(), '.mcp.json'); // --- helpers --- @@ -44,6 +44,75 @@ function mcpEntry(suffix) { }; } +function isCodexRuntime() { + return Boolean(process.env.CODEX_PLUGIN_ROOT) || path.normalize(__dirname).split(path.sep).includes('codex'); +} + +function resolveProjectRoot() { + const envNames = [ + 'PROJECT_ROOT', + 'WORKSPACE_ROOT', + 'GIT_WORK_TREE', + 'CLAUDE_PROJECT_DIR', + 'CODEX_WORKSPACE_ROOT', + 'KIRO_WORKSPACE_ROOT', + ]; + + for (const name of envNames) { + const value = process.env[name]; + if (value && fs.existsSync(value) && fs.statSync(value).isDirectory()) { + return path.resolve(value); + } + } + + let dir = process.cwd(); + let nearestMcpDir = null; + while (true) { + if (!nearestMcpDir && fs.existsSync(path.join(dir, '.mcp.json'))) { + nearestMcpDir = dir; + } + if (fs.existsSync(path.join(dir, '.git'))) { + return dir; + } + + const parent = path.dirname(dir); + if (parent === dir) { + return nearestMcpDir || process.cwd(); + } + dir = parent; + } +} + +function createMcpJson() { + return isCodexRuntime() ? {} : { mcpServers: {} }; +} + +function serverMap(data, create) { + if (!data || typeof data !== 'object' || Array.isArray(data)) { + return null; + } + + if (Object.prototype.hasOwnProperty.call(data, 'mcpServers')) { + if (!data.mcpServers && create) { + data.mcpServers = {}; + } + return data.mcpServers && typeof data.mcpServers === 'object' && !Array.isArray(data.mcpServers) + ? data.mcpServers + : null; + } + + if (Object.prototype.hasOwnProperty.call(data, 'mcp_servers')) { + if (!data.mcp_servers && create) { + data.mcp_servers = {}; + } + return data.mcp_servers && typeof data.mcp_servers === 'object' && !Array.isArray(data.mcp_servers) + ? data.mcp_servers + : null; + } + + return data; +} + function readMcpJson() { if (!fs.existsSync(MCP_JSON_PATH)) { return null; @@ -82,19 +151,21 @@ function cmdAdd(suffix) { } if (data === null) { - data = { mcpServers: {} }; + data = createMcpJson(); } - if (!data.mcpServers) { - data.mcpServers = {}; + const servers = serverMap(data, true); + if (!servers) { + console.error('エラー: .mcp.json の MCP server 定義形式を解釈できません。'); + process.exit(1); } - if (data.mcpServers[name]) { + if (servers[name]) { console.log(`${name} は既に登録されています。変更はありません。`); process.exit(0); } - data.mcpServers[name] = mcpEntry(suffix); + servers[name] = mcpEntry(suffix); writeMcpJson(data); const env = envName(suffix); @@ -121,12 +192,13 @@ function cmdRemove(suffix) { process.exit(1); } - if (data === null || !data.mcpServers || !data.mcpServers[name]) { + const servers = serverMap(data, false); + if (data === null || !servers || !servers[name]) { console.log(`${name} は登録されていません。変更はありません。`); process.exit(0); } - delete data.mcpServers[name]; + delete servers[name]; writeMcpJson(data); console.log(`${name} を .mcp.json から削除しました。`); @@ -142,8 +214,9 @@ function cmdList() { console.error('警告: .mcp.json の JSON が壊れています。'); return; } - if (data && data.mcpServers) { - const names = Object.keys(data.mcpServers) + const servers = serverMap(data, false); + if (servers) { + const names = Object.keys(servers) .filter((n) => isRedashServer(n) && n !== 'redash') .sort(); for (const name of names) { @@ -168,8 +241,9 @@ function cmdStatus() { console.error('警告: .mcp.json の JSON が壊れています。'); return; } - if (data && data.mcpServers) { - const names = Object.keys(data.mcpServers) + const servers = serverMap(data, false); + if (servers) { + const names = Object.keys(servers) .filter((n) => isRedashServer(n) && n !== 'redash') .sort(); for (const name of names) { diff --git a/plugins/mcp/claude/mcp-serena/.mcp.json b/plugins/mcp/claude/mcp-serena/.mcp.json index 6ff356e..c21f7a2 100644 --- a/plugins/mcp/claude/mcp-serena/.mcp.json +++ b/plugins/mcp/claude/mcp-serena/.mcp.json @@ -15,8 +15,7 @@ ], "env": { "SERENA_HOME": "${SERENA_HOME:-.serena}" - }, - "envFile": "${workspaceFolder}/.env" + } } } } diff --git a/plugins/mcp/codex/mcp-redash/scripts/redash-mcp-config.js b/plugins/mcp/codex/mcp-redash/scripts/redash-mcp-config.js index 83ce0f6..a7a16e3 100644 --- a/plugins/mcp/codex/mcp-redash/scripts/redash-mcp-config.js +++ b/plugins/mcp/codex/mcp-redash/scripts/redash-mcp-config.js @@ -15,8 +15,8 @@ const fs = require('fs'); const path = require('path'); -const MCP_JSON_PATH = path.resolve(process.cwd(), '.mcp.json'); const MCP_PACKAGE = '@suthio/redash-mcp'; +const MCP_JSON_PATH = path.join(resolveProjectRoot(), '.mcp.json'); // --- helpers --- @@ -44,6 +44,75 @@ function mcpEntry(suffix) { }; } +function isCodexRuntime() { + return Boolean(process.env.CODEX_PLUGIN_ROOT) || path.normalize(__dirname).split(path.sep).includes('codex'); +} + +function resolveProjectRoot() { + const envNames = [ + 'PROJECT_ROOT', + 'WORKSPACE_ROOT', + 'GIT_WORK_TREE', + 'CLAUDE_PROJECT_DIR', + 'CODEX_WORKSPACE_ROOT', + 'KIRO_WORKSPACE_ROOT', + ]; + + for (const name of envNames) { + const value = process.env[name]; + if (value && fs.existsSync(value) && fs.statSync(value).isDirectory()) { + return path.resolve(value); + } + } + + let dir = process.cwd(); + let nearestMcpDir = null; + while (true) { + if (!nearestMcpDir && fs.existsSync(path.join(dir, '.mcp.json'))) { + nearestMcpDir = dir; + } + if (fs.existsSync(path.join(dir, '.git'))) { + return dir; + } + + const parent = path.dirname(dir); + if (parent === dir) { + return nearestMcpDir || process.cwd(); + } + dir = parent; + } +} + +function createMcpJson() { + return isCodexRuntime() ? {} : { mcpServers: {} }; +} + +function serverMap(data, create) { + if (!data || typeof data !== 'object' || Array.isArray(data)) { + return null; + } + + if (Object.prototype.hasOwnProperty.call(data, 'mcpServers')) { + if (!data.mcpServers && create) { + data.mcpServers = {}; + } + return data.mcpServers && typeof data.mcpServers === 'object' && !Array.isArray(data.mcpServers) + ? data.mcpServers + : null; + } + + if (Object.prototype.hasOwnProperty.call(data, 'mcp_servers')) { + if (!data.mcp_servers && create) { + data.mcp_servers = {}; + } + return data.mcp_servers && typeof data.mcp_servers === 'object' && !Array.isArray(data.mcp_servers) + ? data.mcp_servers + : null; + } + + return data; +} + function readMcpJson() { if (!fs.existsSync(MCP_JSON_PATH)) { return null; @@ -82,19 +151,21 @@ function cmdAdd(suffix) { } if (data === null) { - data = { mcpServers: {} }; + data = createMcpJson(); } - if (!data.mcpServers) { - data.mcpServers = {}; + const servers = serverMap(data, true); + if (!servers) { + console.error('エラー: .mcp.json の MCP server 定義形式を解釈できません。'); + process.exit(1); } - if (data.mcpServers[name]) { + if (servers[name]) { console.log(`${name} は既に登録されています。変更はありません。`); process.exit(0); } - data.mcpServers[name] = mcpEntry(suffix); + servers[name] = mcpEntry(suffix); writeMcpJson(data); const env = envName(suffix); @@ -121,12 +192,13 @@ function cmdRemove(suffix) { process.exit(1); } - if (data === null || !data.mcpServers || !data.mcpServers[name]) { + const servers = serverMap(data, false); + if (data === null || !servers || !servers[name]) { console.log(`${name} は登録されていません。変更はありません。`); process.exit(0); } - delete data.mcpServers[name]; + delete servers[name]; writeMcpJson(data); console.log(`${name} を .mcp.json から削除しました。`); @@ -142,8 +214,9 @@ function cmdList() { console.error('警告: .mcp.json の JSON が壊れています。'); return; } - if (data && data.mcpServers) { - const names = Object.keys(data.mcpServers) + const servers = serverMap(data, false); + if (servers) { + const names = Object.keys(servers) .filter((n) => isRedashServer(n) && n !== 'redash') .sort(); for (const name of names) { @@ -168,8 +241,9 @@ function cmdStatus() { console.error('警告: .mcp.json の JSON が壊れています。'); return; } - if (data && data.mcpServers) { - const names = Object.keys(data.mcpServers) + const servers = serverMap(data, false); + if (servers) { + const names = Object.keys(servers) .filter((n) => isRedashServer(n) && n !== 'redash') .sort(); for (const name of names) { diff --git a/plugins/mcp/codex/mcp-serena/.mcp.json b/plugins/mcp/codex/mcp-serena/.mcp.json index ad9c0e4..3746657 100644 --- a/plugins/mcp/codex/mcp-serena/.mcp.json +++ b/plugins/mcp/codex/mcp-serena/.mcp.json @@ -14,7 +14,6 @@ ], "env": { "SERENA_HOME": "${SERENA_HOME:-.serena}" - }, - "envFile": "${workspaceFolder}/.env" + } } } diff --git a/plugins/mcp/kiro/mcp-redash/scripts/redash-mcp-config.js b/plugins/mcp/kiro/mcp-redash/scripts/redash-mcp-config.js index 83ce0f6..a7a16e3 100644 --- a/plugins/mcp/kiro/mcp-redash/scripts/redash-mcp-config.js +++ b/plugins/mcp/kiro/mcp-redash/scripts/redash-mcp-config.js @@ -15,8 +15,8 @@ const fs = require('fs'); const path = require('path'); -const MCP_JSON_PATH = path.resolve(process.cwd(), '.mcp.json'); const MCP_PACKAGE = '@suthio/redash-mcp'; +const MCP_JSON_PATH = path.join(resolveProjectRoot(), '.mcp.json'); // --- helpers --- @@ -44,6 +44,75 @@ function mcpEntry(suffix) { }; } +function isCodexRuntime() { + return Boolean(process.env.CODEX_PLUGIN_ROOT) || path.normalize(__dirname).split(path.sep).includes('codex'); +} + +function resolveProjectRoot() { + const envNames = [ + 'PROJECT_ROOT', + 'WORKSPACE_ROOT', + 'GIT_WORK_TREE', + 'CLAUDE_PROJECT_DIR', + 'CODEX_WORKSPACE_ROOT', + 'KIRO_WORKSPACE_ROOT', + ]; + + for (const name of envNames) { + const value = process.env[name]; + if (value && fs.existsSync(value) && fs.statSync(value).isDirectory()) { + return path.resolve(value); + } + } + + let dir = process.cwd(); + let nearestMcpDir = null; + while (true) { + if (!nearestMcpDir && fs.existsSync(path.join(dir, '.mcp.json'))) { + nearestMcpDir = dir; + } + if (fs.existsSync(path.join(dir, '.git'))) { + return dir; + } + + const parent = path.dirname(dir); + if (parent === dir) { + return nearestMcpDir || process.cwd(); + } + dir = parent; + } +} + +function createMcpJson() { + return isCodexRuntime() ? {} : { mcpServers: {} }; +} + +function serverMap(data, create) { + if (!data || typeof data !== 'object' || Array.isArray(data)) { + return null; + } + + if (Object.prototype.hasOwnProperty.call(data, 'mcpServers')) { + if (!data.mcpServers && create) { + data.mcpServers = {}; + } + return data.mcpServers && typeof data.mcpServers === 'object' && !Array.isArray(data.mcpServers) + ? data.mcpServers + : null; + } + + if (Object.prototype.hasOwnProperty.call(data, 'mcp_servers')) { + if (!data.mcp_servers && create) { + data.mcp_servers = {}; + } + return data.mcp_servers && typeof data.mcp_servers === 'object' && !Array.isArray(data.mcp_servers) + ? data.mcp_servers + : null; + } + + return data; +} + function readMcpJson() { if (!fs.existsSync(MCP_JSON_PATH)) { return null; @@ -82,19 +151,21 @@ function cmdAdd(suffix) { } if (data === null) { - data = { mcpServers: {} }; + data = createMcpJson(); } - if (!data.mcpServers) { - data.mcpServers = {}; + const servers = serverMap(data, true); + if (!servers) { + console.error('エラー: .mcp.json の MCP server 定義形式を解釈できません。'); + process.exit(1); } - if (data.mcpServers[name]) { + if (servers[name]) { console.log(`${name} は既に登録されています。変更はありません。`); process.exit(0); } - data.mcpServers[name] = mcpEntry(suffix); + servers[name] = mcpEntry(suffix); writeMcpJson(data); const env = envName(suffix); @@ -121,12 +192,13 @@ function cmdRemove(suffix) { process.exit(1); } - if (data === null || !data.mcpServers || !data.mcpServers[name]) { + const servers = serverMap(data, false); + if (data === null || !servers || !servers[name]) { console.log(`${name} は登録されていません。変更はありません。`); process.exit(0); } - delete data.mcpServers[name]; + delete servers[name]; writeMcpJson(data); console.log(`${name} を .mcp.json から削除しました。`); @@ -142,8 +214,9 @@ function cmdList() { console.error('警告: .mcp.json の JSON が壊れています。'); return; } - if (data && data.mcpServers) { - const names = Object.keys(data.mcpServers) + const servers = serverMap(data, false); + if (servers) { + const names = Object.keys(servers) .filter((n) => isRedashServer(n) && n !== 'redash') .sort(); for (const name of names) { @@ -168,8 +241,9 @@ function cmdStatus() { console.error('警告: .mcp.json の JSON が壊れています。'); return; } - if (data && data.mcpServers) { - const names = Object.keys(data.mcpServers) + const servers = serverMap(data, false); + if (servers) { + const names = Object.keys(servers) .filter((n) => isRedashServer(n) && n !== 'redash') .sort(); for (const name of names) { diff --git a/plugins/mcp/kiro/mcp-serena/.mcp.json b/plugins/mcp/kiro/mcp-serena/.mcp.json index 6ff356e..c21f7a2 100644 --- a/plugins/mcp/kiro/mcp-serena/.mcp.json +++ b/plugins/mcp/kiro/mcp-serena/.mcp.json @@ -15,8 +15,7 @@ ], "env": { "SERENA_HOME": "${SERENA_HOME:-.serena}" - }, - "envFile": "${workspaceFolder}/.env" + } } } } diff --git a/plugins/mcp/shared/mcp-redash/scripts/redash-mcp-config.js b/plugins/mcp/shared/mcp-redash/scripts/redash-mcp-config.js index 83ce0f6..a7a16e3 100644 --- a/plugins/mcp/shared/mcp-redash/scripts/redash-mcp-config.js +++ b/plugins/mcp/shared/mcp-redash/scripts/redash-mcp-config.js @@ -15,8 +15,8 @@ const fs = require('fs'); const path = require('path'); -const MCP_JSON_PATH = path.resolve(process.cwd(), '.mcp.json'); const MCP_PACKAGE = '@suthio/redash-mcp'; +const MCP_JSON_PATH = path.join(resolveProjectRoot(), '.mcp.json'); // --- helpers --- @@ -44,6 +44,75 @@ function mcpEntry(suffix) { }; } +function isCodexRuntime() { + return Boolean(process.env.CODEX_PLUGIN_ROOT) || path.normalize(__dirname).split(path.sep).includes('codex'); +} + +function resolveProjectRoot() { + const envNames = [ + 'PROJECT_ROOT', + 'WORKSPACE_ROOT', + 'GIT_WORK_TREE', + 'CLAUDE_PROJECT_DIR', + 'CODEX_WORKSPACE_ROOT', + 'KIRO_WORKSPACE_ROOT', + ]; + + for (const name of envNames) { + const value = process.env[name]; + if (value && fs.existsSync(value) && fs.statSync(value).isDirectory()) { + return path.resolve(value); + } + } + + let dir = process.cwd(); + let nearestMcpDir = null; + while (true) { + if (!nearestMcpDir && fs.existsSync(path.join(dir, '.mcp.json'))) { + nearestMcpDir = dir; + } + if (fs.existsSync(path.join(dir, '.git'))) { + return dir; + } + + const parent = path.dirname(dir); + if (parent === dir) { + return nearestMcpDir || process.cwd(); + } + dir = parent; + } +} + +function createMcpJson() { + return isCodexRuntime() ? {} : { mcpServers: {} }; +} + +function serverMap(data, create) { + if (!data || typeof data !== 'object' || Array.isArray(data)) { + return null; + } + + if (Object.prototype.hasOwnProperty.call(data, 'mcpServers')) { + if (!data.mcpServers && create) { + data.mcpServers = {}; + } + return data.mcpServers && typeof data.mcpServers === 'object' && !Array.isArray(data.mcpServers) + ? data.mcpServers + : null; + } + + if (Object.prototype.hasOwnProperty.call(data, 'mcp_servers')) { + if (!data.mcp_servers && create) { + data.mcp_servers = {}; + } + return data.mcp_servers && typeof data.mcp_servers === 'object' && !Array.isArray(data.mcp_servers) + ? data.mcp_servers + : null; + } + + return data; +} + function readMcpJson() { if (!fs.existsSync(MCP_JSON_PATH)) { return null; @@ -82,19 +151,21 @@ function cmdAdd(suffix) { } if (data === null) { - data = { mcpServers: {} }; + data = createMcpJson(); } - if (!data.mcpServers) { - data.mcpServers = {}; + const servers = serverMap(data, true); + if (!servers) { + console.error('エラー: .mcp.json の MCP server 定義形式を解釈できません。'); + process.exit(1); } - if (data.mcpServers[name]) { + if (servers[name]) { console.log(`${name} は既に登録されています。変更はありません。`); process.exit(0); } - data.mcpServers[name] = mcpEntry(suffix); + servers[name] = mcpEntry(suffix); writeMcpJson(data); const env = envName(suffix); @@ -121,12 +192,13 @@ function cmdRemove(suffix) { process.exit(1); } - if (data === null || !data.mcpServers || !data.mcpServers[name]) { + const servers = serverMap(data, false); + if (data === null || !servers || !servers[name]) { console.log(`${name} は登録されていません。変更はありません。`); process.exit(0); } - delete data.mcpServers[name]; + delete servers[name]; writeMcpJson(data); console.log(`${name} を .mcp.json から削除しました。`); @@ -142,8 +214,9 @@ function cmdList() { console.error('警告: .mcp.json の JSON が壊れています。'); return; } - if (data && data.mcpServers) { - const names = Object.keys(data.mcpServers) + const servers = serverMap(data, false); + if (servers) { + const names = Object.keys(servers) .filter((n) => isRedashServer(n) && n !== 'redash') .sort(); for (const name of names) { @@ -168,8 +241,9 @@ function cmdStatus() { console.error('警告: .mcp.json の JSON が壊れています。'); return; } - if (data && data.mcpServers) { - const names = Object.keys(data.mcpServers) + const servers = serverMap(data, false); + if (servers) { + const names = Object.keys(servers) .filter((n) => isRedashServer(n) && n !== 'redash') .sort(); for (const name of names) { diff --git a/plugins/mcp/shared/mcp-serena/.mcp.json b/plugins/mcp/shared/mcp-serena/.mcp.json index 6ff356e..c21f7a2 100644 --- a/plugins/mcp/shared/mcp-serena/.mcp.json +++ b/plugins/mcp/shared/mcp-serena/.mcp.json @@ -15,8 +15,7 @@ ], "env": { "SERENA_HOME": "${SERENA_HOME:-.serena}" - }, - "envFile": "${workspaceFolder}/.env" + } } } } diff --git a/scripts/build-runtime-plugins.sh b/scripts/build-runtime-plugins.sh index a35c2bc..199b210 100755 --- a/scripts/build-runtime-plugins.sh +++ b/scripts/build-runtime-plugins.sh @@ -72,10 +72,6 @@ copy_tree() { fi } -json_string() { - python3 -c 'import json,sys; print(json.dumps(sys.argv[1], ensure_ascii=False))' "$1" -} - rewrite_codex_skill_paths() { local skills_dir="$1" local script_dir="$2" From f7b604cc2a3a5cbf9f4e2c0813885428b542c653 Mon Sep 17 00:00:00 2001 From: "takemi.ohama" Date: Tue, 7 Jul 2026 04:32:53 +0000 Subject: [PATCH 07/10] =?UTF-8?q?Fix:=20MCP=E5=A4=96=E9=83=A8=E3=82=B3?= =?UTF-8?q?=E3=83=9E=E3=83=B3=E3=83=89=E5=AE=9F=E8=A1=8C=E3=82=92=E5=AE=89?= =?UTF-8?q?=E5=85=A8=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../claude/mcp-playwright/scripts/ensure-playwright.js | 10 +++++++--- .../mcp/claude/mcp-redash/scripts/redash-mcp-config.js | 10 ++++++++++ .../mcp/claude/mcp-redash/skills/redash-add/SKILL.md | 2 +- .../claude/mcp-redash/skills/redash-remove/SKILL.md | 2 +- .../codex/mcp-playwright/scripts/ensure-playwright.js | 10 +++++++--- .../mcp/codex/mcp-redash/scripts/redash-mcp-config.js | 10 ++++++++++ .../mcp/codex/mcp-redash/skills/redash-add/SKILL.md | 2 +- .../mcp/codex/mcp-redash/skills/redash-remove/SKILL.md | 2 +- .../kiro/mcp-playwright/scripts/ensure-playwright.js | 10 +++++++--- .../mcp/kiro/mcp-redash/scripts/redash-mcp-config.js | 10 ++++++++++ plugins/mcp/kiro/mcp-redash/skills/redash-add/SKILL.md | 2 +- .../mcp/kiro/mcp-redash/skills/redash-remove/SKILL.md | 2 +- .../shared/mcp-playwright/scripts/ensure-playwright.js | 10 +++++++--- .../mcp/shared/mcp-redash/scripts/redash-mcp-config.js | 10 ++++++++++ .../mcp/shared/mcp-redash/skills/redash-add/SKILL.md | 2 +- .../shared/mcp-redash/skills/redash-remove/SKILL.md | 2 +- 16 files changed, 76 insertions(+), 20 deletions(-) diff --git a/plugins/mcp/claude/mcp-playwright/scripts/ensure-playwright.js b/plugins/mcp/claude/mcp-playwright/scripts/ensure-playwright.js index 57f602b..faa02bd 100755 --- a/plugins/mcp/claude/mcp-playwright/scripts/ensure-playwright.js +++ b/plugins/mcp/claude/mcp-playwright/scripts/ensure-playwright.js @@ -1,6 +1,6 @@ #!/usr/bin/env node -const { execSync } = require('child_process'); +const { execFileSync } = require('child_process'); const fs = require('fs'); const path = require('path'); const os = require('os'); @@ -9,6 +9,7 @@ const PLUGIN_ROOT = process.env.PLUGIN_ROOT || process.env.CODEX_PLUGIN_ROOT || const FLAG_FILE = path.join(os.homedir(), '.claude-playwright-installed'); const BROWSER_PATH = path.join(os.homedir(), '.cache', 'ms-playwright'); const TIMEOUT_MS = 5 * 60 * 1000; // 5分タイムアウト +const PLAYWRIGHT_VERSION_PATTERN = /^[~^]?\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/; // 既にインストール済みかチェック(冪等性) if (fs.existsSync(FLAG_FILE)) { @@ -26,7 +27,7 @@ console.log(''); try { // @playwright/mcpが依存するPlaywrightのバージョンを取得 console.log('🔍 @playwright/mcpが使用するPlaywrightバージョンを確認中...'); - const depsOutput = execSync('npm view @playwright/mcp@latest dependencies --json', { + const depsOutput = execFileSync('npm', ['view', '@playwright/mcp@latest', 'dependencies', '--json'], { encoding: 'utf-8', cwd: PLUGIN_ROOT, timeout: 30000 @@ -38,13 +39,16 @@ try { if (!playwrightVersion) { throw new Error('@playwright/mcpの依存関係からPlaywrightバージョンを取得できませんでした'); } + if (!PLAYWRIGHT_VERSION_PATTERN.test(playwrightVersion)) { + throw new Error(`不正なPlaywrightバージョンです: ${playwrightVersion}`); + } console.log(`✓ Playwright ${playwrightVersion} を使用します`); console.log(''); // @playwright/mcpと互換性のあるバージョンのChromiumをインストール console.log(`📦 Playwright ${playwrightVersion} でChromiumをインストール中...`); - execSync(`npx -y playwright@${playwrightVersion} install chromium`, { + execFileSync('npx', ['-y', `playwright@${playwrightVersion}`, 'install', 'chromium'], { stdio: 'inherit', cwd: PLUGIN_ROOT, timeout: TIMEOUT_MS, diff --git a/plugins/mcp/claude/mcp-redash/scripts/redash-mcp-config.js b/plugins/mcp/claude/mcp-redash/scripts/redash-mcp-config.js index a7a16e3..cd32cd7 100644 --- a/plugins/mcp/claude/mcp-redash/scripts/redash-mcp-config.js +++ b/plugins/mcp/claude/mcp-redash/scripts/redash-mcp-config.js @@ -32,6 +32,14 @@ function mcpName(suffix) { return `redash-${suffix}`; } +function validateSuffix(suffix) { + if (!/^[a-z0-9][a-z0-9-]*$/.test(suffix)) { + console.error('エラー: suffix は英小文字・数字・ハイフンのみで指定してください。'); + console.error('例: dev, stg, prod2, sandbox-1'); + process.exit(1); + } +} + function mcpEntry(suffix) { const env = envName(suffix); return { @@ -141,6 +149,7 @@ function cmdAdd(suffix) { console.error('suffix には dev, stg, prod2, sandbox などを指定してください。'); process.exit(1); } + validateSuffix(suffix); const name = mcpName(suffix); let data = readMcpJson(); @@ -183,6 +192,7 @@ function cmdRemove(suffix) { console.error('エラー: デフォルトの redash は plugin 同梱のため削除できません。'); process.exit(1); } + validateSuffix(suffix); const name = mcpName(suffix); let data = readMcpJson(); diff --git a/plugins/mcp/claude/mcp-redash/skills/redash-add/SKILL.md b/plugins/mcp/claude/mcp-redash/skills/redash-add/SKILL.md index f91167b..ce1fc02 100644 --- a/plugins/mcp/claude/mcp-redash/skills/redash-add/SKILL.md +++ b/plugins/mcp/claude/mcp-redash/skills/redash-add/SKILL.md @@ -19,7 +19,7 @@ allowed-tools: 以下のコマンドを実行してください。`$ARGUMENTS` にはユーザーが指定した suffix が入ります。 ```bash -node "${PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}}/scripts/redash-mcp-config.js" add $ARGUMENTS +node "${PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}}/scripts/redash-mcp-config.js" add "$ARGUMENTS" ``` ## 実行後 diff --git a/plugins/mcp/claude/mcp-redash/skills/redash-remove/SKILL.md b/plugins/mcp/claude/mcp-redash/skills/redash-remove/SKILL.md index 93d8a10..00fe202 100644 --- a/plugins/mcp/claude/mcp-redash/skills/redash-remove/SKILL.md +++ b/plugins/mcp/claude/mcp-redash/skills/redash-remove/SKILL.md @@ -19,7 +19,7 @@ allowed-tools: 以下のコマンドを実行してください。`$ARGUMENTS` にはユーザーが指定した suffix が入ります。 ```bash -node "${PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}}/scripts/redash-mcp-config.js" remove $ARGUMENTS +node "${PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}}/scripts/redash-mcp-config.js" remove "$ARGUMENTS" ``` ## 実行後 diff --git a/plugins/mcp/codex/mcp-playwright/scripts/ensure-playwright.js b/plugins/mcp/codex/mcp-playwright/scripts/ensure-playwright.js index 57f602b..faa02bd 100755 --- a/plugins/mcp/codex/mcp-playwright/scripts/ensure-playwright.js +++ b/plugins/mcp/codex/mcp-playwright/scripts/ensure-playwright.js @@ -1,6 +1,6 @@ #!/usr/bin/env node -const { execSync } = require('child_process'); +const { execFileSync } = require('child_process'); const fs = require('fs'); const path = require('path'); const os = require('os'); @@ -9,6 +9,7 @@ const PLUGIN_ROOT = process.env.PLUGIN_ROOT || process.env.CODEX_PLUGIN_ROOT || const FLAG_FILE = path.join(os.homedir(), '.claude-playwright-installed'); const BROWSER_PATH = path.join(os.homedir(), '.cache', 'ms-playwright'); const TIMEOUT_MS = 5 * 60 * 1000; // 5分タイムアウト +const PLAYWRIGHT_VERSION_PATTERN = /^[~^]?\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/; // 既にインストール済みかチェック(冪等性) if (fs.existsSync(FLAG_FILE)) { @@ -26,7 +27,7 @@ console.log(''); try { // @playwright/mcpが依存するPlaywrightのバージョンを取得 console.log('🔍 @playwright/mcpが使用するPlaywrightバージョンを確認中...'); - const depsOutput = execSync('npm view @playwright/mcp@latest dependencies --json', { + const depsOutput = execFileSync('npm', ['view', '@playwright/mcp@latest', 'dependencies', '--json'], { encoding: 'utf-8', cwd: PLUGIN_ROOT, timeout: 30000 @@ -38,13 +39,16 @@ try { if (!playwrightVersion) { throw new Error('@playwright/mcpの依存関係からPlaywrightバージョンを取得できませんでした'); } + if (!PLAYWRIGHT_VERSION_PATTERN.test(playwrightVersion)) { + throw new Error(`不正なPlaywrightバージョンです: ${playwrightVersion}`); + } console.log(`✓ Playwright ${playwrightVersion} を使用します`); console.log(''); // @playwright/mcpと互換性のあるバージョンのChromiumをインストール console.log(`📦 Playwright ${playwrightVersion} でChromiumをインストール中...`); - execSync(`npx -y playwright@${playwrightVersion} install chromium`, { + execFileSync('npx', ['-y', `playwright@${playwrightVersion}`, 'install', 'chromium'], { stdio: 'inherit', cwd: PLUGIN_ROOT, timeout: TIMEOUT_MS, diff --git a/plugins/mcp/codex/mcp-redash/scripts/redash-mcp-config.js b/plugins/mcp/codex/mcp-redash/scripts/redash-mcp-config.js index a7a16e3..cd32cd7 100644 --- a/plugins/mcp/codex/mcp-redash/scripts/redash-mcp-config.js +++ b/plugins/mcp/codex/mcp-redash/scripts/redash-mcp-config.js @@ -32,6 +32,14 @@ function mcpName(suffix) { return `redash-${suffix}`; } +function validateSuffix(suffix) { + if (!/^[a-z0-9][a-z0-9-]*$/.test(suffix)) { + console.error('エラー: suffix は英小文字・数字・ハイフンのみで指定してください。'); + console.error('例: dev, stg, prod2, sandbox-1'); + process.exit(1); + } +} + function mcpEntry(suffix) { const env = envName(suffix); return { @@ -141,6 +149,7 @@ function cmdAdd(suffix) { console.error('suffix には dev, stg, prod2, sandbox などを指定してください。'); process.exit(1); } + validateSuffix(suffix); const name = mcpName(suffix); let data = readMcpJson(); @@ -183,6 +192,7 @@ function cmdRemove(suffix) { console.error('エラー: デフォルトの redash は plugin 同梱のため削除できません。'); process.exit(1); } + validateSuffix(suffix); const name = mcpName(suffix); let data = readMcpJson(); diff --git a/plugins/mcp/codex/mcp-redash/skills/redash-add/SKILL.md b/plugins/mcp/codex/mcp-redash/skills/redash-add/SKILL.md index f91167b..ce1fc02 100644 --- a/plugins/mcp/codex/mcp-redash/skills/redash-add/SKILL.md +++ b/plugins/mcp/codex/mcp-redash/skills/redash-add/SKILL.md @@ -19,7 +19,7 @@ allowed-tools: 以下のコマンドを実行してください。`$ARGUMENTS` にはユーザーが指定した suffix が入ります。 ```bash -node "${PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}}/scripts/redash-mcp-config.js" add $ARGUMENTS +node "${PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}}/scripts/redash-mcp-config.js" add "$ARGUMENTS" ``` ## 実行後 diff --git a/plugins/mcp/codex/mcp-redash/skills/redash-remove/SKILL.md b/plugins/mcp/codex/mcp-redash/skills/redash-remove/SKILL.md index 93d8a10..00fe202 100644 --- a/plugins/mcp/codex/mcp-redash/skills/redash-remove/SKILL.md +++ b/plugins/mcp/codex/mcp-redash/skills/redash-remove/SKILL.md @@ -19,7 +19,7 @@ allowed-tools: 以下のコマンドを実行してください。`$ARGUMENTS` にはユーザーが指定した suffix が入ります。 ```bash -node "${PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}}/scripts/redash-mcp-config.js" remove $ARGUMENTS +node "${PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}}/scripts/redash-mcp-config.js" remove "$ARGUMENTS" ``` ## 実行後 diff --git a/plugins/mcp/kiro/mcp-playwright/scripts/ensure-playwright.js b/plugins/mcp/kiro/mcp-playwright/scripts/ensure-playwright.js index 57f602b..faa02bd 100755 --- a/plugins/mcp/kiro/mcp-playwright/scripts/ensure-playwright.js +++ b/plugins/mcp/kiro/mcp-playwright/scripts/ensure-playwright.js @@ -1,6 +1,6 @@ #!/usr/bin/env node -const { execSync } = require('child_process'); +const { execFileSync } = require('child_process'); const fs = require('fs'); const path = require('path'); const os = require('os'); @@ -9,6 +9,7 @@ const PLUGIN_ROOT = process.env.PLUGIN_ROOT || process.env.CODEX_PLUGIN_ROOT || const FLAG_FILE = path.join(os.homedir(), '.claude-playwright-installed'); const BROWSER_PATH = path.join(os.homedir(), '.cache', 'ms-playwright'); const TIMEOUT_MS = 5 * 60 * 1000; // 5分タイムアウト +const PLAYWRIGHT_VERSION_PATTERN = /^[~^]?\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/; // 既にインストール済みかチェック(冪等性) if (fs.existsSync(FLAG_FILE)) { @@ -26,7 +27,7 @@ console.log(''); try { // @playwright/mcpが依存するPlaywrightのバージョンを取得 console.log('🔍 @playwright/mcpが使用するPlaywrightバージョンを確認中...'); - const depsOutput = execSync('npm view @playwright/mcp@latest dependencies --json', { + const depsOutput = execFileSync('npm', ['view', '@playwright/mcp@latest', 'dependencies', '--json'], { encoding: 'utf-8', cwd: PLUGIN_ROOT, timeout: 30000 @@ -38,13 +39,16 @@ try { if (!playwrightVersion) { throw new Error('@playwright/mcpの依存関係からPlaywrightバージョンを取得できませんでした'); } + if (!PLAYWRIGHT_VERSION_PATTERN.test(playwrightVersion)) { + throw new Error(`不正なPlaywrightバージョンです: ${playwrightVersion}`); + } console.log(`✓ Playwright ${playwrightVersion} を使用します`); console.log(''); // @playwright/mcpと互換性のあるバージョンのChromiumをインストール console.log(`📦 Playwright ${playwrightVersion} でChromiumをインストール中...`); - execSync(`npx -y playwright@${playwrightVersion} install chromium`, { + execFileSync('npx', ['-y', `playwright@${playwrightVersion}`, 'install', 'chromium'], { stdio: 'inherit', cwd: PLUGIN_ROOT, timeout: TIMEOUT_MS, diff --git a/plugins/mcp/kiro/mcp-redash/scripts/redash-mcp-config.js b/plugins/mcp/kiro/mcp-redash/scripts/redash-mcp-config.js index a7a16e3..cd32cd7 100644 --- a/plugins/mcp/kiro/mcp-redash/scripts/redash-mcp-config.js +++ b/plugins/mcp/kiro/mcp-redash/scripts/redash-mcp-config.js @@ -32,6 +32,14 @@ function mcpName(suffix) { return `redash-${suffix}`; } +function validateSuffix(suffix) { + if (!/^[a-z0-9][a-z0-9-]*$/.test(suffix)) { + console.error('エラー: suffix は英小文字・数字・ハイフンのみで指定してください。'); + console.error('例: dev, stg, prod2, sandbox-1'); + process.exit(1); + } +} + function mcpEntry(suffix) { const env = envName(suffix); return { @@ -141,6 +149,7 @@ function cmdAdd(suffix) { console.error('suffix には dev, stg, prod2, sandbox などを指定してください。'); process.exit(1); } + validateSuffix(suffix); const name = mcpName(suffix); let data = readMcpJson(); @@ -183,6 +192,7 @@ function cmdRemove(suffix) { console.error('エラー: デフォルトの redash は plugin 同梱のため削除できません。'); process.exit(1); } + validateSuffix(suffix); const name = mcpName(suffix); let data = readMcpJson(); diff --git a/plugins/mcp/kiro/mcp-redash/skills/redash-add/SKILL.md b/plugins/mcp/kiro/mcp-redash/skills/redash-add/SKILL.md index 2fc8ef7..f6ef3f4 100644 --- a/plugins/mcp/kiro/mcp-redash/skills/redash-add/SKILL.md +++ b/plugins/mcp/kiro/mcp-redash/skills/redash-add/SKILL.md @@ -19,7 +19,7 @@ allowed-tools: 以下のコマンドを実行してください。`$ARGUMENTS` にはユーザーが指定した suffix が入ります。 ```bash -node "${PLUGIN_ROOT:-.kiro/plugins/mcp-redash}/scripts/redash-mcp-config.js" add $ARGUMENTS +node "${PLUGIN_ROOT:-.kiro/plugins/mcp-redash}/scripts/redash-mcp-config.js" add "$ARGUMENTS" ``` ## 実行後 diff --git a/plugins/mcp/kiro/mcp-redash/skills/redash-remove/SKILL.md b/plugins/mcp/kiro/mcp-redash/skills/redash-remove/SKILL.md index 0ce9608..bebb222 100644 --- a/plugins/mcp/kiro/mcp-redash/skills/redash-remove/SKILL.md +++ b/plugins/mcp/kiro/mcp-redash/skills/redash-remove/SKILL.md @@ -19,7 +19,7 @@ allowed-tools: 以下のコマンドを実行してください。`$ARGUMENTS` にはユーザーが指定した suffix が入ります。 ```bash -node "${PLUGIN_ROOT:-.kiro/plugins/mcp-redash}/scripts/redash-mcp-config.js" remove $ARGUMENTS +node "${PLUGIN_ROOT:-.kiro/plugins/mcp-redash}/scripts/redash-mcp-config.js" remove "$ARGUMENTS" ``` ## 実行後 diff --git a/plugins/mcp/shared/mcp-playwright/scripts/ensure-playwright.js b/plugins/mcp/shared/mcp-playwright/scripts/ensure-playwright.js index 57f602b..faa02bd 100755 --- a/plugins/mcp/shared/mcp-playwright/scripts/ensure-playwright.js +++ b/plugins/mcp/shared/mcp-playwright/scripts/ensure-playwright.js @@ -1,6 +1,6 @@ #!/usr/bin/env node -const { execSync } = require('child_process'); +const { execFileSync } = require('child_process'); const fs = require('fs'); const path = require('path'); const os = require('os'); @@ -9,6 +9,7 @@ const PLUGIN_ROOT = process.env.PLUGIN_ROOT || process.env.CODEX_PLUGIN_ROOT || const FLAG_FILE = path.join(os.homedir(), '.claude-playwright-installed'); const BROWSER_PATH = path.join(os.homedir(), '.cache', 'ms-playwright'); const TIMEOUT_MS = 5 * 60 * 1000; // 5分タイムアウト +const PLAYWRIGHT_VERSION_PATTERN = /^[~^]?\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/; // 既にインストール済みかチェック(冪等性) if (fs.existsSync(FLAG_FILE)) { @@ -26,7 +27,7 @@ console.log(''); try { // @playwright/mcpが依存するPlaywrightのバージョンを取得 console.log('🔍 @playwright/mcpが使用するPlaywrightバージョンを確認中...'); - const depsOutput = execSync('npm view @playwright/mcp@latest dependencies --json', { + const depsOutput = execFileSync('npm', ['view', '@playwright/mcp@latest', 'dependencies', '--json'], { encoding: 'utf-8', cwd: PLUGIN_ROOT, timeout: 30000 @@ -38,13 +39,16 @@ try { if (!playwrightVersion) { throw new Error('@playwright/mcpの依存関係からPlaywrightバージョンを取得できませんでした'); } + if (!PLAYWRIGHT_VERSION_PATTERN.test(playwrightVersion)) { + throw new Error(`不正なPlaywrightバージョンです: ${playwrightVersion}`); + } console.log(`✓ Playwright ${playwrightVersion} を使用します`); console.log(''); // @playwright/mcpと互換性のあるバージョンのChromiumをインストール console.log(`📦 Playwright ${playwrightVersion} でChromiumをインストール中...`); - execSync(`npx -y playwright@${playwrightVersion} install chromium`, { + execFileSync('npx', ['-y', `playwright@${playwrightVersion}`, 'install', 'chromium'], { stdio: 'inherit', cwd: PLUGIN_ROOT, timeout: TIMEOUT_MS, diff --git a/plugins/mcp/shared/mcp-redash/scripts/redash-mcp-config.js b/plugins/mcp/shared/mcp-redash/scripts/redash-mcp-config.js index a7a16e3..cd32cd7 100644 --- a/plugins/mcp/shared/mcp-redash/scripts/redash-mcp-config.js +++ b/plugins/mcp/shared/mcp-redash/scripts/redash-mcp-config.js @@ -32,6 +32,14 @@ function mcpName(suffix) { return `redash-${suffix}`; } +function validateSuffix(suffix) { + if (!/^[a-z0-9][a-z0-9-]*$/.test(suffix)) { + console.error('エラー: suffix は英小文字・数字・ハイフンのみで指定してください。'); + console.error('例: dev, stg, prod2, sandbox-1'); + process.exit(1); + } +} + function mcpEntry(suffix) { const env = envName(suffix); return { @@ -141,6 +149,7 @@ function cmdAdd(suffix) { console.error('suffix には dev, stg, prod2, sandbox などを指定してください。'); process.exit(1); } + validateSuffix(suffix); const name = mcpName(suffix); let data = readMcpJson(); @@ -183,6 +192,7 @@ function cmdRemove(suffix) { console.error('エラー: デフォルトの redash は plugin 同梱のため削除できません。'); process.exit(1); } + validateSuffix(suffix); const name = mcpName(suffix); let data = readMcpJson(); diff --git a/plugins/mcp/shared/mcp-redash/skills/redash-add/SKILL.md b/plugins/mcp/shared/mcp-redash/skills/redash-add/SKILL.md index f91167b..ce1fc02 100644 --- a/plugins/mcp/shared/mcp-redash/skills/redash-add/SKILL.md +++ b/plugins/mcp/shared/mcp-redash/skills/redash-add/SKILL.md @@ -19,7 +19,7 @@ allowed-tools: 以下のコマンドを実行してください。`$ARGUMENTS` にはユーザーが指定した suffix が入ります。 ```bash -node "${PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}}/scripts/redash-mcp-config.js" add $ARGUMENTS +node "${PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}}/scripts/redash-mcp-config.js" add "$ARGUMENTS" ``` ## 実行後 diff --git a/plugins/mcp/shared/mcp-redash/skills/redash-remove/SKILL.md b/plugins/mcp/shared/mcp-redash/skills/redash-remove/SKILL.md index 93d8a10..00fe202 100644 --- a/plugins/mcp/shared/mcp-redash/skills/redash-remove/SKILL.md +++ b/plugins/mcp/shared/mcp-redash/skills/redash-remove/SKILL.md @@ -19,7 +19,7 @@ allowed-tools: 以下のコマンドを実行してください。`$ARGUMENTS` にはユーザーが指定した suffix が入ります。 ```bash -node "${PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}}/scripts/redash-mcp-config.js" remove $ARGUMENTS +node "${PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}}/scripts/redash-mcp-config.js" remove "$ARGUMENTS" ``` ## 実行後 From d5c57f960e2bd13dd72c3d00541037ac0808b782 Mon Sep 17 00:00:00 2001 From: "takemi.ohama" Date: Tue, 7 Jul 2026 04:38:07 +0000 Subject: [PATCH 08/10] =?UTF-8?q?Fix:=20round=206=E3=81=AEMCP=20runtime?= =?UTF-8?q?=E6=8C=87=E6=91=98=E3=81=AB=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scripts/ensure-playwright.js | 5 +- plugins/mcp/codex/mcp-playwright/README.md | 68 +++----- .../scripts/ensure-playwright.js | 5 +- .../scripts/ensure-playwright.js | 5 +- .../mcp/shared/mcp-playwright/README.codex.md | 148 ++++++++++++++++++ .../scripts/ensure-playwright.js | 5 +- scripts/build-runtime-plugins.sh | 12 ++ 7 files changed, 195 insertions(+), 53 deletions(-) create mode 100644 plugins/mcp/shared/mcp-playwright/README.codex.md diff --git a/plugins/mcp/claude/mcp-playwright/scripts/ensure-playwright.js b/plugins/mcp/claude/mcp-playwright/scripts/ensure-playwright.js index faa02bd..48cd722 100755 --- a/plugins/mcp/claude/mcp-playwright/scripts/ensure-playwright.js +++ b/plugins/mcp/claude/mcp-playwright/scripts/ensure-playwright.js @@ -10,6 +10,7 @@ const FLAG_FILE = path.join(os.homedir(), '.claude-playwright-installed'); const BROWSER_PATH = path.join(os.homedir(), '.cache', 'ms-playwright'); const TIMEOUT_MS = 5 * 60 * 1000; // 5分タイムアウト const PLAYWRIGHT_VERSION_PATTERN = /^[~^]?\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/; +const EXEC_FILE_OPTIONS = process.platform === 'win32' ? { shell: true } : {}; // 既にインストール済みかチェック(冪等性) if (fs.existsSync(FLAG_FILE)) { @@ -30,7 +31,8 @@ try { const depsOutput = execFileSync('npm', ['view', '@playwright/mcp@latest', 'dependencies', '--json'], { encoding: 'utf-8', cwd: PLUGIN_ROOT, - timeout: 30000 + timeout: 30000, + ...EXEC_FILE_OPTIONS }); const deps = JSON.parse(depsOutput); @@ -52,6 +54,7 @@ try { stdio: 'inherit', cwd: PLUGIN_ROOT, timeout: TIMEOUT_MS, + ...EXEC_FILE_OPTIONS, env: { ...process.env, PLAYWRIGHT_BROWSERS_PATH: BROWSER_PATH, diff --git a/plugins/mcp/codex/mcp-playwright/README.md b/plugins/mcp/codex/mcp-playwright/README.md index 8662f56..5635b95 100644 --- a/plugins/mcp/codex/mcp-playwright/README.md +++ b/plugins/mcp/codex/mcp-playwright/README.md @@ -1,10 +1,10 @@ # playwright Plugin -Playwright MCPを自動的にセットアップし、ブラウザ自動化機能を提供するプラグインです。 +Playwright MCPを自動的にセットアップし、ブラウザ自動化機能をCodexで利用するためのプラグインです。 ## 概要 -このプラグインは、Playwright MCPサーバーとChromiumブラウザを自動的にインストール・設定します。Claude Codeでブラウザ自動化タスク(Webスクレイピング、E2Eテスト、スクリーンショット取得など)を簡単に実行できるようになります。 +このプラグインは、Playwright MCPサーバーとChromiumブラウザを自動的にインストール・設定します。Codexでブラウザ自動化タスク(Webスクレイピング、E2Eテスト、スクリーンショット取得など)を実行できるようになります。 ## 機能 @@ -15,26 +15,12 @@ Playwright MCPを自動的にセットアップし、ブラウザ自動化機能 ## インストール -### Claude Code - -```bash -/plugin install mcp-playwright@ai-plugins -``` - ### Codex ```bash codex plugin add mcp-playwright@ai-plugins ``` -### Kiro CLI - -Kiro では repository clone 後、対象 plugin の installer を project root で実行します。 - -```bash -bash plugins/mcp/kiro/mcp-playwright/install.sh -``` - ### 必要な環境変数 - `HOME` @@ -43,11 +29,10 @@ bash plugins/mcp/kiro/mcp-playwright/install.sh ### 基本的な使い方 -プラグインをインストールして、Claude Codeを起動するだけで自動的にセットアップが実行されます。 +プラグインをインストールして、Codexを起動すると自動的にセットアップが実行されます。 ```bash -# Claude Codeを起動 -claude +codex ``` 初回起動時、以下のようなメッセージが表示されます: @@ -74,44 +59,29 @@ Playwright Chromiumブラウザをインストール中... ### Playwright MCPツールの使用例 -セットアップ完了後、以下のようなタスクが実行できます: - -``` -// Webページにアクセスしてスクリーンショットを取得 -mcp__plugin_playwright__browser_navigate(url: "https://example.com") -mcp__plugin_playwright__browser_take_screenshot() - -// フォームに入力してボタンをクリック -mcp__plugin_playwright__browser_fill(selector: "#email", value: "test@example.com") -mcp__plugin_playwright__browser_click(selector: "button[type='submit']") - -// ページのスナップショットを取得(アクセシビリティツリー) -mcp__plugin_playwright__browser_snapshot() -``` +セットアップ完了後、CodexのMCPツール一覧に表示される `playwright` サーバーの `browser_*` ツールを利用できます。 ## 設定 ### MCP設定(`.mcp.json`) -プラグインは以下のMCP設定を提供します: +Codex runtimeでは、プラグイン内の `.mcp.json` は direct server map 形式で提供されます: ```json { - "mcpServers": { - "playwright": { - "type": "stdio", - "command": "npx", - "args": [ - "-y", - "@playwright/mcp@latest", - "--browser", - "chromium", - "--isolated", - "--no-sandbox" - ], - "env": { - "PLAYWRIGHT_BROWSERS_PATH": "${HOME}/.cache/ms-playwright" - } + "playwright": { + "type": "stdio", + "command": "npx", + "args": [ + "-y", + "@playwright/mcp@latest", + "--browser", + "chromium", + "--isolated", + "--no-sandbox" + ], + "env": { + "PLAYWRIGHT_BROWSERS_PATH": "${HOME}/.cache/ms-playwright" } } } diff --git a/plugins/mcp/codex/mcp-playwright/scripts/ensure-playwright.js b/plugins/mcp/codex/mcp-playwright/scripts/ensure-playwright.js index faa02bd..48cd722 100755 --- a/plugins/mcp/codex/mcp-playwright/scripts/ensure-playwright.js +++ b/plugins/mcp/codex/mcp-playwright/scripts/ensure-playwright.js @@ -10,6 +10,7 @@ const FLAG_FILE = path.join(os.homedir(), '.claude-playwright-installed'); const BROWSER_PATH = path.join(os.homedir(), '.cache', 'ms-playwright'); const TIMEOUT_MS = 5 * 60 * 1000; // 5分タイムアウト const PLAYWRIGHT_VERSION_PATTERN = /^[~^]?\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/; +const EXEC_FILE_OPTIONS = process.platform === 'win32' ? { shell: true } : {}; // 既にインストール済みかチェック(冪等性) if (fs.existsSync(FLAG_FILE)) { @@ -30,7 +31,8 @@ try { const depsOutput = execFileSync('npm', ['view', '@playwright/mcp@latest', 'dependencies', '--json'], { encoding: 'utf-8', cwd: PLUGIN_ROOT, - timeout: 30000 + timeout: 30000, + ...EXEC_FILE_OPTIONS }); const deps = JSON.parse(depsOutput); @@ -52,6 +54,7 @@ try { stdio: 'inherit', cwd: PLUGIN_ROOT, timeout: TIMEOUT_MS, + ...EXEC_FILE_OPTIONS, env: { ...process.env, PLAYWRIGHT_BROWSERS_PATH: BROWSER_PATH, diff --git a/plugins/mcp/kiro/mcp-playwright/scripts/ensure-playwright.js b/plugins/mcp/kiro/mcp-playwright/scripts/ensure-playwright.js index faa02bd..48cd722 100755 --- a/plugins/mcp/kiro/mcp-playwright/scripts/ensure-playwright.js +++ b/plugins/mcp/kiro/mcp-playwright/scripts/ensure-playwright.js @@ -10,6 +10,7 @@ const FLAG_FILE = path.join(os.homedir(), '.claude-playwright-installed'); const BROWSER_PATH = path.join(os.homedir(), '.cache', 'ms-playwright'); const TIMEOUT_MS = 5 * 60 * 1000; // 5分タイムアウト const PLAYWRIGHT_VERSION_PATTERN = /^[~^]?\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/; +const EXEC_FILE_OPTIONS = process.platform === 'win32' ? { shell: true } : {}; // 既にインストール済みかチェック(冪等性) if (fs.existsSync(FLAG_FILE)) { @@ -30,7 +31,8 @@ try { const depsOutput = execFileSync('npm', ['view', '@playwright/mcp@latest', 'dependencies', '--json'], { encoding: 'utf-8', cwd: PLUGIN_ROOT, - timeout: 30000 + timeout: 30000, + ...EXEC_FILE_OPTIONS }); const deps = JSON.parse(depsOutput); @@ -52,6 +54,7 @@ try { stdio: 'inherit', cwd: PLUGIN_ROOT, timeout: TIMEOUT_MS, + ...EXEC_FILE_OPTIONS, env: { ...process.env, PLAYWRIGHT_BROWSERS_PATH: BROWSER_PATH, diff --git a/plugins/mcp/shared/mcp-playwright/README.codex.md b/plugins/mcp/shared/mcp-playwright/README.codex.md new file mode 100644 index 0000000..5635b95 --- /dev/null +++ b/plugins/mcp/shared/mcp-playwright/README.codex.md @@ -0,0 +1,148 @@ +# playwright Plugin + +Playwright MCPを自動的にセットアップし、ブラウザ自動化機能をCodexで利用するためのプラグインです。 + +## 概要 + +このプラグインは、Playwright MCPサーバーとChromiumブラウザを自動的にインストール・設定します。Codexでブラウザ自動化タスク(Webスクレイピング、E2Eテスト、スクリーンショット取得など)を実行できるようになります。 + +## 機能 + +- **自動セットアップ**: 初回起動時にPlaywright Chromiumブラウザを自動インストール +- **バージョン互換性**: @playwright/mcpと互換性のあるPlaywrightバージョンを自動検出 +- **冪等性**: 既にインストール済みの場合はスキップ(高速起動) +- **環境変数対応**: PLAYWRIGHT_BROWSERS_PATHで共有キャッシュを利用 + +## インストール + +### Codex + +```bash +codex plugin add mcp-playwright@ai-plugins +``` + +### 必要な環境変数 + +- `HOME` + +## 使用方法 + +### 基本的な使い方 + +プラグインをインストールして、Codexを起動すると自動的にセットアップが実行されます。 + +```bash +codex +``` + +初回起動時、以下のようなメッセージが表示されます: + +``` +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +🎭 Playwright MCP Plugin: 初回セットアップ +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +Playwright Chromiumブラウザをインストール中... +ネットワーク環境により1-2分かかる場合があります。 + +🔍 @playwright/mcpが使用するPlaywrightバージョンを確認中... +✓ Playwright 1.49.1 を使用します + +📦 Playwright 1.49.1 でChromiumをインストール中... +[インストールログ...] + +✅ セットアップ完了!Playwright Chromiumの準備ができました。 + Playwrightバージョン: 1.49.1 + ブラウザパス: ~/.cache/ms-playwright +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +``` + +### Playwright MCPツールの使用例 + +セットアップ完了後、CodexのMCPツール一覧に表示される `playwright` サーバーの `browser_*` ツールを利用できます。 + +## 設定 + +### MCP設定(`.mcp.json`) + +Codex runtimeでは、プラグイン内の `.mcp.json` は direct server map 形式で提供されます: + +```json +{ + "playwright": { + "type": "stdio", + "command": "npx", + "args": [ + "-y", + "@playwright/mcp@latest", + "--browser", + "chromium", + "--isolated", + "--no-sandbox" + ], + "env": { + "PLAYWRIGHT_BROWSERS_PATH": "${HOME}/.cache/ms-playwright" + } + } +} +``` + +### ブラウザキャッシュパス + +デフォルトでは、Chromiumブラウザは `~/.cache/ms-playwright` にインストールされます。 + +別の場所を使用したい場合は、環境変数を設定してください: + +```bash +export PLAYWRIGHT_BROWSERS_PATH=/path/to/custom/location +``` + +## トラブルシューティング + +### インストールが失敗する場合 + +1. **手動インストール**: + ```bash + # 互換性のあるバージョンを確認 + npm view @playwright/mcp@latest dependencies + + # Chromiumをインストール + PLAYWRIGHT_BROWSERS_PATH=~/.cache/ms-playwright npx playwright@ install chromium + ``` + +2. **キャッシュをクリア**: + ```bash + rm ~/.claude-playwright-installed + ``` + +3. **ログを確認**: + プラグインは詳細なログを出力するので、エラーメッセージを確認してください。 + +### ブラウザが見つからない場合 + +環境変数 `PLAYWRIGHT_BROWSERS_PATH` が正しく設定されているか確認してください: + +```bash +echo $PLAYWRIGHT_BROWSERS_PATH +ls -la ~/.cache/ms-playwright +``` + +### タイムアウトエラー + +ネットワーク環境が遅い場合、インストールに時間がかかることがあります。 +デフォルトのタイムアウトは5分です。 + +## 参考資料 + +- [Playwright公式ドキュメント](https://playwright.dev/) +- [@playwright/mcp README](https://www.npmjs.com/package/@playwright/mcp) +- [Playwright Browser Management](https://playwright.dev/docs/browsers) + +## ライセンス + +MIT License + +## サポート + +問題が発生した場合は、GitHubリポジトリでissueを作成してください: +https://github.com/devbasex/ai-plugins/issues diff --git a/plugins/mcp/shared/mcp-playwright/scripts/ensure-playwright.js b/plugins/mcp/shared/mcp-playwright/scripts/ensure-playwright.js index faa02bd..48cd722 100755 --- a/plugins/mcp/shared/mcp-playwright/scripts/ensure-playwright.js +++ b/plugins/mcp/shared/mcp-playwright/scripts/ensure-playwright.js @@ -10,6 +10,7 @@ const FLAG_FILE = path.join(os.homedir(), '.claude-playwright-installed'); const BROWSER_PATH = path.join(os.homedir(), '.cache', 'ms-playwright'); const TIMEOUT_MS = 5 * 60 * 1000; // 5分タイムアウト const PLAYWRIGHT_VERSION_PATTERN = /^[~^]?\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/; +const EXEC_FILE_OPTIONS = process.platform === 'win32' ? { shell: true } : {}; // 既にインストール済みかチェック(冪等性) if (fs.existsSync(FLAG_FILE)) { @@ -30,7 +31,8 @@ try { const depsOutput = execFileSync('npm', ['view', '@playwright/mcp@latest', 'dependencies', '--json'], { encoding: 'utf-8', cwd: PLUGIN_ROOT, - timeout: 30000 + timeout: 30000, + ...EXEC_FILE_OPTIONS }); const deps = JSON.parse(depsOutput); @@ -52,6 +54,7 @@ try { stdio: 'inherit', cwd: PLUGIN_ROOT, timeout: TIMEOUT_MS, + ...EXEC_FILE_OPTIONS, env: { ...process.env, PLAYWRIGHT_BROWSERS_PATH: BROWSER_PATH, diff --git a/scripts/build-runtime-plugins.sh b/scripts/build-runtime-plugins.sh index 199b210..e09aa9a 100755 --- a/scripts/build-runtime-plugins.sh +++ b/scripts/build-runtime-plugins.sh @@ -287,6 +287,17 @@ config_path.write_text(json.dumps(servers, indent=2, ensure_ascii=False) + "\n") PY } +apply_mcp_readme_template() { + local runtime="$1" + local plugin_dir="$2" + local readme_template="$plugin_dir/README.$runtime.md" + + if [ -f "$readme_template" ]; then + mv "$readme_template" "$plugin_dir/README.md" + fi + rm -f "$plugin_dir"/README.claude.md "$plugin_dir"/README.codex.md "$plugin_dir"/README.kiro.md +} + rewrite_kiro_mcp_paths() { local plugin_dir="$1" local plugin_name="$2" @@ -461,6 +472,7 @@ sync_mcp_runtime() { -name '*.pyc' -o \ -name '*.pyo' \ \) -exec rm -rf {} + 2>/dev/null || true + apply_mcp_readme_template "$runtime" "$tmp_dir" case "$runtime" in claude) From 6a4b091f746d8dbd69fdb1b72134f473f815adad Mon Sep 17 00:00:00 2001 From: "takemi.ohama" Date: Tue, 7 Jul 2026 04:45:34 +0000 Subject: [PATCH 09/10] =?UTF-8?q?Fix:=20cross-review=20round=207=20?= =?UTF-8?q?=E3=81=AE=E6=8C=87=E6=91=98=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CLAUDE.md | 2 +- docs/specifications/ndf-knowledge-and-kiro.md | 2 +- .../scripts/ensure-playwright.js | 19 ++++++- .../mcp-redash/scripts/redash-mcp-config.js | 57 ++++++++++++++++++- plugins/mcp/claude/mcp-serena/.mcp.json | 2 +- .../scripts/ensure-playwright.js | 19 ++++++- .../mcp-redash/scripts/redash-mcp-config.js | 57 ++++++++++++++++++- plugins/mcp/codex/mcp-serena/.mcp.json | 2 +- .../scripts/ensure-playwright.js | 19 ++++++- .../mcp-redash/scripts/redash-mcp-config.js | 57 ++++++++++++++++++- plugins/mcp/kiro/mcp-serena/.mcp.json | 2 +- .../scripts/ensure-playwright.js | 19 ++++++- .../mcp-redash/scripts/redash-mcp-config.js | 57 ++++++++++++++++++- plugins/mcp/shared/mcp-serena/.mcp.json | 2 +- 14 files changed, 294 insertions(+), 22 deletions(-) mode change 100644 => 100755 plugins/mcp/claude/mcp-redash/scripts/redash-mcp-config.js mode change 100644 => 100755 plugins/mcp/codex/mcp-redash/scripts/redash-mcp-config.js mode change 100644 => 100755 plugins/mcp/kiro/mcp-redash/scripts/redash-mcp-config.js mode change 100644 => 100755 plugins/mcp/shared/mcp-redash/scripts/redash-mcp-config.js diff --git a/CLAUDE.md b/CLAUDE.md index 352fdf2..26753da 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -17,7 +17,7 @@ Serena MCPは**mcp-serena**プラグインとして提供されます(NDFと **Serena memoryは使用禁止**。知識は `docs/` に、手順は `skills/` に配置してください。 -詳細は `plugins/mcp/claude/mcp-serena/docs/serena-guide.md` を参照。 +詳細は `plugins/mcp/shared/mcp-serena/docs/serena-guide.md` を参照。 ## 知識アーキテクチャ diff --git a/docs/specifications/ndf-knowledge-and-kiro.md b/docs/specifications/ndf-knowledge-and-kiro.md index 82fef4d..e0f0724 100644 --- a/docs/specifications/ndf-knowledge-and-kiro.md +++ b/docs/specifications/ndf-knowledge-and-kiro.md @@ -59,6 +59,6 @@ Codex 連携は MCP サーバではなく `/ndf:codex` skill と `corder` エー ## 関連リンク -- [mcp-serena README](../../plugins/mcp/claude/mcp-serena/README.md) +- [mcp-serena README](../../plugins/mcp/shared/mcp-serena/README.md) - [NDF Plugin リファレンス](../ndf-plugin-reference.md) - [NDF README](../../plugins/ndf/README.md) diff --git a/plugins/mcp/claude/mcp-playwright/scripts/ensure-playwright.js b/plugins/mcp/claude/mcp-playwright/scripts/ensure-playwright.js index 48cd722..4d33996 100755 --- a/plugins/mcp/claude/mcp-playwright/scripts/ensure-playwright.js +++ b/plugins/mcp/claude/mcp-playwright/scripts/ensure-playwright.js @@ -12,9 +12,16 @@ const TIMEOUT_MS = 5 * 60 * 1000; // 5分タイムアウト const PLAYWRIGHT_VERSION_PATTERN = /^[~^]?\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/; const EXEC_FILE_OPTIONS = process.platform === 'win32' ? { shell: true } : {}; -// 既にインストール済みかチェック(冪等性) -if (fs.existsSync(FLAG_FILE)) { - process.exit(0); +function readInstalledVersion() { + if (!fs.existsSync(FLAG_FILE)) { + return null; + } + try { + const flagData = JSON.parse(fs.readFileSync(FLAG_FILE, 'utf-8')); + return typeof flagData.playwrightVersion === 'string' ? flagData.playwrightVersion : null; + } catch { + return null; + } } console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'); @@ -48,6 +55,12 @@ try { console.log(`✓ Playwright ${playwrightVersion} を使用します`); console.log(''); + const installedVersion = readInstalledVersion(); + if (installedVersion === playwrightVersion) { + console.log('既に同じ Playwright バージョンでセットアップ済みです。'); + process.exit(0); + } + // @playwright/mcpと互換性のあるバージョンのChromiumをインストール console.log(`📦 Playwright ${playwrightVersion} でChromiumをインストール中...`); execFileSync('npx', ['-y', `playwright@${playwrightVersion}`, 'install', 'chromium'], { diff --git a/plugins/mcp/claude/mcp-redash/scripts/redash-mcp-config.js b/plugins/mcp/claude/mcp-redash/scripts/redash-mcp-config.js old mode 100644 new mode 100755 index cd32cd7..416c8ef --- a/plugins/mcp/claude/mcp-redash/scripts/redash-mcp-config.js +++ b/plugins/mcp/claude/mcp-redash/scripts/redash-mcp-config.js @@ -16,7 +16,9 @@ const fs = require('fs'); const path = require('path'); const MCP_PACKAGE = '@suthio/redash-mcp'; -const MCP_JSON_PATH = path.join(resolveProjectRoot(), '.mcp.json'); +const PROJECT_ROOT = resolveProjectRoot(); +const MCP_JSON_PATH = path.join(PROJECT_ROOT, '.mcp.json'); +const KIRO_AGENT_PATH = path.join(PROJECT_ROOT, '.kiro', 'agents', 'default.json'); // --- helpers --- @@ -56,6 +58,11 @@ function isCodexRuntime() { return Boolean(process.env.CODEX_PLUGIN_ROOT) || path.normalize(__dirname).split(path.sep).includes('codex'); } +function isKiroRuntime() { + const parts = path.normalize(__dirname).split(path.sep); + return Boolean(process.env.KIRO_WORKSPACE_ROOT) || parts.includes('kiro') || parts.includes('.kiro'); +} + function resolveProjectRoot() { const envNames = [ 'PROJECT_ROOT', @@ -137,6 +144,46 @@ function writeMcpJson(data) { fs.writeFileSync(MCP_JSON_PATH, JSON.stringify(data, null, 2) + '\n', 'utf-8'); } +function syncKiroAgent(data) { + if (!isKiroRuntime()) { + return; + } + + const servers = serverMap(data, false) || {}; + let agent = {}; + if (fs.existsSync(KIRO_AGENT_PATH)) { + try { + agent = JSON.parse(fs.readFileSync(KIRO_AGENT_PATH, 'utf-8')); + } catch { + console.error('エラー: .kiro/agents/default.json の JSON が壊れています。手動で修正してください。'); + process.exit(1); + } + } else { + agent = { + name: 'default', + resources: ['skill://.kiro/skills/**/SKILL.md'], + }; + } + + if (!agent.mcpServers || typeof agent.mcpServers !== 'object' || Array.isArray(agent.mcpServers)) { + agent.mcpServers = {}; + } + + for (const name of Object.keys(agent.mcpServers)) { + if (isRedashServer(name)) { + delete agent.mcpServers[name]; + } + } + for (const [name, server] of Object.entries(servers)) { + if (isRedashServer(name)) { + agent.mcpServers[name] = server; + } + } + + fs.mkdirSync(path.dirname(KIRO_AGENT_PATH), { recursive: true }); + fs.writeFileSync(KIRO_AGENT_PATH, JSON.stringify(agent, null, 2) + '\n', 'utf-8'); +} + function isRedashServer(name) { return name === 'redash' || name.startsWith('redash-'); } @@ -176,9 +223,13 @@ function cmdAdd(suffix) { servers[name] = mcpEntry(suffix); writeMcpJson(data); + syncKiroAgent(data); const env = envName(suffix); console.log(`${name} を .mcp.json に追加しました。`); + if (isKiroRuntime()) { + console.log(`${name} を .kiro/agents/default.json に同期しました。`); + } console.log(''); console.log('必要な環境変数:'); console.log(` ${env.url}`); @@ -210,8 +261,12 @@ function cmdRemove(suffix) { delete servers[name]; writeMcpJson(data); + syncKiroAgent(data); console.log(`${name} を .mcp.json から削除しました。`); + if (isKiroRuntime()) { + console.log(`${name} を .kiro/agents/default.json から削除しました。`); + } } function cmdList() { diff --git a/plugins/mcp/claude/mcp-serena/.mcp.json b/plugins/mcp/claude/mcp-serena/.mcp.json index c21f7a2..17de95a 100644 --- a/plugins/mcp/claude/mcp-serena/.mcp.json +++ b/plugins/mcp/claude/mcp-serena/.mcp.json @@ -14,7 +14,7 @@ "False" ], "env": { - "SERENA_HOME": "${SERENA_HOME:-.serena}" + "SERENA_HOME": ".serena" } } } diff --git a/plugins/mcp/codex/mcp-playwright/scripts/ensure-playwright.js b/plugins/mcp/codex/mcp-playwright/scripts/ensure-playwright.js index 48cd722..4d33996 100755 --- a/plugins/mcp/codex/mcp-playwright/scripts/ensure-playwright.js +++ b/plugins/mcp/codex/mcp-playwright/scripts/ensure-playwright.js @@ -12,9 +12,16 @@ const TIMEOUT_MS = 5 * 60 * 1000; // 5分タイムアウト const PLAYWRIGHT_VERSION_PATTERN = /^[~^]?\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/; const EXEC_FILE_OPTIONS = process.platform === 'win32' ? { shell: true } : {}; -// 既にインストール済みかチェック(冪等性) -if (fs.existsSync(FLAG_FILE)) { - process.exit(0); +function readInstalledVersion() { + if (!fs.existsSync(FLAG_FILE)) { + return null; + } + try { + const flagData = JSON.parse(fs.readFileSync(FLAG_FILE, 'utf-8')); + return typeof flagData.playwrightVersion === 'string' ? flagData.playwrightVersion : null; + } catch { + return null; + } } console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'); @@ -48,6 +55,12 @@ try { console.log(`✓ Playwright ${playwrightVersion} を使用します`); console.log(''); + const installedVersion = readInstalledVersion(); + if (installedVersion === playwrightVersion) { + console.log('既に同じ Playwright バージョンでセットアップ済みです。'); + process.exit(0); + } + // @playwright/mcpと互換性のあるバージョンのChromiumをインストール console.log(`📦 Playwright ${playwrightVersion} でChromiumをインストール中...`); execFileSync('npx', ['-y', `playwright@${playwrightVersion}`, 'install', 'chromium'], { diff --git a/plugins/mcp/codex/mcp-redash/scripts/redash-mcp-config.js b/plugins/mcp/codex/mcp-redash/scripts/redash-mcp-config.js old mode 100644 new mode 100755 index cd32cd7..416c8ef --- a/plugins/mcp/codex/mcp-redash/scripts/redash-mcp-config.js +++ b/plugins/mcp/codex/mcp-redash/scripts/redash-mcp-config.js @@ -16,7 +16,9 @@ const fs = require('fs'); const path = require('path'); const MCP_PACKAGE = '@suthio/redash-mcp'; -const MCP_JSON_PATH = path.join(resolveProjectRoot(), '.mcp.json'); +const PROJECT_ROOT = resolveProjectRoot(); +const MCP_JSON_PATH = path.join(PROJECT_ROOT, '.mcp.json'); +const KIRO_AGENT_PATH = path.join(PROJECT_ROOT, '.kiro', 'agents', 'default.json'); // --- helpers --- @@ -56,6 +58,11 @@ function isCodexRuntime() { return Boolean(process.env.CODEX_PLUGIN_ROOT) || path.normalize(__dirname).split(path.sep).includes('codex'); } +function isKiroRuntime() { + const parts = path.normalize(__dirname).split(path.sep); + return Boolean(process.env.KIRO_WORKSPACE_ROOT) || parts.includes('kiro') || parts.includes('.kiro'); +} + function resolveProjectRoot() { const envNames = [ 'PROJECT_ROOT', @@ -137,6 +144,46 @@ function writeMcpJson(data) { fs.writeFileSync(MCP_JSON_PATH, JSON.stringify(data, null, 2) + '\n', 'utf-8'); } +function syncKiroAgent(data) { + if (!isKiroRuntime()) { + return; + } + + const servers = serverMap(data, false) || {}; + let agent = {}; + if (fs.existsSync(KIRO_AGENT_PATH)) { + try { + agent = JSON.parse(fs.readFileSync(KIRO_AGENT_PATH, 'utf-8')); + } catch { + console.error('エラー: .kiro/agents/default.json の JSON が壊れています。手動で修正してください。'); + process.exit(1); + } + } else { + agent = { + name: 'default', + resources: ['skill://.kiro/skills/**/SKILL.md'], + }; + } + + if (!agent.mcpServers || typeof agent.mcpServers !== 'object' || Array.isArray(agent.mcpServers)) { + agent.mcpServers = {}; + } + + for (const name of Object.keys(agent.mcpServers)) { + if (isRedashServer(name)) { + delete agent.mcpServers[name]; + } + } + for (const [name, server] of Object.entries(servers)) { + if (isRedashServer(name)) { + agent.mcpServers[name] = server; + } + } + + fs.mkdirSync(path.dirname(KIRO_AGENT_PATH), { recursive: true }); + fs.writeFileSync(KIRO_AGENT_PATH, JSON.stringify(agent, null, 2) + '\n', 'utf-8'); +} + function isRedashServer(name) { return name === 'redash' || name.startsWith('redash-'); } @@ -176,9 +223,13 @@ function cmdAdd(suffix) { servers[name] = mcpEntry(suffix); writeMcpJson(data); + syncKiroAgent(data); const env = envName(suffix); console.log(`${name} を .mcp.json に追加しました。`); + if (isKiroRuntime()) { + console.log(`${name} を .kiro/agents/default.json に同期しました。`); + } console.log(''); console.log('必要な環境変数:'); console.log(` ${env.url}`); @@ -210,8 +261,12 @@ function cmdRemove(suffix) { delete servers[name]; writeMcpJson(data); + syncKiroAgent(data); console.log(`${name} を .mcp.json から削除しました。`); + if (isKiroRuntime()) { + console.log(`${name} を .kiro/agents/default.json から削除しました。`); + } } function cmdList() { diff --git a/plugins/mcp/codex/mcp-serena/.mcp.json b/plugins/mcp/codex/mcp-serena/.mcp.json index 3746657..e0aca4e 100644 --- a/plugins/mcp/codex/mcp-serena/.mcp.json +++ b/plugins/mcp/codex/mcp-serena/.mcp.json @@ -13,7 +13,7 @@ "False" ], "env": { - "SERENA_HOME": "${SERENA_HOME:-.serena}" + "SERENA_HOME": ".serena" } } } diff --git a/plugins/mcp/kiro/mcp-playwright/scripts/ensure-playwright.js b/plugins/mcp/kiro/mcp-playwright/scripts/ensure-playwright.js index 48cd722..4d33996 100755 --- a/plugins/mcp/kiro/mcp-playwright/scripts/ensure-playwright.js +++ b/plugins/mcp/kiro/mcp-playwright/scripts/ensure-playwright.js @@ -12,9 +12,16 @@ const TIMEOUT_MS = 5 * 60 * 1000; // 5分タイムアウト const PLAYWRIGHT_VERSION_PATTERN = /^[~^]?\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/; const EXEC_FILE_OPTIONS = process.platform === 'win32' ? { shell: true } : {}; -// 既にインストール済みかチェック(冪等性) -if (fs.existsSync(FLAG_FILE)) { - process.exit(0); +function readInstalledVersion() { + if (!fs.existsSync(FLAG_FILE)) { + return null; + } + try { + const flagData = JSON.parse(fs.readFileSync(FLAG_FILE, 'utf-8')); + return typeof flagData.playwrightVersion === 'string' ? flagData.playwrightVersion : null; + } catch { + return null; + } } console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'); @@ -48,6 +55,12 @@ try { console.log(`✓ Playwright ${playwrightVersion} を使用します`); console.log(''); + const installedVersion = readInstalledVersion(); + if (installedVersion === playwrightVersion) { + console.log('既に同じ Playwright バージョンでセットアップ済みです。'); + process.exit(0); + } + // @playwright/mcpと互換性のあるバージョンのChromiumをインストール console.log(`📦 Playwright ${playwrightVersion} でChromiumをインストール中...`); execFileSync('npx', ['-y', `playwright@${playwrightVersion}`, 'install', 'chromium'], { diff --git a/plugins/mcp/kiro/mcp-redash/scripts/redash-mcp-config.js b/plugins/mcp/kiro/mcp-redash/scripts/redash-mcp-config.js old mode 100644 new mode 100755 index cd32cd7..416c8ef --- a/plugins/mcp/kiro/mcp-redash/scripts/redash-mcp-config.js +++ b/plugins/mcp/kiro/mcp-redash/scripts/redash-mcp-config.js @@ -16,7 +16,9 @@ const fs = require('fs'); const path = require('path'); const MCP_PACKAGE = '@suthio/redash-mcp'; -const MCP_JSON_PATH = path.join(resolveProjectRoot(), '.mcp.json'); +const PROJECT_ROOT = resolveProjectRoot(); +const MCP_JSON_PATH = path.join(PROJECT_ROOT, '.mcp.json'); +const KIRO_AGENT_PATH = path.join(PROJECT_ROOT, '.kiro', 'agents', 'default.json'); // --- helpers --- @@ -56,6 +58,11 @@ function isCodexRuntime() { return Boolean(process.env.CODEX_PLUGIN_ROOT) || path.normalize(__dirname).split(path.sep).includes('codex'); } +function isKiroRuntime() { + const parts = path.normalize(__dirname).split(path.sep); + return Boolean(process.env.KIRO_WORKSPACE_ROOT) || parts.includes('kiro') || parts.includes('.kiro'); +} + function resolveProjectRoot() { const envNames = [ 'PROJECT_ROOT', @@ -137,6 +144,46 @@ function writeMcpJson(data) { fs.writeFileSync(MCP_JSON_PATH, JSON.stringify(data, null, 2) + '\n', 'utf-8'); } +function syncKiroAgent(data) { + if (!isKiroRuntime()) { + return; + } + + const servers = serverMap(data, false) || {}; + let agent = {}; + if (fs.existsSync(KIRO_AGENT_PATH)) { + try { + agent = JSON.parse(fs.readFileSync(KIRO_AGENT_PATH, 'utf-8')); + } catch { + console.error('エラー: .kiro/agents/default.json の JSON が壊れています。手動で修正してください。'); + process.exit(1); + } + } else { + agent = { + name: 'default', + resources: ['skill://.kiro/skills/**/SKILL.md'], + }; + } + + if (!agent.mcpServers || typeof agent.mcpServers !== 'object' || Array.isArray(agent.mcpServers)) { + agent.mcpServers = {}; + } + + for (const name of Object.keys(agent.mcpServers)) { + if (isRedashServer(name)) { + delete agent.mcpServers[name]; + } + } + for (const [name, server] of Object.entries(servers)) { + if (isRedashServer(name)) { + agent.mcpServers[name] = server; + } + } + + fs.mkdirSync(path.dirname(KIRO_AGENT_PATH), { recursive: true }); + fs.writeFileSync(KIRO_AGENT_PATH, JSON.stringify(agent, null, 2) + '\n', 'utf-8'); +} + function isRedashServer(name) { return name === 'redash' || name.startsWith('redash-'); } @@ -176,9 +223,13 @@ function cmdAdd(suffix) { servers[name] = mcpEntry(suffix); writeMcpJson(data); + syncKiroAgent(data); const env = envName(suffix); console.log(`${name} を .mcp.json に追加しました。`); + if (isKiroRuntime()) { + console.log(`${name} を .kiro/agents/default.json に同期しました。`); + } console.log(''); console.log('必要な環境変数:'); console.log(` ${env.url}`); @@ -210,8 +261,12 @@ function cmdRemove(suffix) { delete servers[name]; writeMcpJson(data); + syncKiroAgent(data); console.log(`${name} を .mcp.json から削除しました。`); + if (isKiroRuntime()) { + console.log(`${name} を .kiro/agents/default.json から削除しました。`); + } } function cmdList() { diff --git a/plugins/mcp/kiro/mcp-serena/.mcp.json b/plugins/mcp/kiro/mcp-serena/.mcp.json index c21f7a2..17de95a 100644 --- a/plugins/mcp/kiro/mcp-serena/.mcp.json +++ b/plugins/mcp/kiro/mcp-serena/.mcp.json @@ -14,7 +14,7 @@ "False" ], "env": { - "SERENA_HOME": "${SERENA_HOME:-.serena}" + "SERENA_HOME": ".serena" } } } diff --git a/plugins/mcp/shared/mcp-playwright/scripts/ensure-playwright.js b/plugins/mcp/shared/mcp-playwright/scripts/ensure-playwright.js index 48cd722..4d33996 100755 --- a/plugins/mcp/shared/mcp-playwright/scripts/ensure-playwright.js +++ b/plugins/mcp/shared/mcp-playwright/scripts/ensure-playwright.js @@ -12,9 +12,16 @@ const TIMEOUT_MS = 5 * 60 * 1000; // 5分タイムアウト const PLAYWRIGHT_VERSION_PATTERN = /^[~^]?\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/; const EXEC_FILE_OPTIONS = process.platform === 'win32' ? { shell: true } : {}; -// 既にインストール済みかチェック(冪等性) -if (fs.existsSync(FLAG_FILE)) { - process.exit(0); +function readInstalledVersion() { + if (!fs.existsSync(FLAG_FILE)) { + return null; + } + try { + const flagData = JSON.parse(fs.readFileSync(FLAG_FILE, 'utf-8')); + return typeof flagData.playwrightVersion === 'string' ? flagData.playwrightVersion : null; + } catch { + return null; + } } console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'); @@ -48,6 +55,12 @@ try { console.log(`✓ Playwright ${playwrightVersion} を使用します`); console.log(''); + const installedVersion = readInstalledVersion(); + if (installedVersion === playwrightVersion) { + console.log('既に同じ Playwright バージョンでセットアップ済みです。'); + process.exit(0); + } + // @playwright/mcpと互換性のあるバージョンのChromiumをインストール console.log(`📦 Playwright ${playwrightVersion} でChromiumをインストール中...`); execFileSync('npx', ['-y', `playwright@${playwrightVersion}`, 'install', 'chromium'], { diff --git a/plugins/mcp/shared/mcp-redash/scripts/redash-mcp-config.js b/plugins/mcp/shared/mcp-redash/scripts/redash-mcp-config.js old mode 100644 new mode 100755 index cd32cd7..416c8ef --- a/plugins/mcp/shared/mcp-redash/scripts/redash-mcp-config.js +++ b/plugins/mcp/shared/mcp-redash/scripts/redash-mcp-config.js @@ -16,7 +16,9 @@ const fs = require('fs'); const path = require('path'); const MCP_PACKAGE = '@suthio/redash-mcp'; -const MCP_JSON_PATH = path.join(resolveProjectRoot(), '.mcp.json'); +const PROJECT_ROOT = resolveProjectRoot(); +const MCP_JSON_PATH = path.join(PROJECT_ROOT, '.mcp.json'); +const KIRO_AGENT_PATH = path.join(PROJECT_ROOT, '.kiro', 'agents', 'default.json'); // --- helpers --- @@ -56,6 +58,11 @@ function isCodexRuntime() { return Boolean(process.env.CODEX_PLUGIN_ROOT) || path.normalize(__dirname).split(path.sep).includes('codex'); } +function isKiroRuntime() { + const parts = path.normalize(__dirname).split(path.sep); + return Boolean(process.env.KIRO_WORKSPACE_ROOT) || parts.includes('kiro') || parts.includes('.kiro'); +} + function resolveProjectRoot() { const envNames = [ 'PROJECT_ROOT', @@ -137,6 +144,46 @@ function writeMcpJson(data) { fs.writeFileSync(MCP_JSON_PATH, JSON.stringify(data, null, 2) + '\n', 'utf-8'); } +function syncKiroAgent(data) { + if (!isKiroRuntime()) { + return; + } + + const servers = serverMap(data, false) || {}; + let agent = {}; + if (fs.existsSync(KIRO_AGENT_PATH)) { + try { + agent = JSON.parse(fs.readFileSync(KIRO_AGENT_PATH, 'utf-8')); + } catch { + console.error('エラー: .kiro/agents/default.json の JSON が壊れています。手動で修正してください。'); + process.exit(1); + } + } else { + agent = { + name: 'default', + resources: ['skill://.kiro/skills/**/SKILL.md'], + }; + } + + if (!agent.mcpServers || typeof agent.mcpServers !== 'object' || Array.isArray(agent.mcpServers)) { + agent.mcpServers = {}; + } + + for (const name of Object.keys(agent.mcpServers)) { + if (isRedashServer(name)) { + delete agent.mcpServers[name]; + } + } + for (const [name, server] of Object.entries(servers)) { + if (isRedashServer(name)) { + agent.mcpServers[name] = server; + } + } + + fs.mkdirSync(path.dirname(KIRO_AGENT_PATH), { recursive: true }); + fs.writeFileSync(KIRO_AGENT_PATH, JSON.stringify(agent, null, 2) + '\n', 'utf-8'); +} + function isRedashServer(name) { return name === 'redash' || name.startsWith('redash-'); } @@ -176,9 +223,13 @@ function cmdAdd(suffix) { servers[name] = mcpEntry(suffix); writeMcpJson(data); + syncKiroAgent(data); const env = envName(suffix); console.log(`${name} を .mcp.json に追加しました。`); + if (isKiroRuntime()) { + console.log(`${name} を .kiro/agents/default.json に同期しました。`); + } console.log(''); console.log('必要な環境変数:'); console.log(` ${env.url}`); @@ -210,8 +261,12 @@ function cmdRemove(suffix) { delete servers[name]; writeMcpJson(data); + syncKiroAgent(data); console.log(`${name} を .mcp.json から削除しました。`); + if (isKiroRuntime()) { + console.log(`${name} を .kiro/agents/default.json から削除しました。`); + } } function cmdList() { diff --git a/plugins/mcp/shared/mcp-serena/.mcp.json b/plugins/mcp/shared/mcp-serena/.mcp.json index c21f7a2..17de95a 100644 --- a/plugins/mcp/shared/mcp-serena/.mcp.json +++ b/plugins/mcp/shared/mcp-serena/.mcp.json @@ -14,7 +14,7 @@ "False" ], "env": { - "SERENA_HOME": "${SERENA_HOME:-.serena}" + "SERENA_HOME": ".serena" } } } From e47f478cfb9bd2a021043d772a5236c33bbd0a0b Mon Sep 17 00:00:00 2001 From: "takemi.ohama" Date: Tue, 7 Jul 2026 04:53:22 +0000 Subject: [PATCH 10/10] =?UTF-8?q?Fix:=20Redash=20MCP=E8=A8=AD=E5=AE=9A?= =?UTF-8?q?=E3=81=AEsuffix=E3=81=A8schema=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/mcp/claude/mcp-redash/README.md | 5 ++-- .../mcp-redash/scripts/redash-mcp-config.js | 24 ++++++++++++++----- .../mcp-redash/skills/redash-guide/SKILL.md | 5 ++-- plugins/mcp/codex/mcp-redash/README.md | 5 ++-- .../mcp-redash/scripts/redash-mcp-config.js | 24 ++++++++++++++----- .../mcp-redash/skills/redash-guide/SKILL.md | 5 ++-- plugins/mcp/kiro/mcp-redash/README.md | 5 ++-- .../mcp-redash/scripts/redash-mcp-config.js | 24 ++++++++++++++----- .../mcp-redash/skills/redash-guide/SKILL.md | 5 ++-- plugins/mcp/shared/mcp-redash/README.md | 5 ++-- .../mcp-redash/scripts/redash-mcp-config.js | 24 ++++++++++++++----- .../mcp-redash/skills/redash-guide/SKILL.md | 5 ++-- 12 files changed, 96 insertions(+), 40 deletions(-) diff --git a/plugins/mcp/claude/mcp-redash/README.md b/plugins/mcp/claude/mcp-redash/README.md index 532f5a4..1e55d22 100644 --- a/plugins/mcp/claude/mcp-redash/README.md +++ b/plugins/mcp/claude/mcp-redash/README.md @@ -95,9 +95,10 @@ REDASH_API_KEY=your-api-key | dev | redash-dev | REDASH_DEV_URL, REDASH_DEV_API_KEY | | stg | redash-stg | REDASH_STG_URL, REDASH_STG_API_KEY | | prod2 | redash-prod2 | REDASH_PROD2_URL, REDASH_PROD2_API_KEY | -| sandbox | redash-sandbox | REDASH_SANDBOX_URL, REDASH_SANDBOX_API_KEY | +| sandbox-1 | redash-sandbox-1 | REDASH_SANDBOX_1_URL, REDASH_SANDBOX_1_API_KEY | -- suffix は英数字で自由に指定可能 +- suffix は英小文字・数字・ハイフンで自由に指定可能 +- 環境変数名では suffix 内のハイフンをアンダースコアに変換 - `default` は予約語のため使用不可(plugin 同梱の `redash` が該当) ## ファイル構成 diff --git a/plugins/mcp/claude/mcp-redash/scripts/redash-mcp-config.js b/plugins/mcp/claude/mcp-redash/scripts/redash-mcp-config.js index 416c8ef..7529703 100755 --- a/plugins/mcp/claude/mcp-redash/scripts/redash-mcp-config.js +++ b/plugins/mcp/claude/mcp-redash/scripts/redash-mcp-config.js @@ -23,7 +23,7 @@ const KIRO_AGENT_PATH = path.join(PROJECT_ROOT, '.kiro', 'agents', 'default.json // --- helpers --- function envName(suffix) { - const upper = suffix.toUpperCase(); + const upper = suffix.toUpperCase().replaceAll('-', '_'); return { url: `REDASH_${upper}_URL`, key: `REDASH_${upper}_API_KEY`, @@ -54,10 +54,6 @@ function mcpEntry(suffix) { }; } -function isCodexRuntime() { - return Boolean(process.env.CODEX_PLUGIN_ROOT) || path.normalize(__dirname).split(path.sep).includes('codex'); -} - function isKiroRuntime() { const parts = path.normalize(__dirname).split(path.sep); return Boolean(process.env.KIRO_WORKSPACE_ROOT) || parts.includes('kiro') || parts.includes('.kiro'); @@ -99,7 +95,17 @@ function resolveProjectRoot() { } function createMcpJson() { - return isCodexRuntime() ? {} : { mcpServers: {} }; + return { mcpServers: {} }; +} + +function normalizeWritableMcpJson(data) { + if (Object.prototype.hasOwnProperty.call(data, 'mcpServers')) { + return data; + } + if (Object.prototype.hasOwnProperty.call(data, 'mcp_servers')) { + return { mcpServers: data.mcp_servers }; + } + return { mcpServers: data }; } function serverMap(data, create) { @@ -208,6 +214,8 @@ function cmdAdd(suffix) { if (data === null) { data = createMcpJson(); + } else { + data = normalizeWritableMcpJson(data); } const servers = serverMap(data, true); @@ -253,6 +261,10 @@ function cmdRemove(suffix) { process.exit(1); } + if (data !== null) { + data = normalizeWritableMcpJson(data); + } + const servers = serverMap(data, false); if (data === null || !servers || !servers[name]) { console.log(`${name} は登録されていません。変更はありません。`); diff --git a/plugins/mcp/claude/mcp-redash/skills/redash-guide/SKILL.md b/plugins/mcp/claude/mcp-redash/skills/redash-guide/SKILL.md index 5a134fe..0cbdbdd 100644 --- a/plugins/mcp/claude/mcp-redash/skills/redash-guide/SKILL.md +++ b/plugins/mcp/claude/mcp-redash/skills/redash-guide/SKILL.md @@ -62,9 +62,10 @@ REDASH_STG_API_KEY=your-stg-api-key | dev | redash-dev | REDASH_DEV_URL, REDASH_DEV_API_KEY | | stg | redash-stg | REDASH_STG_URL, REDASH_STG_API_KEY | | prod2 | redash-prod2 | REDASH_PROD2_URL, REDASH_PROD2_API_KEY | -| sandbox | redash-sandbox | REDASH_SANDBOX_URL, REDASH_SANDBOX_API_KEY | +| sandbox-1 | redash-sandbox-1 | REDASH_SANDBOX_1_URL, REDASH_SANDBOX_1_API_KEY | -- suffix は英数字で自由に指定可能 +- suffix は英小文字・数字・ハイフンで自由に指定可能 +- 環境変数名では suffix 内のハイフンをアンダースコアに変換 - `default` は予約語のため使用不可(plugin 同梱の `redash` が該当) ## 環境の削除 diff --git a/plugins/mcp/codex/mcp-redash/README.md b/plugins/mcp/codex/mcp-redash/README.md index 532f5a4..1e55d22 100644 --- a/plugins/mcp/codex/mcp-redash/README.md +++ b/plugins/mcp/codex/mcp-redash/README.md @@ -95,9 +95,10 @@ REDASH_API_KEY=your-api-key | dev | redash-dev | REDASH_DEV_URL, REDASH_DEV_API_KEY | | stg | redash-stg | REDASH_STG_URL, REDASH_STG_API_KEY | | prod2 | redash-prod2 | REDASH_PROD2_URL, REDASH_PROD2_API_KEY | -| sandbox | redash-sandbox | REDASH_SANDBOX_URL, REDASH_SANDBOX_API_KEY | +| sandbox-1 | redash-sandbox-1 | REDASH_SANDBOX_1_URL, REDASH_SANDBOX_1_API_KEY | -- suffix は英数字で自由に指定可能 +- suffix は英小文字・数字・ハイフンで自由に指定可能 +- 環境変数名では suffix 内のハイフンをアンダースコアに変換 - `default` は予約語のため使用不可(plugin 同梱の `redash` が該当) ## ファイル構成 diff --git a/plugins/mcp/codex/mcp-redash/scripts/redash-mcp-config.js b/plugins/mcp/codex/mcp-redash/scripts/redash-mcp-config.js index 416c8ef..7529703 100755 --- a/plugins/mcp/codex/mcp-redash/scripts/redash-mcp-config.js +++ b/plugins/mcp/codex/mcp-redash/scripts/redash-mcp-config.js @@ -23,7 +23,7 @@ const KIRO_AGENT_PATH = path.join(PROJECT_ROOT, '.kiro', 'agents', 'default.json // --- helpers --- function envName(suffix) { - const upper = suffix.toUpperCase(); + const upper = suffix.toUpperCase().replaceAll('-', '_'); return { url: `REDASH_${upper}_URL`, key: `REDASH_${upper}_API_KEY`, @@ -54,10 +54,6 @@ function mcpEntry(suffix) { }; } -function isCodexRuntime() { - return Boolean(process.env.CODEX_PLUGIN_ROOT) || path.normalize(__dirname).split(path.sep).includes('codex'); -} - function isKiroRuntime() { const parts = path.normalize(__dirname).split(path.sep); return Boolean(process.env.KIRO_WORKSPACE_ROOT) || parts.includes('kiro') || parts.includes('.kiro'); @@ -99,7 +95,17 @@ function resolveProjectRoot() { } function createMcpJson() { - return isCodexRuntime() ? {} : { mcpServers: {} }; + return { mcpServers: {} }; +} + +function normalizeWritableMcpJson(data) { + if (Object.prototype.hasOwnProperty.call(data, 'mcpServers')) { + return data; + } + if (Object.prototype.hasOwnProperty.call(data, 'mcp_servers')) { + return { mcpServers: data.mcp_servers }; + } + return { mcpServers: data }; } function serverMap(data, create) { @@ -208,6 +214,8 @@ function cmdAdd(suffix) { if (data === null) { data = createMcpJson(); + } else { + data = normalizeWritableMcpJson(data); } const servers = serverMap(data, true); @@ -253,6 +261,10 @@ function cmdRemove(suffix) { process.exit(1); } + if (data !== null) { + data = normalizeWritableMcpJson(data); + } + const servers = serverMap(data, false); if (data === null || !servers || !servers[name]) { console.log(`${name} は登録されていません。変更はありません。`); diff --git a/plugins/mcp/codex/mcp-redash/skills/redash-guide/SKILL.md b/plugins/mcp/codex/mcp-redash/skills/redash-guide/SKILL.md index 5a134fe..0cbdbdd 100644 --- a/plugins/mcp/codex/mcp-redash/skills/redash-guide/SKILL.md +++ b/plugins/mcp/codex/mcp-redash/skills/redash-guide/SKILL.md @@ -62,9 +62,10 @@ REDASH_STG_API_KEY=your-stg-api-key | dev | redash-dev | REDASH_DEV_URL, REDASH_DEV_API_KEY | | stg | redash-stg | REDASH_STG_URL, REDASH_STG_API_KEY | | prod2 | redash-prod2 | REDASH_PROD2_URL, REDASH_PROD2_API_KEY | -| sandbox | redash-sandbox | REDASH_SANDBOX_URL, REDASH_SANDBOX_API_KEY | +| sandbox-1 | redash-sandbox-1 | REDASH_SANDBOX_1_URL, REDASH_SANDBOX_1_API_KEY | -- suffix は英数字で自由に指定可能 +- suffix は英小文字・数字・ハイフンで自由に指定可能 +- 環境変数名では suffix 内のハイフンをアンダースコアに変換 - `default` は予約語のため使用不可(plugin 同梱の `redash` が該当) ## 環境の削除 diff --git a/plugins/mcp/kiro/mcp-redash/README.md b/plugins/mcp/kiro/mcp-redash/README.md index 532f5a4..1e55d22 100644 --- a/plugins/mcp/kiro/mcp-redash/README.md +++ b/plugins/mcp/kiro/mcp-redash/README.md @@ -95,9 +95,10 @@ REDASH_API_KEY=your-api-key | dev | redash-dev | REDASH_DEV_URL, REDASH_DEV_API_KEY | | stg | redash-stg | REDASH_STG_URL, REDASH_STG_API_KEY | | prod2 | redash-prod2 | REDASH_PROD2_URL, REDASH_PROD2_API_KEY | -| sandbox | redash-sandbox | REDASH_SANDBOX_URL, REDASH_SANDBOX_API_KEY | +| sandbox-1 | redash-sandbox-1 | REDASH_SANDBOX_1_URL, REDASH_SANDBOX_1_API_KEY | -- suffix は英数字で自由に指定可能 +- suffix は英小文字・数字・ハイフンで自由に指定可能 +- 環境変数名では suffix 内のハイフンをアンダースコアに変換 - `default` は予約語のため使用不可(plugin 同梱の `redash` が該当) ## ファイル構成 diff --git a/plugins/mcp/kiro/mcp-redash/scripts/redash-mcp-config.js b/plugins/mcp/kiro/mcp-redash/scripts/redash-mcp-config.js index 416c8ef..7529703 100755 --- a/plugins/mcp/kiro/mcp-redash/scripts/redash-mcp-config.js +++ b/plugins/mcp/kiro/mcp-redash/scripts/redash-mcp-config.js @@ -23,7 +23,7 @@ const KIRO_AGENT_PATH = path.join(PROJECT_ROOT, '.kiro', 'agents', 'default.json // --- helpers --- function envName(suffix) { - const upper = suffix.toUpperCase(); + const upper = suffix.toUpperCase().replaceAll('-', '_'); return { url: `REDASH_${upper}_URL`, key: `REDASH_${upper}_API_KEY`, @@ -54,10 +54,6 @@ function mcpEntry(suffix) { }; } -function isCodexRuntime() { - return Boolean(process.env.CODEX_PLUGIN_ROOT) || path.normalize(__dirname).split(path.sep).includes('codex'); -} - function isKiroRuntime() { const parts = path.normalize(__dirname).split(path.sep); return Boolean(process.env.KIRO_WORKSPACE_ROOT) || parts.includes('kiro') || parts.includes('.kiro'); @@ -99,7 +95,17 @@ function resolveProjectRoot() { } function createMcpJson() { - return isCodexRuntime() ? {} : { mcpServers: {} }; + return { mcpServers: {} }; +} + +function normalizeWritableMcpJson(data) { + if (Object.prototype.hasOwnProperty.call(data, 'mcpServers')) { + return data; + } + if (Object.prototype.hasOwnProperty.call(data, 'mcp_servers')) { + return { mcpServers: data.mcp_servers }; + } + return { mcpServers: data }; } function serverMap(data, create) { @@ -208,6 +214,8 @@ function cmdAdd(suffix) { if (data === null) { data = createMcpJson(); + } else { + data = normalizeWritableMcpJson(data); } const servers = serverMap(data, true); @@ -253,6 +261,10 @@ function cmdRemove(suffix) { process.exit(1); } + if (data !== null) { + data = normalizeWritableMcpJson(data); + } + const servers = serverMap(data, false); if (data === null || !servers || !servers[name]) { console.log(`${name} は登録されていません。変更はありません。`); diff --git a/plugins/mcp/kiro/mcp-redash/skills/redash-guide/SKILL.md b/plugins/mcp/kiro/mcp-redash/skills/redash-guide/SKILL.md index 5a134fe..0cbdbdd 100644 --- a/plugins/mcp/kiro/mcp-redash/skills/redash-guide/SKILL.md +++ b/plugins/mcp/kiro/mcp-redash/skills/redash-guide/SKILL.md @@ -62,9 +62,10 @@ REDASH_STG_API_KEY=your-stg-api-key | dev | redash-dev | REDASH_DEV_URL, REDASH_DEV_API_KEY | | stg | redash-stg | REDASH_STG_URL, REDASH_STG_API_KEY | | prod2 | redash-prod2 | REDASH_PROD2_URL, REDASH_PROD2_API_KEY | -| sandbox | redash-sandbox | REDASH_SANDBOX_URL, REDASH_SANDBOX_API_KEY | +| sandbox-1 | redash-sandbox-1 | REDASH_SANDBOX_1_URL, REDASH_SANDBOX_1_API_KEY | -- suffix は英数字で自由に指定可能 +- suffix は英小文字・数字・ハイフンで自由に指定可能 +- 環境変数名では suffix 内のハイフンをアンダースコアに変換 - `default` は予約語のため使用不可(plugin 同梱の `redash` が該当) ## 環境の削除 diff --git a/plugins/mcp/shared/mcp-redash/README.md b/plugins/mcp/shared/mcp-redash/README.md index 532f5a4..1e55d22 100644 --- a/plugins/mcp/shared/mcp-redash/README.md +++ b/plugins/mcp/shared/mcp-redash/README.md @@ -95,9 +95,10 @@ REDASH_API_KEY=your-api-key | dev | redash-dev | REDASH_DEV_URL, REDASH_DEV_API_KEY | | stg | redash-stg | REDASH_STG_URL, REDASH_STG_API_KEY | | prod2 | redash-prod2 | REDASH_PROD2_URL, REDASH_PROD2_API_KEY | -| sandbox | redash-sandbox | REDASH_SANDBOX_URL, REDASH_SANDBOX_API_KEY | +| sandbox-1 | redash-sandbox-1 | REDASH_SANDBOX_1_URL, REDASH_SANDBOX_1_API_KEY | -- suffix は英数字で自由に指定可能 +- suffix は英小文字・数字・ハイフンで自由に指定可能 +- 環境変数名では suffix 内のハイフンをアンダースコアに変換 - `default` は予約語のため使用不可(plugin 同梱の `redash` が該当) ## ファイル構成 diff --git a/plugins/mcp/shared/mcp-redash/scripts/redash-mcp-config.js b/plugins/mcp/shared/mcp-redash/scripts/redash-mcp-config.js index 416c8ef..7529703 100755 --- a/plugins/mcp/shared/mcp-redash/scripts/redash-mcp-config.js +++ b/plugins/mcp/shared/mcp-redash/scripts/redash-mcp-config.js @@ -23,7 +23,7 @@ const KIRO_AGENT_PATH = path.join(PROJECT_ROOT, '.kiro', 'agents', 'default.json // --- helpers --- function envName(suffix) { - const upper = suffix.toUpperCase(); + const upper = suffix.toUpperCase().replaceAll('-', '_'); return { url: `REDASH_${upper}_URL`, key: `REDASH_${upper}_API_KEY`, @@ -54,10 +54,6 @@ function mcpEntry(suffix) { }; } -function isCodexRuntime() { - return Boolean(process.env.CODEX_PLUGIN_ROOT) || path.normalize(__dirname).split(path.sep).includes('codex'); -} - function isKiroRuntime() { const parts = path.normalize(__dirname).split(path.sep); return Boolean(process.env.KIRO_WORKSPACE_ROOT) || parts.includes('kiro') || parts.includes('.kiro'); @@ -99,7 +95,17 @@ function resolveProjectRoot() { } function createMcpJson() { - return isCodexRuntime() ? {} : { mcpServers: {} }; + return { mcpServers: {} }; +} + +function normalizeWritableMcpJson(data) { + if (Object.prototype.hasOwnProperty.call(data, 'mcpServers')) { + return data; + } + if (Object.prototype.hasOwnProperty.call(data, 'mcp_servers')) { + return { mcpServers: data.mcp_servers }; + } + return { mcpServers: data }; } function serverMap(data, create) { @@ -208,6 +214,8 @@ function cmdAdd(suffix) { if (data === null) { data = createMcpJson(); + } else { + data = normalizeWritableMcpJson(data); } const servers = serverMap(data, true); @@ -253,6 +261,10 @@ function cmdRemove(suffix) { process.exit(1); } + if (data !== null) { + data = normalizeWritableMcpJson(data); + } + const servers = serverMap(data, false); if (data === null || !servers || !servers[name]) { console.log(`${name} は登録されていません。変更はありません。`); diff --git a/plugins/mcp/shared/mcp-redash/skills/redash-guide/SKILL.md b/plugins/mcp/shared/mcp-redash/skills/redash-guide/SKILL.md index 5a134fe..0cbdbdd 100644 --- a/plugins/mcp/shared/mcp-redash/skills/redash-guide/SKILL.md +++ b/plugins/mcp/shared/mcp-redash/skills/redash-guide/SKILL.md @@ -62,9 +62,10 @@ REDASH_STG_API_KEY=your-stg-api-key | dev | redash-dev | REDASH_DEV_URL, REDASH_DEV_API_KEY | | stg | redash-stg | REDASH_STG_URL, REDASH_STG_API_KEY | | prod2 | redash-prod2 | REDASH_PROD2_URL, REDASH_PROD2_API_KEY | -| sandbox | redash-sandbox | REDASH_SANDBOX_URL, REDASH_SANDBOX_API_KEY | +| sandbox-1 | redash-sandbox-1 | REDASH_SANDBOX_1_URL, REDASH_SANDBOX_1_API_KEY | -- suffix は英数字で自由に指定可能 +- suffix は英小文字・数字・ハイフンで自由に指定可能 +- 環境変数名では suffix 内のハイフンをアンダースコアに変換 - `default` は予約語のため使用不可(plugin 同梱の `redash` が該当) ## 環境の削除