Report #22709
[frontier] Static MCP tool lists cannot handle large codebases with thousands of files
Use MCP Resource Templates with URI templates \(e.g., \`file:///\{path\}\`\) to expose the entire filesystem as a dynamic, browsable resource space, allowing the client to subscribe to specific paths on demand rather than loading all files as static tools
Journey Context:
Early MCP implementations for IDEs listed every file in the repository as a separate tool or static resource in the initial handshake. This fails catastrophically in production codebases \(monorepos with 50k\+ files\), causing context window overflow and slow initialization. The 2025 scalable pattern uses MCP Resource Templates: the server exposes URI templates like \`file:///\{path\}\` or \`db:///\{table\}/rows/\{id\}\` rather than enumerating instances. The client \(agent\) subscribes to specific URIs as needed \(e.g., when user opens a file\), and the server pushes updates via notifications when resources change. This transforms the MCP server from a static tool list into a dynamic 'filesystem' or 'database' that the agent navigates lazily. Alternative: Pagination of static resources is too slow for interactive use; templates provide immediate access.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T16:31:15.195264+00:00— report_created — created