Skip to content

Commit 3ee5032

Browse files
committed
feat: add initialization script and improve template setup experience
- Add init.sh script for automated template customization - Interactive prompts with input validation - Automatic placeholder replacement across all files - Directory renaming and workspace updates - Comprehensive validation and summary - Add comprehensive CI workflow (.github/workflows/ci.yml) - Pre-commit checks with rustfmt, clippy, detect-secrets - Cross-platform builds (Linux, macOS, Windows) - Binary verification without requiring config files - Security audit and template validation - Add pre-commit hooks configuration - Rust formatting and linting (cargo fmt, clippy) - Shell script checks (shellcheck, shfmt) - Secret detection with baseline - Markdown and JavaScript formatting - Add validation script (scripts/validate.sh) - Checks for unreplaced placeholders - Validates package configuration - Color-coded output with actionable errors - Fix NPM publish workflow - Remove problematic npm install step that fails during parallel publishing - Add supporting files - requirements-dev.txt for Python dependencies - .secrets.baseline for detect-secrets - .markdownlint.json for markdown linting config - Enhance documentation - README: Add Getting Started with automated and manual setup - README: Add Pre-commit hooks and Troubleshooting sections - PUBLISHING: Add validation step before publishing - Fix template issues - Add missing schemars dependency - Fix start_time field usage in get_status method - Apply formatting fixes from pre-commit hooks Fixes #10
1 parent 4c26602 commit 3ee5032

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1766
-338
lines changed
Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,47 @@
11
---
22
name: Bug report
33
about: Create a report to help us improve
4-
title: '[BUG] '
4+
title: "[BUG] "
55
labels: bug
6-
assignees: ''
6+
assignees: ""
77
---
88

99
## Bug Description
10+
1011
A clear and concise description of what the bug is.
1112

1213
## To Reproduce
14+
1315
Steps to reproduce the behavior:
16+
1417
1. Build the server with '...'
1518
2. Run command '...'
1619
3. Send request '...'
1720
4. See error
1821

1922
## Expected Behavior
23+
2024
A clear and concise description of what you expected to happen.
2125

2226
## Actual Behavior
27+
2328
What actually happened.
2429

2530
## Error Output
31+
2632
```
2733
Paste any error messages or logs here
2834
```
2935

3036
## Environment
37+
3138
- OS: [e.g. macOS, Ubuntu, Windows]
3239
- Rust version: [e.g. 1.75.0]
3340
- Framework version: [e.g. 0.8.2]
3441
- MCP Client: [e.g. Claude Desktop, MCP Inspector]
3542

3643
## Request/Response Examples
44+
3745
```json
3846
// Request that caused the issue
3947
{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{...}}
@@ -43,4 +51,5 @@ Paste any error messages or logs here
4351
```
4452

4553
## Additional Context
46-
Add any other context about the problem here.
54+
55+
Add any other context about the problem here.
Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,37 @@
11
---
22
name: Feature request
33
about: Suggest an idea for this project
4-
title: '[FEATURE] '
4+
title: "[FEATURE] "
55
labels: enhancement
6-
assignees: ''
6+
assignees: ""
77
---
88

99
## Feature Description
10+
1011
A clear and concise description of what you want to add.
1112

1213
## Problem Statement
14+
1315
What problem does this feature solve? Is your feature request related to a problem?
1416

1517
## Proposed Solution
18+
1619
Describe the solution you'd like to see implemented.
1720

1821
## Tool Specification
22+
1923
If this is a new MCP tool, provide the specification:
2024

2125
### Tool Name
26+
2227
`your_tool_name`
2328

2429
### Description
30+
2531
What the tool does and when to use it.
2632

2733
### Parameters
34+
2835
```json
2936
{
3037
"param1": {
@@ -33,22 +40,25 @@ What the tool does and when to use it.
3340
"required": true
3441
},
3542
"param2": {
36-
"type": "number",
43+
"type": "number",
3744
"description": "Optional parameter",
3845
"required": false
3946
}
4047
}
4148
```
4249

4350
### Expected Response
51+
4452
```json
4553
{
4654
"result": "example response format"
4755
}
4856
```
4957

5058
## Alternative Solutions
59+
5160
Describe any alternative solutions or features you've considered.
5261

5362
## Additional Context
54-
Add any other context, mockups, or examples about the feature request here.
63+
64+
Add any other context, mockups, or examples about the feature request here.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# Pull Request
22

33
## Description
4+
45
Brief description of changes made in this PR.
56

67
## Type of Change
8+
79
- [ ] Bug fix (non-breaking change which fixes an issue)
810
- [ ] New feature (non-breaking change which adds functionality)
911
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
@@ -12,17 +14,20 @@ Brief description of changes made in this PR.
1214
- [ ] Performance improvement
1315

1416
## Changes Made
17+
1518
- Change 1
1619
- Change 2
1720
- Change 3
1821

1922
## Testing
23+
2024
- [ ] I have tested these changes locally
2125
- [ ] I have tested with MCP Inspector
2226
- [ ] I have tested the tools/list endpoint
2327
- [ ] I have tested tool execution
2428

2529
## Test Commands
30+
2631
```bash
2732
# List tools
2833
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | ./target/debug/your-server
@@ -32,12 +37,14 @@ echo '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"tool_name"
3237
```
3338

3439
## Documentation
40+
3541
- [ ] I have updated the README if needed
3642
- [ ] I have added/updated code comments
3743
- [ ] I have updated tool descriptions
3844

3945
## Checklist
46+
4047
- [ ] My code follows the project's style guidelines
4148
- [ ] I have performed a self-review of my own code
4249
- [ ] My changes generate no new warnings
43-
- [ ] Any dependent changes have been merged and published
50+
- [ ] Any dependent changes have been merged and published

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ updates:
1111
- "rust"
1212
commit-message:
1313
prefix: "chore"
14-
include: "scope"
14+
include: "scope"

.github/workflows/ci.yml

Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
RUST_BACKTRACE: 1
12+
13+
jobs:
14+
pre-commit:
15+
name: Pre-commit Checks
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Install Rust
22+
uses: dtolnay/rust-toolchain@stable
23+
with:
24+
components: rustfmt, clippy
25+
26+
- name: Setup Python
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: "3.11"
30+
31+
- name: Install pre-commit
32+
run: |
33+
pip install pre-commit detect-secrets
34+
pre-commit --version
35+
36+
- name: Create secrets baseline if missing
37+
run: |
38+
if [ ! -f .secrets.baseline ]; then
39+
echo "Creating .secrets.baseline"
40+
detect-secrets scan --baseline .secrets.baseline
41+
fi
42+
43+
- name: Run pre-commit hooks
44+
run: pre-commit run --all-files --show-diff-on-failure
45+
46+
test:
47+
name: Test Suite
48+
runs-on: ${{ matrix.os }}
49+
strategy:
50+
fail-fast: false
51+
matrix:
52+
os: [ubuntu-latest, macos-latest, windows-latest]
53+
rust: [stable]
54+
steps:
55+
- name: Checkout repository
56+
uses: actions/checkout@v4
57+
58+
- name: Install Rust
59+
uses: dtolnay/rust-toolchain@master
60+
with:
61+
toolchain: ${{ matrix.rust }}
62+
63+
- name: Cache dependencies
64+
uses: Swatinem/rust-cache@v2
65+
66+
- name: Run tests
67+
run: cargo test --all-features --workspace
68+
69+
- name: Run doc tests
70+
run: cargo test --doc --all-features --workspace
71+
72+
build:
73+
name: Build & Verify
74+
runs-on: ${{ matrix.os }}
75+
strategy:
76+
fail-fast: false
77+
matrix:
78+
include:
79+
- target: x86_64-unknown-linux-gnu
80+
os: ubuntu-latest
81+
- target: x86_64-apple-darwin
82+
os: macos-13
83+
- target: aarch64-apple-darwin
84+
os: macos-14
85+
- target: x86_64-pc-windows-msvc
86+
os: windows-latest
87+
88+
steps:
89+
- name: Checkout repository
90+
uses: actions/checkout@v4
91+
92+
- name: Install Rust
93+
uses: dtolnay/rust-toolchain@stable
94+
with:
95+
targets: ${{ matrix.target }}
96+
97+
- name: Cache dependencies
98+
uses: Swatinem/rust-cache@v2
99+
100+
- name: Build binary
101+
run: cargo build --release --target ${{ matrix.target }} --package template-mcp-server
102+
103+
- name: Verify binary is executable (Unix)
104+
if: runner.os != 'Windows'
105+
run: |
106+
BINARY="target/${{ matrix.target }}/release/template-mcp-server"
107+
chmod +x "$BINARY"
108+
file "$BINARY"
109+
# Just verify it exists and is executable, don't run it
110+
# (running might require config files that don't exist in CI)
111+
ls -lh "$BINARY"
112+
echo "✓ Binary built successfully and is executable"
113+
114+
- name: Verify binary exists (Windows)
115+
if: runner.os == 'Windows'
116+
run: |
117+
$BINARY = "target/${{ matrix.target }}/release/template-mcp-server.exe"
118+
if (Test-Path $BINARY) {
119+
Get-Item $BINARY | Format-List
120+
Write-Host "✓ Binary built successfully"
121+
} else {
122+
Write-Error "Binary not found at $BINARY"
123+
exit 1
124+
}
125+
126+
clippy:
127+
name: Clippy Lints
128+
runs-on: ubuntu-latest
129+
steps:
130+
- name: Checkout repository
131+
uses: actions/checkout@v4
132+
133+
- name: Install Rust
134+
uses: dtolnay/rust-toolchain@stable
135+
with:
136+
components: clippy
137+
138+
- name: Cache dependencies
139+
uses: Swatinem/rust-cache@v2
140+
141+
- name: Run clippy
142+
run: cargo clippy --all-targets --all-features --workspace -- -D warnings
143+
144+
format:
145+
name: Formatting Check
146+
runs-on: ubuntu-latest
147+
steps:
148+
- name: Checkout repository
149+
uses: actions/checkout@v4
150+
151+
- name: Install Rust
152+
uses: dtolnay/rust-toolchain@stable
153+
with:
154+
components: rustfmt
155+
156+
- name: Check formatting
157+
run: cargo fmt --all -- --check
158+
159+
security:
160+
name: Security Audit
161+
runs-on: ubuntu-latest
162+
steps:
163+
- name: Checkout repository
164+
uses: actions/checkout@v4
165+
166+
- name: Install Rust
167+
uses: dtolnay/rust-toolchain@stable
168+
169+
- name: Cache dependencies
170+
uses: Swatinem/rust-cache@v2
171+
172+
- name: Install cargo-audit
173+
run: cargo install cargo-audit
174+
175+
- name: Run security audit
176+
run: cargo audit
177+
178+
validation:
179+
name: Template Validation
180+
runs-on: ubuntu-latest
181+
steps:
182+
- name: Checkout repository
183+
uses: actions/checkout@v4
184+
185+
- name: Run validation script
186+
run: |
187+
chmod +x scripts/validate.sh
188+
./scripts/validate.sh || echo "⚠️ Template not initialized (expected for template repo)"

0 commit comments

Comments
 (0)