mcp-rubber-duck 1.1.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.
- package/.dockerignore +19 -0
- package/.env.desktop.example +145 -0
- package/.env.example +45 -0
- package/.env.pi.example +106 -0
- package/.env.template +165 -0
- package/.eslintrc.json +40 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +65 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +58 -0
- package/.github/ISSUE_TEMPLATE/question.md +67 -0
- package/.github/pull_request_template.md +111 -0
- package/.github/workflows/docker-build.yml +138 -0
- package/.github/workflows/release.yml +182 -0
- package/.github/workflows/security.yml +141 -0
- package/.github/workflows/semantic-release.yml +89 -0
- package/.prettierrc +10 -0
- package/.releaserc.json +66 -0
- package/CHANGELOG.md +95 -0
- package/CONTRIBUTING.md +242 -0
- package/Dockerfile +62 -0
- package/LICENSE +21 -0
- package/README.md +803 -0
- package/audit-ci.json +8 -0
- package/config/claude_desktop.json +14 -0
- package/config/config.example.json +91 -0
- package/dist/config/config.d.ts +51 -0
- package/dist/config/config.d.ts.map +1 -0
- package/dist/config/config.js +301 -0
- package/dist/config/config.js.map +1 -0
- package/dist/config/types.d.ts +356 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +41 -0
- package/dist/config/types.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +109 -0
- package/dist/index.js.map +1 -0
- package/dist/providers/duck-provider-enhanced.d.ts +29 -0
- package/dist/providers/duck-provider-enhanced.d.ts.map +1 -0
- package/dist/providers/duck-provider-enhanced.js +230 -0
- package/dist/providers/duck-provider-enhanced.js.map +1 -0
- package/dist/providers/enhanced-manager.d.ts +54 -0
- package/dist/providers/enhanced-manager.d.ts.map +1 -0
- package/dist/providers/enhanced-manager.js +217 -0
- package/dist/providers/enhanced-manager.js.map +1 -0
- package/dist/providers/manager.d.ts +28 -0
- package/dist/providers/manager.d.ts.map +1 -0
- package/dist/providers/manager.js +204 -0
- package/dist/providers/manager.js.map +1 -0
- package/dist/providers/provider.d.ts +29 -0
- package/dist/providers/provider.d.ts.map +1 -0
- package/dist/providers/provider.js +179 -0
- package/dist/providers/provider.js.map +1 -0
- package/dist/providers/types.d.ts +69 -0
- package/dist/providers/types.d.ts.map +1 -0
- package/dist/providers/types.js +2 -0
- package/dist/providers/types.js.map +1 -0
- package/dist/server.d.ts +24 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +501 -0
- package/dist/server.js.map +1 -0
- package/dist/services/approval.d.ts +44 -0
- package/dist/services/approval.d.ts.map +1 -0
- package/dist/services/approval.js +159 -0
- package/dist/services/approval.js.map +1 -0
- package/dist/services/cache.d.ts +21 -0
- package/dist/services/cache.d.ts.map +1 -0
- package/dist/services/cache.js +63 -0
- package/dist/services/cache.js.map +1 -0
- package/dist/services/conversation.d.ts +24 -0
- package/dist/services/conversation.d.ts.map +1 -0
- package/dist/services/conversation.js +108 -0
- package/dist/services/conversation.js.map +1 -0
- package/dist/services/function-bridge.d.ts +41 -0
- package/dist/services/function-bridge.d.ts.map +1 -0
- package/dist/services/function-bridge.js +259 -0
- package/dist/services/function-bridge.js.map +1 -0
- package/dist/services/health.d.ts +17 -0
- package/dist/services/health.d.ts.map +1 -0
- package/dist/services/health.js +77 -0
- package/dist/services/health.js.map +1 -0
- package/dist/services/mcp-client-manager.d.ts +49 -0
- package/dist/services/mcp-client-manager.d.ts.map +1 -0
- package/dist/services/mcp-client-manager.js +279 -0
- package/dist/services/mcp-client-manager.js.map +1 -0
- package/dist/tools/approve-mcp-request.d.ts +9 -0
- package/dist/tools/approve-mcp-request.d.ts.map +1 -0
- package/dist/tools/approve-mcp-request.js +111 -0
- package/dist/tools/approve-mcp-request.js.map +1 -0
- package/dist/tools/ask-duck.d.ts +9 -0
- package/dist/tools/ask-duck.d.ts.map +1 -0
- package/dist/tools/ask-duck.js +43 -0
- package/dist/tools/ask-duck.js.map +1 -0
- package/dist/tools/chat-duck.d.ts +9 -0
- package/dist/tools/chat-duck.d.ts.map +1 -0
- package/dist/tools/chat-duck.js +57 -0
- package/dist/tools/chat-duck.js.map +1 -0
- package/dist/tools/clear-conversations.d.ts +8 -0
- package/dist/tools/clear-conversations.d.ts.map +1 -0
- package/dist/tools/clear-conversations.js +17 -0
- package/dist/tools/clear-conversations.js.map +1 -0
- package/dist/tools/compare-ducks.d.ts +8 -0
- package/dist/tools/compare-ducks.d.ts.map +1 -0
- package/dist/tools/compare-ducks.js +49 -0
- package/dist/tools/compare-ducks.js.map +1 -0
- package/dist/tools/duck-council.d.ts +8 -0
- package/dist/tools/duck-council.d.ts.map +1 -0
- package/dist/tools/duck-council.js +69 -0
- package/dist/tools/duck-council.js.map +1 -0
- package/dist/tools/get-pending-approvals.d.ts +15 -0
- package/dist/tools/get-pending-approvals.d.ts.map +1 -0
- package/dist/tools/get-pending-approvals.js +74 -0
- package/dist/tools/get-pending-approvals.js.map +1 -0
- package/dist/tools/list-ducks.d.ts +9 -0
- package/dist/tools/list-ducks.d.ts.map +1 -0
- package/dist/tools/list-ducks.js +47 -0
- package/dist/tools/list-ducks.js.map +1 -0
- package/dist/tools/list-models.d.ts +8 -0
- package/dist/tools/list-models.d.ts.map +1 -0
- package/dist/tools/list-models.js +72 -0
- package/dist/tools/list-models.js.map +1 -0
- package/dist/tools/mcp-status.d.ts +17 -0
- package/dist/tools/mcp-status.d.ts.map +1 -0
- package/dist/tools/mcp-status.js +100 -0
- package/dist/tools/mcp-status.js.map +1 -0
- package/dist/utils/ascii-art.d.ts +19 -0
- package/dist/utils/ascii-art.d.ts.map +1 -0
- package/dist/utils/ascii-art.js +73 -0
- package/dist/utils/ascii-art.js.map +1 -0
- package/dist/utils/logger.d.ts +3 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +86 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/safe-logger.d.ts +23 -0
- package/dist/utils/safe-logger.d.ts.map +1 -0
- package/dist/utils/safe-logger.js +145 -0
- package/dist/utils/safe-logger.js.map +1 -0
- package/docker-compose.yml +161 -0
- package/jest.config.js +26 -0
- package/package.json +65 -0
- package/scripts/build-multiarch.sh +290 -0
- package/scripts/deploy-raspbian.sh +410 -0
- package/scripts/deploy.sh +322 -0
- package/scripts/gh-deploy.sh +343 -0
- package/scripts/setup-docker-raspbian.sh +530 -0
- package/server.json +8 -0
- package/src/config/config.ts +357 -0
- package/src/config/types.ts +89 -0
- package/src/index.ts +114 -0
- package/src/providers/duck-provider-enhanced.ts +294 -0
- package/src/providers/enhanced-manager.ts +290 -0
- package/src/providers/manager.ts +257 -0
- package/src/providers/provider.ts +207 -0
- package/src/providers/types.ts +78 -0
- package/src/server.ts +603 -0
- package/src/services/approval.ts +225 -0
- package/src/services/cache.ts +79 -0
- package/src/services/conversation.ts +146 -0
- package/src/services/function-bridge.ts +329 -0
- package/src/services/health.ts +107 -0
- package/src/services/mcp-client-manager.ts +362 -0
- package/src/tools/approve-mcp-request.ts +126 -0
- package/src/tools/ask-duck.ts +74 -0
- package/src/tools/chat-duck.ts +82 -0
- package/src/tools/clear-conversations.ts +24 -0
- package/src/tools/compare-ducks.ts +67 -0
- package/src/tools/duck-council.ts +88 -0
- package/src/tools/get-pending-approvals.ts +90 -0
- package/src/tools/list-ducks.ts +65 -0
- package/src/tools/list-models.ts +101 -0
- package/src/tools/mcp-status.ts +117 -0
- package/src/utils/ascii-art.ts +85 -0
- package/src/utils/logger.ts +116 -0
- package/src/utils/safe-logger.ts +165 -0
- package/systemd/mcp-rubber-duck-with-ollama.service +55 -0
- package/systemd/mcp-rubber-duck.service +58 -0
- package/test-functionality.js +147 -0
- package/test-mcp-interface.js +221 -0
- package/tests/ascii-art.test.ts +36 -0
- package/tests/config.test.ts +239 -0
- package/tests/conversation.test.ts +308 -0
- package/tests/mcp-bridge.test.ts +291 -0
- package/tests/providers.test.ts +269 -0
- package/tests/tools/clear-conversations.test.ts +163 -0
- package/tsconfig.json +26 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
name: 📦 Semantic Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- master
|
|
7
|
+
- main
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
test:
|
|
12
|
+
name: 🧪 Test Before Release
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- name: 📥 Checkout
|
|
16
|
+
uses: actions/checkout@v4
|
|
17
|
+
|
|
18
|
+
- name: 📦 Setup Node.js
|
|
19
|
+
uses: actions/setup-node@v4
|
|
20
|
+
with:
|
|
21
|
+
node-version: '20'
|
|
22
|
+
cache: 'npm'
|
|
23
|
+
|
|
24
|
+
- name: 📥 Install dependencies
|
|
25
|
+
run: npm ci
|
|
26
|
+
|
|
27
|
+
- name: 🔍 Lint
|
|
28
|
+
run: npm run lint
|
|
29
|
+
|
|
30
|
+
- name: 🏗️ Build
|
|
31
|
+
run: npm run build
|
|
32
|
+
|
|
33
|
+
- name: 🔬 Type check
|
|
34
|
+
run: npm run typecheck
|
|
35
|
+
|
|
36
|
+
# Enable when tests are working
|
|
37
|
+
# - name: 🧪 Test
|
|
38
|
+
# run: npm test
|
|
39
|
+
|
|
40
|
+
release:
|
|
41
|
+
name: 📦 Release
|
|
42
|
+
needs: test
|
|
43
|
+
runs-on: ubuntu-latest
|
|
44
|
+
permissions:
|
|
45
|
+
contents: write
|
|
46
|
+
issues: write
|
|
47
|
+
pull-requests: write
|
|
48
|
+
packages: write
|
|
49
|
+
|
|
50
|
+
steps:
|
|
51
|
+
- name: 📥 Checkout
|
|
52
|
+
uses: actions/checkout@v4
|
|
53
|
+
with:
|
|
54
|
+
fetch-depth: 0
|
|
55
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
56
|
+
|
|
57
|
+
- name: 📦 Setup Node.js
|
|
58
|
+
uses: actions/setup-node@v4
|
|
59
|
+
with:
|
|
60
|
+
node-version: '20'
|
|
61
|
+
cache: 'npm'
|
|
62
|
+
|
|
63
|
+
- name: 📥 Install dependencies
|
|
64
|
+
run: npm ci
|
|
65
|
+
|
|
66
|
+
- name: 🏗️ Build
|
|
67
|
+
run: npm run build
|
|
68
|
+
|
|
69
|
+
- name: 📦 Run semantic-release
|
|
70
|
+
env:
|
|
71
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
72
|
+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
73
|
+
run: npx semantic-release
|
|
74
|
+
|
|
75
|
+
- name: 📊 Release Summary
|
|
76
|
+
if: success()
|
|
77
|
+
run: |
|
|
78
|
+
echo "🎉 **Semantic Release Completed Successfully!**" >> $GITHUB_STEP_SUMMARY
|
|
79
|
+
echo "" >> $GITHUB_STEP_SUMMARY
|
|
80
|
+
echo "📋 **What happened:**" >> $GITHUB_STEP_SUMMARY
|
|
81
|
+
echo "- 🔍 Analyzed commits since last release" >> $GITHUB_STEP_SUMMARY
|
|
82
|
+
echo "- 📝 Generated changelog entries" >> $GITHUB_STEP_SUMMARY
|
|
83
|
+
echo "- 🏷️ Created git tag (if new version)" >> $GITHUB_STEP_SUMMARY
|
|
84
|
+
echo "- 📦 Updated package.json version" >> $GITHUB_STEP_SUMMARY
|
|
85
|
+
echo "- 🐳 Tagged version will trigger Docker build via release.yml" >> $GITHUB_STEP_SUMMARY
|
|
86
|
+
echo "" >> $GITHUB_STEP_SUMMARY
|
|
87
|
+
echo "🔄 **Next Steps:**" >> $GITHUB_STEP_SUMMARY
|
|
88
|
+
echo "- If a new version was released, the release.yml workflow will build Docker images" >> $GITHUB_STEP_SUMMARY
|
|
89
|
+
echo "- Check the releases page for the new version" >> $GITHUB_STEP_SUMMARY
|
package/.prettierrc
ADDED
package/.releaserc.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"branches": [
|
|
3
|
+
"master",
|
|
4
|
+
"main"
|
|
5
|
+
],
|
|
6
|
+
"plugins": [
|
|
7
|
+
"@semantic-release/commit-analyzer",
|
|
8
|
+
"@semantic-release/release-notes-generator",
|
|
9
|
+
[
|
|
10
|
+
"@semantic-release/changelog",
|
|
11
|
+
{
|
|
12
|
+
"changelogFile": "CHANGELOG.md"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"@semantic-release/npm",
|
|
16
|
+
[
|
|
17
|
+
"@semantic-release/git",
|
|
18
|
+
{
|
|
19
|
+
"assets": [
|
|
20
|
+
"package.json",
|
|
21
|
+
"CHANGELOG.md"
|
|
22
|
+
],
|
|
23
|
+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"@semantic-release/github"
|
|
27
|
+
],
|
|
28
|
+
"releaseRules": [
|
|
29
|
+
{
|
|
30
|
+
"type": "feat",
|
|
31
|
+
"release": "minor"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"type": "fix",
|
|
35
|
+
"release": "patch"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"type": "docs",
|
|
39
|
+
"release": false
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"type": "style",
|
|
43
|
+
"release": false
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"type": "refactor",
|
|
47
|
+
"release": "patch"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"type": "perf",
|
|
51
|
+
"release": "patch"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"type": "test",
|
|
55
|
+
"release": false
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"type": "chore",
|
|
59
|
+
"release": false
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"scope": "no-release",
|
|
63
|
+
"release": false
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
}
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# [1.1.0](https://github.com/nesquikm/mcp-rubber-duck/compare/v1.0.0...v1.1.0) (2025-09-17)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* add NPM publishing for MCP Registry ([96a7a5b](https://github.com/nesquikm/mcp-rubber-duck/commit/96a7a5b6e2e25f7113c0ec87880e39d4a2fae02f))
|
|
7
|
+
|
|
8
|
+
# 1.0.0 (2025-09-11)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* Always silence console logs in MCP mode to prevent JSON-RPC parsing errors ([0761756](https://github.com/nesquikm/mcp-rubber-duck/commit/076175671f67c7bf10118e578a81078b7e798fc0))
|
|
14
|
+
* Clean up MCP server output to prevent JSON parsing errors ([e391c46](https://github.com/nesquikm/mcp-rubber-duck/commit/e391c46b1cbd151abc99304055f9a2217ee0e2e6))
|
|
15
|
+
* Configure Jest for ESM modules compatibility ([221492d](https://github.com/nesquikm/mcp-rubber-duck/commit/221492dd5aaf049aba637467767626bad6e0bebe))
|
|
16
|
+
* Correct Gemini API endpoint URL and add comprehensive tests ([36f4c3d](https://github.com/nesquikm/mcp-rubber-duck/commit/36f4c3d0f3385d3d374fdff6078b8c3204a8fc77))
|
|
17
|
+
* Display requested model name instead of resolved API model name ([9acfe25](https://github.com/nesquikm/mcp-rubber-duck/commit/9acfe25e56ac67bb52957e594eb0022187129a33))
|
|
18
|
+
* Health checks for reasoning models (GPT-5, Gemini-2.5) ([2af7816](https://github.com/nesquikm/mcp-rubber-duck/commit/2af7816698fac18cf64026404f8cca5061ddb9ce))
|
|
19
|
+
* Implement smart parameter detection for OpenAI API compatibility ([fed002f](https://github.com/nesquikm/mcp-rubber-duck/commit/fed002f6db8d61d0fee520d13b454d15533db9ea))
|
|
20
|
+
* Prevent Ollama auto-detection when not configured ([9409441](https://github.com/nesquikm/mcp-rubber-duck/commit/940944121500cc54740339c2167040fdb327761f))
|
|
21
|
+
* Remove conventionalcommits preset from semantic-release config ([f34934f](https://github.com/nesquikm/mcp-rubber-duck/commit/f34934f4e06b0b9106132415e98b42016c2fcd5d))
|
|
22
|
+
* Remove npm publishing from semantic-release configuration ([e3f0f4b](https://github.com/nesquikm/mcp-rubber-duck/commit/e3f0f4b374ff5579565f1bcfcee445bc084c7ae1))
|
|
23
|
+
* Remove token limits completely to resolve empty responses from reasoning models ([ac41f73](https://github.com/nesquikm/mcp-rubber-duck/commit/ac41f738ac3b166c8845b271e77ba8315ac9d0b9))
|
|
24
|
+
* Temporarily disable lint in CI to fix deployment ([30d8b3b](https://github.com/nesquikm/mcp-rubber-duck/commit/30d8b3bb2412a53086190752bfc95e970382efa2))
|
|
25
|
+
* Temporarily disable tests in CI to fix deployment ([d023a32](https://github.com/nesquikm/mcp-rubber-duck/commit/d023a32847115dae6144fe5fe1e3c04b21c85a7e))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Features
|
|
29
|
+
|
|
30
|
+
* 🦆 Ducks can now use MCP tools! Per-server trust & smart approvals ([2fa5a0f](https://github.com/nesquikm/mcp-rubber-duck/commit/2fa5a0f1ab3cb81736494ddda7f29919c5c93a51))
|
|
31
|
+
* Add automated versioning with semantic-release ([b3c7470](https://github.com/nesquikm/mcp-rubber-duck/commit/b3c7470ba27e2d043b9080b0fe0fcdb54ef56ab3))
|
|
32
|
+
* Add conversation reset functionality ([92dc489](https://github.com/nesquikm/mcp-rubber-duck/commit/92dc4895951200afadf7b82e634e12ddd072afa2))
|
|
33
|
+
* Add dynamic model listing and selection ([ce84823](https://github.com/nesquikm/mcp-rubber-duck/commit/ce84823eb94c09f767671d8d24875c125ddd21b6))
|
|
34
|
+
* Add environment variable support for provider default models ([4ac2272](https://github.com/nesquikm/mcp-rubber-duck/commit/4ac2272cb57bba21195504dea191aaa5bafd5dfe))
|
|
35
|
+
* Add GitHub Actions for automated Docker builds and releases ([2ff30d6](https://github.com/nesquikm/mcp-rubber-duck/commit/2ff30d635116f5db2f860412642d794ee5ad2531))
|
|
36
|
+
* Add Google Gemini support ([359db64](https://github.com/nesquikm/mcp-rubber-duck/commit/359db641a22d447df25297bee2889352f97614b3))
|
|
37
|
+
* Add optional custom duck nicknames via environment variables ([c3b3e6a](https://github.com/nesquikm/mcp-rubber-duck/commit/c3b3e6a9c6ce863e4a0ec03fb8a14099b795d8cd))
|
|
38
|
+
* Add systemd service files for production deployment ([63333fb](https://github.com/nesquikm/mcp-rubber-duck/commit/63333fb851b8546fc0e803b7a43d921385b471cc))
|
|
39
|
+
* Add universal multi-platform Docker deployment support ([37ea1cb](https://github.com/nesquikm/mcp-rubber-duck/commit/37ea1cb0c2b13cb5b2a82addf23888f3c1898550))
|
|
40
|
+
* Display model name in all duck responses ([ab87434](https://github.com/nesquikm/mcp-rubber-duck/commit/ab874347a611406fb47c1002f87696580ed416fe))
|
|
41
|
+
* Enhance MCP rubber duck functionality with improved provider support and error handling ([2356389](https://github.com/nesquikm/mcp-rubber-duck/commit/23563898a90c101d794648c411f4d8e29fbaf687))
|
|
42
|
+
* Support multiple custom providers via CUSTOM_{NAME}_* environment variables ([5bfeb82](https://github.com/nesquikm/mcp-rubber-duck/commit/5bfeb8224d2d1057d66422253d912424d254b943))
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
### BREAKING CHANGES
|
|
46
|
+
|
|
47
|
+
* Removes old CUSTOM_API_KEY/CUSTOM_BASE_URL pattern.
|
|
48
|
+
|
|
49
|
+
# Changelog
|
|
50
|
+
|
|
51
|
+
All notable changes to this project will be documented in this file.
|
|
52
|
+
|
|
53
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
54
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
55
|
+
|
|
56
|
+
## [Unreleased]
|
|
57
|
+
|
|
58
|
+
## [1.0.0] - 2025-09-11
|
|
59
|
+
|
|
60
|
+
### Added
|
|
61
|
+
- 🦆 **Multiple AI Provider Support:** Query OpenAI, Gemini, Groq, Ollama, and custom providers
|
|
62
|
+
- 💬 **Conversation Management:** Maintain context across messages with conversation IDs
|
|
63
|
+
- 🏛️ **Duck Council:** Get responses from all configured LLMs simultaneously
|
|
64
|
+
- 🔗 **MCP Bridge:** Connect to external MCP servers with approval system
|
|
65
|
+
- 🛡️ **Security Features:** Per-server trust settings and smart tool approval workflow
|
|
66
|
+
- 🐳 **Universal Deployment:** Multi-platform Docker support (AMD64, ARM64)
|
|
67
|
+
- 📦 **Multiple Configuration Options:** Desktop, Raspberry Pi, and remote deployment configs
|
|
68
|
+
- 🔧 **Flexible Provider Configuration:** Support for custom providers via environment variables
|
|
69
|
+
- 🧪 **Comprehensive Testing:** Jest-based test suite with ESM module support
|
|
70
|
+
- 🚀 **CI/CD Pipeline:** Automated Docker builds and releases via GitHub Actions
|
|
71
|
+
- 📝 **Rich Logging:** Winston-based logging with safe credential handling
|
|
72
|
+
- 🔄 **Conversation Reset:** Clear conversation history functionality
|
|
73
|
+
- 🏷️ **Custom Duck Nicknames:** Optional custom names for AI providers
|
|
74
|
+
|
|
75
|
+
### Features
|
|
76
|
+
- Support for multiple OpenAI-compatible LLM providers
|
|
77
|
+
- Conversation context management with unique IDs
|
|
78
|
+
- MCP server integration with security approval system
|
|
79
|
+
- Docker-based deployment with multi-architecture support
|
|
80
|
+
- Comprehensive configuration via environment variables
|
|
81
|
+
- Automated versioning and release system (semantic-release)
|
|
82
|
+
- GitHub Actions workflows for CI/CD
|
|
83
|
+
- Systemd service files for production deployment
|
|
84
|
+
|
|
85
|
+
### Technical Improvements
|
|
86
|
+
- TypeScript support with strict type checking
|
|
87
|
+
- ESLint and Prettier for code quality
|
|
88
|
+
- Jest testing framework configured for ESM modules
|
|
89
|
+
- Winston logging with credential sanitization
|
|
90
|
+
- Zod schema validation for configuration
|
|
91
|
+
- Docker multi-stage builds for optimized images
|
|
92
|
+
- GitHub Container Registry integration
|
|
93
|
+
|
|
94
|
+
[Unreleased]: https://github.com/nesquikm/mcp-rubber-duck/compare/v1.0.0...HEAD
|
|
95
|
+
[1.0.0]: https://github.com/nesquikm/mcp-rubber-duck/releases/tag/v1.0.0
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
# 🦆 Contributing to MCP Rubber Duck
|
|
2
|
+
|
|
3
|
+
Welcome to the duck pond! 🏞️ We're thrilled that you want to help make our rubber duck debugging experience even better.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
__
|
|
7
|
+
<(o )___
|
|
8
|
+
( ._> / "Quack! Let's build something amazing together!"
|
|
9
|
+
`---'
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## 🏊 Getting Your Feet Wet
|
|
13
|
+
|
|
14
|
+
Before you can swim with the ducks, let's make sure you have everything set up properly.
|
|
15
|
+
|
|
16
|
+
### Prerequisites
|
|
17
|
+
|
|
18
|
+
- **Node.js 20+** (because even ducks need modern JavaScript)
|
|
19
|
+
- **npm or yarn** (for managing our duck food... er, dependencies)
|
|
20
|
+
- **Git** (for version control that doesn't ruffle any feathers)
|
|
21
|
+
- **A sense of humor** (optional but highly recommended)
|
|
22
|
+
|
|
23
|
+
### 🥚 Hatching Your Development Environment
|
|
24
|
+
|
|
25
|
+
1. **Fork and clone the repository**
|
|
26
|
+
```bash
|
|
27
|
+
git clone https://github.com/nesquikm/mcp-rubber-duck.git
|
|
28
|
+
cd mcp-rubber-duck
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
2. **Install dependencies**
|
|
32
|
+
```bash
|
|
33
|
+
npm install
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
3. **Build the project**
|
|
37
|
+
```bash
|
|
38
|
+
npm run build
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
4. **Run tests** (make sure everything floats properly)
|
|
42
|
+
```bash
|
|
43
|
+
npm test
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
5. **Start developing!**
|
|
47
|
+
```bash
|
|
48
|
+
npm run dev
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## 🎯 Ways to Contribute
|
|
52
|
+
|
|
53
|
+
### 🐛 Found a Bug? Help Us Debug the Duck!
|
|
54
|
+
|
|
55
|
+
If something's not working right, don't just let it be a sitting duck! Here's how to report it:
|
|
56
|
+
|
|
57
|
+
1. **Check existing issues** first (maybe another duck already spotted it)
|
|
58
|
+
2. **Create a new issue** with:
|
|
59
|
+
- Clear description of what went wrong
|
|
60
|
+
- Steps to reproduce the quacking... er, cracking behavior
|
|
61
|
+
- Your environment details (OS, Node version, etc.)
|
|
62
|
+
- Any error messages (screenshots welcome!)
|
|
63
|
+
|
|
64
|
+
### 💡 Duck Tales: Suggesting New Features
|
|
65
|
+
|
|
66
|
+
Got an idea that would make our ducks even more awesome? We're all ears! (Do ducks have ears? 🤔)
|
|
67
|
+
|
|
68
|
+
1. **Open a feature request issue**
|
|
69
|
+
2. **Describe the problem** you're trying to solve
|
|
70
|
+
3. **Explain your proposed solution**
|
|
71
|
+
4. **Consider alternatives** (there's more than one way to float a duck)
|
|
72
|
+
|
|
73
|
+
### 🔌 Teaching Ducks New Tricks (Adding Providers)
|
|
74
|
+
|
|
75
|
+
Want to add support for a new LLM provider? Fantastic! Here's the duck-tested process:
|
|
76
|
+
|
|
77
|
+
1. **Create a new provider configuration** in `src/providers/`
|
|
78
|
+
2. **Add provider tests** (because untested ducks don't swim)
|
|
79
|
+
3. **Update documentation** (help other ducks find their way)
|
|
80
|
+
4. **Add environment variables** following the `PROVIDER_NAME_*` pattern
|
|
81
|
+
|
|
82
|
+
## 📏 Duck Standards (Code Guidelines)
|
|
83
|
+
|
|
84
|
+
We like to keep our code as clean as a duck's... code. Here are our standards:
|
|
85
|
+
|
|
86
|
+
### TypeScript
|
|
87
|
+
|
|
88
|
+
- **Use TypeScript** for all new code (even ducks need types)
|
|
89
|
+
- **Prefer interfaces over types** when possible
|
|
90
|
+
- **Add proper JSDoc comments** for public APIs
|
|
91
|
+
- **Use strict null checks** (no undefined ducks allowed)
|
|
92
|
+
|
|
93
|
+
### Code Style
|
|
94
|
+
|
|
95
|
+
- **Run the linter**: `npm run lint`
|
|
96
|
+
- **Use Prettier**: `npm run format`
|
|
97
|
+
- **Follow existing patterns** (when in duck pond, do as the ducks do)
|
|
98
|
+
- **Keep functions focused** (one quack per function)
|
|
99
|
+
|
|
100
|
+
### File Organization
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
src/
|
|
104
|
+
├── providers/ # Duck provider implementations
|
|
105
|
+
├── tools/ # MCP tool implementations
|
|
106
|
+
├── services/ # Core services (cache, conversations, etc.)
|
|
107
|
+
├── config/ # Configuration management
|
|
108
|
+
└── utils/ # Utility functions (logging, validation, etc.)
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## 🧪 Testing (Making Sure Ducks Float)
|
|
112
|
+
|
|
113
|
+
> "If it walks like a duck and quacks like a duck, it better pass tests like a duck!"
|
|
114
|
+
|
|
115
|
+
### Running Tests
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
# Run all tests
|
|
119
|
+
npm test
|
|
120
|
+
|
|
121
|
+
# Run tests in watch mode (for active development)
|
|
122
|
+
npm run test:watch
|
|
123
|
+
|
|
124
|
+
# Run with coverage (see which ducks are covered)
|
|
125
|
+
npm test -- --coverage
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Writing Tests
|
|
129
|
+
|
|
130
|
+
- **Write tests for new features** (no test, no merge - that's the duck law)
|
|
131
|
+
- **Use descriptive test names** (`should quack when duck is happy`)
|
|
132
|
+
- **Test error conditions** (what happens when ducks get grumpy?)
|
|
133
|
+
- **Mock external dependencies** (don't let real APIs mess with our test ducks)
|
|
134
|
+
|
|
135
|
+
## 💬 Commit Messages (Duck Communication Protocol)
|
|
136
|
+
|
|
137
|
+
We use [Conventional Commits](https://www.conventionalcommits.org/) because our automated release system speaks duck:
|
|
138
|
+
|
|
139
|
+
### Format
|
|
140
|
+
```
|
|
141
|
+
type(scope): description
|
|
142
|
+
|
|
143
|
+
[optional body]
|
|
144
|
+
|
|
145
|
+
[optional footer(s)]
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Types That Make Our Ducks Happy
|
|
149
|
+
- `feat:` - New feature (🦆 gets a new trick)
|
|
150
|
+
- `fix:` - Bug fix (🔧 duck repairs)
|
|
151
|
+
- `docs:` - Documentation changes (📚 duck education)
|
|
152
|
+
- `style:` - Code style changes (💄 duck grooming)
|
|
153
|
+
- `refactor:` - Code refactoring (🏗️ duck house renovation)
|
|
154
|
+
- `test:` - Adding tests (🧪 duck quality assurance)
|
|
155
|
+
- `chore:` - Maintenance tasks (🧹 duck pond cleaning)
|
|
156
|
+
|
|
157
|
+
### Good Examples
|
|
158
|
+
```bash
|
|
159
|
+
feat: add support for Anthropic Claude API
|
|
160
|
+
fix: prevent duck overflow in conversation cache
|
|
161
|
+
docs: update setup instructions for macOS ducks
|
|
162
|
+
test: add integration tests for duck council feature
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Version Impact
|
|
166
|
+
- `fix:` → Patch release (1.0.0 → 1.0.1)
|
|
167
|
+
- `feat:` → Minor release (1.0.0 → 1.1.0)
|
|
168
|
+
- `BREAKING CHANGE:` → Major release (1.0.0 → 2.0.0)
|
|
169
|
+
|
|
170
|
+
## 🚀 Pull Request Process (Paddling Upstream)
|
|
171
|
+
|
|
172
|
+
Ready to submit your contribution? Here's how to navigate the waters:
|
|
173
|
+
|
|
174
|
+
### Before You Submit
|
|
175
|
+
|
|
176
|
+
1. **Update documentation** if needed
|
|
177
|
+
2. **Add tests** for your changes
|
|
178
|
+
3. **Run the full test suite**: `npm test`
|
|
179
|
+
4. **Lint your code**: `npm run lint`
|
|
180
|
+
5. **Build successfully**: `npm run build`
|
|
181
|
+
6. **Update CHANGELOG.md** if it's a notable change
|
|
182
|
+
|
|
183
|
+
### PR Guidelines
|
|
184
|
+
|
|
185
|
+
1. **Create a descriptive PR title** (following conventional commit format)
|
|
186
|
+
2. **Fill out the PR template** (helps us understand your duck logic)
|
|
187
|
+
3. **Link any related issues** (`Fixes #123`)
|
|
188
|
+
4. **Keep PRs focused** (one feature per duck, please)
|
|
189
|
+
5. **Be patient** - our duck reviewers are thorough but fair
|
|
190
|
+
|
|
191
|
+
### The Review Process
|
|
192
|
+
|
|
193
|
+
Our council of senior ducks will review your PR. They might:
|
|
194
|
+
- **Request changes** (suggestions to make your duck even better)
|
|
195
|
+
- **Ask questions** (rubber duck debugging in action!)
|
|
196
|
+
- **Approve and merge** (welcome to the pond! 🎉)
|
|
197
|
+
|
|
198
|
+
## 🤝 Duck Pond Etiquette
|
|
199
|
+
|
|
200
|
+
We're building a welcoming community where all ducks can thrive:
|
|
201
|
+
|
|
202
|
+
### The Golden Rules
|
|
203
|
+
|
|
204
|
+
1. **Be respectful** - No aggressive quacking
|
|
205
|
+
2. **Be constructive** - Help make things better
|
|
206
|
+
3. **Be patient** - We're all learning to swim
|
|
207
|
+
4. **Be inclusive** - Every duck has value
|
|
208
|
+
5. **Have fun** - We're building cool stuff with AI ducks!
|
|
209
|
+
|
|
210
|
+
### Getting Help
|
|
211
|
+
|
|
212
|
+
- **💬 Discussions**: Use GitHub Discussions for questions
|
|
213
|
+
- **🐛 Issues**: Bug reports and feature requests
|
|
214
|
+
- **📖 Wiki**: Additional documentation and guides
|
|
215
|
+
|
|
216
|
+
## 🏆 Recognition
|
|
217
|
+
|
|
218
|
+
Contributors who help improve our duck pond will be:
|
|
219
|
+
- **Listed in our README** (hall of fame!)
|
|
220
|
+
- **Mentioned in release notes** (when appropriate)
|
|
221
|
+
- **Given our eternal gratitude** (priceless!)
|
|
222
|
+
|
|
223
|
+
## 📜 Legal Stuff (The Fine Print)
|
|
224
|
+
|
|
225
|
+
By contributing, you agree that:
|
|
226
|
+
- Your contributions will be licensed under the same MIT license
|
|
227
|
+
- You have the right to contribute the code
|
|
228
|
+
- No ducks were harmed in the making of your contribution
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## 🦆 Ready to Dive In?
|
|
233
|
+
|
|
234
|
+
Thanks for reading our contributing guide! Whether you're fixing bugs, adding features, or just improving documentation, every contribution makes our duck pond a better place.
|
|
235
|
+
|
|
236
|
+
Remember: **Good code is like a good rubber duck - it helps you think clearly and solves problems!**
|
|
237
|
+
|
|
238
|
+
Happy quacking! 🦆✨
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
*"The best way to debug code is to explain it to a rubber duck. The best way to improve open source is to contribute to it!"*
|
package/Dockerfile
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Multi-stage build for optimal size
|
|
2
|
+
FROM node:20-alpine AS builder
|
|
3
|
+
|
|
4
|
+
# Set working directory
|
|
5
|
+
WORKDIR /app
|
|
6
|
+
|
|
7
|
+
# Copy package files
|
|
8
|
+
COPY package*.json ./
|
|
9
|
+
|
|
10
|
+
# Install dependencies
|
|
11
|
+
RUN npm ci
|
|
12
|
+
|
|
13
|
+
# Copy source code
|
|
14
|
+
COPY . .
|
|
15
|
+
|
|
16
|
+
# Build the application
|
|
17
|
+
RUN npm run build
|
|
18
|
+
|
|
19
|
+
# Production stage
|
|
20
|
+
FROM node:20-alpine
|
|
21
|
+
|
|
22
|
+
# Install dumb-init for proper signal handling
|
|
23
|
+
RUN apk add --no-cache dumb-init
|
|
24
|
+
|
|
25
|
+
# Create app user
|
|
26
|
+
RUN addgroup -g 1001 -S nodejs && \
|
|
27
|
+
adduser -S nodejs -u 1001
|
|
28
|
+
|
|
29
|
+
# Set working directory
|
|
30
|
+
WORKDIR /app
|
|
31
|
+
|
|
32
|
+
# Copy package files
|
|
33
|
+
COPY package*.json ./
|
|
34
|
+
|
|
35
|
+
# Install production dependencies only
|
|
36
|
+
RUN npm ci --only=production && \
|
|
37
|
+
npm cache clean --force
|
|
38
|
+
|
|
39
|
+
# Copy built application from builder
|
|
40
|
+
COPY --from=builder /app/dist ./dist
|
|
41
|
+
|
|
42
|
+
# Copy configuration examples
|
|
43
|
+
COPY config/config.example.json ./config/
|
|
44
|
+
|
|
45
|
+
# Change ownership
|
|
46
|
+
RUN chown -R nodejs:nodejs /app
|
|
47
|
+
|
|
48
|
+
# Switch to non-root user
|
|
49
|
+
USER nodejs
|
|
50
|
+
|
|
51
|
+
# Expose stdio
|
|
52
|
+
EXPOSE 3000
|
|
53
|
+
|
|
54
|
+
# Add healthcheck for monitoring
|
|
55
|
+
HEALTHCHECK --interval=30s --timeout=10s --retries=3 --start-period=30s \
|
|
56
|
+
CMD node -e "process.exit(0)" || exit 1
|
|
57
|
+
|
|
58
|
+
# Use dumb-init to handle signals properly
|
|
59
|
+
ENTRYPOINT ["dumb-init", "--"]
|
|
60
|
+
|
|
61
|
+
# Start the application
|
|
62
|
+
CMD ["node", "dist/index.js"]
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 MCP Rubber Duck Contributors
|
|
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.
|