Skip to content

Commit 471be18

Browse files
feat: pkgx mcp registry
1 parent 5651103 commit 471be18

File tree

6 files changed

+99
-32
lines changed

6 files changed

+99
-32
lines changed

.github/workflows/docker.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,43 @@ jobs:
5454
platforms: linux/amd64
5555
tags: ${{ steps.meta.outputs.tags }}
5656
labels: ${{ steps.meta.outputs.labels }}
57+
58+
publish-mcp:
59+
needs: build-and-push
60+
if: startsWith(github.ref, 'refs/tags/v')
61+
runs-on: ubuntu-latest
62+
permissions:
63+
contents: read
64+
id-token: write
65+
steps:
66+
- name: Checkout
67+
uses: actions/checkout@v4
68+
69+
- name: Install MCP Publisher
70+
run: |
71+
curl -L "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" \
72+
| tar xz mcp-publisher
73+
chmod +x mcp-publisher
74+
75+
- name: Prepare server manifest
76+
run: |
77+
VERSION=${GITHUB_REF#refs/tags/v}
78+
IMAGE_REPO=$(echo "${GITHUB_REPOSITORY}" | tr '[:upper:]' '[:lower:]')
79+
IMAGE="ghcr.io/${IMAGE_REPO}:$VERSION"
80+
jq --arg v "$VERSION" --arg image "$IMAGE" '
81+
.version = $v
82+
| .packages = (.packages // [] | map(
83+
if .registryType == "oci" then
84+
(.identifier = $image)
85+
else .
86+
end
87+
| (if has("version") then .version = $v else . end)
88+
))
89+
' server.json > server.publish.json
90+
mv server.publish.json server.json
91+
92+
- name: Login to MCP Registry
93+
run: ./mcp-publisher login github-oidc
94+
95+
- name: Publish to MCP Registry
96+
run: ./mcp-publisher publish

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@
77
- add an Alpine-based Docker image build + entrypoint script plus usage docs for container publishing
88
- publish the container automatically to GHCR using `.github/workflows/docker.yml`
99
- update Docker builder stage to the latest stable Rust toolchain (1.91.1) for smaller, faster binaries
10+
- add a self-contained pkgx pantry (`pkgx/`) with build/test metadata so `pkgx cratedocs` can install the server via the pkgx runtime, plus README instructions for using and upstreaming it
11+
- add `just install-pkgx` to verify the pkgx pantry wiring end-to-end (falls back to a helpful message until the package is mirrored onto dist.pkgx.dev)

Cargo.lock

Lines changed: 32 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ COPY docker/entrypoint.sh /entrypoint.sh
2828

2929
RUN chmod +x /entrypoint.sh
3030

31+
LABEL io.modelcontextprotocol.server.name="io.github.promptexecution/rust-cargo-docs-rag-mcp"
32+
3133
EXPOSE 8080
3234

3335
ENV CRATEDOCS_MODE=http \

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,24 @@ git clone https://github.com/promptexecution/rust-cargo-docs-rag-mcp.git
1515
cd rust-cargo-docs-rag-mcp
1616
cargo build --release
1717
cargo install --path .
18+
# Or install the pkgx-managed binary and check its version
19+
just install-pkgx
1820
```
1921

22+
### Installing with pkgx
23+
24+
The repository includes a mini [pkgx pantry](./pkgx) so you can build and run the CLI through `pkgx` without touching your global toolchain:
25+
26+
```bash
27+
git clone https://github.com/promptexecution/rust-cargo-docs-rag-mcp.git
28+
cd rust-cargo-docs-rag-mcp
29+
export PKGX_PANTRY_PATH=$PWD/pkgx
30+
export PKGX_PANTRY_DIR=$PWD/pkgx # pkgx^2 compatibility
31+
pkgx cratedocs version
32+
```
33+
34+
`pkgx` will download the tagged source tarball, compile `cratedocs` with the required Rust toolchain, and cache the result for subsequent runs. Once you're ready to upstream this package to the central [pkgx pantry](https://github.com/pkgxdev/pantry), copy `pkgx/projects/github.com/promptexecution/rust-cargo-docs-rag-mcp/package.yml` into a new PR there.
35+
2036
## Running the Server
2137

2238
There are multiple ways to run the documentation server:

justfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ install:
44
run:
55
cargo run --bin cratedocs http --address 0.0.0.0:3000 --debug
66

7+
install-pkgx:
8+
@echo "Using pkgx pantry at {{invocation_directory()}}/pkgx"
9+
PKGX_PANTRY_PATH={{invocation_directory()}}/pkgx \
10+
PKGX_PANTRY_DIR={{invocation_directory()}}/pkgx \
11+
pkgx cratedocs version || \
12+
(echo "pkgx failed (likely no network); see README for manual steps" && exit 1)
13+
714
docker-build:
815
docker build -t promptexecution/rust-cargo-docs-rag-mcp .
916

0 commit comments

Comments
 (0)