`LangAlpha`: compiling `MCP` servers into Python libs to cut agent context cost
Instead of stuffing financial MCP schemas and price data into prompts, it generates typed Python modules and keeps only a one-line server summary. The stronger signal is the workspace model: persistent sandboxes plus memory/index files make long-horizon research agents much more usable.
- A single five-year daily price pull can dump tens of thousands of tokens; large
MCPschemas alone can burn 50k+ tokens before useful work starts. - The workaround is practical: auto-generate typed Python modules from
MCPschemas at workspace init, then let the agentimporttools like a normal library. - Prompt cost stays flat even with scale: about 80 tools across servers, while only a one-line summary per server remains in context.
- Persistent workspaces matter more than the finance angle. Sandbox state, a memory file, and a file index survive across sessions, so analysis compounds instead of resetting.