Replies: 2 comments
-
|
You need two things to do code mode mcp:
I do not recommend you build this yourself, unless that is your project focus or as a learning experience. It's not trivial and it certainly isn't easily retrofitted onto an SDK. |
Beta Was this translation helpful? Give feedback.
-
|
I have a project that enables this using Jint: https://github.com/CharlieDigital/runjs Effectively it allows the LLM to generate and execute JavaScript over MCP in a safe sandbox. With Jint, you can also expose your runtime .NET domain to it. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Pre-submission Checklist
Question Category
Your Question
I've been reading recent engineering posts from Anthropic and Cloudflare regarding the shift from standard tool-calling loops to "Code Mode" (Code Execution).
The core idea is moving away from the chat-based loop (LLM -> Tool Call -> Response -> LLM) and towards letting agents write and execute scripts that use MCP tools as importable libraries. This approach significantly reduces latency and token usage for data-heavy tasks.
My Question: Do we currently have any examples or best practices for implementing this pattern using the C# MCP SDK?
Thank you
Beta Was this translation helpful? Give feedback.
All reactions