Add MCP endpoint for audit and failed messages#5391
Add MCP endpoint for audit and failed messages#5391WilliamBZA wants to merge 35 commits intomasterfrom
Conversation
src/ServiceControl.AcceptanceTests/TestSupport/ServiceControlComponentRunner.cs
Outdated
Show resolved
Hide resolved
src/ServiceControl.Audit.AcceptanceTests/Mcp/When_mcp_server_is_enabled.cs
Outdated
Show resolved
Hide resolved
src/ServiceControl.Audit.UnitTests/Mcp/AuditMessageMcpToolsTests.cs
Outdated
Show resolved
Hide resolved
src/ServiceControl.Audit/Infrastructure/WebApi/HostApplicationBuilderExtensions.cs
Show resolved
Hide resolved
|
I see you can spec agent behavior. It would be interesting if this can included something like:
@WilliamBZA Is something like this possible? |
|
@ramonsmits MCPs can even inject prompts but that comes with a cost because it is applied to every session. But having some workflow guidance usually helps |
|
@ramonsmits You probably could, but it would depend on the agent being able to do time-based triggers. It would also have to know wait for the successful/failed audit, so maybe... But I'm not sure we want to include that in the V1 part of this PR, or if that's more of a next step |
* Improve MCP metadata guidance for AI clients * Make it clearer when many entities are affected * Tighten MCP safety metadata wording * Add scenario-guided MCP prompt validation * Remove guides --------- Co-authored-by: Daniel Marbach <danielmarbach@users.noreply.github.com>
…ompatibility for clients and inspectors. Update tests and approvals to verify output schemas, structured payloads, and text fallbacks end to end." This reverts commit 18faeecb09fd48951d2b0d4eafe248c9178f5b09. Add structured MCP responses and schemas Return typed structured content for MCP tools while preserving text compatibility for clients and inspectors. Update tests and approvals to verify output schemas, structured payloads, and text fallbacks end to end.
Use source-generated serialization metadata for MCP DTOs and acceptance support while keeping centralized options as the compatibility path. This keeps manual MCP serialization aligned with the published structured content contract without changing the SDK-managed response shape.
Reports the configuration state of the MCP server and write mode features to the licensing component.
|
@WilliamBZA, I have added a bit of telemetry so that we can make better decisions in the future, see #5413 |
johnsimons
left a comment
There was a problem hiding this comment.
So that is not lost, I don't think we need the Audit instance MCP changes, given all API calls should flow via the error instance.
So the MCP server is hosted in the error instance, and the engine then uses the current flow to query data from all configured instances (using the scatter-gather approach).
| { | ||
| var mcpBuilder = builder.Services | ||
| .AddMcpServer() | ||
| .WithHttpTransport() |
There was a problem hiding this comment.
@WilliamBZA, it seems that it is recommended to explicitly enable stateless configuration for HTTP-based MCP servers.
Is this something you reviewed and decided not to enable?
| builder.Services.AddCors(options => options.AddDefaultPolicy(Cors.GetDefaultPolicy(corsSettings))); | ||
| if (settings.EnableMcpServer || settings.EnableMcpServerWriteMode) | ||
| { | ||
| var mcpBuilder = builder.Services |
There was a problem hiding this comment.
I was expecting to see some configuration here regarding authentication that is now supported.
Or does it just flow through? (From the reading I have done, it does not seem to)
Just in case, here is a sample showing the configuration.
There was a problem hiding this comment.
Actually, there is this issue that pretty much talks about our setup
Adds support for MCP servers within ServiceControl and ServiceControl.Audit