Skip to content

Commit 459f224

Browse files
initial version testingbot mcp sewrver
0 parents  commit 459f224

40 files changed

Lines changed: 9850 additions & 0 deletions

.env.example

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# TestingBot API Credentials
2+
# Get your credentials from https://testingbot.com/members/user/edit
3+
TESTINGBOT_KEY=your-api-key-here
4+
TESTINGBOT_SECRET=your-api-secret-here
5+
6+
# Optional: Logging configuration
7+
LOG_LEVEL=info
8+
NODE_ENV=development

.github/workflows/build-mcpb.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: "Build MCPB Bundle"
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- 'v*'
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
build-mcpb:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: "Checkout source code"
17+
uses: actions/checkout@v4
18+
19+
- name: "Set up Node.js"
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: 22.x
23+
24+
- name: "Install dependencies"
25+
run: npm ci
26+
27+
- name: "Build the project"
28+
run: npm run build
29+
30+
- name: "Install MCPB CLI"
31+
run: npm install -g @anthropic-ai/mcpb
32+
33+
- name: "Validate manifest.json"
34+
run: |
35+
if [ ! -f "manifest.json" ]; then
36+
echo "Error: manifest.json not found"
37+
exit 1
38+
fi
39+
echo "manifest.json found, validating..."
40+
cat manifest.json | jq '.' > /dev/null
41+
echo "manifest.json is valid JSON"
42+
43+
- name: "Pack MCPB bundle"
44+
run: mcpb pack
45+
46+
- name: "Get version from package.json"
47+
id: get_version
48+
run: |
49+
VERSION="v$(node -p 'require("./package.json").version')"
50+
echo "version=$VERSION" >> $GITHUB_OUTPUT
51+
52+
- name: "List generated files"
53+
run: |
54+
echo "Looking for .mcpb files..."
55+
ls -lah *.mcpb || echo "No .mcpb files found in root"
56+
find . -name "*.mcpb" -type f
57+
58+
- name: "Upload MCPB bundle as artifact"
59+
uses: actions/upload-artifact@v4
60+
with:
61+
name: testingbot-mcp-server-${{ steps.get_version.outputs.version }}.mcpb
62+
path: "*.mcpb"
63+
if-no-files-found: error
64+
65+
- name: "Upload MCPB to GitHub Release"
66+
if: startsWith(github.ref, 'refs/tags/')
67+
uses: softprops/action-gh-release@v1
68+
with:
69+
files: "*.mcpb"
70+
fail_on_unmatched_files: true
71+
env:
72+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: "Release New Version"
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: write
8+
9+
jobs:
10+
publish:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: "Checkout source code"
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
18+
- name: "Set up Node.js"
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: 22.x
22+
registry-url: "https://registry.npmjs.org/"
23+
24+
- name: "Install dependencies"
25+
run: npm ci
26+
27+
- name: "Create build"
28+
run: npm run build
29+
30+
- name: "Get version from package.json"
31+
id: get_version
32+
run: |
33+
VERSION="v$(node -p 'require("./package.json").version')"
34+
echo "version=$VERSION" >> $GITHUB_OUTPUT
35+
36+
- name: "Get previous Git tag"
37+
id: get_previous_tag
38+
run: |
39+
VERSION="${{ steps.get_version.outputs.version }}"
40+
PREV_TAG=$(git tag --sort=-creatordate | grep '^v' | grep -v "$VERSION" | head -n 1)
41+
echo "previous_tag=$PREV_TAG" >> $GITHUB_OUTPUT
42+
43+
- name: "Fetch and categorize merged PRs"
44+
id: fetch_prs
45+
env:
46+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
run: |
48+
set -e
49+
PREVIOUS_TAG=${{ steps.get_previous_tag.outputs.previous_tag }}
50+
if [ -z "$PREVIOUS_TAG" ]; then
51+
echo "pr_list=No previous tag found to compare PRs." >> $GITHUB_OUTPUT
52+
exit 0
53+
fi
54+
PREVIOUS_SHA=$(git rev-list -n 1 $PREVIOUS_TAG)
55+
PREVIOUS_DATE=$(git show -s --format=%cI $PREVIOUS_SHA)
56+
CURRENT_DATE=$(git show -s --format=%cI HEAD)
57+
echo "Fetching PRs merged between $PREVIOUS_DATE and $CURRENT_DATE"
58+
59+
RAW_PRS=$(gh pr list --state merged --search "merged:${PREVIOUS_DATE}..${CURRENT_DATE}" \
60+
--json number,title,url \
61+
--jq '.[] | "- [#\(.number)](\(.url)) \(.title)"')
62+
63+
if [ -z "$RAW_PRS" ]; then
64+
echo "pr_list=No pull requests were merged during this release." >> $GITHUB_OUTPUT
65+
exit 0
66+
fi
67+
68+
ADDED=""
69+
FIXED=""
70+
while IFS= read -r pr; do
71+
if echo "$pr" | grep -iq "fix"; then
72+
FIXED+="$pr"$'\n'
73+
else
74+
ADDED+="$pr"$'\n'
75+
fi
76+
done <<< "$RAW_PRS"
77+
78+
BODY=""
79+
if [ -n "$ADDED" ]; then
80+
BODY="$BODY### Added"$'\n'"$ADDED"
81+
fi
82+
if [ -n "$FIXED" ]; then
83+
BODY="$BODY"$'\n'"### Fixed"$'\n'"$FIXED"
84+
fi
85+
86+
echo "pr_list<<EOF" >> $GITHUB_OUTPUT
87+
echo "$BODY" >> $GITHUB_OUTPUT
88+
echo "EOF" >> $GITHUB_OUTPUT
89+
90+
- name: "Set Git user name and email"
91+
run: |
92+
git config --global user.name "github-actions"
93+
git config --global user.email "github-actions@github.com"
94+
95+
- name: "Create Git tag for version"
96+
run: git tag ${{ steps.get_version.outputs.version }}
97+
98+
- name: "Push tag to origin"
99+
run: git push origin ${{ steps.get_version.outputs.version }}
100+
101+
- name: "Publish to NPM"
102+
run: npm publish --access public
103+
env:
104+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
105+
106+
- name: "Create GitHub Release"
107+
uses: actions/create-release@v1
108+
with:
109+
tag_name: ${{ steps.get_version.outputs.version }}
110+
release_name: ${{ steps.get_version.outputs.version }}
111+
body: |
112+
${{ steps.fetch_prs.outputs.pr_list }}
113+
114+
Published by ${{ github.actor }}
115+
env:
116+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Dependencies
2+
node_modules/
3+
4+
# Build output
5+
dist/
6+
7+
# Environment variables
8+
.env
9+
.env.local
10+
11+
# Logs
12+
*.log
13+
logs/
14+
15+
# IDE
16+
.vscode/
17+
.idea/
18+
*.swp
19+
*.swo
20+
*~
21+
22+
# OS
23+
.DS_Store
24+
Thumbs.db
25+
26+
# Testing
27+
coverage/
28+
.nyc_output/
29+
30+
# Temporary files
31+
*.tmp
32+
.cache/

.prettierrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"semi": true,
3+
"trailingComma": "es5",
4+
"singleQuote": false,
5+
"printWidth": 100,
6+
"tabWidth": 2,
7+
"useTabs": false
8+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 TestingBot
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 commit comments

Comments
 (0)