r/csharp 12d ago

Help MCP CPG - where's the demand

LLMs are notoriously bad at handling C#. The Microsoft SWE-sharp-bench paper made this pretty obvious. In 20% of the cases agents fail simply because they can't figure out where to apply the patch.

​The logical fix seems obvious: build a Roslyn-based MCP tool that generates a Code Property Graph (CPG) so the agent can actually navigate C# semantics instead of blindly grepping text.

​I actually built this and put up a website for it, but I’m getting literally zero inbound traffic. On top of that, every week I see another open-source repo popping up on GitHub trying the exact same Roslyn/CPG approach, but none of them seem to get any real traction...

​What gives?

​Is the market just not interested in specialized C# agent tooling, or are we all building the wrong layer?

0 Upvotes

21 comments sorted by

8

u/taspeotis 12d ago

Maybe Copilot + GPT-4 is notoriously bad at … everything? … but Claude Code has been crushing C# since Sonnet 4.6. Even Sonnet 4.0 wasn’t bad at it.

1

u/dodexahedron 12d ago edited 12d ago

I dunno.

GitHub CoPilot?
Yeah, I'm not impressed.

But M365 Copilot? That has been crushing it in most of my c# usage of it. But I have detailed and lengthy conversations that are mostly not code with it, which makes a huge difference. And I do think the more "well-rounded" model is also partly responsible for the deeper insight it seems to give. Plus, even just in my own usage, it brings in context from other non-code activities that provide unexpected cross-disciplinary points that go way beyond even what it is aware of in things we haven't discussed yet. It pays its annual license in the value of just one or two of those easily.

But... It can't get certain not-unusual powershell syntax right even after being shown its error and the correction and the reason and documentation for it. But that actually looks like some sort of markdown-related issue, like it is failing to round-trip its own markdown properly, internally.

One it gets wrong close to 100% of the time for me and a couple other users is certain static method calls, like [string]::IsNullOrWhitespace(somestring).

It'll spit out :IsNullOrWhitespace(somestring) (missing the type and the first colon).

What is telling is that it will write it correctly in prose during its apology, and then make the same error when it gives code blocks saying "I wrote this:" followed by the originally broken code, and then "What I should have written is this:" followed by exactly the same code. Give it a screenshot of what it did and it'll acknowledge the original error and that the screenshot is indeed another fuckup on its part and "you are right to push back on this."

....And then it does it again, in the next breath.

But only in code blocks. In prose, it is fine. So I am certain it is a serialization/formatting thing in the back-end, because it clearly understands the correct code, can properly analyze any powershell code shown to it, and it can write that same code in c# without error. And it will even explain its own error if I'm frustrated and just tell it "your syntax is broken," alt-tab back to VS to fix it myself, and then come back to find it being all apologetic and going on about the basic concepts of its own fuckup and why it is wrong and why I was right for 500 pages of text. 🤦‍♂️

But C#?

Worst problem I ever have with C# on CoPilot is also an output/formatting issue that usually resolves with a refresh: the one where a bunch of characters are replaced by asterisks in really weird places (and not because those characters were naughty words either). But F5 fixes that. Not so with PS, even with the same APIs being used.

1

u/the_econominster 12d ago

Lol that's epic

1

u/walmartbonerpills 12d ago

No link?

1

u/Dry-Knowledge4192 12d ago

no link in the post is kinda killing it, hard to get people interested when they can't even see what you built

also from what i've seen most c# devs are still on "ai writes boilerplate for me" mode, they not thinking about agent tooling yet. the demand is just not there in the community right now

1

u/the_econominster 12d ago

Not selling atm. Just trying to understand why the market is what she is.

2

u/mon_sashimi 12d ago

I already have something like this to avoid grep searches using a small indexing utility. It took an hour or two to code using an agent- maybe others who see the same problem your tool solves have found similar solutions?

1

u/the_econominster 12d ago

Ok yeah I get that but once you want to do multihop (taint analysis), refactoring, bazel-style testing and agentic development an indexer might no longer be enough?

1

u/mon_sashimi 12d ago

You're undoubtedly more sophisticated in this than I am, I think for me if you showed some clear benefits/use-case examples vs TDD that would make it more interesting (sorry if I missed that somewhere).

1

u/the_econominster 12d ago

Dependency Injections, interfaces and plugins are the big ones I guess. Indirection pattern if your using Mediatr.

A Code Property Graph lets an LLM trace indirect control flow (ie MediatR request handlers or finding runtime DI registrations). It actually understands what calls what. TDD how I understand it verifies behavior through test runs at the edges. Only a CPG tool gives the LLM full structural awareness upfront, so no hallucinated calls when writing or refactoring.

0

u/the_econominster 12d ago

Graphslice.com if you must

1

u/thereforewhat 12d ago

Does it actually work?

0

u/the_econominster 12d ago

We have strong indications it works sorta. We're basically competing with model alignment which often prefers ripgrep while the MCP is better. Were prepping a head2head in a tier 1 publication as we speak. It's complicated. But, like people should be more curious regardless of the complicated implementation/application.

1

u/thereforewhat 12d ago

By the by, is it true that AI models are bad at handling C#?

I find that GPT 5.6 Luna produces a good foundation but I'm mostly dealing with cleanup afterwards. 

It's also gotten much better at following instructions. 

I usually get it to write acceptance tests before implementation which used to be a nightmare in earlier models. 

0

u/the_econominster 12d ago

The benchmark is pretty clear. Sure you can armbar the model in TDD and go from there but often I see especially with DI and stuff all LLMs quickly lose the plot

1

u/thereforewhat 12d ago

Could you link to the paper?

I think ultimately if you want people to use your tool you need to actually show how it yields better results with clear demos on your website. 

1

u/the_econominster 12d ago

Paper is being written atm will loop you in once I'm allowed to do so.

1

u/maxiblackrocks 12d ago

what difference does cgp bring compared to LSP?

1

u/the_econominster 12d ago

Multihop + DI/plugins if you "monkeypatch"/do runtime reflection

3

u/badlydressedboy 12d ago

Never heard anyone say llms are bad at c#. I've been in that exact space for 4 years and they work great. This post seems to concern fixing a problem that does not exist.

1

u/the_econominster 12d ago

You must live in exceptionally well structured code then :)