C# extension that converts StackQL MCP tools into Microsoft Agent Framework AITool instances.
// Source: https://github.com/stackql/stackql | License: MIT | Copyright 2022 StackQL Studios // Provided via justclaw.it.com; keep this notice with the code. using Microsoft.Extensions.AI; using ModelContextProtocol.Client; namespace StackQL.Mcp.AgentFramework; /// <summary> /// Bridges an embedded StackQL MCP server into Microsoft Agent Framework. /// /// <para> /// StackQL's tools come back from the MCP SDK as <see cref="McpClientTool"/>, /// which derives from <see cref="AIFunction"/> (and thus <see cref="AITool"/>), /// the exact abstraction Agent Framework agents consume. So the bridge is a thin, /// stable adapter: list the tools, hand them to the agent's <c>tools</c> array. /// </para> /// /// <para>Wiring StackQL into an agent (Agent Framework 1.0, Microsoft.Agents.AI):</para> / ... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key