{"slug": "show-hn-toolnexus-for-net-mcp-and-agent-skills-as-tools-for-any-llm", "title": "Show HN: Toolnexus for .NET – MCP and agent skills as tools for any LLM", "summary": "Toolnexus 0.1.2, a C#/.NET library that unifies MCP servers, agent skills, custom functions, and HTTP endpoints into a single tool set for any LLM, has been released. The library enables building agents in a few lines of code with features like streaming, retries, and memory, and is a port of the same library available in JavaScript, Python, Go, and Java.", "body_md": "# Toolnexus 0.1.2\n\n```\ndotnet add package Toolnexus --version 0.1.2\n                    \n\n                            \nNuGet\\Install-Package Toolnexus -Version 0.1.2\n                    \n\n                            \n```\n\n[Install-Package](https://docs.microsoft.com/nuget/reference/ps-reference/ps-ref-install-package).\n\n```\n<PackageReference Include=\"Toolnexus\" Version=\"0.1.2\" />\n                    \n\n                            \n```\n\n[PackageReference](https://docs.microsoft.com/nuget/consume-packages/package-references-in-project-files), copy this XML node into the project file to reference the package.\n\n```\n<PackageVersion Include=\"Toolnexus\" Version=\"0.1.2\" />\n                    \n\n                            Directory.Packages.props\n                        \n\n                            \n<PackageReference Include=\"Toolnexus\" />\n                    \n\n                            Project file\n                        \n\n                            \n```\n\n[Central Package Management (CPM)](https://learn.microsoft.com/en-us/nuget/consume-packages/central-package-management), copy this XML node into the solution Directory.Packages.props file to version the package.\n\n```\npaket add Toolnexus --version 0.1.2\n                    \n\n                            \n```\n\n[maintainers](https://fsprojects.github.io/Paket/contact.html)for support.\n\n```\n#r \"nuget: Toolnexus, 0.1.2\"\n                    \n\n                            \n#:package Toolnexus@0.1.2\n                    \n\n                            \n#addin nuget:?package=Toolnexus&version=0.1.2\n                    \n\n                            Install as a Cake Addin\n                        \n\n                            \n#tool nuget:?package=Toolnexus&version=0.1.2\n                    \n\n                            Install as a Cake Tool\n                        \n\n                            \n```\n\n[maintainers](https://cakebuild.net/support/nuget)for support.\n\n## toolnexus\n\n**Build an agent in a few lines.** Point at an `mcp.json`\n\nand a `skills/`\n\nfolder, call `RunAsync()`\n\n,\nand you have a working agent — MCP servers, agent skills, your own functions, and HTTP endpoints\nunified as one tool set, driving any LLM.\n\nRight-sized.Not a framework (no builders, no config to wade through), not a toy that falls over the moment you need streaming or a retry. Everything a real agent needs — the loop, hooks, streaming, retries, memory — and nothing it doesn't.\n\nThe C#/.NET port of [toolnexus](https://github.com/muthuishere/toolnexus) — the same library,\nbyte-identical, also in **JavaScript, Python, Go, and Java**. Built on the official\n`ModelContextProtocol`\n\nSDK. Targets .NET 10.\n\n### Install\n\n```\ndotnet add package Toolnexus\n```\n\n### An agent in 3 steps\n\n```\nusing Toolnexus;\n\n// 1. tools from an mcp.json + a skills/ folder\nawait using var tk = await Toolkit.CreateAsync(new Toolkit.Options()\n    .WithMcpConfig(\"./mcp.json\")\n    .WithSkillsDir(\"./skills\"));\n\n// 2. point at any OpenAI- or Anthropic-style endpoint\nvar agent = LlmClient.Create(new LlmClient.Options\n{\n    BaseUrl = \"https://openrouter.ai/api/v1\",\n    Style   = \"openai\",                 // or \"anthropic\"\n    Model   = \"openai/gpt-4o-mini\",\n    ApiKey  = Environment.GetEnvironmentVariable(\"OPENROUTER_API_KEY\"),\n});\n\n// 3. run — skills injected into the system prompt, tools called for you, looped to an answer\nvar res = await agent.RunAsync(\"Refund order 1234 for the customer.\", tk);\nConsole.WriteLine(res.Text);\n```\n\nThe loop runs call → execute tools → feed back → repeat, with hooks, streaming, retries/backoff,\nand conversation memory available. `res`\n\ncarries `Text`\n\n, `ToolCalls`\n\n, usage, turns, and model.\n\n### Add your own tools\n\n```\nusing Toolnexus;\n\n// a method → a tool (attribute-based)\npublic sealed class MathTools\n{\n    [ToolMethod(\"add\", \"Add two numbers\")]\n    public string Add([Param(\"a\")] double a, [Param(\"b\")] double b) => (a + b).ToString();\n}\n\ntk.Register(Tools.FromObject(new MathTools()).ToArray());\n\n// a REST endpoint → a tool\ntk.Register(HttpTool.Of(new HttpTool.Options\n{\n    Name = \"create_ticket\", Description = \"Create a ticket\", Method = \"POST\",\n    Url = \"https://api.example.com/tickets\",\n    Headers = new Dictionary<string, string> { [\"Authorization\"] = \"Bearer ${API_TOKEN}\" }, // ${ENV} expands, never logged\n    InputSchema = new Dictionary<string, object?>\n    {\n        [\"type\"] = \"object\",\n        [\"properties\"] = new Dictionary<string, object?> { [\"title\"] = new Dictionary<string, object?> { [\"type\"] = \"string\" } },\n        [\"required\"] = new List<object?> { \"title\" },\n    },\n}));\n```\n\nYou can also pass `ExtraTools`\n\n/ `AnnotatedObjects`\n\nstraight into `Toolkit.Options`\n\n.\n\n### Bring your own loop\n\n``` js\nvar tools  = tk.ToOpenAI();      // or tk.ToAnthropic() / tk.ToGemini()\nvar system = tk.SkillsPrompt();  // skills catalog for your system prompt\n// when the model returns a tool call (name, arguments):\nvar res = await tk.ExecuteAsync(name, args);   // -> ToolResult(Output, IsError, Metadata)\n```\n\n### The four sources\n\n| Source | How |\n|---|---|\nMCP servers |\nan `mcp.json` (`mcpServers` /`servers` /`mcp` ); local stdio + remote streamable-HTTP, `Headers` for auth |\nAgent skills |\na folder of `<name>/SKILL.md` ; a `skill` tool loads each on demand + a system-prompt catalog |\nNative tools |\n`[ToolMethod]` /`[Param]` on a class (`Tools.FromObject` ), or `NativeTool.Of(...)` |\nHTTP / REST |\n`HttpTool.Of(...)` — an endpoint becomes a tool, `${ENV}` headers |\n\nAll four appear as one uniform `ITool`\n\nin `tk.Tools()`\n\n.\n\n### API\n\n| Member | Description |\n|---|---|\n`Toolkit.CreateAsync(opts)` |\nasync factory → `Toolkit` (`await using` ) |\n`LlmClient.Create(opts)` |\nthe unified host loop (`RunAsync` / `StreamAsync` ) |\n`tk.Tools()` |\nthe uniform tools |\n`tk.ExecuteAsync(name, args, ctx?)` |\nrun a tool → `ToolResult` |\n`tk.SkillsPrompt()` |\nsystem-prompt skill catalog |\n`tk.ToOpenAI()` / `ToAnthropic()` / `ToGemini()` |\nprovider tool schemas |\n`tk.Register(params ITool[])` |\nadd native/http/custom tools |\n\n### More\n\nFull docs, the other four language ports, the shared behavior spec, and runnable examples:\n[https://github.com/muthuishere/toolnexus](https://github.com/muthuishere/toolnexus)\n\nMIT licensed.\n\nProduct |\nVersions\nCompatible and additional computed target framework versions.\n|\n|---|---|\n| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |\n\n*Learn more about*\n\n[Target Frameworks](https://docs.microsoft.com/dotnet/standard/frameworks)and[.NET Standard](https://docs.microsoft.com/dotnet/standard/net-standard).-\n#### net10.0\n\n-\n[ModelContextProtocol](/packages/ModelContextProtocol/)(>= 1.4.0)\n\n-\n\n###\n**NuGet packages**\n\nThis package is not used by any NuGet packages.\n\n###\n**GitHub repositories**\n\nThis package is not used by any popular GitHub repositories.", "url": "https://wpnews.pro/news/show-hn-toolnexus-for-net-mcp-and-agent-skills-as-tools-for-any-llm", "canonical_source": "https://www.nuget.org/packages/Toolnexus/", "published_at": "2026-06-29 16:18:48+00:00", "updated_at": "2026-06-29 16:20:35.251600+00:00", "lang": "en", "topics": ["developer-tools", "ai-agents", "large-language-models", "ai-tools"], "entities": ["Toolnexus", "ModelContextProtocol", "OpenRouter", "OpenAI", "Anthropic", "NuGet"], "alternates": {"html": "https://wpnews.pro/news/show-hn-toolnexus-for-net-mcp-and-agent-skills-as-tools-for-any-llm", "markdown": "https://wpnews.pro/news/show-hn-toolnexus-for-net-mcp-and-agent-skills-as-tools-for-any-llm.md", "text": "https://wpnews.pro/news/show-hn-toolnexus-for-net-mcp-and-agent-skills-as-tools-for-any-llm.txt", "jsonld": "https://wpnews.pro/news/show-hn-toolnexus-for-net-mcp-and-agent-skills-as-tools-for-any-llm.jsonld"}}