-
Notifications
You must be signed in to change notification settings - Fork 754
Add applicators to aspire mcp init for agent instructions and Playwright MCP server configuration
#13375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
aspire mcp init for agent instructions and Playwright MCP server configuration
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 13375Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 13375" |
1 similar comment
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 13375Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 13375" |
src/Aspire.Cli/Agents/ClaudeCode/ClaudeCodeAgentEnvironmentScanner.cs
Outdated
Show resolved
Hide resolved
|
@copilot lift the instructions generation logic out of the scanners (and remove the flag from the scanner context). It looks like AGENTS.md file is pretty much the standard across most environments. If the AGENTS.md file does not exist create it, if it does exist create AGENTS.aspire.md. |
Done in 561c11e. Removed agent-specific instruction file creation from all scanners and centralized it in |
|
@copilot Change the logic so that instead of prompting for instruction files and playwright it just adds additional applicators. In the case of the agent file we only want it added once so we need a flag on the context object which notes that the agent instructions were added so that subsequent scanners don't add an applicator for it. This means that the logic to add a playwright mcp ends up being a completely different applicator. Make sure that even if the aspire MCP is already present that it will still prompt for the playwright one if it is not present. |
Done in ebef8fe. Changed the implementation to add applicators instead of prompts:
Users can now select any combination of applicators they want to apply. |
aspire mcp init for agent instructions and Playwright MCP server configurationaspire mcp init for agent instructions and Playwright MCP server configuration
|
@copilot when the |
Co-authored-by: mitchdenny <513398+mitchdenny@users.noreply.github.com>
Co-authored-by: mitchdenny <513398+mitchdenny@users.noreply.github.com>
… individual parameters Co-authored-by: mitchdenny <513398+mitchdenny@users.noreply.github.com>
…anners Co-authored-by: mitchdenny <513398+mitchdenny@users.noreply.github.com>
- Removed CreateAgentInstructions flag from AgentEnvironmentScanContext - Removed all Create*InstructionsAsync methods from individual scanners - Added centralized CreateAgentInstructionsAsync in McpInitCommand - Creates AGENTS.md, or AGENTS.aspire.md if AGENTS.md already exists - Updated all tests to remove CreateAgentInstructions references Co-authored-by: mitchdenny <513398+mitchdenny@users.noreply.github.com>
… and Playwright - Removed ConfirmAsync prompts from McpInitCommand - Added AgentInstructionsApplicatorAdded flag to AgentEnvironmentScanContext - Created CommonAgentApplicators helper with TryAddAgentInstructionsApplicator - Updated all four scanners to add separate applicators for: - Aspire MCP configuration - Playwright MCP configuration (only if not already configured) - Agent instructions (once across all scanners) - Each applicator can be individually selected by users - Playwright applicators are offered even if Aspire MCP is already configured - Updated all tests to remove ConfigurePlaywrightMcpServer references Co-authored-by: mitchdenny <513398+mitchdenny@users.noreply.github.com>
- Modified TryAddAgentInstructionsApplicator to read and compare AGENTS.md content - Only proposes AGENTS.aspire.md if AGENTS.md exists with different content - Skips applicator creation if AGENTS.md already has the same content - Added comprehensive tests for all content comparison scenarios Co-authored-by: mitchdenny <513398+mitchdenny@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Check file existence before adding agent instructions applicator - Only propose AGENTS.aspire.md when AGENTS.md exists with different content - Update applicator description to show which file will be created - Fix spelling errors in agent instructions content - Improve test assertions to verify all applicators are empty when everything is configured - Address PR review feedback from copilot-pull-request-reviewer bot Co-authored-by: mitchdenny <513398+mitchdenny@users.noreply.github.com>
ba5cf02 to
717ecba
Compare
|
@copilot remove the logic to generate the |
…ists - Removed AGENTS.aspire.md fallback logic entirely - If AGENTS.md exists, don't offer to create instructions at all - Simplified TryAddAgentInstructionsApplicator to check only for AGENTS.md existence - Simplified CreateAgentInstructionsAsync to only create AGENTS.md - Updated tests to reflect simplified behavior - Removed tests for AGENTS.aspire.md creation and content comparison Co-authored-by: mitchdenny <513398+mitchdenny@users.noreply.github.com>
Done in the above commit. Removed |
Head branch was pushed to by a user without write access
Description
Extends
aspire mcp initwith an applicator-based approach for configuring agent environments. Users are presented with a list of available applicators and can select which configurations to apply.Changes
Applicator-Based Configuration
Context Extension
AgentEnvironmentScanContextincludes:AgentInstructionsApplicatorAdded- flag to ensure agent instructions applicator is added only once across all scannersAPI Refactoring
IAgentEnvironmentDetector.DetectAsync()signature simplified to acceptAgentEnvironmentScanContextandCancellationToken(2 parameters instead of 5)AgentEnvironmentDetectortoMcpInitCommandfor better separation of concernsScanner Behavior
npx -y @playwright/mcp@latest) (only if not already configured)CommonAgentApplicators.TryAddAgentInstructionsApplicator)Agent Instructions
CommonAgentApplicatorshelper classAGENTS.mdat workspace root only if it doesn't already existAGENTS.mdexists, no applicator is offered (regardless of content)AGENTS.mddoesn't exist, offers to create itAGENTS.md(no fallback to alternative filenames)Example Output
When Aspire and Playwright applicators are selected for VS Code,
mcp.jsonincludes:{ "servers": { "aspire": { "type": "stdio", "command": "aspire", "args": ["mcp", "start"] }, "playwright": { "type": "stdio", "command": "npx", "args": ["-y", "@playwright/mcp@latest"] } } }When the agent instructions applicator is selected, a file is created at the workspace root as
AGENTS.md:Checklist
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.