Skip to content

Commit ca85a1e

Browse files
authored
Merge pull request #170 from dotnet-presentations/copilot/fix-87d09b71-0cf1-42ac-94a1-ce1967ac5215
Fix Part 7 README code snippets to match actual MyMcpServer template output
2 parents c6d2b15 + e9acb69 commit ca85a1e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Part 7 - MCP Server Basics/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ The template generates a simple `RandomNumberTools` class with a `GetRandomNumbe
149149
using System.ComponentModel;
150150
using ModelContextProtocol.Server;
151151

152+
namespace MyMcpServer.Tools;
153+
152154
/// <summary>
153155
/// Sample MCP tools for demonstration purposes.
154156
/// These tools can be invoked by MCP clients to perform various operations.
@@ -166,7 +168,7 @@ internal class RandomNumberTools
166168
}
167169
```
168170

169-
We'll replace this with weather functionality while keeping the same class name for simplicity.
171+
We'll add weather functionality alongside this, keeping both tools available.
170172

171173
**`.mcp/server.json`** - Metadata that describes your MCP server to package managers. Contains example values that should be customized for actual publication.
172174

@@ -248,12 +250,13 @@ internal class WeatherTools
248250
}
249251
```
250252

251-
1. **Register the new weather tools** in `Program.cs`. Update the file to register both tool classes:
253+
2. **Register the new weather tools** in `Program.cs`. Update the file to register both tool classes:
252254

253255
```csharp
254256
using Microsoft.Extensions.DependencyInjection;
255257
using Microsoft.Extensions.Hosting;
256258
using Microsoft.Extensions.Logging;
259+
using MyMcpServer.Tools;
257260

258261
var builder = Host.CreateApplicationBuilder(args);
259262

0 commit comments

Comments
 (0)