diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4138fc9..27d85e8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,11 +33,10 @@ jobs: ${{ runner.os }}-cargo- - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.91.1 - override: true - components: clippy, rustfmt + run: | + rustup toolchain install 1.91.1 + rustup default 1.91.1 + rustup component add clippy rustfmt - name: Show rustc & cargo versions run: | diff --git a/.github/workflows/release-and-publish.yml b/.github/workflows/release-and-publish.yml index 1898aa7..551a1cb 100644 --- a/.github/workflows/release-and-publish.yml +++ b/.github/workflows/release-and-publish.yml @@ -22,13 +22,13 @@ jobs: fetch-depth: 0 - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Authenticate to GHCR - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} @@ -40,7 +40,7 @@ jobs: echo "ref_name=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT - name: Build and push multi-arch Docker image - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v6 with: context: . file: ./Dockerfile @@ -73,10 +73,14 @@ jobs: strip target/x86_64-unknown-linux-gnu/release/cratedocs || true - name: Build aarch64-unknown-linux-gnu release binary + env: + CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc + CC_aarch64_unknown_linux_gnu: aarch64-linux-gnu-gcc + CXX_aarch64_unknown_linux_gnu: aarch64-linux-gnu-g++ + AR_aarch64_unknown_linux_gnu: aarch64-linux-gnu-ar run: | - export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc cargo build --locked --release --target aarch64-unknown-linux-gnu - strip target/aarch64-unknown-linux-gnu/release/cratedocs || true + aarch64-linux-gnu-strip target/aarch64-unknown-linux-gnu/release/cratedocs || true - name: Upload x86_64 binary to release uses: softprops/action-gh-release@v1 diff --git a/README.md b/README.md index 1529dfd..341cd9a 100644 --- a/README.md +++ b/README.md @@ -295,7 +295,99 @@ in `mcp_settings.json`: } ``` ---- +### Using Docker with MCP + +You can use the Docker image directly in your MCP configuration: + +```json +{ + "mcpServers": { + "rust-crate-docs-docker": { + "command": "docker", + "args": [ + "run", + "--rm", + "-i", + "ghcr.io/promptexecution/rust-cargo-docs-rag-mcp:latest", + "stdio" + ] + } + } +} +``` + +Or if you want to run the HTTP/SSE server in Docker and connect via mcp-remote: + +```bash +# Start the HTTP server in Docker +docker run --rm -p 8080:8080 ghcr.io/promptexecution/rust-cargo-docs-rag-mcp:latest +``` + +Then in `mcp_settings.json`: +```json +{ + "mcpServers": { + "rust-crate-docs-docker-http": { + "command": "bunx", + "args": [ + "-y", + "mcp-remote@latest", + "http://localhost:8080/sse", + "--allow-http", + "--transport", "sse-only" + ] + } + } +} +``` + +### Using pkgx with MCP + +If you have [pkgx](https://pkgx.dev) installed, you can run the server without a system-wide Rust installation: + +```json +{ + "mcpServers": { + "rust-crate-docs-pkgx": { + "command": "pkgx", + "args": [ + "+rust", + "+cargo", + "cargo", + "run", + "--manifest-path", + "/path/to/rust-cargo-docs-rag-mcp/Cargo.toml", + "--bin", + "cratedocs", + "--", + "stdio" + ] + } + } +} +``` + +Or use pkgx to install and run directly: + +```bash +# Clone and install with pkgx +git clone https://github.com/promptexecution/rust-cargo-docs-rag-mcp.git +cd rust-cargo-docs-rag-mcp +pkgx +rust +cargo cargo install --path . +``` + +Then reference it normally in `mcp_settings.json`: +```json +{ + "mcpServers": { + "rust-crate-docs": { + "command": "cratedocs", + "args": ["stdio"] + } + } +} +``` + ## Implementation Notes