![]() |
VOOZH | about |
dotnet add package Mythosia.AI.Mcp --version 0.0.1-preview
NuGet\Install-Package Mythosia.AI.Mcp -Version 0.0.1-preview
<PackageReference Include="Mythosia.AI.Mcp" Version="0.0.1-preview" />
<PackageVersion Include="Mythosia.AI.Mcp" Version="0.0.1-preview" />Directory.Packages.props
<PackageReference Include="Mythosia.AI.Mcp" />Project file
paket add Mythosia.AI.Mcp --version 0.0.1-preview
#r "nuget: Mythosia.AI.Mcp, 0.0.1-preview"
#:package Mythosia.AI.Mcp@0.0.1-preview
#addin nuget:?package=Mythosia.AI.Mcp&version=0.0.1-preview&prereleaseInstall as a Cake Addin
#tool nuget:?package=Mythosia.AI.Mcp&version=0.0.1-preview&prereleaseInstall as a Cake Tool
MCP (Model Context Protocol) client integration for Mythosia.AI.
Connect to any MCP server and automatically register its tools as FunctionDefinitions — usable by all AI providers (OpenAI, Anthropic, Google, xAI, DeepSeek, etc.).
dotnet add package Mythosia.AI.Mcp
using Mythosia.AI.Mcp;
using Mythosia.AI.Services.OpenAI;
var service = new OpenAIService(apiKey, httpClient);
// Connect to an MCP server (stdio transport)
await using var mcp = await service.WithMcpServerAsync(
"npx", "-y @modelcontextprotocol/server-filesystem /workspace");
// AI now has access to all MCP tools automatically
var answer = await service.GetCompletionAsync("List all files in /workspace");
tools/list is called on connect; each tool becomes a FunctionDefinition[AiFunction] local functions and FunctionBuilder definitionsIAsyncDisposable pattern; await using shuts down the server cleanly// Basic — command + args
await using var mcp = await service.WithMcpServerAsync(
"npx", "-y @modelcontextprotocol/server-filesystem /workspace");
// With environment variables
await using var mcp = await service.WithMcpServerAsync(
"python", "-m my_mcp_server",
environmentVariables: new Dictionary<string, string>
{
["API_KEY"] = "sk-..."
});
// Only include specific tools
await using var mcp = await service.WithMcpServerAsync(
"npx", "-y @modelcontextprotocol/server-github",
toolFilter: name => name is "search_repositories" or "get_file_contents");
// Connect to multiple servers — use namePrefix to avoid collisions
await using var fs = await service.WithMcpServerAsync(
"npx", "-y @modelcontextprotocol/server-filesystem /workspace",
namePrefix: "fs_");
await using var gh = await service.WithMcpServerAsync(
"npx", "-y @modelcontextprotocol/server-github",
namePrefix: "gh_");
// AI sees tools like: fs_read_file, fs_write_file, gh_search_repositories, etc.
using Mythosia.AI.Mcp.Transports;
// Use any IMcpTransport implementation
var transport = new StdioTransport("node", "my-server.js");
await using var mcp = await service.WithMcpServerAsync(transport);
// For lower-level control without AIService integration
var transport = new StdioTransport("npx", "-y @modelcontextprotocol/server-filesystem /tmp");
var connection = new McpConnection(transport);
await connection.InitializeAsync();
// Inspect discovered tools
foreach (var tool in connection.Tools)
Console.WriteLine($"{tool.Name}: {tool.Description}");
// Call a tool directly
var result = await connection.CallToolAsync("read_file",
new Dictionary<string, object> { ["path"] = "/tmp/hello.txt" });
// Convert to FunctionDefinitions manually
var functions = McpToolAdapter.ToFunctionDefinitions(connection);
Mythosia.AI.Abstractions ← FunctionDefinition, FunctionParameters
↑
Mythosia.AI ← AIService, provider implementations
↑
Mythosia.AI.Mcp ← McpConnection, StdioTransport, McpToolAdapter
MCP tools are converted to FunctionDefinition at connection time. The existing function calling infrastructure (ReAct loop, tool execution) handles the rest — no changes needed in the core package.
| Feature | Status |
|---|---|
tools/list (tool discovery) |
Supported |
tools/call (tool execution) |
Supported |
| Stdio transport | Supported |
| SSE transport | Planned |
| Streamable HTTP transport | Planned |
resources/* |
Planned |
prompts/* |
Planned |
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 netstandard2.1 is compatible. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.0.1-preview | 91 | 4/4/2026 |
v0.0.1-preview: Initial preview — McpConnection, StdioTransport, automatic MCP tool-to-FunctionDefinition bridging, AIService.WithMcpServerAsync() extension method.