You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have verified this would not be more appropriate as a feature request in a specific repository
I have searched existing discussions to avoid duplicates
Your Idea
Note: I've searched existing discussions and found only #627
(MCPProxy) which is related but addresses a
different approach (server-side orchestration rather than client-side virtualization).
Context
Anthropic's recent blog post describes a powerful pattern for interacting with MCP tools through generated code instead of sequential tool calls, achieving up to 98.7% token reduction (150k → 2k tokens).
The blog describes presenting MCP tools as a virtual filesystem that agents can explore:
Agents progressively discover tools by exploring this structure, reading only the definitions they need, then generating code that imports and calls multiple tools efficiently.
However, the blog post doesn't specify where this should be implemented. I see two possible architectures, each with significant trade-offs. I'd like the community's input on which makes more sense.
Option 1: Client-Side Execution (What Blog Appears to Describe)
Agent generates code: from servers.google_drive import getDocument
Code executes in client's sandbox, calls callMCPTool() which routes to actual MCP servers
Results processed locally before returning to LLM
Pros
✅ MCP servers unchanged - works with all existing servers
✅ Client controls security - single sandbox implementation
✅ Cross-server coordination - code can orchestrate multiple servers
✅ Privacy by default - data processing happens client-side
✅ Solves token problem - only loads needed tool definitions
Cons
❌ Every client reimplements - fragmentation across Claude Code, Desktop, third-party clients
❌ Complex client-side - execution environment, sandboxing, security
❌ No standardization - different virtual filesystem structures per client
❌ Heavy client - not suitable for lightweight integrations
Server exposes new tool: execute_code(language: str, code: str)
Client sends code to server via normal tools/call
Server executes in its own sandbox with direct access to its tools
Server processes data locally, returns results
Works with current MCP clients (no client changes)
Pros
✅ Works with current clients - just another MCP tool
✅ Server controls security - sandbox near the data
✅ No client fragmentation - standardized tool interface
✅ Lightweight clients - web apps, CLI tools work unchanged
✅ Better for privacy - data never leaves server
Cons
❌ Every server must implement - execution environment, sandboxing
❌ Security burden on server devs - harder to get right
❌ Can't coordinate across servers - each executes in isolation
❌ Doesn't solve token problem - still need all tool definitions upfront (unless combined with client-side caching)
Hybrid Approach?
Could we combine both?
Client-side caching + virtual filesystem - solves token problem via progressive discovery
Optional server-side execution - servers can expose execute_code for data-heavy operations
Client routes intelligently - run simple operations client-side, heavy operations server-side
Questions for the Community
Which architecture makes more sense for the MCP ecosystem?
Should this be standardized?
Protocol-level (part of MCP spec)
Convention-based (recommended patterns)
Leave it to client implementations
How do we avoid fragmentation?
If client-side: reference implementation? shared library?
If server-side: standard execution API? security guidelines?
What about the token efficiency problem?
Client-side naturally solves it (progressive discovery)
Server-side doesn't help unless client also caches metadata
Is this even the right problem to solve?
Security considerations?
Who should manage sandboxing? Clients or servers?
What are the risks of each approach?
Should there be execution policy configuration?
Backwards compatibility?
How do we ensure existing tools/clients continue working?
Should traditional tool calling remain the default?
Fragmentation if every client implements differently
Could we have a reference implementation or shared library?
Should the MCP spec provide guidance on virtual filesystem structure?
What does the community think? Has anyone started implementing this? Are there other approaches I'm missing?
Why I'm Asking
For my own MCP server, I need to know which of these architectures are on the roadmap so I can understand how I need to write my server to comply with it (if its server based). Just want to understand the direction of the ecosystem before investing development time.
My goals with this discussion:
Understand what's already being worked on - Is anyone actively implementing this?
✅ Existing discussions (only found #627 MCPProxy which addresses a different approach)
If there are existing implementations, documentation, or active development efforts I've missed, please point me in the right direction! The last thing I want is to duplicate work or miss ongoing efforts.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Pre-submission Checklist
Your Idea
Context
Anthropic's recent blog post describes a powerful pattern for interacting with MCP tools through generated code instead of sequential tool calls, achieving up to 98.7% token reduction (150k → 2k tokens).
The blog describes presenting MCP tools as a virtual filesystem that agents can explore:
Agents progressively discover tools by exploring this structure, reading only the definitions they need, then generating code that imports and calls multiple tools efficiently.
However, the blog post doesn't specify where this should be implemented. I see two possible architectures, each with significant trade-offs. I'd like the community's input on which makes more sense.
Option 1: Client-Side Execution (What Blog Appears to Describe)
Architecture
How It Works
tools/liston all connected servers, caches metadata locally.tsfilesls servers/,cat servers/google-drive/getDocument.ts)from servers.google_drive import getDocumentcallMCPTool()which routes to actual MCP serversPros
✅ MCP servers unchanged - works with all existing servers
✅ Client controls security - single sandbox implementation
✅ Cross-server coordination - code can orchestrate multiple servers
✅ Privacy by default - data processing happens client-side
✅ Solves token problem - only loads needed tool definitions
Cons
❌ Every client reimplements - fragmentation across Claude Code, Desktop, third-party clients
❌ Complex client-side - execution environment, sandboxing, security
❌ No standardization - different virtual filesystem structures per client
❌ Heavy client - not suitable for lightweight integrations
Option 2: Server-Side Execution (Alternative)
Architecture
How It Works
execute_code(language: str, code: str)tools/callPros
✅ Works with current clients - just another MCP tool
✅ Server controls security - sandbox near the data
✅ No client fragmentation - standardized tool interface
✅ Lightweight clients - web apps, CLI tools work unchanged
✅ Better for privacy - data never leaves server
Cons
❌ Every server must implement - execution environment, sandboxing
❌ Security burden on server devs - harder to get right
❌ Can't coordinate across servers - each executes in isolation
❌ Doesn't solve token problem - still need all tool definitions upfront (unless combined with client-side caching)
Hybrid Approach?
Could we combine both?
execute_codefor data-heavy operationsQuestions for the Community
Which architecture makes more sense for the MCP ecosystem?
Should this be standardized?
How do we avoid fragmentation?
What about the token efficiency problem?
Security considerations?
Backwards compatibility?
My Current Thinking
I'm leaning toward Option 1 (client-side) because:
But I'm concerned about:
What does the community think? Has anyone started implementing this? Are there other approaches I'm missing?
Why I'm Asking
For my own MCP server, I need to know which of these architectures are on the roadmap so I can understand how I need to write my server to comply with it (if its server based). Just want to understand the direction of the ecosystem before investing development time.
My goals with this discussion:
Have I Missed Something?
I've searched the following repositories and found no public implementations or discussions:
If there are existing implementations, documentation, or active development efforts I've missed, please point me in the right direction! The last thing I want is to duplicate work or miss ongoing efforts.
References
Scope
Beta Was this translation helpful? Give feedback.
All reactions