Models and Agents and Tools, oh my!

The title of this blog stems from the phrase "Lions and tigers and bears, oh my!"; a phrase that originates from the 1939 movie The Wizard of Oz.  The underlying meaning is an expression of anxiety for escalating, unknown, or overwhelming fears; or in a lesser sense, having to face daunting tasks and challenges.  In the movie, Dorthy, the Scarecrow, and the Tin Man chant it as a nervous mantra as they walk through a dark forest potentially holding dangerous creatures.  This title seems an appropriate AI [nervous] mantra...  the ambiguity, overloading, and misuse of terms, is staggering.... 

We are in and AI industry, where the architects are too far removed from their ignorance; a place where overloaded and reused terms do not detract from their meaning in the context of experience, but leave no breadcrumbs for those of us learning.  As I study AI architecture for the rewrite of this BlogEngine.net app (with AI support), I keep bumping into the same wall that we hit every day at the keyboard: nobody has handed us a map of what an App, an Agent, a Tool, and a Model actually are, or where the responsibility of one ends and the next begins.  

I stopped treating "the AI" as one black box and started recognizing it as a pipeline of distinct, collaborating parts.  Once you can see the seams, you know exactly where your prompt is going, why it's being reasoned about (or not), and where your tokens are actually being spent.  That's the map this article hopes to gives you.

The Chassis and the Engine

Before the pipeline, one distinction has to be nailed down because it trips up almost everyone: the App is not the Model.  Think of it like a car.  Microsoft Copilot and Anthropic's Claude interface are the chassis—they dictate the dashboard, the context window, the security guardrails, and how the assistant touches your files or enterprise data.  The Large Language Model (LLM) underneath is the engine—the part actually doing the thinking

Historically that pairing was fixed: Copilot ran OpenAI's GPT engines, Claude ran Anthropic's own.  That is no longer true.  Modern orchestration platforms are multi-model, meaning an administrator can plug a Claude engine [model] into the Copilot chassis, or route a request through a completely different model depending on policy.  The app you're typing into and the brain answering you are two separate, swappable things—so "Copilot" and "the model" are not synonyms, even though we say them like they are.  At 10k feet this means that selecting a Claude engine [model] into a Copilot app does not give you Claude capabilities; only the ability to use Claude's (Anthropic) engine.

Inferencing (Copilot) Versus Reasoning (Claude, ChatGPT, etc.)

For developers, the cleanest way to think about Copilot and Claude is not as competing myths, but as tools tuned for different kinds of work.  Copilot tends to shine when you want something fast, embedded, and close to the work you are already doing—write the code, finish the small edit, summarize the file, move to the next step.  Claude tends to shine when you want the assistant to slow down and think with you—analyze tradeoffs, untangle requirements, reason across a long context, or help you work through a design before you act.  Both can infer and both can reason; the practical difference is that Copilot is usually optimized for speed and integration, while Claude is usually optimized for deeper, more deliberate analysis.  Knowing that difference helps you choose the right tool before you spend tokens trying to make one behave like the other.

The Pipeline: App → Agent → Tool → Model

Once you separate the chassis from the engine, the rest of the ambiguity falls into four (plus three supporting) roles.  Here is the workflow, end to end:

User → App (UI) → Agent → Tool → Model → Agent → App (UI) → User

  • App (UI) — the product shell you actually use.  This is the concrete surface in front of you: GitHub Copilot in Visual Studio Code, ChatGPT in the browser or desktop app, Claude on the web or desktop, Microsoft 365 Copilot in Word or Excel, or a company-specific internal assistant.  The App handles sign-in, permissions, prompt assembly, conversation state, citations, loading indicators, and how the answer is rendered back to you.  It does not do the thinking itself; it packages your request, sends it into the Agent/Model stack, and turns the result into a usable human experience.
  • Agent — the decision layer.  The Agent is the part that interprets your intent and decides what needs to happen next.  It sits between your messy human request and the precise mechanics of execution.  If you say, "fix the failing test," the Agent figures out which file, which tool, which parameters, and what sequence of steps are required.  It can ask for clarification, choose the right tool, map your words into structured instructions, and decide whether to retry, reformulate, or stop.  In other words, the Agent does not usually create the answer itself; it orchestrates the work that gets the answer created.
  • Tool — the thing that actually does the work.  A Tool is a deterministic capability the Agent can call when it needs a real action performed.  Think of a search API, a file system operation, a database query, a build step, or a web request.  For example, if the Agent needs to check whether a package exists, it might call a search tool; if it needs to validate code, it might call a compiler or test runner; if it needs current weather, it might call a weather API.  The Tool does not reason about intent.  It receives a structured request, executes it, and returns raw results.  The Agent then interprets those results and decides what to do next.
  • Model — the brain behind the response.  Changing the Model does not change the App; it changes the brain the App is asking to think.  The interface, buttons, login, context window, and workflow can stay exactly the same while the underlying model changes from one provider or version to another.  That is why Copilot, ChatGPT, Claude, or a custom enterprise assistant can look identical on the surface while behaving very differently underneath.  The App is the body; the Model is the brain.  What the brain looks like, the Model is not literally a chain of if statements, but that is a useful beginner analogy because it learns patterns that behave like conditional responses.  Under the hood, it is trained on enormous amounts of text and code to predict the next token in a sequence.  During training, it learns relationships between words, ideas, syntax, and structure.  At runtime, it turns your prompt into internal numerical representations, compares them through many learned layers, and produces a probability distribution over the next token.  It does this again and again, one token at a time, until the response is complete.  So while it can feel like "if this, then that," what it really has is a very large learned pattern system that has been shaped by training rather than handwritten rules.

The following supporting roles complete the picture, they're exactly where a lot of where confusion comes fromIn addition, I touch on the important role of the cross-cutting concern of security:

  • Retrieval turns the Agent's conceptual need into a search query, ranks the results, and injects the most relevant chunks into the prompt so the Model has fresh, proprietary knowledge it wasn't trained on.
  • Memory is what actually gives you the illusion of a Model "remembering" anything—a short-term session buffer plus long-term archival, scored for relevance and pruned when stale.  The Model consumes memory chunks; it doesn't own them.
  • Security sits across all of it—access control, guardrails, PII protection, and audit logging—quietly enforcing policy at every hop.   SECURITY ISSUE The Mother of All AI Supply Chains: Critical, Systemic Vulnerability at the Core of Anthropic's MCP.  

Excerpt from the above link follows:
"Massive Scale: The vulnerability ripples through a supply chain with 150M+ downloads, 7,000+ publicly accessible servers — and up to 200,000 vulnerable instances in total."

Not every request needs the full pipeline, either.  If your input is already structured—filling out a form with a clean "Origin," "Destination," and a Search button—the App can talk directly to the Tool and skip the Agent entirely.  The Agent only earns its keep when the request is ambiguous, multi-step, or needs error recovery.  Recognizing which situation you're in is itself a way to save tokens: don't pay for cognitive overhead you don't need.

Why This Matters When Your Tokens Are Metered

Here's where the map turns into practical advice.  Under a per-use token structure, every one of those hops—App to Agent, Agent to Tool, Tool back to Agent, Agent to Model—can consume budget, especially when the Agent has to retry or reformulate because the Model stumbled.  That retry loop is the single biggest silent drain I've seen: the Agent gets a broken result, feeds it back to the Model, gets another imperfect result, and repeats.  Each pass looks like "the AI trying to help," but it's really the Agent layer churning without ever stepping back to look at the whole problem.

None of this is a character flaw in the developer watching it happen.  It's a visibility problem.  If you don't know that the retry loop is happening at the Agent layer, you can't recognize when to stop it.  A few habits that come directly out of understanding this pipeline:

  • Stop the loop early. Stop the "I can fix it" cycle; if a correction attempt produces a second broken result, that's the Agent/Model pair failing to reason through the actual structure—not a problem one more nudge will fix.  Start a fresh session instead of paying for a third and fourth attempt in the same thread.  
  • Do the Agent's planning for it.  Since the Agent is only as good as the intent it can extract, be explicit: name the dependency to mock, the framework to use, and the edge case to cover, rather than a high-level goal it has to infer and plan around.
  • Match the task to the pipeline it needs.  Some tasks are simple and structured, so they can go straight from App to Tool without much reasoning.  For example, if you ask the assistant to rename a file, convert a date, or run a search, the App can send that request directly to the Tool and get an immediate result.  Other tasks are ambiguous and need planning, so they require the full App → Agent → Tool → Model pipeline.  For example, "write unit tests for this class" or "fix the failing build" usually requires the Agent to inspect the situation, choose the right tool, interpret the results, and possibly retry or refine the plan.  In short: simple tasks should stay simple; complex tasks need the full cognitive pipeline.  How does the developer do this?  The developer does it by judging the task before asking the assistant to work.  If the task is simple and already structured, use the fastest path: ask for the action directly and let the App go to the Tool.  If the task is unclear, multi-step, or likely to fail without planning, give the Assistant enough context so the Agent can reason through it.  In practice, this means being explicit about the goal, the inputs, the expected output, and any constraints.  The more clearly you describe the work, the easier it is to avoid unnecessary token churn and keep the request on the right pipeline.
  • Remember the Model is stateless.  If a conversation feels like it's "forgetting," that's a Memory/Agent context-assembly issue, not a reason to keep re-explaining the same thing to the Model in increasingly frustrated tones.  Prevent forgetting by externalizing the context; Do not rely on the chat to remember your work from session to session.  Treat each AI session as disposable and keep a short living handoff note outside the conversation: what you are building, what has already been decided, what is blocked, what files or links matter, and what the next step is.  Before ending a session, ask the AI to summarize that context in a reusable form that you can paste into the next session.  That way, when you delete the thread, you are not losing memory—you are carrying it forward deliberately, while also clearing out the non-essential chatter that is consuming valuable context window space.

My hope is that seeing the App, the Agent, the Tool, and the Model as four distinct collaborators—each with its own job, and Retrieval, Memory, and Security supporting them—gives you back the vocabulary that got lost in the overloading.  You don't need to be an AI architect to understand it; you just need to know how to follow the breadcrumbs. 

Recommended reading - blog Ai Requires More Discipline From Us

The following Responsibility-Driven Design (RDD) XMind map helped me flush out the contents of this blog.  I used Rebecca Wirfs book Object Design guidance to create the map.

The End of Loose Prompting: Why AI Now Requires More Discipline from Us

Ai Requires More Discipline From Us

AI is no longer just correcting our spelling, finishing our sentences, or helping us phrase an idea. Increasingly, AI systems are becoming operational actors. That changes everything.

The Shift I Am Beginning to Notice

For years, many of us have been trained by software to be imprecise.

Autocorrect fixes our spelling. Search engines guess what we meant. Recommendation engines infer our preferences. IDEs complete our code. Navigation systems route us without requiring us to understand the roads.

That convenience has benefits, but it also has a cost: it conditions us to become comfortable with vague intent.

With traditional software, vague intent was often tolerable. If autocorrect picked the wrong word, we could fix it. If search returned the wrong page, we could search again. If autocomplete made a bad suggestion, we could delete it.

But AI is moving beyond suggestion.

Modern AI systems can now invoke tools, read documents, edit repositories, call APIs, operate through connectors, send messages, schedule events, generate code, and interact with systems through protocols such as MCP-style tool interfaces.

That means the relationship has changed.

We are no longer merely asking software to help us express intent. We are increasingly asking software to act on intent.

Once AI can act, loose prompting becomes more than a communication issue. It becomes an operational risk.

Why This Feels Different

Older AI prompting often felt like trying to get better prose from a clever assistant. The goal was usually to get a better answer, a better summary, a better email, or a better explanation.

That is still useful. But it is no longer the whole picture.

As AI systems become connected to tools and workflows, prompting starts to carry more weight. A prompt is no longer just a request. In many cases, it becomes a temporary policy boundary.

It may define:

  • what the AI is allowed to touch,
  • what it should avoid,
  • what source of truth it should trust,
  • whether it may act or only advise,
  • how much autonomy it has,
  • what should be logged,
  • what requires confirmation,
  • and what outcome counts as complete.

That is a very different world from “write me a paragraph about this topic.”

The MCP Security Lesson

The recent attention around MCP security did not create this problem by itself. It exposed a problem that was already forming.

MCP-style systems make tool use visible and standardized. That is valuable. But once a model can interact with tools, files, services, and credentials, the question is no longer simply, “Can the model answer correctly?”

The question becomes:

Can the system act safely when exposed to ambiguous instructions, hostile context, excessive permissions, or hidden prompt manipulation?

This is why the security conversation has expanded beyond ordinary bugs. Prompt injection, excessive agency, insecure tool use, sensitive information disclosure, and confused authorization boundaries are now architectural concerns, not just prompting annoyances.

In plain English: if an AI can use tools, then someone must define what those tools are allowed to do, under what authority, with what evidence, and with what audit trail.

The Real Issue: Assistant Versus Actor

A helpful way to think about this is the difference between an assistant and an actor.

An assistant helps you think, write, review, explain, summarize, or plan.

An actor changes things.

It edits files. It opens tickets. It runs commands. It sends emails. It schedules meetings. It queries private systems. It modifies infrastructure. It may even chain multiple actions together.

When AI behaves as an assistant, vague prompting is often merely inefficient.

When AI behaves as an actor, vague prompting can become dangerous.

The more authority we give an AI system, the more disciplined our instructions must become.

Why Non-Developers Need to Understand This

This is not only a developer problem.

Developers may see it first because they work close to tools, repositories, terminals, APIs, permissions, and logs. But the same shift is coming to everyone.

AI systems are being connected to email, calendars, documents, customer records, spreadsheets, business processes, personal assistants, financial systems, learning tools, research workflows, and office automation.

That means ordinary users will increasingly face systems that do not merely suggest what to do. They may do it.

If users remain conditioned by “loosey-goosey autocorrect” habits, frustration is inevitable. People may say something vague, the AI may interpret it differently, and the result may not match what the person intended.

Worse, the user may accept the result because they have been trained by years of convenience software to trust the machine’s correction over their own unfinished thought.

The Human Risk: Convenience Can Weaken Judgment

This is the part that concerns me most.

Human beings adapt to convenience. That is not an insult; it is a reality of human behavior.

When software repeatedly fills in gaps for us, we may stop noticing the gaps. We become less intentional. We accept “close enough.” We allow systems to complete our thoughts before we have fully formed them.

That can be harmless when the output is a misspelled word.

It is not harmless when the output is a business decision, a legal statement, a code change, a customer response, a financial action, or a security-sensitive operation.

AI does not merely risk making humans lazy. It risks making humans comfortable with unexamined delegation.

That is a much deeper issue than prompt engineering.

Prompting Is Becoming an Operational Skill

Disciplined prompting is not about using magic phrases.

It is not about tricking the model.

It is not about sounding technical.

Disciplined prompting is about expressing intent clearly enough that an AI system can operate within safe and useful boundaries.

That includes being clear about:

  • the goal,
  • the scope,
  • the source of truth,
  • the allowed actions,
  • the disallowed actions,
  • the expected output,
  • the level of autonomy,
  • and the point where human review is required.

In other words, good prompting is becoming less like casual conversation and more like operational instruction.

A Simple Example

A loose prompt might say:

Clean this up and make it better.

That may be fine for a casual paragraph. But if the AI is working inside a repository, a business document, or a production workflow, that prompt is too vague.

A more disciplined prompt might say:

Review this document for technical accuracy and clarity. Do not rewrite it in your voice. Identify places where my wording is misleading, ambiguous, or technically incorrect. Suggest corrections, but preserve my intent and style. Do not expand the scope beyond this document.

The difference is not verbosity for its own sake. The difference is control.

The New Mental Model

The old mental model was:

I ask AI a question, and it gives me an answer.

The emerging mental model is:

I define a bounded task, provide trusted context, constrain the action space, and review the result.

That may feel less magical, but it is more mature.

It also reflects where AI systems are going. As models become more capable, the limiting factor will often not be whether the AI can do something. The limiting factor will be whether we can define what it should do safely, precisely, and responsibly.

Why This Matters for AI Systems Authors

An AI Systems Author is not merely someone who writes prompts. It is someone who understands that AI behavior emerges from the interaction between models, tools, instructions, context, permissions, memory, retrieval, and human review.

That role requires a different discipline.

It requires asking questions such as:

  • What is the source of truth?
  • What authority does the AI have?
  • What should the AI never do without approval?
  • What context is trusted?
  • What context may be hostile or misleading?
  • What evidence should be preserved?
  • How will the human know what happened?
  • How can the system fail safely?

These questions are not academic. They are practical.

They are the difference between using AI as a helpful assistant and accidentally creating an ungoverned operational actor.

The Frustration That Is Coming

Many users are accustomed to software silently correcting them. They may expect AI to do the same thing, only better.

But as AI systems become more safety-conscious, users may begin to feel friction.

The AI may ask for clearer instructions. It may refuse to infer too much. It may avoid taking action without confirmation. It may distinguish between reviewing, drafting, editing, executing, and publishing. It may resist vague requests that would have been accepted casually before.

Some users may experience that as the AI becoming less helpful.

But in many cases, the opposite is true.

The system is not becoming less helpful. It is becoming more aware that helpfulness without boundaries can be harmful.

Patience Is Part of the Skill

Learning to work well with AI will require patience.

That patience is not just waiting for better answers. It is the patience to clarify our own intent before delegating work. It is the patience to review what was done. It is the patience to correct the instruction, not merely complain about the output.

This is where I expect my own prompting habits to be sharpened.

If I ask for something vague, I should expect the AI to help expose that vagueness. If I give it too much authority, I should expect it to slow down. If I fail to define the source of truth, I should expect the result to be less reliable. If I ask it to “make it better,” I should be prepared to explain what “better” means.

That is not a weakness in the process. That is the process teaching me to be more intentional.

Conclusion: The End of Casual Delegation

AI is becoming more powerful, but that does not remove responsibility from the human. It increases it.

The future will not belong only to people who know how to ask clever questions. It will belong to people who know how to define bounded work, preserve human judgment, and use AI without surrendering discernment.

Loose prompting may still work for casual tasks.

But for serious work, the era of casual delegation is ending.

As AI becomes more capable of acting, humans must become more capable of instructing.

References and Further Reading

Understanding a Named Pipe Listener

Named Pipe Listener

In the VS MCP Bridge architecture, the Visual Studio side of the system does not wait for natural-language prompts from an AI tool. It waits for structured bridge requests.

That waiting point is the named-pipe side of the bridge.

A named pipe is a local inter-process communication channel provided by the operating system. One process creates the pipe and waits for a connection. Another process connects and exchanges messages. No public network port is required.

In this project, the named-pipe boundary exists because the MCP server and the Visual Studio extension have different jobs. The MCP server speaks MCP over stdio to the AI client. The VSIX runs inside Visual Studio and owns Visual Studio APIs, editor state, proposal application, and host-specific behavior.

The Short Version

The current VS-backed tool path is:

AI client
  -> MCP over stdio
VsMcpBridge.McpServer
  -> PipeClient
local named pipe: VsMcpBridge
  -> PipeServer in the VSIX
VsService
  -> Visual Studio APIs / editor state

The important boundary is simple: stdio gets the request into the local MCP server, and the named pipe gets Visual Studio-backed work into the VSIX.

Why the VSIX Side Is Isolated from stdio

The VSIX runs inside Visual Studio. It can access DTE, editor state, solution state, the Error List, and the proposal-approval UI. The MCP server does not run inside Visual Studio and should not pretend to be the IDE host.

Keeping stdio out of the VSIX gives the bridge a cleaner architecture:

  • The AI client talks MCP to a local server process.
  • The MCP server keeps stdout reserved for MCP protocol responses.
  • The VSIX owns Visual Studio-specific work and Visual Studio privileges.
  • The named pipe provides a local-only bridge between those two processes.

This is why the named pipe is not just an implementation detail. It is the local host boundary between the AI-facing process and the IDE-facing process.

PipeClient and PipeServer Responsibilities

The named-pipe layer has two sides.

PipeClient lives in the MCP server process. For VS-backed tools, it connects to the local pipe name, writes a serialized request envelope, waits for a serialized response, and returns that response to the MCP tool method.

PipeServer lives on the host side. In the VSIX host, it accepts the pipe connection, reads the request envelope, dispatches the command, and writes a response.

At a high level, the client side looks like this:

using var pipe = new NamedPipeClientStream(".", _pipeName, PipeDirection.InOut, PipeOptions.Asynchronous);
await pipe.ConnectAsync(timeout: 5000, cancellationToken);

await writer.WriteLineAsync(JsonSerializer.Serialize(envelope, JsonOptions));
var responseJson = await reader.ReadLineAsync(cancellationToken);

And the server side listens for local pipe connections, then hands each connection to request handling:

pipe = new NamedPipeServerStream(
    PipeName,
    PipeDirection.InOut,
    NamedPipeServerStream.MaxAllowedServerInstances,
    PipeTransmissionMode.Byte,
    PipeOptions.Asynchronous);

pipe.WaitForConnection();
_ = Task.Run(() => HandleConnectionAsync(pipe, ct), CancellationToken.None);

The useful point is not the exact syntax. The useful point is the split of responsibility: the MCP server initiates a local pipe request, and the VSIX host accepts and dispatches it.

The Request Envelope

The named-pipe listener is not a chat endpoint. It expects a structured request envelope.

That envelope carries fields such as:

  • Command
  • RequestId
  • Payload

The command tells the host what operation is being requested. The request ID gives the logs and responses a stable correlation point. The payload contains the typed request body for that operation.

This structure is what makes the bridge diagnosable. When a tool call fails, the operator can ask which request crossed which boundary instead of guessing from unstructured text.

How Dispatch Works

Once the pipe server has a request envelope, it dispatches by command name. It does not interpret prose or execute arbitrary instructions.

VsResponseBase response = envelope.Command switch
{
    PipeCommands.GetActiveDocument => await _vsService.GetActiveDocumentAsync(),
    PipeCommands.GetSelectedText => await _vsService.GetSelectedTextAsync(),
    PipeCommands.ListSolutionProjects => await _vsService.ListSolutionProjectsAsync(),
    PipeCommands.GetErrorList => await _vsService.GetErrorListAsync(),
    PipeCommands.ProposeTextEdit => await DispatchProposeEditAsync(envelope),
    _ => new VsResponseBaseUnknown { Success = false, ErrorMessage = $"Unknown command: {envelope.Command}" }
};

The current MCP surface is explicit and limited. Unknown, empty, malformed, or unsupported pipe commands fail closed instead of being dispatched.

Where Visual Studio Work Happens

The pipe server owns transport and dispatch. It does not need to own DTE or editor behavior directly.

Visual Studio-specific work is handled by the host service layer, such as VsService. That is where operations such as these belong:

  • getting the active document,
  • reading selected text,
  • listing solution projects,
  • reading the Error List,
  • creating approval-gated edit proposals.

This keeps transport concerns separate from Visual Studio concerns. It also keeps the MCP server from needing direct knowledge of Visual Studio SDK details.

Activation and Startup Boundaries

The VSIX side must be active before VS-backed MCP tools can succeed. In live validation, the reliable operator path is to launch the Visual Studio Experimental Instance and open View -> Other Windows -> VS MCP Bridge. That activation path initializes the VSIX/tool-window side needed for the named pipe.

If the MCP server is running but the VSIX pipe side is inactive, that is not an MCP stdio failure. It is a named-pipe activation failure.

The current diagnostic path treats that case explicitly. Instead of appearing as an opaque timeout, the pipe client returns a structured activation diagnostic telling the operator to launch Visual Studio, open the VS MCP Bridge tool window, and retry the VS-backed tool.

That matters because a transport failure should identify the failed boundary:

  • If stdio is broken, the AI client and MCP server are not talking correctly.
  • If the named pipe is unavailable, the MCP server cannot reach the VSIX side.
  • If command dispatch fails, the request reached the host but did not match an allowed operation.
  • If VsService fails, the request reached Visual Studio-side execution but the host operation failed.

Request and Response Correlation

The named-pipe layer participates in the same anti-black-box logging discipline as the rest of the bridge. Requests carry IDs across the boundary so logs can be reconstructed later.

A useful trace should be able to answer:

  • which MCP tool was called,
  • which pipe command was sent,
  • which request ID crossed the pipe,
  • whether the pipe connected, timed out, or returned a structured failure,
  • which host operation ran,
  • how long each boundary took.

That is why the architecture emphasizes request IDs, operation names, elapsed timing, success or failure state, and durable trace artifacts. The goal is not more logging for its own sake. The goal is to make failure reconstruction practical.

Approval-Aware Flow Where It Matters

The named pipe does not approve tool execution by itself. It moves structured requests between local processes.

For Visual Studio edit operations, the VSIX proposal workflow remains approval-gated. MCP can propose edits, but applying them still requires explicit approval in the host UI.

For shared compiled bridge tools, approval-aware execution is a separate executor concern. A compiled tool descriptor can require approval, and BridgeToolExecutor owns policy evaluation, approval evaluation, execution, audit, correlation, and redaction for that path.

That means the named-pipe layer supports approval-aware architecture by preserving structured boundaries and correlation, but it is not the shared compiled-tool policy engine.

Relationship to MCP and BridgeToolExecutor

It helps to keep three boundaries separate:

  • MCP stdio boundary: the AI client talks to VsMcpBridge.McpServer.
  • Named-pipe boundary: VsMcpBridge.McpServer talks to the VSIX host for Visual Studio-backed tools.
  • BridgeToolExecutor boundary: shared compiled tools run through policy, approval, execution, audit, redaction, and correlation seams.

Those boundaries are complementary. The named pipe keeps Visual Studio operations local to the VSIX. BridgeToolExecutor keeps compiled tool execution governed by a single shared policy and audit boundary. stdio keeps the AI client protocol isolated from both of those internal implementation details.

Failure Isolation and Troubleshooting

If you are debugging a VS-backed tool call, follow the boundary chain instead of treating the bridge as one black box:

  1. Did the AI client successfully launch and speak to the MCP server over stdio?
  2. Did the MCP server resolve the expected registered tool?
  3. Did PipeClient attempt the expected command with a request ID?
  4. Was the VSIX/tool-window side active and listening on the named pipe?
  5. Did PipeServer accept and parse the request envelope?
  6. Did the command dispatch to a known PipeCommands value?
  7. Did VsService complete the host operation?
  8. Did the response return through the pipe and then over MCP stdout?

This is the practical value of clean transport boundaries. Each step has a narrow responsibility, so the first missing or failing boundary can be found from logs and trace artifacts.

Related Mermaid Trace Sources

The repo already has Mermaid sources that support this post:

Those .mmd files remain the diagram source of truth. This post references them directly instead of embedding generated images.

Why This Supports Future Extensibility

The named-pipe layer gives future work a stable place to preserve local host isolation. New VS-backed operations can stay explicit command-and-response paths. New compiled tools can continue to use BridgeToolExecutor for policy, approval, redaction, and audit. Additional diagnostics can attach to the existing correlation chain without polluting MCP stdout.

That is the main architectural benefit. The bridge can grow without collapsing the AI protocol, Visual Studio host operations, transport diagnostics, and tool security seams into one layer.

Takeaway

A named pipe listener is the local Visual Studio-side endpoint that waits for structured inter-process requests. In VS MCP Bridge, it exists so the VSIX can own Visual Studio operations while a separate MCP server process owns the AI-facing MCP stdio transport.

The short version is:

stdio gets into the MCP server
named pipes get into Visual Studio
BridgeToolExecutor governs shared compiled tool execution

Keeping those roles separate is what makes the bridge easier to diagnose, safer to extend, and more useful for observable AI tooling.

Why a VSIX Project Should Target .NET Framework 4.7.2

Host Constraints, Shared Code, And Stable Bridge Boundaries

When building a Visual Studio extension, one detail is easy to underestimate: an in-process VSIX is loaded by the Visual Studio shell. It is not a standalone desktop app, and it should not be treated like one.

In VS MCP Bridge, that is why VsMcpBridge.Vsix targets .NET Framework 4.7.2. The VSIX must align with the Visual Studio SDK and in-process extension hosting model, while the rest of the solution can use other target frameworks where they make sense.

Microsoft's in-process extension guidance summarizes the rule this way: in-process extensions must target the .NET version used by the Visual Studio version they run in. The relevant guidance is here: VisualStudio.Extensibility in-process extensions.

The VSIX Runs Inside Visual Studio

The VSIX host is different from the standalone app and different from the local MCP server.

The VSIX is loaded into the Visual Studio process. It uses the Visual Studio SDK, shell services, tool window infrastructure, MEF composition expectations, DTE/editor APIs, package loading behavior, and WPF UI hosted by Visual Studio.

That hosting model is the reason the extension project follows Visual Studio's in-process runtime constraints. Trying to force the VSIX itself to behave like a modern out-of-process .NET app would make loading, packaging, dependency resolution, and tool-window behavior harder to reason about.

The Current Solution Uses Targeting Deliberately

The target framework split is part of the architecture:

  • VsMcpBridge.Vsix targets .NET Framework 4.7.2 because it is the Visual Studio in-process extension host.
  • VsMcpBridge.Shared targets netstandard2.0 so shared contracts, tools, security seams, diagnostics, and orchestration logic can be reused across hosts.
  • VsMcpBridge.Shared.Wpf multi-targets so the reusable WPF surface can support both VSIX and standalone app hosts.
  • VsMcpBridge.App can target a modern Windows desktop runtime because it is not loaded into Visual Studio.
  • VsMcpBridge.McpServer can target a modern runtime because it runs out of process and communicates over stdio plus the local named pipe.

This is not accidental legacy layering. It is how the bridge keeps Visual Studio-specific constraints from infecting every project.

Host Code And Shared Logic Stay Separate

The VSIX owns Visual Studio-specific behavior:

  • package initialization
  • tool window creation
  • Visual Studio service access
  • DTE and editor interactions
  • UI-thread switching
  • VSIX-host logging and diagnostics

Shared infrastructure owns reusable bridge behavior:

  • pipe message contracts and dispatch abstractions
  • presenter/viewmodel orchestration
  • proposal lifecycle contracts
  • bridge tool descriptors, requests, results, catalog, and executor
  • policy, approval, redaction, audit, capability, and secret-reference seams
  • diagnostic patterns and correlation metadata

That separation lets the shared layer be tested without loading Visual Studio. It also lets the standalone app reuse the same core presentation and bridge concepts without pretending to be a VSIX.

Tool Windows Follow Visual Studio Lifecycle Rules

Visual Studio owns the lifecycle of extension components. Tool windows are created by the shell, not by normal application startup code.

That matters for dependency wiring and initialization. A VSIX should not assume that every object can be created with application-style constructor injection. Tool-window initialization belongs at the lifecycle points Visual Studio provides, including ToolWindowPane.OnToolWindowCreated() where appropriate.

This lifecycle constraint connects directly to the threading post: the VSIX must respect both Visual Studio object creation and Visual Studio UI-thread requirements.

Stable Pipe Integration Depends On Host Isolation

The local MCP server does not run inside Visual Studio. It speaks MCP over stdio to the AI client and communicates with the host through the local named pipe.

That boundary is important. The MCP server should not need to reference Visual Studio SDK assemblies, know about tool-window lifecycle rules, or switch to the Visual Studio UI thread. It should remain transport-focused and protocol-safe.

The VSIX side can then own the named-pipe server and host behavior. When a pipe-backed tool needs active document state, selected text, solution projects, error list data, or proposal UI behavior, the request crosses into the VSIX host, where Visual Studio-specific services are available.

This keeps the out-of-process server stable while letting the in-process extension follow Visual Studio's runtime rules.

Testing Benefits From The Split

Because shared infrastructure is not trapped inside the VSIX target framework, much of the bridge can be tested directly:

  • shared tool execution tests can validate catalog, executor, policy, approval, audit, redaction, and correlation behavior
  • proposal lifecycle tests can validate state transitions without starting Visual Studio
  • shared WPF and presenter behavior can be exercised outside the VSIX host where appropriate
  • VSIX-specific tests can focus on composition and host-specific service behavior

That is one reason the project can evolve safely. The VSIX target framework is a host constraint, not a reason to put all behavior into untestable host code.

Transport And Tool Execution Should Not Depend On VSIX Runtime Behavior

The bridge architecture intentionally prevents shared transport and tool execution concepts from depending on VSIX-only runtime behavior.

For example, BridgeToolExecutor owns shared tool policy, approval, redaction, audit, correlation, and structured results. It should not need to know whether the caller is the VSIX, the standalone app, or a test harness. Likewise, tool descriptors and request/result models should not depend on Visual Studio shell types.

When a tool genuinely needs Visual Studio, that should be represented as host-provided behavior behind the proper boundary. The shared contract should remain portable and observable.

What This Does Not Claim

This post is not a promise that the VSIX will move to a different framework. It is also not a claim that every project in the solution must target .NET Framework.

The practical rule is narrower:

  • respect the runtime constraints of the Visual Studio in-process extension host
  • keep Visual Studio-specific code in the VSIX host
  • keep reusable bridge contracts and logic outside the VSIX where possible
  • let out-of-process components use target frameworks appropriate to their own runtime

Takeaway

Targeting .NET Framework 4.7.2 in the VSIX project is not just an old default. It is part of respecting the Visual Studio in-process hosting environment.

The maintainable design is to keep the VSIX host compatible with Visual Studio, keep shared logic portable and testable, keep the MCP server out of process, and let each boundary use the runtime model that fits its role.

That is what makes the bridge easier to build, validate, troubleshoot, and eventually evolve without turning Visual Studio hosting constraints into system-wide coupling.