MCP Server Support for FabrCore Agents
FabrCore now supports connecting MCP (Model Context Protocol) servers to agents, giving them access to external tools — GitHub, filesystem, databases, and more — with zero agent code changes.
What is MCP?
The Model Context Protocol is an open standard for connecting AI models to external tools and data sources. Instead of writing custom integration code for every service your agent needs to talk to, MCP provides a universal protocol that lets any compliant server expose tools that any compliant client can use.
Think of it like USB for AI tools — one standard interface, endless peripherals. FabrCore is now an MCP client, which means your agents can connect to any MCP server and immediately gain access to its tools.
Option 1: Config-Driven (Zero Code)
The simplest way to connect MCP servers is through your agent configuration JSON. Add an McpServers array and you're done:
{
"Handle": "coding-agent",
"AgentType": "CodingAgent",
"Models": "OpenAIProd",
"McpServers": [
{
"Name": "GitHub",
"TransportType": "Stdio",
"Command": "npx",
"Arguments": ["-y", "@modelcontextprotocol/server-github"],
"Env": { "GITHUB_TOKEN": "ghp_xxx" }
}
]
}
No agent code changes needed — ResolveConfiguredToolsAsync() automatically connects MCP servers and includes their tools alongside plugin and standalone tools. If an MCP server fails to connect, a warning is logged and the agent continues with its other tools.
Option 2: Code-Driven (Manual Control)
For dynamic connections at runtime, call ConnectMcpServerAsync() directly in your agent proxy:
public override async Task OnInitialize()
{
var mcpTools = await ConnectMcpServerAsync(new McpServerConfig
{
Name = "GitHub",
Command = "npx",
Arguments = ["-y", "@modelcontextprotocol/server-github"],
Env = new() { ["GITHUB_TOKEN"] = Environment.GetEnvironmentVariable("GITHUB_TOKEN")! }
});
// Combine with other tools
var tools = await ResolveConfiguredToolsAsync();
tools.AddRange(mcpTools);
// Pass to CreateChatClientAgent as usual
_agent = await CreateChatClientAgent(config.Models!, config.Handle!, tools);
}
In code-driven mode, exceptions propagate to your code — you decide how to handle failures.
Two Transport Types
FabrCore supports both MCP transport protocols:
Stdio — launches a local process and communicates over stdin/stdout. Ideal for CLI-based MCP servers like the GitHub, filesystem, or database servers:
{
"Name": "GitHub",
"TransportType": "Stdio",
"Command": "npx",
"Arguments": ["-y", "@modelcontextprotocol/server-github"],
"Env": { "GITHUB_TOKEN": "ghp_xxx" }
}
Http — connects to a remote MCP server over HTTP. Use this for shared or hosted MCP services:
{
"Name": "MyRemoteTools",
"TransportType": "Http",
"Url": "https://mcp.example.com/sse",
"Headers": { "Authorization": "Bearer sk-xxx" }
}
Why This Matters
Before MCP support, every external integration meant writing custom tool code. Need GitHub access? Write a plugin. Need filesystem tools? Write another plugin. Need a database? Another plugin. Each one with its own authentication handling, error management, and maintenance burden.
With MCP, the ecosystem does the heavy lifting. Hundreds of MCP servers already exist for popular services, and more are being built every day. Your FabrCore agents can now tap into all of them with a few lines of configuration.
And because MCP tools are standard AITool instances, they work seamlessly with everything else in FabrCore — CreateChatClientAgent(), ChatOptions.Tools, health diagnostics, the full stack.
Get Started
MCP server support is available now. Check out the full documentation for the complete McpServerConfig reference, error behavior details, and health diagnostics integration.
Builder of FabrCore and OpenCaddis.