@yottameta/yotta-dev-mcp-plugin 0.0.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "yotta-dev-mcp",
3
+ "interface": {
4
+ "displayName": "元开 yotta-dev-mcp (YottaMeta)"
5
+ },
6
+ "plugins": [
7
+ {
8
+ "name": "yotta-dev-mcp",
9
+ "source": ".",
10
+ "policy": {
11
+ "installation": "AVAILABLE",
12
+ "authentication": "ON_INSTALL"
13
+ },
14
+ "category": "Developer Tools",
15
+ "version": "0.2.0",
16
+ "description": "YuanKai (yotta-dev-mcp) - deterministic local development tools exposed over stdio MCP: repo_map, system_model, architecture_review, impact_analysis, verify_change, self_test, run_adapter, find_code, compress_output, review_code, review_diff, mcp_doctor, scan_secrets, scan_dependencies, check_publish_readiness, run_checks, scaffold_skill and workflow_state. Reads an optional .yotta/architecture.json contract plus .yotta/verification.json policy for architecture reviews, change impact cones and the L0-L5 evidence ledger. Optional explicit adapters integrate import-linter, dependency-cruiser and Repomix without auto-install or network access. Python 3.8+ standard library, offline by default; writes and command execution require explicit flags.",
17
+ "interface": {
18
+ "displayName": "元开 yotta-dev-mcp",
19
+ "shortDescription": "YuanKai (yotta-dev-mcp) - deterministic local development tools exposed over stdio MCP: repo_map, system_model, architec",
20
+ "developerName": "YottaMeta",
21
+ "category": "Developer Tools"
22
+ }
23
+ }
24
+ ]
25
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "yotta-dev-mcp",
3
+ "interface": {
4
+ "displayName": "元开 yotta-dev-mcp (YottaMeta)"
5
+ },
6
+ "plugins": [
7
+ {
8
+ "name": "yotta-dev-mcp",
9
+ "source": ".",
10
+ "policy": {
11
+ "installation": "AVAILABLE",
12
+ "authentication": "ON_INSTALL"
13
+ },
14
+ "category": "Developer Tools",
15
+ "version": "0.2.0",
16
+ "description": "YuanKai (yotta-dev-mcp) - deterministic local development tools exposed over stdio MCP: repo_map, system_model, architecture_review, impact_analysis, verify_change, self_test, run_adapter, find_code, compress_output, review_code, review_diff, mcp_doctor, scan_secrets, scan_dependencies, check_publish_readiness, run_checks, scaffold_skill and workflow_state. Reads an optional .yotta/architecture.json contract plus .yotta/verification.json policy for architecture reviews, change impact cones and the L0-L5 evidence ledger. Optional explicit adapters integrate import-linter, dependency-cruiser and Repomix without auto-install or network access. Python 3.8+ standard library, offline by default; writes and command execution require explicit flags.",
17
+ "interface": {
18
+ "displayName": "元开 yotta-dev-mcp",
19
+ "shortDescription": "YuanKai (yotta-dev-mcp) - deterministic local development tools exposed over stdio MCP: repo_map, system_model, architec",
20
+ "developerName": "YottaMeta",
21
+ "category": "Developer Tools"
22
+ }
23
+ }
24
+ ]
25
+ }
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 YottaMeta
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,107 @@
1
+ # 元开 yotta-dev-mcp — Agent Plugin
2
+
3
+ YuanKai (yotta-dev-mcp): deterministic local development tools over stdio MCP, covering code map, review, secret/dependency scan, release checks, whitelisted checks, scaffold and workflow state.
4
+
5
+ [English](#english) | [中文](#中文)
6
+
7
+ ## English
8
+
9
+ This repository is a standalone [Agent Plugins 1.0](https://agent-plugins.org) plugin. It packages one skill and one MCP server in the standard layout (`plugin.json`, `skills/`, `mcp.json`).
10
+
11
+ ### Install
12
+
13
+ #### Codex (verified)
14
+
15
+ ```bash
16
+ codex plugin marketplace add YottaMeta/yotta-dev-mcp-plugin
17
+ codex plugin add yotta-dev-mcp@yotta-dev-mcp
18
+ ```
19
+
20
+ #### Other compatible clients
21
+
22
+ Agent Plugins defines the package format, not a universal installer command. Use your client’s official setup instructions:
23
+
24
+ | Client | Setup instructions |
25
+ | --- | --- |
26
+ | VS Code | [Agent Plugins in VS Code](https://code.visualstudio.com/docs/agent-customization/agent-plugins) |
27
+ | Cursor | [Cursor plugins](https://cursor.com/docs/plugins) |
28
+ | GitHub Copilot | [About plugins](https://docs.github.com/en/copilot/concepts/agents/about-plugins) |
29
+ | ChatGPT & Codex | [OpenAI plugins](https://developers.openai.com/plugins) |
30
+ | Kiro | [Powers](https://kiro.dev/docs/powers/) |
31
+ | Hermes Agent | [Portable Agent Plugins v1 packages](https://hermes-agent.nousresearch.com/docs/developer-guide/plugins#portable-agent-plugins-v1-packages) |
32
+ | OpenClaw | [Plugin bundles](https://docs.openclaw.ai/plugins/bundles) |
33
+ | Grok Bot | [Skills, routines, and automations](https://docs.x.ai/grok-bot/skills-routines-and-automations) |
34
+ | NanoClaw | [Templates](https://github.com/nanocoai/nanoclaw/blob/main/docs/templates.md) |
35
+
36
+ Codex is verified by YottaMeta. Other clients are linked from the official Agent Plugins compatibility page and are not yet verified here.
37
+
38
+ ### What you get
39
+
40
+ - **Skill** — `yotta-dev-mcp` skill instructions (`skills/yotta-dev-mcp/SKILL.md`)
41
+ - **MCP server** — started automatically by the client (stdio; requires Python 3.8+)
42
+
43
+ ### Boundaries
44
+
45
+ - The MCP server runs fully local over stdio; no telemetry, no remote calls from the plugin itself.
46
+ - If the required runtime is missing, the MCP component may fail to start; the skill payload remains available.
47
+ - The skill payload is copied from the source repository release; for full documentation see [YottaMeta/yotta-dev-mcp](https://github.com/YottaMeta/yotta-dev-mcp).
48
+
49
+ ### Source
50
+
51
+ Upstream skill repository: [YottaMeta/yotta-dev-mcp](https://github.com/YottaMeta/yotta-dev-mcp)
52
+ Plugin repository: [YottaMeta/yotta-dev-mcp-plugin](https://github.com/YottaMeta/yotta-dev-mcp-plugin)
53
+
54
+ ### License
55
+
56
+ MIT — see `LICENSE` and the license inside the skill payload.
57
+
58
+ ## 中文
59
+
60
+ 本仓库是一个独立的 [Agent Plugins 1.0](https://agent-plugins.org) 插件,按标准目录结构打包一项技能和一个 MCP server(`plugin.json`、`skills/`、`mcp.json`)。
61
+
62
+ ### 安装
63
+
64
+ #### Codex(已实测)
65
+
66
+ ```bash
67
+ codex plugin marketplace add YottaMeta/yotta-dev-mcp-plugin
68
+ codex plugin add yotta-dev-mcp@yotta-dev-mcp
69
+ ```
70
+
71
+ #### 其他兼容客户端
72
+
73
+ Agent Plugins 只定义包格式,不定义统一安装命令。请按你所用客户端的官方说明接入:
74
+
75
+ | 客户端 | 官方说明 |
76
+ | --- | --- |
77
+ | VS Code | [Agent Plugins in VS Code](https://code.visualstudio.com/docs/agent-customization/agent-plugins) |
78
+ | Cursor | [Cursor plugins](https://cursor.com/docs/plugins) |
79
+ | GitHub Copilot | [About plugins](https://docs.github.com/en/copilot/concepts/agents/about-plugins) |
80
+ | ChatGPT & Codex | [OpenAI plugins](https://developers.openai.com/plugins) |
81
+ | Kiro | [Powers](https://kiro.dev/docs/powers/) |
82
+ | Hermes Agent | [Portable Agent Plugins v1 packages](https://hermes-agent.nousresearch.com/docs/developer-guide/plugins#portable-agent-plugins-v1-packages) |
83
+ | OpenClaw | [Plugin bundles](https://docs.openclaw.ai/plugins/bundles) |
84
+ | Grok Bot | [Skills, routines, and automations](https://docs.x.ai/grok-bot/skills-routines-and-automations) |
85
+ | NanoClaw | [Templates](https://github.com/nanocoai/nanoclaw/blob/main/docs/templates.md) |
86
+
87
+ Codex 已由 YottaMeta 实测;其他客户端仅链接官方说明,尚未在本仓库逐项实测。
88
+
89
+ ### 内容
90
+
91
+ - **技能** — `yotta-dev-mcp` 技能指令(`skills/yotta-dev-mcp/SKILL.md`)
92
+ - **MCP server** — 由客户端自动启动(stdio;需要 Python 3.8+)
93
+
94
+ ### 边界
95
+
96
+ - MCP server 完全本地 stdio 运行;插件本身不做遥测、不发起远程调用。
97
+ - 若运行时缺失,MCP 组件可能启动失败;技能内容仍可使用。
98
+ - 技能内容来自源仓库发布版;完整文档见 [YottaMeta/yotta-dev-mcp](https://github.com/YottaMeta/yotta-dev-mcp)。
99
+
100
+ ### 来源
101
+
102
+ 上游技能仓库:[YottaMeta/yotta-dev-mcp](https://github.com/YottaMeta/yotta-dev-mcp)
103
+ 插件仓库:[YottaMeta/yotta-dev-mcp-plugin](https://github.com/YottaMeta/yotta-dev-mcp-plugin)
104
+
105
+ ### 许可证
106
+
107
+ MIT — 见 `LICENSE` 与技能目录内许可证。
package/mcp.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "$schema": "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json",
3
+ "mcpServers": {
4
+ "yotta-dev-mcp": {
5
+ "type": "stdio",
6
+ "command": "python",
7
+ "args": [
8
+ "${PLUGIN_ROOT}/skills/yotta-dev-mcp/scripts/yotta_dev_mcp.py"
9
+ ]
10
+ }
11
+ }
12
+ }
package/package.json CHANGED
@@ -1,19 +1,22 @@
1
1
  {
2
2
  "name": "@yottameta/yotta-dev-mcp-plugin",
3
- "version": "0.0.0",
4
- "description": "Placeholder package for Trusted Publisher setup.",
5
- "main": "index.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
8
- },
9
- "keywords": [],
10
- "author": "",
3
+ "version": "0.2.0",
4
+ "description": "YuanKai (yotta-dev-mcp) Agent Plugin: deterministic local development tools over stdio MCP.",
11
5
  "license": "MIT",
12
- "type": "commonjs",
13
6
  "repository": {
7
+ "type": "git",
14
8
  "url": "git+https://github.com/YottaMeta/yotta-dev-mcp-plugin.git"
15
9
  },
16
10
  "publishConfig": {
17
11
  "access": "public"
18
- }
12
+ },
13
+ "files": [
14
+ ".agents",
15
+ ".claude-plugin",
16
+ "LICENSE",
17
+ "README.md",
18
+ "mcp.json",
19
+ "plugin.json",
20
+ "skills"
21
+ ]
19
22
  }
package/plugin.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
3
+ "name": "yotta-dev-mcp",
4
+ "version": "0.2.0",
5
+ "description": "YuanKai (yotta-dev-mcp) - deterministic local development tools exposed over stdio MCP: repo_map, system_model, architecture_review, impact_analysis, verify_change, self_test, run_adapter, find_code, compress_output, review_code, review_diff, mcp_doctor, scan_secrets, scan_dependencies, check_publish_readiness, run_checks, scaffold_skill and workflow_state. Reads an optional .yotta/architecture.json contract plus .yotta/verification.json policy for architecture reviews, change impact cones and the L0-L5 evidence ledger. Optional explicit adapters integrate import-linter, dependency-cruiser and Repomix without auto-install or network access. Python 3.8+ standard library, offline by default; writes and command execution require explicit flags.",
6
+ "author": {
7
+ "name": "YottaMeta",
8
+ "url": "https://github.com/YottaMeta"
9
+ },
10
+ "homepage": "https://github.com/YottaMeta/yotta-dev-mcp-plugin",
11
+ "repository": "https://github.com/YottaMeta/yotta-dev-mcp-plugin",
12
+ "license": "MIT",
13
+ "keywords": [
14
+ "yottameta",
15
+ "agent-plugins",
16
+ "agent-skills",
17
+ "mcp",
18
+ "yotta-dev-mcp"
19
+ ]
20
+ }
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 YottaMeta
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,7 @@
1
+ # NOTICE - YottaMeta 品牌声明
2
+
3
+ 「YottaMeta」「元阁」「yotta-dev-mcp」以及本家族各技能名称(yotta-* 前缀)
4
+ 是 YottaMeta 的品牌与标识。
5
+
6
+ 本软件以 MIT 许可证开源。派生作品不得继续使用 YottaMeta 或本家族名称作为名称,
7
+ 不得暗示派生作品由 YottaMeta 官方维护或认可。
@@ -0,0 +1,81 @@
1
+ ---
2
+ name: yotta-dev-mcp
3
+ description: 元开(yotta-dev-mcp)—— 本地、确定性的开发工具 MCP,把只读默认的开发能力暴露为 stdio MCP server:repo_map / system_model / architecture_review / impact_analysis / verify_change / self_test / run_adapter / find_code / compress_output / review_code / review_diff / mcp_doctor / scan_secrets / scan_dependencies / check_publish_readiness / run_checks / scaffold_skill / workflow_state。触发:让 AI 在陌生项目里先做结构盘点、构建系统模型或架构契约(.yotta/architecture.json)、按契约评审架构、分析改动影响锥与回归面、按验证阶梯产出证据账本、对元开自身做完整性 / 反证自测、探测或显式运行 import-linter / dependency-cruiser / Repomix 可选适配器、定位代码、评审改动、扫描密钥/依赖、检查发布就绪、运行白名单检查、生成脚手架或读取 .workflow 状态时;或用户说 元开 / 开发能力 MCP / yotta-dev-mcp / 代码库地图 / 系统模型 / 架构契约 / 架构评审 / 影响分析 / 验证账本 / 反证自测 / 代码评审 MCP / 适配器 等。边界:Python 3.8+ 标准库、离线默认;除 run_checks(显式 allow_execute)、verify_change 的 L2-L4 策略检查(显式 allow_execute)与 self_test 的测试子集(显式 allow_execute)、run_adapter 的 action=run(显式 allow_execute)、scaffold_skill / workflow_state 的显式 apply 外均为只读;不上传源码、不自动修改、不提交、不联网查询包是否存在、不自动安装或下载适配器。
4
+ version: 0.2.0
5
+ license: MIT
6
+ ---
7
+
8
+ # 元开(yotta-dev-mcp)
9
+
10
+ 元开(YuanKai)把一组本地、确定性的开发工具做成一个 stdio MCP server。任何支持 MCP 的客户端接上后,
11
+ 都能在真实开发任务里调用这些工具;输出带文件、行号、规则和证据,便于直接进入修复清单。
12
+
13
+ ## 何时使用
14
+
15
+ - 接手陌生项目:先 `repo_map` 看模块、依赖和入口,再 `find_code` 定位。
16
+ - 架构与影响分析:先写 `.yotta/architecture.json`,再用 `system_model` 拿分层、依赖、测试映射与 `UNKNOWN` 清单。
17
+ - 契约评审:用 `architecture_review` 查依赖规则、边界可见性与数据归属,每条给证据与严重级。
18
+ - 改动前评估:用 `impact_analysis` 从改动文件 / diff / 目标符号走出影响锥、映射测试与回滚探针。
19
+ - 改动后验证:用 `verify_change` 跑 L0 / L1 默认检查,按需结合 `.yotta/verification.json` 与 `allow_execute=true` 执行 L2-L4 白名单检查,产出可复算账本。
20
+ - 自身完整性:用 `self_test` 检查文件、版本、工具契约、写闸门与 seeded defect / mutation 反证。
21
+ - 可选增强:用 `run_adapter` 先 `action=list` 探测 import-linter / dependency-cruiser / Repomix,再按需 `action=run` + `allow_execute=true`;缺工具或配置返回 UNKNOWN,不自动安装、不自动下载。
22
+ - 评审改动:`review_diff` 只看新增行;`review_code` 对文件或仓库做规则检查。
23
+ - 长日志 / 长命令输出:`compress_output` 保错误、错误栈和首尾上下文。
24
+ - 本机排查:`mcp_doctor` 只读检查技能目录和 MCP JSON 配置。
25
+
26
+ ## MCP 接入
27
+
28
+ 启动命令:
29
+
30
+ ```bash
31
+ npx -y @yottameta/yotta-dev-mcp
32
+ ```
33
+
34
+ 或直接用本地脚本:
35
+
36
+ ```bash
37
+ python scripts/yotta_dev_mcp.py
38
+ ```
39
+
40
+ 自动接入说明:AI 首次协助配置时,必须先展示目标配置文件、完整配置片段和影响,
41
+ 并获得用户明确同意后再写入 `mcpServers`。用户拒绝时不要写文件,直接提供上面的启动命令
42
+ 让用户手动接入。
43
+
44
+ ## 工具
45
+
46
+ | 工具 | 用途 | 写入 |
47
+ |---|---|---|
48
+ | `repo_map` | 模块、导入、入口点地图 | 否 |
49
+ | `system_model` | 系统模型:模块、依赖、入口、测试映射、配置与数据归属;附带契约分层,输出 PASS / FAIL / UNKNOWN | 否 |
50
+ | `architecture_review` | 按契约评审依赖规则、边界可见性与数据归属;critical / high 判 FAIL,medium / low 只告警 | 否 |
51
+ | `impact_analysis` | 变更影响锥:直接消费者、受影响层 / 边界 / 存储 / 不变量、映射测试、风险分级与回滚探针 | 否 |
52
+ | `verify_change` | L0-L5 验证阶梯与证据账本:L0 / L1 默认,L2-L4 需策略声明 + 显式执行,L5 始终留在未验证项 | 仅显式 allow_execute 的 L2-L4 |
53
+ | `self_test` | 文件 / 版本 / 工具契约 / 写闸门 / seeded defect 与 mutation 反证自测 | 仅显式 allow_execute 的测试子集 |
54
+ | `run_adapter` | 探测或显式运行 import-linter / dependency-cruiser / Repomix;固定 argv、项目内 cwd、有界输出与哈希 | 仅 action=run + 显式 allow_execute |
55
+ | `find_code` | 符号 / 文本定位,结果有上限 | 否 |
56
+ | `compress_output` | 保留错误与首尾的长输出压缩 | 否 |
57
+ | `review_code` | 规则化代码评审,带行号与建议 | 否 |
58
+ | `review_diff` | 只评审 diff 的新增行 | 否 |
59
+ | `mcp_doctor` | 技能版本与 MCP JSON 配置体检 | 否 |
60
+ | `scan_secrets` | 密钥 / 凭据 / 高熵令牌扫描(强制脱敏) | 否 |
61
+ | `scan_dependencies` | 依赖清单、lockfile、来源与 typosquat 启发式检查 | 否 |
62
+ | `check_publish_readiness` | 版本四件、发布文件、仓库与 publishConfig 检查 | 否 |
63
+ | `run_checks` | 白名单测试 / lint / compile 并返回结构化摘要 | 仅显式 allow_execute |
64
+ | `scaffold_skill` | 生成最小技能脚手架,默认 dry-run | 仅显式 apply |
65
+ | `workflow_state` | 读取 `.workflow`,可选显式追加日志 | 仅显式 apply |
66
+
67
+ 详细契约见 `references/tools.md`;架构契约、评审语义与影响锥字段见 `references/architecture-contract.md`。
68
+
69
+ ## 边界
70
+
71
+ - 会执行项目代码的工具默认关闭:`run_checks`、`verify_change` 的 L2-L4 策略检查、`self_test` 的测试子集都必须显式 `allow_execute=true`,且只运行白名单检查或已声明的策略检查。
72
+ - 外部适配器只在用户已安装时接入:`run_adapter` 不安装、不下载、不访问远端、不接收任意命令参数;工具缺失或配置缺失一律返回 `UNKNOWN` 并给出 next_step。
73
+ - `scaffold_skill` / `workflow_state` 默认只预览,显式 `apply=true` 才写入;脚手架拒绝覆盖已有非空目录,状态写入使用原子替换并为被覆盖文件保留 `.bak`。
74
+ - 不联网,不查询包是否存在于公共仓库。
75
+ - 不读取或修改 YottaCode 仓库。
76
+ - 结论是确定性静态判断,不替代人工评审与最终决策。
77
+
78
+ ## 当前版本
79
+
80
+ - v0.2.0(2026-09-25):新增 `system_model`、`architecture_review`、`impact_analysis`、`verify_change`、`self_test`、`run_adapter`,以及 `.yotta/architecture.json` 与可选 `.yotta/verification.json` 契约(版本 1);工具总数 18,原 12 个工具行为不变。
81
+ - v0.1.1:品牌显示名统一为「元开」;功能与 12 个工具不变。
@@ -0,0 +1,57 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * yotta-dev-mcp launcher.
4
+ *
5
+ * Default: start the stdio MCP server.
6
+ * Install flags: delegate to bin/install.js.
7
+ */
8
+ 'use strict';
9
+ const { spawn, spawnSync } = require('child_process');
10
+ const path = require('path');
11
+
12
+ const PKG_ROOT = path.join(__dirname, '..');
13
+ const SERVER = path.join(PKG_ROOT, 'scripts', 'yotta_dev_mcp.py');
14
+ const INSTALL_FLAGS = ['--agent', '--dir', '--list', '-l', '-g', '--global', '--dry-run', '--yes'];
15
+
16
+ function isInstallRequest(args) {
17
+ return args.some(function (item) {
18
+ if (INSTALL_FLAGS.indexOf(item) !== -1) return true;
19
+ return item.indexOf('--agent=') === 0 || item.indexOf('--dir=') === 0;
20
+ });
21
+ }
22
+
23
+ function findPython() {
24
+ const candidates = [];
25
+ if (process.env.YOTTA_MCP_PYTHON) candidates.push(process.env.YOTTA_MCP_PYTHON);
26
+ candidates.push('python3', 'python', 'py');
27
+ for (let i = 0; i < candidates.length; i++) {
28
+ try {
29
+ const result = spawnSync(candidates[i], ['--version'], { encoding: 'utf8', timeout: 5000 });
30
+ if (result.status === 0) return candidates[i];
31
+ } catch (error) {
32
+ // Try the next candidate.
33
+ }
34
+ }
35
+ return 'python';
36
+ }
37
+
38
+ function main() {
39
+ const args = process.argv.slice(2);
40
+ if (args.indexOf('--version') !== -1 || args.indexOf('-v') !== -1) {
41
+ process.stdout.write(require(path.join(PKG_ROOT, 'package.json')).version + '\n');
42
+ return;
43
+ }
44
+ if (isInstallRequest(args)) {
45
+ require(path.join(__dirname, 'install.js'));
46
+ return;
47
+ }
48
+ const python = findPython();
49
+ const child = spawn(python, [SERVER].concat(args), { stdio: 'inherit' });
50
+ child.on('exit', function (code) { process.exit(code || 0); });
51
+ child.on('error', function (error) {
52
+ process.stderr.write('yotta-dev-mcp: cannot start Python MCP server: ' + error.message + '\n');
53
+ process.exit(1);
54
+ });
55
+ }
56
+
57
+ main();
@@ -0,0 +1,69 @@
1
+ # Optional external adapters
2
+
3
+ `run_adapter` probes and explicitly runs mature third-party tools that the user
4
+ already installed. The core engine stays Python-standard-library-only; adapters
5
+ are optional evidence sources, never a required dependency.
6
+
7
+ ## Adapter matrix
8
+
9
+ | Adapter | License | What it adds | Required config |
10
+ |---|---|---|---|
11
+ | `import-linter` | BSD-2-Clause | Python import boundaries and layered contracts | `.importlinter`, `setup.cfg`, `tox.ini` or `pyproject.toml` |
12
+ | `dependency-cruiser` | MIT | JavaScript / TypeScript dependency rules | `.dependency-cruiser.js` / `.cjs` / `.mjs` / `.json` |
13
+ | `repomix` | MIT | Repository packing and context budget enforcement | optional `repomix.config.json` |
14
+
15
+ ## Commands
16
+
17
+ `action=list` only inspects the project-local `node_modules/.bin`, project
18
+ virtualenv directories and `PATH`. It does not execute anything. Each adapter
19
+ entry reports `available`, `ready`, `executable`, `executable_source`, `config`
20
+ and a reason when it is not ready.
21
+
22
+ `action=run` requires `allow_execute=true` and exactly one adapter. The command
23
+ arguments are fixed by the adapter implementation:
24
+
25
+ ```text
26
+ lint-imports --config <detected-config>
27
+ depcruise --config <detected-config> --output-type json --progress none --exclude node_modules <target>
28
+ repomix --stdout --style xml --quiet --no-git-sort-by-changes [--token-budget N] <target>
29
+ ```
30
+
31
+ No adapter accepts arbitrary arguments, shell strings, remote repositories or
32
+ package installation. Repomix never receives `--remote` or
33
+ `--no-security-check`.
34
+
35
+ ## Output
36
+
37
+ The run result contains:
38
+
39
+ - `status`: `PASS`, `FAIL` or `UNKNOWN`;
40
+ - `adapter`: detected executable, source, config and version;
41
+ - `command`: fixed argv, relative cwd, exit code, timeout flag and output hash;
42
+ - `findings`: normalized adapter violations with rule, severity, path and target;
43
+ - `content`: Repomix-only packed text metadata and bounded text;
44
+ - `next_step`: what to install, configure or rerun when the result is not PASS.
45
+
46
+ Missing tools, missing required config, invalid JSON output, timeouts and
47
+ non-whitelisted execution all degrade to `UNKNOWN`. Adapter findings are
48
+ reported separately; they do not silently change the status of
49
+ `system_model`, `architecture_review`, `impact_analysis` or `verify_change`.
50
+
51
+ ## Safety boundary
52
+
53
+ Adapters are local-only and deterministic under the same repository state:
54
+
55
+ - executable discovery is limited to the project `node_modules/.bin`, project
56
+ virtualenvs and `PATH`;
57
+ - execution uses a fixed argv with `shell=False`;
58
+ - the working directory and target must stay inside the repository;
59
+ - output is bounded, hashed and never contains wall-clock timestamps;
60
+ - no package is installed, downloaded or updated by this tool.
61
+
62
+ ## Command line
63
+
64
+ ```bash
65
+ python scripts/dev_engine.py adapter . --action list
66
+ python scripts/dev_engine.py adapter . --action run --adapter import-linter --allow-execute
67
+ python scripts/dev_engine.py adapter . --action run --adapter dependency-cruiser --allow-execute
68
+ python scripts/dev_engine.py adapter . --action run --adapter repomix --allow-execute --token-budget 50000
69
+ ```