mcp-rubber-duck 1.9.4 → 1.10.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.
Files changed (55) hide show
  1. package/.eslintrc.json +3 -1
  2. package/CHANGELOG.md +19 -0
  3. package/README.md +54 -10
  4. package/assets/ext-apps-compare.png +0 -0
  5. package/assets/ext-apps-debate.png +0 -0
  6. package/assets/ext-apps-usage-stats.png +0 -0
  7. package/assets/ext-apps-vote.png +0 -0
  8. package/audit-ci.json +3 -1
  9. package/dist/server.d.ts +5 -2
  10. package/dist/server.d.ts.map +1 -1
  11. package/dist/server.js +414 -498
  12. package/dist/server.js.map +1 -1
  13. package/dist/tools/compare-ducks.d.ts.map +1 -1
  14. package/dist/tools/compare-ducks.js +19 -0
  15. package/dist/tools/compare-ducks.js.map +1 -1
  16. package/dist/tools/duck-debate.d.ts.map +1 -1
  17. package/dist/tools/duck-debate.js +24 -0
  18. package/dist/tools/duck-debate.js.map +1 -1
  19. package/dist/tools/duck-vote.d.ts.map +1 -1
  20. package/dist/tools/duck-vote.js +23 -0
  21. package/dist/tools/duck-vote.js.map +1 -1
  22. package/dist/tools/get-usage-stats.d.ts.map +1 -1
  23. package/dist/tools/get-usage-stats.js +13 -0
  24. package/dist/tools/get-usage-stats.js.map +1 -1
  25. package/dist/ui/compare-ducks/mcp-app.html +187 -0
  26. package/dist/ui/duck-debate/mcp-app.html +182 -0
  27. package/dist/ui/duck-vote/mcp-app.html +168 -0
  28. package/dist/ui/usage-stats/mcp-app.html +192 -0
  29. package/jest.config.js +1 -0
  30. package/package.json +7 -3
  31. package/src/server.ts +491 -523
  32. package/src/tools/compare-ducks.ts +20 -0
  33. package/src/tools/duck-debate.ts +27 -0
  34. package/src/tools/duck-vote.ts +24 -0
  35. package/src/tools/get-usage-stats.ts +14 -0
  36. package/src/ui/compare-ducks/app.ts +88 -0
  37. package/src/ui/compare-ducks/mcp-app.html +102 -0
  38. package/src/ui/duck-debate/app.ts +111 -0
  39. package/src/ui/duck-debate/mcp-app.html +97 -0
  40. package/src/ui/duck-vote/app.ts +128 -0
  41. package/src/ui/duck-vote/mcp-app.html +83 -0
  42. package/src/ui/usage-stats/app.ts +156 -0
  43. package/src/ui/usage-stats/mcp-app.html +107 -0
  44. package/tests/duck-debate.test.ts +3 -1
  45. package/tests/duck-vote.test.ts +3 -1
  46. package/tests/tool-annotations.test.ts +208 -41
  47. package/tests/tools/compare-ducks-ui.test.ts +135 -0
  48. package/tests/tools/compare-ducks.test.ts +3 -1
  49. package/tests/tools/duck-debate-ui.test.ts +234 -0
  50. package/tests/tools/duck-vote-ui.test.ts +172 -0
  51. package/tests/tools/get-usage-stats.test.ts +3 -1
  52. package/tests/tools/usage-stats-ui.test.ts +130 -0
  53. package/tests/ui-build.test.ts +53 -0
  54. package/tsconfig.json +1 -1
  55. package/vite.config.ts +19 -0
package/.eslintrc.json CHANGED
@@ -36,6 +36,8 @@
36
36
  "node_modules/",
37
37
  "coverage/",
38
38
  "tests/",
39
- "*.config.js"
39
+ "src/ui/",
40
+ "*.config.js",
41
+ "*.config.ts"
40
42
  ]
41
43
  }
package/CHANGELOG.md CHANGED
@@ -1,3 +1,22 @@
1
+ # [1.10.0](https://github.com/nesquikm/mcp-rubber-duck/compare/v1.9.5...v1.10.0) (2026-01-29)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * allowlist GHSA-p5wg-g6qr-c7cg (eslint circular ref stack overflow) ([bf5388e](https://github.com/nesquikm/mcp-rubber-duck/commit/bf5388e26f91e412dba28986a4c177b60539b4f4))
7
+
8
+
9
+ ### Features
10
+
11
+ * add interactive UIs for compare, vote, debate, and usage tools via MCP Apps ([9904ad9](https://github.com/nesquikm/mcp-rubber-duck/commit/9904ad94b12b2c69a8c5c50e18778966fc7e0069))
12
+
13
+ ## [1.9.5](https://github.com/nesquikm/mcp-rubber-duck/compare/v1.9.4...v1.9.5) (2026-01-29)
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * allowlist GHSA-34x7-hfp2-rc4v (tar via npm internals) ([76718d8](https://github.com/nesquikm/mcp-rubber-duck/commit/76718d86391469b04e1d74792ed8ab212d547e3d))
19
+
1
20
  ## [1.9.4](https://github.com/nesquikm/mcp-rubber-duck/compare/v1.9.3...v1.9.4) (2026-01-26)
2
21
 
3
22
 
package/README.md CHANGED
@@ -20,6 +20,7 @@ An MCP (Model Context Protocol) server that acts as a bridge to query multiple O
20
20
  - [Claude Desktop Configuration](#claude-desktop-configuration)
21
21
  - [MCP Bridge](#mcp-bridge---connect-to-other-mcp-servers)
22
22
  - [Guardrails](#guardrails---safety--compliance-layer)
23
+ - [Interactive UIs (MCP Apps)](#interactive-uis-mcp-apps)
23
24
  - [Available Tools](#available-tools)
24
25
  - [Basic Tools](#basic-tools)
25
26
  - [Multi-Agent Tools](#multi-agent-consensus--debate-tools)
@@ -29,8 +30,8 @@ An MCP (Model Context Protocol) server that acts as a bridge to query multiple O
29
30
  - [Recommended: Use Prompts as Templates](#recommended-use-prompts-as-templates)
30
31
  - [Usage Examples](#usage-examples)
31
32
  - [Provider-Specific Setup](#provider-specific-setup)
32
- - [Docker Support](#docker-support)
33
33
  - [Development](#development)
34
+ - [Docker Support](#docker-support)
34
35
  - [Troubleshooting](#troubleshooting)
35
36
  - [Contributing](#contributing)
36
37
 
@@ -52,6 +53,7 @@ An MCP (Model Context Protocol) server that acts as a bridge to query multiple O
52
53
  - 🔗 **MCP Bridge**: Connect ducks to other MCP servers for extended functionality
53
54
  - 🛡️ **Guardrails**: Pluggable safety layer with rate limiting, token limits, pattern blocking, and PII redaction
54
55
  - 🔐 **Granular Security**: Per-server approval controls with session-based approvals
56
+ - 🖼️ **Interactive UIs**: Rich HTML panels for compare, vote, debate, and usage tools (via [MCP Apps](https://github.com/modelcontextprotocol/ext-apps))
55
57
  - 🏷️ **Tool Annotations**: MCP-compliant hints for tool behavior (read-only, destructive, etc.)
56
58
  - 🎨 **Fun Duck Theme**: Rubber duck debugging with personality!
57
59
 
@@ -139,9 +141,6 @@ GROQ_DEFAULT_MODEL=llama-3.3-70b-versatile # Optional: defaults to llama-3.3-70
139
141
  OLLAMA_BASE_URL=http://localhost:11434/v1 # Optional
140
142
  OLLAMA_DEFAULT_MODEL=llama3.2 # Optional: defaults to llama3.2
141
143
 
142
- # Together AI
143
- TOGETHER_API_KEY=...
144
-
145
144
  # Custom Providers (you can add multiple)
146
145
  # Format: CUSTOM_{NAME}_* where NAME becomes the provider key (lowercase)
147
146
 
@@ -179,7 +178,7 @@ OPENAI_NICKNAME="DUCK-4" # Optional: defaults to "GPT Duck"
179
178
  GEMINI_NICKNAME="Duckmini" # Optional: defaults to "Gemini Duck"
180
179
  GROQ_NICKNAME="Quackers" # Optional: defaults to "Groq Duck"
181
180
  OLLAMA_NICKNAME="Local Quacker" # Optional: defaults to "Local Duck"
182
- CUSTOM_NICKNAME="My Special Duck" # Optional: defaults to "Custom Duck"
181
+ # For custom providers, use: CUSTOM_{NAME}_NICKNAME (see custom provider section above)
183
182
  ```
184
183
 
185
184
  **Note:** Duck nicknames are completely optional! If you don't set them, you'll get the charming defaults (GPT Duck, Gemini Duck, etc.). If you use a `config.json` file, those nicknames take priority over environment variables.
@@ -600,6 +599,42 @@ Guardrails intercept at multiple points in the request lifecycle:
600
599
  | `pre_tool_input` | Before MCP tool execution | PII redactor |
601
600
  | `post_tool_output` | After MCP tool returns | PII redactor (restore) |
602
601
 
602
+ ## Interactive UIs (MCP Apps)
603
+
604
+ Four tools — `compare_ducks`, `duck_vote`, `duck_debate`, and `get_usage_stats` — can render rich interactive HTML panels inside supported MCP clients via [MCP Apps](https://github.com/modelcontextprotocol/ext-apps). Once this MCP server is configured in a supporting client, the UIs appear automatically — no additional setup is required. Clients without MCP Apps support still receive the same plain text output (no functionality is lost). See the [MCP Apps repo](https://github.com/modelcontextprotocol/ext-apps) for an up-to-date list of supported clients.
605
+
606
+ ### Compare Ducks
607
+
608
+ Compare multiple model responses side-by-side, with latency indicators, token counts, model badges, and error states.
609
+
610
+ <p align="center">
611
+ <img src="assets/ext-apps-compare.png" alt="Compare Ducks interactive UI" width="600">
612
+ </p>
613
+
614
+ ### Duck Vote
615
+
616
+ Have multiple ducks vote on options, displayed as a visual vote tally with bar charts, consensus badge, winner card, confidence bars, and collapsible reasoning.
617
+
618
+ <p align="center">
619
+ <img src="assets/ext-apps-vote.png" alt="Duck Vote interactive UI" width="600">
620
+ </p>
621
+
622
+ ### Duck Debate
623
+
624
+ Structured multi-round debate between ducks, shown as a round-by-round view with format badge, participant list, collapsible rounds, and synthesis section.
625
+
626
+ <p align="center">
627
+ <img src="assets/ext-apps-debate.png" alt="Duck Debate interactive UI" width="600">
628
+ </p>
629
+
630
+ ### Usage Stats
631
+
632
+ Usage analytics with summary cards, provider breakdown with expandable rows, token distribution bars, and estimated costs.
633
+
634
+ <p align="center">
635
+ <img src="assets/ext-apps-usage-stats.png" alt="Usage Stats interactive UI" width="600">
636
+ </p>
637
+
603
638
  ## Available Tools
604
639
 
605
640
  ### Basic Tools
@@ -655,7 +690,7 @@ List available models for LLM providers.
655
690
  ```
656
691
 
657
692
  #### 🔍 compare_ducks
658
- Ask the same question to multiple providers simultaneously.
693
+ Ask the same question to multiple providers simultaneously. Renders an [interactive UI](#compare-ducks) in supported clients.
659
694
 
660
695
  ```typescript
661
696
  {
@@ -674,7 +709,7 @@ Get responses from all configured ducks - like a panel discussion!
674
709
  ```
675
710
 
676
711
  #### 📊 get_usage_stats
677
- Get usage statistics and estimated costs for your duck queries.
712
+ Get usage statistics and estimated costs for your duck queries. Renders an [interactive UI](#usage-stats) in supported clients.
678
713
 
679
714
  ```typescript
680
715
  {
@@ -691,7 +726,7 @@ Usage data is stored in `~/.mcp-rubber-duck/data/usage.json`.
691
726
  Research-backed tools for multi-agent coordination.
692
727
 
693
728
  #### 🗳️ duck_vote
694
- Have multiple ducks vote on options with reasoning and confidence scores.
729
+ Have multiple ducks vote on options with reasoning and confidence scores. Renders an [interactive UI](#duck-vote) in supported clients.
695
730
 
696
731
  ```typescript
697
732
  {
@@ -733,7 +768,7 @@ Modes:
733
768
  - **critique-improve**: Alternates between critiquing and improving
734
769
 
735
770
  #### 🎓 duck_debate
736
- Structured multi-round debate between ducks.
771
+ Structured multi-round debate between ducks. Renders an [interactive UI](#duck-debate) in supported clients.
737
772
 
738
773
  ```typescript
739
774
  {
@@ -1005,7 +1040,13 @@ ollama pull llama3.2
1005
1040
 
1006
1041
  ### Together AI
1007
1042
  1. Get API key from https://api.together.xyz/
1008
- 2. Add to environment: `TOGETHER_API_KEY=...`
1043
+ 2. Configure as a custom provider:
1044
+ ```env
1045
+ CUSTOM_TOGETHER_API_KEY=...
1046
+ CUSTOM_TOGETHER_BASE_URL=https://api.together.xyz/v1
1047
+ CUSTOM_TOGETHER_DEFAULT_MODEL=meta-llama/Llama-3.3-70B-Instruct-Turbo
1048
+ CUSTOM_TOGETHER_NICKNAME=Together Duck
1049
+ ```
1009
1050
 
1010
1051
  ## Verifying OpenAI Compatibility
1011
1052
 
@@ -1217,10 +1258,13 @@ mcp-rubber-duck/
1217
1258
  ├── src/
1218
1259
  │ ├── server.ts # MCP server implementation
1219
1260
  │ ├── config/ # Configuration management
1261
+ │ ├── data/ # Default pricing data
1262
+ │ ├── guardrails/ # Safety & compliance plugins
1220
1263
  │ ├── providers/ # OpenAI client wrapper
1221
1264
  │ ├── tools/ # MCP tool implementations
1222
1265
  │ ├── prompts/ # MCP prompt templates
1223
1266
  │ ├── services/ # Health, cache, conversations
1267
+ │ ├── ui/ # Interactive UI apps (MCP Apps)
1224
1268
  │ └── utils/ # Logging, ASCII art
1225
1269
  ├── config/ # Configuration examples
1226
1270
  └── tests/ # Test suites
Binary file
Binary file
Binary file
Binary file
package/audit-ci.json CHANGED
@@ -9,6 +9,8 @@
9
9
  "GHSA-73rr-hh4g-fpgx",
10
10
  "GHSA-8qq5-rm4j-mr97",
11
11
  "GHSA-g9mf-h72j-4rw9",
12
- "GHSA-r6q2-hw4h-h46w"
12
+ "GHSA-r6q2-hw4h-h46w",
13
+ "GHSA-34x7-hfp2-rc4v",
14
+ "GHSA-p5wg-g6qr-c7cg"
13
15
  ]
14
16
  }
package/dist/server.d.ts CHANGED
@@ -15,12 +15,15 @@ export declare class RubberDuckServer {
15
15
  private mcpEnabled;
16
16
  constructor();
17
17
  private initializeMCPBridge;
18
- private setupHandlers;
18
+ private toolResult;
19
+ private toolErrorResult;
20
+ private registerTools;
21
+ private registerPrompts;
22
+ private registerUIResources;
19
23
  private handleAskDuckWithMCP;
20
24
  private handleCompareDucksWithMCP;
21
25
  private handleDuckCouncilWithMCP;
22
26
  private formatEnhancedDuckResponse;
23
- private getTools;
24
27
  start(): Promise<void>;
25
28
  stop(): Promise<void>;
26
29
  }
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAkDA,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,iBAAiB,CAAC,CAAoB;IAC9C,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,uBAAuB,CAAC,CAA0B;IAC1D,OAAO,CAAC,mBAAmB,CAAsB;IACjD,OAAO,CAAC,KAAK,CAAgB;IAC7B,OAAO,CAAC,aAAa,CAAgB;IAGrC,OAAO,CAAC,gBAAgB,CAAC,CAAmB;IAC5C,OAAO,CAAC,eAAe,CAAC,CAAkB;IAC1C,OAAO,CAAC,cAAc,CAAC,CAAiB;IACxC,OAAO,CAAC,UAAU,CAAkB;;IAyCpC,OAAO,CAAC,mBAAmB;IA8C3B,OAAO,CAAC,aAAa;YA+HP,oBAAoB;YAwCpB,yBAAyB;YA6BzB,wBAAwB;IAwBtC,OAAO,CAAC,0BAA0B;IAyClC,OAAO,CAAC,QAAQ;IA2ZV,KAAK;IA+CL,IAAI;CAuBX"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAqDA,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAY;IAC1B,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,iBAAiB,CAAC,CAAoB;IAC9C,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,uBAAuB,CAAC,CAA0B;IAC1D,OAAO,CAAC,mBAAmB,CAAsB;IACjD,OAAO,CAAC,KAAK,CAAgB;IAC7B,OAAO,CAAC,aAAa,CAAgB;IAGrC,OAAO,CAAC,gBAAgB,CAAC,CAAmB;IAC5C,OAAO,CAAC,eAAe,CAAC,CAAkB;IAC1C,OAAO,CAAC,cAAc,CAAC,CAAiB;IACxC,OAAO,CAAC,UAAU,CAAkB;;IA2CpC,OAAO,CAAC,mBAAmB;IAgD3B,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,eAAe;IAcvB,OAAO,CAAC,aAAa;IAwYrB,OAAO,CAAC,eAAe;IA8BvB,OAAO,CAAC,mBAAmB;YAuCb,oBAAoB;YAwCpB,yBAAyB;YAiDzB,wBAAwB;IAwBtC,OAAO,CAAC,0BAA0B;IAyC5B,KAAK;IA+CL,IAAI;CAuBX"}