Add gateway endpoint to mock tooling server for local agent testing#197
Merged
sellakumaran merged 2 commits intomicrosoft:mainfrom Feb 11, 2026
Conversation
Problem:
- .NET agents expect a platform gateway endpoint at /agents/{agentInstanceId}/mcpServers
- Mock server only provided direct MCP endpoints (/mcp/sse, /agents/servers/{name})
- This caused MCP tool loading failures during local testing with 404 errors
Solution:
- Added /agents/{agentInstanceId}/mcpServers endpoint (lines 208-241)
- Endpoint returns MCP server discovery list matching ToolingManifest.json structure
- Added logging statement for gateway endpoint at startup (line 81)
Testing:
- Verified with local agent + Agent Playground
- Successfully loaded 32 MCP tools (12 Calendar + 20 Mail)
- Agent now correctly schedules meetings using mock calendar tools
Related: Enables Phase 6 local testing workflow
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a platform gateway endpoint to the mock tooling server to enable local agent testing with MCP server discovery. Previously, .NET agents received 404 errors when trying to discover MCP servers through the expected /agents/{agentInstanceId}/mcpServers endpoint, as the mock server only provided direct MCP endpoints.
Changes:
- Added
/agents/{agentInstanceId}/mcpServersgateway endpoint that returns MCP server discovery information - Included startup logging to indicate gateway endpoint availability
- Response structure matches the platform's ToolingManifest.json format with proper fields (mcpServerName, mcpServerUniqueName, url, scope, audience)
JesuTerraz
reviewed
Jan 27, 2026
These fields are not used by the SDK as noted in PR review feedback. Co-authored-by: JesuTerraz <JesuTerraz@users.noreply.github.com>
Contributor
Author
|
Re: test coverage for the gateway endpoint - Good point! Since the mock server is primarily for local development and other endpoints in this file also lack direct tests, I'll keep this PR focused on the feature itself. Adding integration tests for the mock server endpoints would be a good follow-up improvement. |
joratz
approved these changes
Feb 4, 2026
sellakumaran
approved these changes
Feb 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add gateway endpoint to mock tooling server for local agent testing
Problem
/agents/{agentInstanceId}/mcpServersto discover available MCP servers/mcp/sse,/agents/servers/{name})Solution
/agents/{agentInstanceId}/mcpServersgateway endpoint toServer.csToolingManifest.jsonstructure expected by the platformmcpServerName,mcpServerUniqueName,url,scope, andaudiencefor each configured MCP serverChanges
src/Microsoft.Agents.A365.DevTools.MockToolingServer/Server.csTesting
/mcp/sse,/mcp/schema.json,/health)Related
Enables Phase 6 local testing workflow for agent development