Add Microsoft Learn MCP integration and update ResearcherAgent to sup… - #25
Merged
Conversation
…port multiple tools
There was a problem hiding this comment.
🟡 Changes recommended
Startup now hard-depends on a remote MCP endpoint without a fallback, and tool-call logging at Information level risks excessive/sensitive log output.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR expands the research capabilities of the BlogWriter workflow by integrating the Microsoft Learn MCP server and updating ResearcherAgent to support multiple tools during tool-calling runs.
Changes:
- Updated
ResearcherAgentto accept and attach multiple tools (instead of only Tavily) and log tool invocations generically. - Added Microsoft Learn MCP client initialization in
Program.csand included its tools alongside Tavily. - Added the
ModelContextProtocolpackage and configured the Microsoft Learn MCP server in VS Code settings.
File summaries
| File | Description |
|---|---|
| ResearcherAgent.cs | Generalizes the agent to accept multiple tools and updates invocation logging accordingly. |
| Program.cs | Creates a Microsoft Learn MCP client, lists its tools, and passes them to ResearcherAgent alongside Tavily. |
| BlogWriter.csproj | Adds the ModelContextProtocol NuGet dependency needed for MCP support. |
| .vscode/mcp.json | Registers the microsoft-learn MCP server for local development tooling. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+119
to
+130
| // Microsoft Learn's remote MCP server exposes docs search/fetch tools the | ||
| // Researcher can call alongside Tavily for authoritative Microsoft/Azure content. | ||
| await using McpClient microsoftLearnMcp = await McpClient.CreateAsync( | ||
| new HttpClientTransport(new HttpClientTransportOptions | ||
| { | ||
| Endpoint = new Uri("https://learn.microsoft.com/api/mcp"), | ||
| Name = "microsoft-learn", | ||
| })); | ||
| IList<McpClientTool> microsoftLearnTools = await microsoftLearnMcp.ListToolsAsync(); | ||
|
|
||
| List<AIFunction> researcherTools = [tavilyTool, .. microsoftLearnTools]; | ||
|
|
Comment on lines
+60
to
+63
| _logger.LogInformation( | ||
| "Researcher invoking tool '{Tool}' with arguments {Arguments}", | ||
| context.Function.Name, | ||
| context.Arguments); |
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.
…port multiple tools