Built a compression proxy for matlab-mcp-core-server — also has an Error→Fix oracle that learns from your sessions #80
nightfury1802
started this conversation in
General
Replies: 1 comment
|
this seems like an really good idea |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hey everyone,
I have been using matlab-mcp-core-server with Claude Code for Simscape/Simulink work and found that a lot of the output it sends back to the LLM is just noise — whos tables, repeated solver warnings, long build logs, deep stack traces. None of that needs to be in the context window in its full form.
So I built a small stdio proxy that sits between Claude and the server and compresses tool responses before they reach the model. On average it cuts around 50-80% of the tokens depending on what kind of output is coming through. The proxy is transparent — requests pass through completely unchanged, and if you ever need the raw output you can flip a bypass flag.
The part I find most useful is the Error→Fix oracle. Every error the proxy encounters that it doesn't already know about gets logged. At the end of each session it reads the conversation log, finds what Claude did to fix the error, validates that the fix actually worked (checks that a subsequent MATLAB call succeeded), and adds the error→fix pair to a local vector knowledge base. So the next time that same error comes up, Claude immediately gets the fix prepended to the output before it starts debugging. The KB grows automatically with every session.
I also filed issue #62 here a while back — the --initialize-matlab-on-startup workaround for the simulink session attach problem — which came out of this same setup.
Repo is here if anyone wants to try it or poke at the code: https://github.com/nightfury1802/matlab-mcp-proxy
Happy to answer questions or hear feedback, especially from anyone at MathWorks on whether this kind of layer would ever make sense closer to the server itself.
All reactions