-
Notifications
You must be signed in to change notification settings - Fork 745
Add list_integrations and get_resource_content MCP tools to CLI #13231
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
base: main
Are you sure you want to change the base?
Add list_integrations and get_resource_content MCP tools to CLI #13231
Conversation
|
|
||
| public override string Name => "get_aspire_docs"; | ||
|
|
||
| public override string Description => "Get Aspire documentation content from aspire.dev/llms.txt. This provides a comprehensive overview of .NET Aspire documentation optimized for LLMs. This tool does not require a running AppHost."; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Aspire not .NET Aspire.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 66f7b8b - Changed ".NET Aspire" to "Aspire" in the description.
|
|
||
| public override JsonElement GetInputSchema() | ||
| { | ||
| return JsonDocument.Parse("{ \"type\": \"object\", \"properties\": {} }").RootElement; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Introduce a schema for integrations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 66f7b8b - Added Integration class with name, packageId, and version properties, and ListIntegrationsResponse as the response schema.
| { | ||
| return new CallToolResult | ||
| { | ||
| Content = [new TextContentBlock { Text = "No Aspire hosting integrations found." }] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't return text, return structured content (JSON).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 66f7b8b - Now returns structured JSON with the format {"integrations": [{"name": "Redis", "packageId": "Aspire.Hosting.Redis", "version": "9.0.0"}, ...]}
|
@copilot Implement the PR feedback |
|
@copilot Why does the schema from the ListIntegrationsTool and GetAspireDocsTool have no properties? For the ListIntegrationsTool we should respond with both names (long and short) and the description should describe how to add integrations to the apphost using the aspire cli. |
Fixed in 2c864f1 - The input schemas now include |
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 13231Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 13231" |
|
@copilot remove the GetAspireDocsTool from the CLI MCP server. instead I want you to introduce a new annotation called AgentContentAnnotation into the app model (put it in the Introduce an API that looks like this to the app model: var myresource = builder.AddPostgres("pg")
.WithAgentContent(async (context) => { });The idea is that each resource can have a callback which is invoked to get text which can be returned to the agent. Introduce a new MCP tool called The context instance will be a new type called AgentContentContext which exposes a model for appending text which is ultimately rendered to the client. |
Implemented in eeaf179:
|
Co-authored-by: davidfowl <[email protected]>
Co-authored-by: davidfowl <[email protected]>
Co-authored-by: davidfowl <[email protected]>
…ttpClient timeout Co-authored-by: davidfowl <[email protected]>
Co-authored-by: davidfowl <[email protected]>
…, return JSON Co-authored-by: davidfowl <[email protected]>
Co-authored-by: davidfowl <[email protected]>
…integrations Co-authored-by: davidfowl <[email protected]>
…ent MCP tool Co-authored-by: mitchdenny <[email protected]>
Co-authored-by: mitchdenny <[email protected]>
9ad1588 to
27515a1
Compare
Description
Adds two new MCP tools to the CLI and introduces a new public API for resource agent content in Aspire.Hosting:
MCP Tools
list_integrations- Lists available Aspire hosting integrations (NuGet packages) from configured package channels, returns structured JSON withIntegrationschema containing short name, full package ID, and version. Description explains how to add integrations usingaspire add <integration-name>.get_resource_content- Gets agent content from a resource in the AppHost. Uses the auxiliary backchannel to invokeGetResourceAgentContentAsyncRPC on the AppHost.New Public API (Aspire.Hosting)
Introduces a new
WithAgentContentAPI that allows resources to expose content to AI agents:AgentContentAnnotation- Annotation that stores a callback for generating agent contentAgentContentContext- Context withResource,ServiceProvider,CancellationTokenproperties andAppendText()/AppendLine()methods for building contentWithAgentContent<T>()- Extension method onIResourceBuilder<T>usingResourceAnnotationMutationBehavior.Replace[Experimental("ASPIREAGENTCONTENT001")]Changes
ListIntegrationsTool.cs- UsesIPackagingServiceto fetch packages, extracts friendly names, uses semantic versioning for correct ordering, returns structured JSONGetResourceContentTool.cs- Uses auxiliary backchannel to invoke agent content callbacks on resourcesAgentContentAnnotation.cs- New annotation and context types in Aspire.Hosting.ApplicationModelResourceBuilderExtensions.cs- AddedWithAgentContentextension methodAuxiliaryBackchannelRpcTarget.cs- AddedGetResourceAgentContentAsyncRPC methodMcpStartCommand.cs- Registers new toolsMcpCommand.cs- InjectsIPackagingServicedependencyJsonSourceGenerationContext.cs- AddedIntegrationandListIntegrationsResponsetypes for AOT-compatible JSON serializationChecklist
<remarks />and<code />elements on your triple slash comments?doc-ideatemplatebreaking-changetemplatediagnostictemplateOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.