Desktop App MCP Bridge over a Named Pipe (.NET)

    1

    Users want their assistant to read what is in the app and leave notes, and the app must not become a network service, hand its keys to another process, or act while locked.

    $35

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    Desktop App MCP Bridge over a Named Pipe (.NET)

    Example session with this skill installed

    I need to connect my WPF CRM app to Claude Desktop so I can query customer notes. How do I set up the bridge and what does the configuration look like?

    • Read your context and instructions
    • Compiled the desktop app mcp

    The bridge is ready for implementation. I have generated the IToolBackend implementation for your CRM and the corresponding Claude Desktop configuration JSON.

    Native App MCP Integration

    // 1. Implementation in your WPF App
    public class CrmToolBackend : IToolBackend
    {
        private readonly ICrmService _crm;
    
        public CrmToolBackend(ICrmService crm) => _crm = crm;
    
        public async Task<ToolReply> ExecuteAsync(string tool, JsonElement args)
        {
            try
            {
                if (tool == "get_customer_notes")
                {
                    var id = args.GetProperty("customerId").GetString();
                    var notes = await _crm.GetNotesAsync(id);
                    return ToolReply.Success(new { notes = notes.Redacted() });
                }
                throw new ToolException("UNKNOWN_TOOL", $"Tool {tool} not found");
            }
            catch (Exception ex)
            {
                throw new ToolException("BACKEND_ERROR", ex.Message);
            }
        }
    }
    
    // 2. Start the bridge in App.xaml.cs
    var server = new PipeBridgeServer(
        () => isLocked ? BackendState.Refuse("LOCKED", "Unlock app") : BackendState.Ready(new CrmToolBackend(service)),
        PipeBridge.Name("CrmApp"),
        logger
    );
    server.Start();
    
    // 3. Claude Desktop Configuration (~/AppData/Roaming/Claude/claude_desktop_config.json)
    {
      "mcpServers": {
        "crm-bridge": {
          "command": "C:\\Path\\To\\App\\crm-mcp-shim.exe",
          "args": [],
          "env": {}
        }
      }
    }
    

    Next steps

    • Run the 25-check self-test utility to verify pipe connectivity.
    • Update tools.json with the get_customer_notes schema.
    • Add the crm-mcp-shim.exe to your application installer package.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Users want their assistant to read what is in the app and leave notes, and the app must not become a network service, hand its keys to another process, or act while locked. This bridge is the shape that works.

    McpServer (McpServer.cs): the Model Context Protocol over stdio as Claude Desktop, Claude Code, Codex and the ChatGPT desktop app speak it: newline-delimited JSON-RPC 2.0, protocol version negotiation with fallback, tools with annotations and output schema, optional prompts, instructions, each request on its own task so a ping is answered during a long call, a write gate that keeps output lines whole, results as structuredContent plus pretty text, backend faults mapped to isError with a code.

    PipeBridge (PipeBridge.cs): the per-user named pipe (CurrentUserOnly on both ends) between the shim and the running application. The server runs one tool at a time against the app's current backend, refuses with the app's own LOCKED or TURNED_OFF sentence when the state function says so, logs client and tool to your activity log, and answers CLOSING on shutdown. The client reports NOT_RUNNING when nothing listens, reconnects only when a request could not be sent at all, and reports CONNECTION_LOST rather than retrying a call that may have acted.

    Shim (McpBridge.Shim): the executable the assistant launches, with the tool catalog in tools.json (a template with status, list, get and note tools), optional instructions.txt, --version and --check.

    Self-test (McpBridge.SelfTest, no test framework): 25 checks across the protocol (initialize, versions, client naming, tools/list annotations, tools/call with structured content and refusals, ping, prompts, unknown method and tool, notifications, invalid messages), the pipe (NOT_RUNNING, LOCKED, TURNED_OFF, a result through the pipe, activity log, structured refusal, malformed line) and the stdio loop (a ping answered before a slow call, protocol lines only).

    reference/design.md: why a pipe and not a port, the protocol details that break clients, the pipe contract, what the app implements, the Claude Desktop configuration entry and the privacy rule of thumb. .NET 8+, no packages, no network.

    Windows-only security guarantees for pipes. Single application instance per user. Requires .NET 8 runtime. Linux/macOS require custom socket checks.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 17 days ago

    Requires

    .NET 8 SDK+

    Permissions

    Read Files
    Environment Variables
    Listed17 days ago

    What's inside

    Frequently Asked Questions

    This bridge enables AI assistants to interact with native .NET apps using secure Windows named pipes, bypassing the need for network ports, cloud APIs, or complex stdio management. It solves the problem of keeping sensitive local data private while giving your desktop software AI-driven capabilities.

    The bridge is compatible with any AI assistant that supports the Model Context Protocol (MCP) via stdio, including Claude Desktop, Cursor, and ChatGPT. On the application side, it supports any .NET 8.0+ framework such as WPF, WinForms, WinUI, or Avalonia.

    You receive the .NET 8 bridge library, a lightweight stdio shim for the AI assistant, a sample implementation, and a comprehensive 25-check automated validation suite to ensure your integration is stable and secure.

    The bridge utilizes Windows-only named pipes, ensuring that only the current local user can interact with the application. This prevents network-based attacks and eliminates the need to open firewall ports or expose your application to the broader local network.

    Setting up the bridge is a three-step process: define your tool schemas in a JSON file, map your app’s service layer to the provided interface, and deploy the included shim alongside your executable to act as the communication entry point.

    Currently, this skill is optimized for Windows to leverage per-user pipe isolation. While the MCP logic is cross-platform, the specific security guarantees and named-pipe transport provided in this package are designed specifically for Windows environments.

    New in Agents & Orchestration