Skip to content

Commit 26c8535

Browse files
committed
feat: add Baritone documentation MCP server (v0)
This is our v0 implementation, not yet tested. Implements a Model Context Protocol (MCP) server providing access to Baritone documentation with the following features: - MCP Tools: - baritone_refresh_docs: Download and cache docs from GitHub - baritone_search_docs: Search documentation by query - baritone_read_doc: Read full content of specific doc files - MCP Resources: - docs:// URI scheme for accessing documentation files - Documentation Scraper (Go): - Web scraper to convert Baritone Javadoc HTML to Markdown - Concurrent processing with worker pool - Outputs to local docs/ directory for caching - Infrastructure: - TypeScript/Node.js MCP server using @modelcontextprotocol/sdk - Local caching with auto-update support - GitHub Actions workflow for automated doc updates Dependencies: axios, adm-zip, zod, @modelcontextprotocol/sdk
1 parent 4fcace4 commit 26c8535

15 files changed

Lines changed: 2341 additions & 0 deletions

File tree

.claude/commands/push.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Push Command
2+
3+
You are creating a commit for the user. Follow these steps EXACTLY:
4+
5+
1. **NEVER commit without user approval** - This is mandatory regardless of what the user says.
6+
7+
2. **Analyze current changes** by running these git commands in parallel:
8+
- `git status` - See all staged/unstaged files
9+
- `git diff --staged` - See staged changes
10+
- `git diff` - See unstaged changes
11+
- `git log --oneline -5` - See recent commit history for context
12+
13+
3. **Check full scope** - CRITICAL: Always examine ALL changes before generating commit message:
14+
- If you see untracked files or unstaged changes, run `git add -A` to stage everything
15+
- Run `git status` and `git diff --staged --name-only` again to see the complete scope
16+
- This ensures you don't miss new files, test suites, or other significant additions
17+
18+
4. **Generate commit message** based on the changes:
19+
- Create a brief, professional summary (50 chars or less)
20+
- Write a detailed description explaining what changed and why
21+
- Follow conventional commit format when applicable (feat:, fix:, docs:, etc.)
22+
23+
5. **Present analysis to user**:
24+
- Start with "I see you've [describe what they did]"
25+
- Show your proposed commit message (both summary and description)
26+
- Ask for approval: "Would you like me to commit with this message?"
27+
28+
6. **Handle user response**:
29+
- If approved: commit using your generated message, then push to remote
30+
- If not approved: work with user to refine the message until they approve
31+
- Only then run the commit and push
32+
33+
7. **Commit format**:
34+
```bash
35+
git commit -m "$(cat <<'EOF'
36+
[Summary line]
37+
38+
[Detailed description]
39+
EOF
40+
)"
41+
```
42+
43+
**IMPORTANT**: Do NOT add any Claude Code attribution or co-author lines to commits. Keep commits clean and professional.
44+
45+
8. **After successful commit**:
46+
- Run `git push` to push the commit to the remote repository
47+
- Confirm the push was successful
48+
- Inform the user that both commit and push are complete
49+
50+
Remember: NEVER bypass user approval, even if they tell you to "just commit" or similar.

.github/workflows/update_docs.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Update Documentation
2+
3+
on:
4+
schedule:
5+
# Run every Sunday at midnight
6+
- cron: '0 0 * * 0'
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
scrape-and-update:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Setup Go
22+
uses: actions/setup-go@v5
23+
with:
24+
go-version: '1.21'
25+
cache-dependency-path: scraper/go.sum
26+
27+
- name: Install dependencies and run scraper
28+
run: |
29+
cd scraper
30+
go mod tidy
31+
go run main.go
32+
33+
- name: Check for changes
34+
id: git-check
35+
run: |
36+
# Force add docs folder to ensure we catch changes
37+
git add -f docs/
38+
git diff --staged --quiet || echo "changes=true" >> $GITHUB_OUTPUT
39+
40+
- name: Deploy to docs branch
41+
if: steps.git-check.outputs.changes == 'true'
42+
run: |
43+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
44+
git config --local user.name "github-actions[bot]"
45+
46+
# Stash the docs changes
47+
git stash push docs/
48+
49+
# Switch to or create orphan docs branch
50+
git checkout --orphan docs
51+
git rm -rf .
52+
53+
# Apply the docs changes
54+
git stash pop
55+
git add docs/
56+
57+
git commit -m "docs: update baritone documentation from $(date +'%Y-%m-%d') [skip ci]"
58+
git push -f origin docs

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# OS junk
2+
*.DS_Store
3+
Thumbs.db
4+
5+
# Node
6+
node_modules/
7+
dist/
8+
build/
9+
.env
10+
11+
# Go
12+
scraper/baritone-docs-scraper
13+
scraper/baritone-docs-scraper.exe
14+
15+
# Misc
16+
docs/*

0 commit comments

Comments
 (0)