Skip to content

aspire mcp init doesn't work #14394

@hades200082

Description

@hades200082

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

aspire version: 13.1.0+8a4db1775c3fbae1c602022b636299cb04971fde

When I run aspire mcp init I get the options asking me for the project folder, then if I want to install it for vscode or copilot cli, etc. After that it asks me if I want to create an AGENTS.md and/or configure the Playwright MCP server?

I have to select one of those options for some reason as it won't let me continue without selecting. I select the AGENTS.md option and get the following error:

PS D:\Projects\qs-reborn-dotnet> aspire mcp init     
Enter the path to the root of your workspace: (D:\Projects\qs-reborn-dotnet): D:\Projects\qs-reborn-dotnet
Unhandled exception: System.Text.Json.JsonReaderException: The input does not contain any JSON tokens. Expected the input to start with a valid JSON token, when isFinalBlock is true. LineNumber: 0 | BytePositionInLine: 0.
   at System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader&, ExceptionResource, Byte, ReadOnlySpan`1) + 0x15
   at System.Text.Json.Utf8JsonReader.Read() + 0x65
   at System.Text.Json.JsonDocument.Parse(ReadOnlySpan`1, JsonReaderOptions, JsonDocument.MetadataDb&, JsonDocument.StackRowStack&) + 0x130
   at System.Text.Json.JsonDocument.ParseUnrented(ReadOnlyMemory`1, JsonReaderOptions, JsonTokenType, Boolean) + 0x12f
   at System.Text.Json.JsonDocument.ParseValue(ReadOnlySpan`1, JsonDocumentOptions) + 0x139
   at System.Text.Json.Nodes.JsonNode.Parse(String, Nullable`1, JsonDocumentOptions) + 0x45
   at Aspire.Cli.Agents.VsCode.VsCodeAgentEnvironmentScanner.<ApplyAspireMcpConfigurationAsync>d__14.MoveNext() + 0x88
--- End of stack trace from previous location ---
   at Aspire.Cli.Agents.VsCode.VsCodeAgentEnvironmentScanner.<>c__DisplayClass13_0.<<CreateAspireApplicator>b__0>d.MoveNext() + 0x55
--- End of stack trace from previous location ---
   at Aspire.Cli.Agents.AgentEnvironmentApplicator.<ApplyAsync>d__11.MoveNext() + 0x51
--- End of stack trace from previous location ---
   at Aspire.Cli.Commands.McpInitCommand.<ExecuteAsync>d__10.MoveNext() + 0x77b
--- End of stack trace from previous location ---
   at Aspire.Cli.Commands.BaseCommand.<>c__DisplayClass9_0.<<-ctor>b__0>d.MoveNext() + 0x59
--- End of stack trace from previous location ---
   at System.CommandLine.Invocation.InvocationPipeline.<InvokeAsync>d__0.MoveNext() + 0x1a8

This leaves me unable to use the aspire mcp server.

Expected Behavior

It should work?

Steps To Reproduce

  1. Run aspire mcp init
  2. Just press enter at the first prompt to let it use the default directory
  3. Select "Configure VS Code to use the Aspire MCP server " AND "Configure GitHub Copilot CLI to use the Aspire MCP server" and press enter
  4. Select any options/combination on the last step - it doesn't matter - then press enter

Exceptions (if any)

Unhandled exception: System.Text.Json.JsonReaderException: The input does not contain any JSON tokens. Expected the input to start with a valid JSON token, when isFinalBlock is true. LineNumber: 0 | BytePositionInLine: 0.
at System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader&, ExceptionResource, Byte, ReadOnlySpan1) + 0x15 at System.Text.Json.Utf8JsonReader.Read() + 0x65 at System.Text.Json.JsonDocument.Parse(ReadOnlySpan1, JsonReaderOptions, JsonDocument.MetadataDb&, JsonDocument.StackRowStack&) + 0x130
at System.Text.Json.JsonDocument.ParseUnrented(ReadOnlyMemory1, JsonReaderOptions, JsonTokenType, Boolean) + 0x12f at System.Text.Json.JsonDocument.ParseValue(ReadOnlySpan1, JsonDocumentOptions) + 0x139
at System.Text.Json.Nodes.JsonNode.Parse(String, Nullable`1, JsonDocumentOptions) + 0x45
at Aspire.Cli.Agents.VsCode.VsCodeAgentEnvironmentScanner.d__14.MoveNext() + 0x88
--- End of stack trace from previous location ---
at Aspire.Cli.Agents.VsCode.VsCodeAgentEnvironmentScanner.<>c__DisplayClass13_0.<b__0>d.MoveNext() + 0x55
--- End of stack trace from previous location ---
at Aspire.Cli.Agents.AgentEnvironmentApplicator.d__11.MoveNext() + 0x51
--- End of stack trace from previous location ---
at Aspire.Cli.Commands.McpInitCommand.d__10.MoveNext() + 0x77b
--- End of stack trace from previous location ---
at Aspire.Cli.Commands.BaseCommand.<>c__DisplayClass9_0.<<-ctor>b__0>d.MoveNext() + 0x59
--- End of stack trace from previous location ---
at System.CommandLine.Invocation.InvocationPipeline.d__0.MoveNext() + 0x1a8

.NET Version info

PS D:\Projects\qs-reborn-dotnet> dotnet --info
.NET SDK:
 Version:           10.0.102
 Commit:            4452502459
 Workload version:  10.0.100-manifests.73000c7b
 MSBuild version:   18.0.7+445250245

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.26200
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\10.0.102\

.NET workloads installed:
There are no installed workloads to display.
Configured to use workload sets when installing new manifests.
No workload sets are installed. Run "dotnet workload restore" to install a workload set.

Host:
  Version:      10.0.2
  Architecture: x64
  Commit:       4452502459

.NET SDKs installed:
  6.0.201 [C:\Program Files\dotnet\sdk]
  10.0.102 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 10.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.23 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 10.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 6.0.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.23 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 9.0.12 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 10.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  DOTNET_ASPIRE_CONTAINER_RUNTIME          [podman]

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

Anything else?

Aspire: 13.1.0+8a4db1775c3fbae1c602022b636299cb04971fde
.NET: 10.0.102
IDE: VSCode

Also tried in Windows PowerShell and Windows Terminal

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions