Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
6d35667
Add auth MCP server example project structure (#2)
Mar 16, 2026
75416aa
Add error types module with HTTP response support (#2)
Mar 16, 2026
f1cc18f
Add AuthServerConfig struct with default values (#2)
Mar 16, 2026
79b4393
Add INI file parsing for configuration (#2)
Mar 16, 2026
a236e57
Add config building with endpoint derivation (#2)
Mar 16, 2026
e88e71f
Add config validation and file loading (#2)
Mar 16, 2026
9cfdf32
Add CORS helper module for MCP compatibility (#2)
Mar 16, 2026
40d158a
Add health check endpoint with uptime tracking (#2)
Mar 16, 2026
82b0fea
Add OAuth metadata type definitions (#2)
Mar 16, 2026
c63ccb2
Add protected resource metadata endpoint (#2)
Mar 16, 2026
1a5730c
Add authorization server metadata endpoint (#2)
Mar 16, 2026
a4af10b
Add OpenID Connect discovery endpoint (#2)
Mar 16, 2026
804b8d3
Add OAuth authorize redirect and client registration (#2)
Mar 16, 2026
c401fbf
Add JSON-RPC types and MCP handler definitions (#2)
Mar 16, 2026
57e098c
Add McpHandler core and method dispatch (#2)
Mar 16, 2026
e1417e5
Add tool registration and MCP endpoint handlers (#2)
Mar 16, 2026
e393b25
Add weather tools with scope-based access control (#2)
Mar 16, 2026
623a592
Add auth context and token extraction middleware (#2)
Mar 16, 2026
98f51b1
Add auth middleware and unauthorized response handlers (#2)
Mar 16, 2026
5350884
Add gopher-auth FFI bindings module (#2)
Mar 16, 2026
1d2364e
Add main entry point with router setup (#2)
Mar 16, 2026
b32b5f4
Add graceful shutdown and cleanup handling (#2)
Mar 16, 2026
f94e41a
Add server configuration and run script (#2)
Mar 16, 2026
5fd4218
Add README documentation (#2)
Mar 16, 2026
582f551
Update gopher-orch submodule to track br_release (#2)
Mar 16, 2026
c95a16f
Add auth FFI as optional feature for third-party use (#2)
Mar 16, 2026
55a79e9
Simplify auth example FFI wrapper (#2)
Mar 16, 2026
ececdd1
Include auth feature in build.sh (#2)
Mar 16, 2026
61ef94f
Use localhost in server_url when binding to 0.0.0.0 (#2)
Mar 16, 2026
618eb66
Format code (#2)
Mar 17, 2026
1f8b99c
Add release automation scripts and CI workflow (#2)
Mar 20, 2026
615e6a5
Update auth server realm name in example config (#2)
Mar 20, 2026
5b67004
Update auth example for standalone third-party usage (#2)
Mar 20, 2026
34352e7
Add crates.io publishing support to release workflow (#2)
Mar 20, 2026
2fafe30
Make crates.io publishing the default in dump-version.sh (#2)
Mar 20, 2026
f9b9208
Resolve auth FFI bindings and rename package to gopher-mcp-rust (#2)
Mar 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
305 changes: 305 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,305 @@
name: Release

on:
push:
branches: [br_release]

permissions:
contents: write

env:
# Set to 'true' to also publish to crates.io
PUBLISH_CRATES: ${{ vars.PUBLISH_CRATES || 'false' }}

jobs:
release:
name: Create Release with Native Binaries
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
version_tag: ${{ steps.version.outputs.version_tag }}
release_created: ${{ steps.check_release.outputs.exists != 'true' }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get version from latest tag
id: version
run: |
# Get the latest tag on this branch
VERSION_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")

if [ -z "$VERSION_TAG" ]; then
echo "Error: No tags found. Run dump-version.sh first."
exit 1
fi

# Remove 'v' prefix for version number
VERSION="${VERSION_TAG#v}"

echo "version_tag=${VERSION_TAG}" >> $GITHUB_OUTPUT
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "Version Tag: ${VERSION_TAG}"
echo "Version: ${VERSION}"

- name: Check if release already exists
id: check_release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if gh release view ${{ steps.version.outputs.version_tag }} &>/dev/null; then
echo "Release ${{ steps.version.outputs.version_tag }} already exists"
echo "exists=true" >> $GITHUB_OUTPUT
else
echo "Release ${{ steps.version.outputs.version_tag }} does not exist"
echo "exists=false" >> $GITHUB_OUTPUT
fi

- name: Download native binaries from gopher-orch
if: steps.check_release.outputs.exists != 'true'
env:
GH_TOKEN: ${{ secrets.GOPHER_ORCH_TOKEN }}
run: |
echo "Downloading native binaries for ${{ steps.version.outputs.version_tag }}..."

mkdir -p downloads

# Download all platform binaries from gopher-orch release
gh release download ${{ steps.version.outputs.version_tag }} \
-R GopherSecurity/gopher-orch \
-D downloads \
-p "libgopher-orch-*.tar.gz" \
-p "libgopher-orch-*.zip" || {
echo "Warning: Could not download some binaries"
echo "Available assets:"
gh release view ${{ steps.version.outputs.version_tag }} -R GopherSecurity/gopher-orch --json assets -q '.assets[].name'
}

echo "Downloaded files:"
ls -la downloads/

- name: Prepare release assets
if: steps.check_release.outputs.exists != 'true'
run: |
mkdir -p release-assets

# Copy binaries to release-assets
for file in downloads/*; do
if [ -f "$file" ]; then
cp "$file" "release-assets/"
fi
done

echo "Release assets:"
ls -la release-assets/

- name: Generate release notes
if: steps.check_release.outputs.exists != 'true'
run: |
VERSION="${{ steps.version.outputs.version }}"
VERSION_TAG="${{ steps.version.outputs.version_tag }}"

cat > RELEASE_NOTES.md << EOF
## gopher-mcp-rust ${VERSION_TAG}

Rust SDK for gopher-orch orchestration framework.

### Installation

#### From crates.io

\`\`\`toml
# Add to Cargo.toml
[dependencies]
gopher-orch = "${VERSION}"
\`\`\`

Or via cargo:

\`\`\`bash
cargo add gopher-orch@${VERSION}
\`\`\`

#### From GitHub

\`\`\`toml
[dependencies]
gopher-orch = { git = "https://github.com/GopherSecurity/gopher-mcp-rust.git", tag = "${VERSION_TAG}" }
\`\`\`

### Native Library Installation

\`\`\`bash
# macOS (Apple Silicon)
gh release download ${VERSION_TAG} -R GopherSecurity/gopher-mcp-rust -p "libgopher-orch-macos-arm64.tar.gz"
tar -xzf libgopher-orch-macos-arm64.tar.gz -C ./native

# macOS (Intel)
gh release download ${VERSION_TAG} -R GopherSecurity/gopher-mcp-rust -p "libgopher-orch-macos-x64.tar.gz"
tar -xzf libgopher-orch-macos-x64.tar.gz -C ./native

# Linux (x64)
gh release download ${VERSION_TAG} -R GopherSecurity/gopher-mcp-rust -p "libgopher-orch-linux-x64.tar.gz"
tar -xzf libgopher-orch-linux-x64.tar.gz -C ./native

# Linux (arm64)
gh release download ${VERSION_TAG} -R GopherSecurity/gopher-mcp-rust -p "libgopher-orch-linux-arm64.tar.gz"
tar -xzf libgopher-orch-linux-arm64.tar.gz -C ./native
\`\`\`

### Environment Setup

\`\`\`bash
# macOS
export DYLD_LIBRARY_PATH="./native/lib:\$DYLD_LIBRARY_PATH"

# Linux
export LD_LIBRARY_PATH="./native/lib:\$LD_LIBRARY_PATH"
\`\`\`

### Build Information

- **Version:** ${VERSION}
- **gopher-orch:** ${VERSION_TAG}
- **Commit:** ${{ github.sha }}
- **Date:** $(date -u +"%Y-%m-%d %H:%M:%S UTC")

EOF

# Extract changelog content
if [ -f "CHANGELOG.md" ]; then
echo "### What's Changed" >> RELEASE_NOTES.md
echo "" >> RELEASE_NOTES.md

# Get content from the version section
sed -n "/^## \[${VERSION}\]/,/^## \[/p" CHANGELOG.md | \
grep -v "^## \[" | \
head -30 >> RELEASE_NOTES.md || true
fi

# Add comparison link
PREV_TAG=$(git tag --sort=-creatordate | grep -v "^${VERSION_TAG}$" | head -1)
if [ -n "$PREV_TAG" ]; then
echo "" >> RELEASE_NOTES.md
echo "**Full Changelog**: https://github.com/${{ github.repository }}/compare/${PREV_TAG}...${VERSION_TAG}" >> RELEASE_NOTES.md
fi

echo "=== Release Notes ==="
cat RELEASE_NOTES.md

- name: Create GitHub Release
if: steps.check_release.outputs.exists != 'true'
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.version.outputs.version_tag }}
name: gopher-mcp-rust ${{ steps.version.outputs.version_tag }}
body_path: RELEASE_NOTES.md
draft: false
prerelease: ${{ contains(steps.version.outputs.version, '-') }}
files: release-assets/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Summary
run: |
echo "## Release Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- **Version:** ${{ steps.version.outputs.version_tag }}" >> $GITHUB_STEP_SUMMARY
echo "- **Release URL:** https://github.com/${{ github.repository }}/releases/tag/${{ steps.version.outputs.version_tag }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Native Libraries" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ -d "release-assets" ]; then
ls release-assets/ | while read file; do
echo "- \`${file}\`" >> $GITHUB_STEP_SUMMARY
done
fi

publish-crates:
name: Publish to crates.io
needs: release
runs-on: ubuntu-latest
if: |
needs.release.outputs.release_created == 'true' &&
(vars.PUBLISH_CRATES == 'true' || github.event.head_commit.message contains '[publish]')
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable

- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-publish-${{ hashFiles('**/Cargo.lock') }}

- name: Verify package
run: |
echo "Verifying package before publish..."
cargo package --list
cargo publish --dry-run

- name: Publish to crates.io
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: |
echo "Publishing version ${{ needs.release.outputs.version }} to crates.io..."
cargo publish

- name: Summary
run: |
echo "## crates.io Publish Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- **Version:** ${{ needs.release.outputs.version }}" >> $GITHUB_STEP_SUMMARY
echo "- **crates.io:** https://crates.io/crates/gopher-orch/${{ needs.release.outputs.version }}" >> $GITHUB_STEP_SUMMARY
echo "- **docs.rs:** https://docs.rs/gopher-orch/${{ needs.release.outputs.version }}" >> $GITHUB_STEP_SUMMARY

test:
name: Run Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable

- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Check formatting
run: cargo fmt --check

- name: Run clippy
run: cargo clippy -- -D warnings || echo "Clippy warnings found"

- name: Build (without native library)
run: cargo build || echo "Build requires native library"

notify:
name: Notify on Failure
needs: [release, test]
runs-on: ubuntu-latest
if: failure()
steps:
- name: Report failure
run: |
echo "Release workflow failed!"
echo "Check the logs for details."
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Rust
/target/
**/target/
**/*.rs.bk
Cargo.lock

Expand Down
1 change: 1 addition & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[submodule "third_party/gopher-orch"]
path = third_party/gopher-orch
url = https://github.com/GopherSecurity/gopher-orch.git
branch = br_release
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added
- Initial release of gopher-mcp-rust SDK
- Rust bindings for gopher-orch native library via FFI
- Runtime library loading using `libloading` crate
- OAuth 2.0 authentication support (feature-gated with `auth` feature)
- MCP (Model Context Protocol) client implementation
- GopherAgent for AI agent orchestration
- ConfigBuilder for client configuration
- Auth example server with Axum web framework

### Features
- `default` - Core functionality without auth
- `auth` - OAuth 2.0 token validation via native library

---

[Unreleased]: https://github.com/GopherSecurity/gopher-mcp-rust/compare/HEAD
9 changes: 5 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
[package]
name = "gopher-orch"
version = "0.1.0"
name = "gopher-mcp-rust"
version = "0.1.2-9"
edition = "2021"
authors = ["GopherSecurity"]
description = "Rust SDK for Gopher Orch - AI Agent orchestration framework"
license = "MIT"
license = "Apache-2.0"
repository = "https://github.com/GopherSecurity/gopher-mcp-rust"
keywords = ["ai", "agent", "mcp", "llm", "orchestration"]
categories = ["api-bindings", "development-tools"]

[lib]
name = "gopher_orch"
name = "gopher_mcp_rust"
path = "src/lib.rs"

[[example]]
Expand All @@ -28,3 +28,4 @@ once_cell = "=1.17.0"

[features]
default = []
auth = []
8 changes: 4 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ echo -e "${YELLOW} Compiling Rust SDK...${NC}"
LIBRARY_PATH="${NATIVE_LIB_DIR}" \
LD_LIBRARY_PATH="${NATIVE_LIB_DIR}" \
DYLD_LIBRARY_PATH="${NATIVE_LIB_DIR}" \
cargo build --release
cargo build --release --features auth

echo -e "${GREEN}✓ Rust SDK built successfully${NC}"
echo ""
Expand All @@ -193,7 +193,7 @@ echo -e "${YELLOW}Step 5: Running tests...${NC}"
LIBRARY_PATH="${NATIVE_LIB_DIR}" \
LD_LIBRARY_PATH="${NATIVE_LIB_DIR}" \
DYLD_LIBRARY_PATH="${NATIVE_LIB_DIR}" \
cargo test && echo -e "${GREEN}✓ Tests passed${NC}" || echo -e "${YELLOW}⚠ Some tests may have failed (native library required)${NC}"
cargo test --features auth && echo -e "${GREEN}✓ Tests passed${NC}" || echo -e "${YELLOW}⚠ Some tests may have failed (native library required)${NC}"

echo ""
echo -e "${GREEN}======================================${NC}"
Expand All @@ -204,7 +204,7 @@ echo -e "Native libraries: ${YELLOW}${NATIVE_LIB_DIR}${NC}"
echo -e "Native headers: ${YELLOW}${NATIVE_INCLUDE_DIR}${NC}"
echo ""
echo -e "To run tests manually:"
echo -e " ${YELLOW}DYLD_LIBRARY_PATH=\$(pwd)/native/lib cargo test${NC}"
echo -e " ${YELLOW}DYLD_LIBRARY_PATH=\$(pwd)/native/lib cargo test --features auth${NC}"
echo ""
echo -e "To build:"
echo -e " ${YELLOW}cargo build --release${NC}"
echo -e " ${YELLOW}cargo build --release --features auth${NC}"
Loading
Loading