Skip to content

Commit 1cd7b7a

Browse files
authored
Merge pull request #15 from Litenova-Solutions/fix/install-command-optional
fix: make `fuse mcp install --command` optional (2.2.1)
2 parents 3ca86bc + 4c9a2de commit 1cd7b7a

7 files changed

Lines changed: 71 additions & 13 deletions

File tree

.github/workflows/mcp-registry.yml

Lines changed: 47 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,62 @@ jobs:
2525
- name: Checkout
2626
uses: actions/checkout@v4
2727

28-
- name: Set version in server.json from the tag
29-
if: startsWith(github.ref, 'refs/tags/v')
28+
- name: Resolve package version
3029
run: |
31-
VERSION="${GITHUB_REF_NAME#v}"
32-
jq --arg v "$VERSION" '.version = $v | .packages[0].version = $v' \
33-
mcp-registry/server.json > mcp-registry/server.tmp
34-
mv mcp-registry/server.tmp mcp-registry/server.json
35-
echo "server.json version set to $VERSION"
30+
set -euo pipefail
31+
if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
32+
VERSION="${GITHUB_REF_NAME#v}"
33+
jq --arg v "$VERSION" '.version = $v | .packages[0].version = $v' \
34+
mcp-registry/server.json > mcp-registry/server.tmp
35+
mv mcp-registry/server.tmp mcp-registry/server.json
36+
echo "server.json version set from tag to $VERSION"
37+
else
38+
VERSION="$(jq -r '.version' mcp-registry/server.json)"
39+
echo "No tag; using server.json version $VERSION"
40+
fi
41+
echo "PKG_VERSION=$VERSION" >> "$GITHUB_ENV"
3642
3743
- name: Install mcp-publisher
3844
run: |
3945
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" | tar xz mcp-publisher
4046
47+
# The registry validates that the NuGet package version exists before it will accept the
48+
# server.json. NuGet push and indexing lag the tag push by minutes, so poll the flat
49+
# container until the version is live (or warn and try anyway). Prevents the
50+
# "version X does not exist in the registry ... wait for validation" 400 on fresh releases.
51+
- name: Wait for NuGet to index the package version
52+
run: |
53+
set -uo pipefail
54+
PKG_ID="fuse" # NuGet flat-container paths use the lowercase package id
55+
URL="https://api.nuget.org/v3-flatcontainer/${PKG_ID}/index.json"
56+
echo "Waiting for ${PKG_ID} ${PKG_VERSION} to be indexed on NuGet..."
57+
for attempt in $(seq 1 30); do
58+
if curl -sf "$URL" | jq -e --arg v "$PKG_VERSION" '.versions | index($v)' >/dev/null 2>&1; then
59+
echo "Found ${PKG_ID} ${PKG_VERSION} on NuGet (attempt ${attempt})."
60+
exit 0
61+
fi
62+
echo "Not indexed yet (attempt ${attempt}/30); sleeping 20s..."
63+
sleep 20
64+
done
65+
echo "::warning::${PKG_ID} ${PKG_VERSION} not indexed on NuGet after ~10 minutes; attempting publish anyway."
66+
4167
- name: Authenticate to MCP Registry (GitHub OIDC)
4268
working-directory: mcp-registry
4369
run: ../mcp-publisher login github-oidc
4470

71+
# Retry to cover the brief window where NuGet's flat container lists the version but the
72+
# registry's own package check has not caught up yet.
4573
- name: Publish server to MCP Registry
4674
working-directory: mcp-registry
47-
run: ../mcp-publisher publish
75+
run: |
76+
set -uo pipefail
77+
for attempt in $(seq 1 5); do
78+
if ../mcp-publisher publish; then
79+
echo "Published to MCP Registry on attempt ${attempt}."
80+
exit 0
81+
fi
82+
echo "Publish attempt ${attempt}/5 failed; sleeping 30s before retry..."
83+
sleep 30
84+
done
85+
echo "::error::mcp-publisher publish failed after 5 attempts."
86+
exit 1

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes to Fuse are documented here. The format is based on Keep a Changelog. Fuse 2.0 is a structural rewrite; backward compatibility with 1.x output is not a goal.
44

5+
## [2.2.1]
6+
7+
### Fixed
8+
9+
- **`fuse mcp install` no longer requires `--command`.** The optional `--command` option was inferred as required by the command framework, so `fuse mcp install` failed with `Option '--command' is required` unless a value was passed. It is now declared optional and defaults to the running fuse binary, as documented. (2.2.0 shipped with this regression; 2.2.0 is unusable for install without an explicit `--command`.)
10+
511
## [2.2.0]
612

713
Registering Fuse with an AI client is now one command, and the MCP surface is grouped under `fuse mcp`. The change is about setup ergonomics; the reduction, scoping, and emission paths are unchanged.

mcp-registry/server.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "io.github.Litenova-Solutions/fuse",
44
"title": "Fuse",
55
"description": "Token-efficient .NET codebase context for AI coding agents: skeleton, scoping, change-aware fusion.",
6-
"version": "2.2.0",
6+
"version": "2.2.1",
77
"repository": {
88
"url": "https://github.com/Litenova-Solutions/Fuse",
99
"source": "github",
@@ -15,7 +15,7 @@
1515
"registryType": "nuget",
1616
"registryBaseUrl": "https://api.nuget.org/v3/index.json",
1717
"identifier": "Fuse",
18-
"version": "2.2.0",
18+
"version": "2.2.1",
1919
"runtimeHint": "dnx",
2020
"transport": {
2121
"type": "stdio"

src/Host/Fuse.Cli/Commands/InstallCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public InstallCommand(IConsoleUI consoleUI, McpInstallService mcpInstallService)
5252
/// <summary>
5353
/// Gets or sets the Fuse executable the client should launch; defaults to the running binary or <c>fuse</c>.
5454
/// </summary>
55-
[CliOption(Description = "Executable the client launches (default: the running fuse binary or fuse on PATH).")]
55+
[CliOption(Required = false, Description = "Executable the client launches (default: the running fuse binary or fuse on PATH).")]
5656
public string? Command { get; set; }
5757

5858
/// <summary>

src/Host/Fuse.Cli/Commands/McpServeCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public async Task RunAsync(CliContext context)
6969
options.ServerInfo = new()
7070
{
7171
Name = "fuse",
72-
Version = "2.2.0"
72+
Version = "2.2.1"
7373
};
7474
options.ServerInstructions =
7575
"Fuse is a codebase context optimizer for AI-assisted workflows.\n\n" +

src/Host/Fuse.Cli/Fuse.Cli.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
<AssemblyName>fuse</AssemblyName>
8-
<Version>2.2.0</Version>
8+
<Version>2.2.1</Version>
99
<Product>Fuse</Product>
1010
<Description>A .NET-native codebase context optimizer for AI-assisted development. Fuse collects source files, reduces them for token efficiency, and emits a single structured payload that an agent or developer can consume in one call. Available as a global tool and an MCP server.</Description>
1111
<PackAsTool>true</PackAsTool>

tests/Fuse.Cli.Tests/McpInstallTests.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,19 @@ public void ResolveFuseCommand_UsesProcessPathWhenAvailable()
181181
Assert.False(string.IsNullOrWhiteSpace(path));
182182
}
183183

184+
[Fact]
185+
public void Install_DoesNotRequireCommandOption()
186+
{
187+
// Regression: the optional --command option was inferred as required by the command framework, so
188+
// `fuse mcp install` failed with "Option '--command' is required" unless a value was passed. Parse only
189+
// (no execution) so this never writes real client config.
190+
var result = DotMake.CommandLine.Cli.Parse<Fuse.Cli.FuseCliCommand>(["mcp", "install", "--scope", "user"]);
191+
192+
Assert.DoesNotContain(
193+
result.ParseResult.Errors,
194+
error => error.Message.Contains("command", StringComparison.OrdinalIgnoreCase));
195+
}
196+
184197
private static string CreateTempDirectory()
185198
{
186199
var path = Path.Combine(Path.GetTempPath(), "fuse-install-test", Guid.NewGuid().ToString("N"));

0 commit comments

Comments
 (0)