Skip to content

.Net: Fix some documentation issues #10807

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions dotnet/samples/Demos/ModelContextProtocol/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,18 @@

Kernel kernel = builder.Build();

// Add the MCP simple tools as Kernel functions
// Create an MCPClient for the GitHub server
var mcpClient = await McpDotNetExtensions.GetGitHubToolsAsync().ConfigureAwait(false);
var functions = await mcpClient.MapToFunctionsAsync().ConfigureAwait(false);

foreach (var function in functions)
// Retrieve the list of tools available on the GitHub server
var tools = await mcpClient.ListToolsAsync().ConfigureAwait(false);
foreach (var tool in tools.Tools)
{
Console.WriteLine($"{function.Name}: {function.Description}");
Console.WriteLine($"{tool.Name}: {tool.Description}");
}

// Add the MCP tools as Kernel functions
var functions = await mcpClient.MapToFunctionsAsync().ConfigureAwait(false);
kernel.Plugins.AddFromFunctions("GitHub", functions);

// Enable automatic function calling
Expand Down
6 changes: 3 additions & 3 deletions dotnet/samples/Demos/ModelContextProtocol/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ MCP is an open protocol that standardizes how applications provide context to LL

For for information on Model Context Protocol (MCP) please refer to the [documentation](https://modelcontextprotocol.io/introduction).

This sample uses [mcpdotnet](https://www.nuget.org/packages/mcpdotnet) was heavily influenced by the [samples](https://github.com/PederHP/mcpdotnet/tree/main/samples) from that repository.
This sample uses [mcpdotnet](https://www.nuget.org/packages/mcpdotnet) is heavily influenced by the [samples](https://github.com/PederHP/mcpdotnet/tree/main/samples) from that repository.

The sample shows:

Expand All @@ -15,13 +15,13 @@ The sample shows:
3. Convert the MCP tools to Semantic Kernel functions so they can be added to a Kernel instance
4. Invoke the tools from Semantic Kernel using function calling

## Configuring Secrets
## Configuring Secrets or Environment Variables

The example require credentials to access OpenAI.

If you have set up those credentials as secrets within Secret Manager or through environment variables for other samples from the solution in which this project is found, they will be re-used.

### To set your secrets with Secret Manager:
### To set your secrets with Secret Manager

```text
cd dotnet/samples/Demos/ModelContextProtocol
Expand Down

This file was deleted.

Loading