-
Book Overview & Buying
-
Table Of Contents
Practical C# Projects with .NET
By :
In this final section, we'll look at a more complex MCP tool involving RAG search, cover more details with OpenTelemetry, integrate additional MCP server capabilities via prompts and resources, and look at what's involved with running an MCP server via Standard Input / Output (STDIO).
Earlier we covered how simple tool definitions rely on the McpServerToolType attribute on a class and then the McpServerTool attribute on individual methods. Let's expand on that to do something less trivial than flipping a coin.
Specifically, we'll add a search tool to the ModelContextProtocol.ServerShared project that allows calling a document search API that uses document embedding search, as we covered in the previous chapter, to find relevant results:
[McpServerToolType]
public class DocumentRagSearchTool(
IOptionsSnapshot<McpServerSettings> options) {
private...