Problem
Agents that work in Front via the MCP server repeatedly fetch the same discovery data within a single session — teammates, channels, inboxes, tags, custom fields. Each call hits Front's API. We can cut latency and API call volume by caching read responses at the MCP boundary.
Solution
Wire fastmcp's built-in ResponseCachingMiddleware after the fastmcp 3.x bump (see #108). Stocktrim landed this as PR #158.
Configuration:
- Tools: 5-minute TTL
- Resources: 60-second TTL (less likely to be re-fetched as often, lower TTL keeps freshness)
- Exclude mutation tools by name pattern:
create_*, update_*, delete_*, archive_*, move_*, assign_*, unassign_*, tag_*, untag_*, mark_*
Depends on
Files to change
frontapp_mcp_server/src/frontapp_mcp/server.py — register middleware
- A new
frontapp_mcp_server/src/frontapp_mcp/middleware/cache.py if any custom predicate is needed for the exclusion pattern
frontapp_mcp_server/docs/ — short doc page on cache behavior + how operators can swap to Redis (per stocktrim's observability.md precedent)
Acceptance criteria
Reference
Problem
Agents that work in Front via the MCP server repeatedly fetch the same discovery data within a single session — teammates, channels, inboxes, tags, custom fields. Each call hits Front's API. We can cut latency and API call volume by caching read responses at the MCP boundary.
Solution
Wire fastmcp's built-in
ResponseCachingMiddlewareafter the fastmcp 3.x bump (see #108). Stocktrim landed this as PR #158.Configuration:
create_*,update_*,delete_*,archive_*,move_*,assign_*,unassign_*,tag_*,untag_*,mark_*Depends on
Files to change
frontapp_mcp_server/src/frontapp_mcp/server.py— register middlewarefrontapp_mcp_server/src/frontapp_mcp/middleware/cache.pyif any custom predicate is needed for the exclusion patternfrontapp_mcp_server/docs/— short doc page on cache behavior + how operators can swap to Redis (per stocktrim'sobservability.mdprecedent)Acceptance criteria
FRONTAPP_MCP_CACHE_TTL_TOOLS,_RESOURCES)list_teammatestwice in a row, second is observably fasterReference