Repository navigation
Home
From .NET Framework to .NET 11.
Farol (Portuguese for Lighthouse) is an open-source Model Context Protocol (MCP) server that provides AI coding agents (Claude Code, GitHub Copilot, Google Antigravity, Cursor, Codex) with compiler-accurate understanding of C# and VB.NET solutions.
Unlike traditional tools that only work on modern SDK-style projects or rely on rudimentary text pattern searches, Farol provides first-class support for the entire .NET spectrum, including the legacy codebases that other tools abandon: classic .csproj/.vbproj, packages.config, ASP.NET WebForms, WCF, ASMX, WinForms, and WPF.
When an AI agent works on a complex .NET repository using standard file tools (grep, find, cat, and dotnet build), it encounters severe friction:
-
Text Search is Blind to Compiler Semantics:
-
grepcannot differentiate between a symbol declaration, an invocation, an assignment, a type constraint, or an occurrence inside a comment or string literal. - It cannot resolve overloads, track inherited methods, identify interface implementations, or navigate cross-language references (e.g., C# calling VB.NET).
- In ASP.NET WebForms or WPF, markup files (
.aspx,.ascx,.master,.xaml) reference event handlers and code-behind classes implicitly. Text searches frequently miss these connections, leading agents to falsely assume code is unused and delete it.
-
-
Build Feedback Loops are Prohibitively Expensive:
- Running
dotnet buildon a medium-to-large solution takes between 30 seconds and several minutes. - A single build dumps hundreds of lines of noise, warnings, and duplicated messages into the agent's context window, spending many tokens.
- In multi-targeted projects, every warning and error is repeated for each target framework.
- Running
-
Package Hallucinations:
- LLMs frequently hallucinate APIs of external NuGet packages, guessing method signatures or assuming APIs from newer versions exist in older pinned dependencies.
-
The Legacy Abyss:
- Roslyn-based MCP servers such as
roslyn-codelensskip non-SDK projects. - Non-SDK projects,
packages.config, and legacy enterprise frameworks (WebForms, ASMX, WCF) represent millions of lines of active enterprise code, yet agents have had zero semantic tooling to maintain or modernize them.
- Roslyn-based MCP servers such as
Farol addresses these challenges by embedding the Microsoft Roslyn compiler and MSBuild engine directly into an MCP server with a clean, decoupled 4-layer architecture:
-
Instant Compiler Feedback (
dotnet_check): In about a second (p95 under 2 s), Farol evaluates syntactic and semantic changes made by the agent. It computes a load baseline and returns only newly introduced compiler errors and warnings, completely suppressing pre-existing legacy issues and line-shift false positives. -
Full-Fidelity Legacy Support: Through an out-of-process
BuildHost-net472integrating with Visual Studio 2022+ / Build Tools MSBuild, Farol evaluates classic project files,packages.config, WebForms, ASMX, WCF, and VB.NET. -
Markup-Aware Reference Tracking: Farol indexes
.aspx,.ascx,.master,.svc,.asmx,.asax, and.xamlfiles, connecting code-behind classes, event handlers, and service hosts directly to compiler symbols. -
Decompilation and Public Package API Inspection: Agents can inspect the verified public API surface and XML documentation of any NuGet package version without hallucinating. The package's assemblies are read with Roslyn;
dotnet_symboldecompiles external code with ICSharpCode.Decompiler. -
Refactorings Through the Compiler:
dotnet_rename,dotnet_change_signature,dotnet_move_typeanddotnet_extract_methodchange C# and VB code and its WebForms/XAML markup as a previewed diff, anddotnet_convert_projectconverts classic projects to SDK-style orpackages.configtoPackageReference; every applied change returns a fresh check. -
Analyzers, Without Visual Studio, Before the Load Ends:
dotnet_checkcan run the projects' analyzers; legacy solutions load heuristically on Linux or with the .NET SDK alone, or from a binary log; a persistent index answers navigation while a large solution loads. See Phase 2. -
Automated Modernization Strategy: Generates a dependency-ordered, bottom-up modernization plan with exact API portability diagnostics against modern targets (
net10.0,net10.0-windows), exporting structured reports directly to markdown.
Farol was architected with equal priority across three core enterprise jobs:
| Job | Description | Key Capabilities |
|---|---|---|
| 1. Maintain & Evolve Legacy .NET | Day-to-day bug fixes, refactoring, and feature additions in existing .NET Framework systems in production. | Full MSBuildWorkspace fidelity on Windows, WebForms/XAML reference finding, vstest.console test execution, safe web.config inspection with secrets masked. |
| 2. Modernize Legacy Code | Migrating legacy .NET Framework applications to modern .NET 10/11. |
dotnet_legacy_inventory, dotnet_portability target analysis, dotnet_migration_plan generation, packages.config migration mapping. |
| 3. Day-to-Day Modern .NET Development | Rapid feature development on modern .NET solutions. | SDK-style projects, Central Package Management (CPM), Microsoft.Testing.Platform support, Roslyn lightbulb code actions, edit checks in about a second. |
Farol is structured into four distinct, strictly decoupled layers:
graph TD
Client["AI Agent (Claude Code, Copilot, Antigravity, Cursor)"] -->|"stdio (JSON-RPC)"| Host["Farol.Host (Transport & Process Shell)"]
Host --> Tools["Farol.Tools (23 MCP Tools & 4 MCP Prompts)"]
Tools --> Engine["Farol.Engine (Workspaces, Roslyn, MSBuild, Analysis)"]
Engine --> Core["Farol.Core (Paths, Process Execution, Diffing, Zero Roslyn)"]
Engine -.->|"BuildHost-netCore"| SdkHost[".NET SDK MSBuild (Modern)"]
Engine -.->|"BuildHost-net472"| VsHost["Visual Studio MSBuild (Legacy Full-Fidelity)"]
-
Farol.Host: The executable entry point. Manages stdio JSON-RPC transport, strictly ensures stdout is reserved for MCP protocol messages, pipes diagnostics to stderr, handles CLI arguments, and manages local privacy-first usage logging. -
Farol.Tools: The MCP interface layer. Implements the 23 tool contracts, 7 prompts, 3 skill resources and MCP tasks, manages input validation, enforces token budgets, and formats responses into dense, LLM-optimized compact text. -
Farol.Engine: The core domain engine. Manages RoslynMSBuildWorkspacesessions, immutable snapshots, background compilation warmup, diagnostic checks in about a second, markup parsing, package resolution, and legacy modernization analysis. -
Farol.Core: The low-level infrastructure library. Has zero dependencies on Roslyn or MSBuild. Manages path sandboxing, boundary security, process execution with tree cleanup, Myers unified diffs, atomic file I/O, and token budgeting.
Install the Farol plugin directly in Claude Code. This automatically sets up the MCP server, a PostToolUse hook that verifies every .cs/.vb edit with dotnet_check, and a dedicated modernization skill:
/plugin marketplace add yuriafp/Farol
/plugin install farol@farolFarol is published on NuGet as Farol.Mcp. Using the .NET 10 SDK, clients can launch Farol without prior installation using dnx:
In .mcp.json:
{
"mcpServers": {
"farol": {
"command": "dotnet",
"args": ["dnx", "Farol.Mcp@0.3.0", "--yes"]
}
}
}To install Farol once globally:
dotnet tool install --global Farol.McpClient configuration:
{
"mcpServers": {
"farol": {
"command": "farol",
"args": []
}
}
}Navigate through the in-depth, layer-by-layer technical documentation:
- Architecture & Design Philosophy — High-level architecture, snapshot immutability, BuildHost isolation, and remote-readiness.
- Layer: Farol.Core — Path sandboxing, process execution, diff generation, atomic writes, and privacy-first local logging.
- Layer: Farol.Engine — Workspaces & Loading — Workspace lifecycles, dual BuildHost loading, analyzer copies, toolchain discovery, and background warmup.
- Layer: Farol.Engine — Navigation & Markup — Compiler-accurate symbol search, IOperation classification, WebForms & XAML indexers, and assembly decompilation.
- Layer: Farol.Engine — Verification & Testing — Diagnostic checks in about a second, baseline fingerprinting, edits made during a load, the hook format, Roslyn lightbulb actions, build runner, and affected test analysis.
- Layer: Farol.Engine — Legacy Modernization & Packages — Legacy inventory, config secret masking, target surface portability, migration planning, and NuGet inspection.
- Layer: Farol.Tools & MCP Contract — Detailed specifications, parameters, and examples for all 23 tools, the prompts, the skill resources and MCP tasks.
- Layer: Farol.Host & CLI — Process lifecycle, stdio communication, configuration precedence, and telemetry reporting.
- Integrations & Plugins — Claude Code, Visual Studio 2026, Copilot, Antigravity, VS Code, and NuGet packaging.
- Benchmarks & Evals — Performance targets (Umbraco CMS & DNN Platform), empirical eval results (Claude Haiku 4.5, harder task set: +31 points of success, 32% fewer tokens), and the compiler oracle methodology; the Phase 2 targets and eval round.
-
Phase 2: Refactorings, Analyzers, Loaders & Index — The write path and the five refactoring tools, analyzers in
dotnet_check, the heuristic and binary log loaders, the persistent index, structured output and the MCP Registry. - Phase 3: MCP Tasks & Skills — Build, test, load and convert as MCP tasks, the playbook as three skills served to every client, and the exit results.
Welcome to the official technical documentation for Farol, an open-source Model Context Protocol (MCP) server that equips AI coding agents (Claude Code, GitHub Copilot, Google Antigravity, Cursor, Codex) with compiler-accurate understanding of C# and VB.NET solutions.
- Home — Project overview, value proposition, quickstart, and problem statement
- 01. Architecture & Design Philosophy — Layered architecture, snapshot isolation, BuildHost model, design rationale
- 02. Layer: Farol.Core — Zero-Roslyn foundation: path sandbox, process execution, diffing, atomic writes, privacy
- 03. Layer: Farol.Engine — Workspaces & Loading — MSBuildWorkspaceLoader, analyzer copies, Visual Studio toolchain probing, background warmup, file watcher
- 04. Layer: Farol.Engine — Navigation & Markup — Compiler-accurate navigation, symbol search, IOperation classification, WebForms & XAML indexers, decompilation
- 05. Layer: Farol.Engine — Verification & Testing — Diagnostic checks in about a second, baseline fingerprinting, edits during a load, edit impact analysis, Code Actions, build & test runners
- 06. Layer: Farol.Engine — Legacy Modernization & Packages — Legacy inventory, config inspector, target surface portability, migration planner, NuGet API inspector
- 07. Layer: Farol.Tools & MCP Contract — Comprehensive reference for all 23 MCP tools, 7 prompts, the skill resources and MCP tasks
- 08. Layer: Farol.Host & CLI — Stdio transport, stream isolation, configuration precedence, privacy-first usage telemetry
- 09. Integrations & Plugins — Claude Code plugin (hook & skill), Visual Studio 2026, Copilot, Antigravity, VS Code, NuGet distribution
- 10. Benchmarks & Evals — Performance benchmarks (Umbraco & DNN Platform), evaluation suite and Phase 2 round, compiler oracle
- 11. Phase 2: Refactorings, Analyzers, Loaders & Index — Refactoring write path, analyzers in checks, heuristic and binlog loaders, persistent index, structured output, MCP Registry
- 12. Phase 3: MCP Tasks & Skills — Build, test, load and convert as MCP tasks; the playbook as three skills served by the server; exit results