Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 10 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
node-version: '24.x'
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'

Expand All @@ -63,9 +63,7 @@ jobs:

- name: Publish to npm
if: ${{ github.event.inputs.skip_npm != 'true' }}
run: pnpm publish --provenance --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --provenance --access public --no-git-checks

- name: Index and prepare mappings
env:
Expand All @@ -87,6 +85,11 @@ jobs:
run: |
echo "Generating new database manifest version..."

# Get the shared data directory path (where postinstall downloaded the docs DB)
DATA_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/mcmodding-mcp"
echo "Using shared data directory: $DATA_DIR"
ls -lh "$DATA_DIR/" || echo "Warning: Shared data directory contents not found"

# Regenerate manifest with a patch bump to ensure a new version is created
# This makes the DB version independent of the package version
pnpm run db:manifest -- --bump patch --changelog "Release $RELEASE_TAG" --release-tag "$RELEASE_TAG"
Expand All @@ -97,11 +100,11 @@ jobs:

mkdir -p release-artifacts

# Documentation database artifacts
cp data/mcmodding-docs.db release-artifacts/
# Documentation database - from shared data directory (where postinstall downloaded it)
cp "$DATA_DIR/mcmodding-docs.db" release-artifacts/
cp data/db-manifest.json release-artifacts/db-manifest.json

# Parchment mappings artifacts
# Parchment mappings - from ./data/ (where index-mappings created it)
cp data/parchment-mappings.db release-artifacts/
cp data/parchment-mappings-manifest.json release-artifacts/parchment-mappings-manifest.json

Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
## [0.4.3](https://github.com/OGMatrix/mcmodding-mcp/compare/v0.4.2...v0.4.3) (2026-02-18)

### Bug Fixes

* use shared data dir in postinstall script to match runtime ([6f4c5e7](https://github.com/OGMatrix/mcmodding-mcp/commit/6f4c5e7d1d1de17ffeeb0edffb89dc3d935c45ab))

## [0.4.2](https://github.com/OGMatrix/mcmodding-mcp/compare/v0.4.1...v0.4.2) (2026-02-18)

### Bug Fixes

* allow native module build scripts in pnpm (sharp, better-sqlite3, etc.) ([4c0c03f](https://github.com/OGMatrix/mcmodding-mcp/commit/4c0c03f55ea7864e5bc43920a861b22eed802ee9))
* changed to cwd-relative storage ([#16](https://github.com/OGMatrix/mcmodding-mcp/issues/16)) ([3d59852](https://github.com/OGMatrix/mcmodding-mcp/commit/3d59852a33fd4daf9f0bb416852c3736e061ee02))
* migrate CI workflows from npm to pnpm and remove stale package-lock.json ([3f033e3](https://github.com/OGMatrix/mcmodding-mcp/commit/3f033e3857d8ad733affe861002bf32b84b10eb9))
* synced package and package-lock (updated workflows) ([a88fade](https://github.com/OGMatrix/mcmodding-mcp/commit/a88fade801172eb1f3ec109819a0855b5c14aa18))

## [0.4.1](https://github.com/OGMatrix/mcmodding-mcp/compare/v0.4.0...v0.4.1) (2026-01-01)

### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mcmodding-mcp",
"version": "0.4.1",
"version": "0.4.3",
"packageManager": "pnpm@10.30.0",
"description": "MCP server providing AI assistants with up-to-date Minecraft modding documentation for Fabric and NeoForge",
"type": "module",
Expand Down
3 changes: 3 additions & 0 deletions scripts/generate-db-manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ async function main() {

// Write manifest to data directory for release
const dataDir = path.join(process.cwd(), 'data');
if (!fs.existsSync(dataDir)) {
fs.mkdirSync(dataDir, { recursive: true });
}
const manifestPath = path.join(dataDir, 'db-manifest.json');
fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2));

Expand Down
68 changes: 40 additions & 28 deletions src/cli/manage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -701,43 +701,55 @@ async function getRemoteVersion(dbConfig: OptionalDb): Promise<RemoteInfo | null
`https://api.github.com/repos/${CONFIG.repoOwner}/${CONFIG.repoName}/releases`
)) as GitHubRelease[];

// Find the latest release matching the tag prefix
const release = releases.find((r) => r.tag_name.startsWith(dbConfig.tagPrefix));
// Iterate through releases to find the first one that:
// 1. Matches the tag prefix
// 2. Contains the required database asset
// This handles cases where the latest release failed and has no assets
for (const release of releases) {
if (!release.tag_name.startsWith(dbConfig.tagPrefix)) {
continue;
}

if (!release) return null;
// Find assets
const dbAsset = release.assets.find((a) => a.name === dbConfig.fileName);

// Extract version from tag (e.g., examples-v0.1.0 -> 0.1.0)
let version = release.tag_name.replace(dbConfig.tagPrefix, '');
// Skip releases that don't have the required database asset
if (!dbAsset) {
continue;
}

// Find assets
const dbAsset = release.assets.find((a) => a.name === dbConfig.fileName);
const manifestAsset = release.assets.find((a) => a.name === dbConfig.manifestName);
const manifestAsset = release.assets.find((a) => a.name === dbConfig.manifestName);

if (!dbAsset) return null;
// Extract version from tag (e.g., examples-v0.1.0 -> 0.1.0)
let version = release.tag_name.replace(dbConfig.tagPrefix, '');

// If manifest exists, try to get the real version from it
// This handles cases where DB version differs from Release tag
if (manifestAsset) {
try {
const manifest = (await fetchJson(manifestAsset.browser_download_url)) as {
version: string;
};
if (manifest && manifest.version) {
version = manifest.version;
// If manifest exists, try to get the real version from it
// This handles cases where DB version differs from Release tag
if (manifestAsset) {
try {
const manifest = (await fetchJson(manifestAsset.browser_download_url)) as {
version: string;
};
if (manifest && manifest.version) {
version = manifest.version;
}
} catch {
// Fallback to tag version if manifest fetch fails
}
} catch {
// Fallback to tag version if manifest fetch fails
}

return {
version,
releaseId: release.id,
downloadUrl: dbAsset.browser_download_url,
manifestUrl: manifestAsset ? manifestAsset.browser_download_url : null,
size: dbAsset.size,
publishedAt: release.published_at,
};
}

return {
version,
releaseId: release.id,
downloadUrl: dbAsset.browser_download_url,
manifestUrl: manifestAsset ? manifestAsset.browser_download_url : null,
size: dbAsset.size,
publishedAt: release.published_at,
};
// No release found with the required assets
return null;
} catch {
return null;
}
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ if (process.argv.includes('manage')) {
const server = new Server(
{
name: 'mcmodding-mcp',
version: '0.4.1',
version: '0.4.3',
},
{
capabilities: {
Expand Down
Loading