Skip to content

Add MCP endpoint for audit and failed messages#5391

Open
WilliamBZA wants to merge 35 commits intomasterfrom
add-mcp
Open

Add MCP endpoint for audit and failed messages#5391
WilliamBZA wants to merge 35 commits intomasterfrom
add-mcp

Conversation

@WilliamBZA
Copy link
Copy Markdown
Member

Adds support for MCP servers within ServiceControl and ServiceControl.Audit

@ramonsmits
Copy link
Copy Markdown
Member

ramonsmits commented Mar 23, 2026

I see you can spec agent behavior. It would be interesting if this can included something like:

When decided to retry a large batch of message first retry a single "canary" message. Confirm that it now is successfully processed and only then retry all to prevent unnecessary IO

@WilliamBZA Is something like this possible?

@ramonsmits ramonsmits changed the title Add mcp endpoint for audit and failed messages Add MCP endpoint for audit and failed messages Mar 23, 2026
@danielmarbach
Copy link
Copy Markdown
Contributor

@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

@WilliamBZA
Copy link
Copy Markdown
Member Author

@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

@WilliamBZA WilliamBZA requested a review from tmasternak March 25, 2026 08:00
danielmarbach and others added 5 commits March 25, 2026 16:39
* 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.
WilliamBZA and others added 2 commits April 5, 2026 13:20
Reports the configuration state of the MCP server and write mode features to the licensing component.
@johnsimons
Copy link
Copy Markdown
Member

@WilliamBZA, I have added a bit of telemetry so that we can make better decisions in the future, see #5413

Copy link
Copy Markdown
Member

@johnsimons johnsimons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()
Copy link
Copy Markdown
Member

@johnsimons johnsimons Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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
Copy link
Copy Markdown
Member

@johnsimons johnsimons Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, there is this issue that pretty much talks about our setup

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also found this issue that may affect us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants