Get Free Community License
MCP & Tools

Connect Agents toAny External Service.

Full Model Context Protocol client implementation with a comprehensive library of built-in tools across 8 categories. Define custom tools with ITool or [LMFunction], connect to MCP servers for external capabilities, and compose tool chains with JSON Schema validation and parallel execution.

Full MCP Spec 8 Tool Categories Human-in-the-Loop

Model Context Protocol

Tool Discovery
Resources
Prompts
Sampling
Stdio Transport
Human-in-the-Loop

Built-in Tool Categories

Data Document Text Numeric Security Utility I/O Net
ITool
Custom Interface
[LMFunction]
Attribute-based
MCP
External Services
Protocol & Tooling

Two Ways to Extend Your Agents

Use the Model Context Protocol to connect agents to any external service, or define your own local tools with a simple C# interface. Both approaches integrate seamlessly into the agent runtime with JSON Schema validation and parallel execution.

MCP Protocol

Full Model Context Protocol client implementation. Connect to any MCP server over Stdio transport and discover tools, resources, and prompts at runtime with human-in-the-loop approval.

Resources Prompts Tools Sampling Stdio Transport Human-in-the-Loop

Local Tools

Define tools with the ITool interface or annotate static methods with [LMFunction]. Tools get automatic JSON Schema generation, typed result handling, parallel execution, and policy-based invocation controls.

ITool Interface [LMFunction] JSON Schema Typed Results Parallel Execution Policy Controls
public class WeatherTool : ITool
{
    public string Name => "get_weather";
    public string Description => "Returns the current weather for a given city.";

    public JsonSchema InputSchema => new JsonSchemaBuilder()
        .Property("city", new JsonSchemaBuilder().Type(SchemaValueType.String))
        .Required("city")
        .Build();

    public async Task<ToolResult> InvokeAsync(ToolInput input, CancellationToken ct)
    {
        var city = input.GetArgument<string>("city");
        var data = await FetchWeather(city, ct);
        return ToolResult.FromJson(data);
    }
}
public static class MathTools
{
    [LMFunction("Calculates the sum of two numbers.")]
    public static double Add(double a, double b)
    {
        return a + b;
    }

    [LMFunction("Converts a temperature from Celsius to Fahrenheit.")]
    public static double CelsiusToFahrenheit(double celsius)
    {
        return celsius * 9.0 / 5.0 + 32;
    }
}

// Register with the agent
var agent = Agent.CreateBuilder(model)
    .WithTools(tools => tools.Register<MathTools>())
    .Build();
// Connect to an MCP server over Stdio transport
var mcpClient = new McpClient("npx", "-y @modelcontextprotocol/server-filesystem");
await mcpClient.InitializeAsync();

// Discover available tools from the MCP server
var tools = await mcpClient.ListToolsAsync();
foreach (var tool in tools)
    Console.WriteLine($"Tool: {tool.Name} - {tool.Description}");

// Register MCP tools with the agent
var agent = Agent.CreateBuilder(model)
    .WithTools(tools => tools.ImportFromMcp(mcpClient))
    .Build();

// The agent can now use tools from the MCP server
var response = await agent.RunAsync("List the files in the /docs directory.");
8
Categories of production-ready built-in tools
Data 12
Json Xml Csv Yaml Html Markdown Ini Database Spreadsheet QRCode Base64Image Country
Document 11
PdfSplit PdfInfo PdfToImage PdfMerge ImageToPdf PdfUnlock ImageDeskew ImageCrop ImageResize DocumentText Ocr
Text 9
Text Diff Regex Template Encoding Slug AsciiArt Fuzzy Phonetic
Numeric 10
Calculator Conversion Stats Random Guid Expression Financial Currency Bitwise IpCalc
Security 6
Hash Crypto Validator Jwt Password Checksum
Utility 13
DateTime Cron SemVer Url Color Performance Duration Humanize Locale Mime Path Schedule TimeZone
Network 6
Http Network WebSearch Smtp RssFeed Ftp
Web Search

6 Web Search Providers Built In

Equip agents with web search out of the box. Choose from free providers like DuckDuckGo or connect premium APIs for higher quality results. All providers share the same interface and can be swapped with a single line of code.

D

DuckDuckGo No Key

Free HTML scraping. Default provider, works out of the box with no configuration required.

B

Brave API Key

High-quality search results with a generous free tier available for development and small workloads.

T

Tavily API Key

AI-optimized search engine designed specifically for RAG pipelines and agentic workflows.

S

Serper API Key

Google search results delivered via a fast API with structured JSON responses.

X

SearXNG No Key

Self-hosted meta-search engine. Full privacy control, aggregates results from multiple sources.

C

Custom Optional

Bring your own search endpoint. Implement a custom provider with the shared interface.

WebSearchProviders.cs
// Default provider: DuckDuckGo, no API key required
var webSearch = BuiltInTools.WebSearch;

// Premium providers with API keys
var braveSearch = BuiltInTools.CreateWebSearch(WebSearchTool.Provider.Brave, "your-api-key");
var tavilySearch = BuiltInTools.CreateWebSearch(WebSearchTool.Provider.Tavily, "your-api-key");

// Register with the agent
var agent = Agent.CreateBuilder(model)
    .WithTools(tools => tools.Register(braveSearch))
    .Build();
Glossary

Key Concepts

Learn about the foundational concepts behind MCP, tool calling, agent execution, and AI safety guardrails.

Connect Your Agents to Anything

Build agents that interact with any external service through MCP, call custom tools, and leverage a comprehensive library of built-in capabilities. All running locally on your infrastructure.

Need expert guidance? Talk to our team