Skip to main content
Glama

DSH Plugin Toolkit

5層の画期的インフラストラクチャ + プラグイン循環開発パイプライン。コアはランタイム依存ゼロ。Bridge層は公式の @modelcontextprotocol/sdkに基づく。

5層アーキテクチャ(v2)

層

ディレクトリ

説明

L1 MCP Bridge

src/bridge/

公式MCP SDK McpServer.registerTool + StdioServerTransport、Claude/CursorなどすべてのMCPクライアントとネイティブ互換。server-lite.tsは依存なしの手書き版を保持

L2 A2A Cards

src/a2a/

Google A2A Protocol v1.0仕様に準拠。dsh a2a serveは@a2a-js/sdkに基づき実際のA2A Server(JSON-RPC + REST、スキルレベルルーティング)を起動

L3 Loop Engineering

src/loop/

6つのバリデータ + 3次元ヒューリスティック自己批判 + 線形フォールバック再試行(ユニットテストでカバー)

L4 Cost Governance

src/cost/

3層の予算ステートマシン OK→WARNING→CRITICAL→EXCEEDED、超過時はCostExceededErrorをスローしてブロック

L5 Multi-Agent Demo

src/demo/、src/agents/

シードPRNGによる決定的オーケストレーション、4フェーズ並列スケジューリング

プラグイン発見は3段階のフォールバック:完全なcordis.yml → ランタイム数のみ(count-only) → ソースコードの正規表現抽出(regex)。 すべてのツールは統一契約を共有:MCP入力パラメータ { input_data: string }。

Related MCP server: JMT x402 MCP Server

クイックスタート

npm install
npm run build          # 编译核心 + 全部插件

npx dsh list           # 列出发现的插件与工具
npm test               # 单元测试 (node:test, 9 cases)
npx dsh bridge         # 启动官方 SDK MCP stdio 服务器
npx dsh a2a gen        # 生成 a2a-cards/*.agent-card.json (A2A v1.0)
npx dsh a2a serve      # 启动真实 A2A v1.0 服务器 (:41241)
npx dsh llm models     # 列出本地 Ollama 模型(免费推理)
npx dsh llm ask "..."  # 本地 LLM 生成 + L3 验证循环
npx dsh demo carbon [--llm]  # L5 多Agent Demo(--llm 用本地 Ollama 真实合成)
npx dsh serve [port]   # REST 网关: POST /invoke,API-Key 计费 + 限流 (:8787)
npx dsh registry gen   # 市场目录: registry.json + index.html

組み込みプラグイン(20個)

財務:invoice-calc / loan-calc / invest-growth / salary-tax / fx-rates データと開発:csv-stats / json-format / regex-lab / codec-kit / text-diff / date-math コンテンツとマーケティング:seo-audit / text-summary / readability / markdown-report 生活ツール:health-metrics / unit-convert / color-kit / pass-forge 垂直業界:carbon-baseline

新規プラグインの循環開発

npx dsh scaffold my-tool   # 生成 plugins/dsh-tool-my-tool/
npm run build              # 编译后即刻被 Bridge/A2A/Demo 发现
npx dsh list               # 验证

生成されたsrc/index.tsでhandlerを実装:入力パラメータ input_data: string、 文字列を返す。出力の末尾に免責事項を含めればすべてのバリデータを通過できる。

予算設定

プロジェクトルートにdsh.budget.jsonを配置:

{ "monthly": 5000000, "user": 200000, "plugin": 50000 }

設定しない場合は制限なし(使用量のみ追跡)。

リリースパス

  • MCPマーケット:npm pack後、stdio方式でClaude Desktop / CursorなどのMCPクライアントに接続(エントリ dist/bridge/server.js、公式SDK実装)。npx @modelcontextprotocol/inspector node dist/bridge/server.jsでデバッグ可能

  • Koishiプラグインマーケット:npx dsh pack <plugin>で市場参入規範に適合するリリースパッケージを生成(koishi-plugin-*命名、peerDependencies.koishi、koishiメタデータフィールド)、cd publish/<name> && npm publishで即公開

  • A2Aレジストリ:a2a-cards/はGoogle A2A v1.0仕様と直接互換、公式@a2a-js/sdkのClientFactoryで利用可能

CI

.github/workflows/ci.yml:build → ユニットテスト → 発見/A2A/packスモーク → MCPプロトコルスモーク → 決定性検証。

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers