# MCP server: get_episodes and delete_episode query the wrong graph on FalkorDB (bypass per-group routing)

## TL;DR

[RemanenetSpy (commenter)]: The root cause is storing mutable tenant state on the shared driver (`self.driver = self.driver.clone(database=group_id)`). In an async MCP runtime, concurrent tool calls create a race condition where read tools query the database of whichever group executed last. Neither tool routes to the graph of the requested group, so on FalkorDB they operate on the wrong graph and report data as missing that demonstrably exists.

Use this when you run into the situation in the title.

**When not to use this skill:** unrelated tasks. It covers only the procedure above.

## Compatibility

The steps above apply to the commands named in them. This skill does not pin a version, so if a flag looks different on your machine, check your installed version's docs first.

## Details

The structural fix is replacing mutable driver rebinding with **Stateless Per-Request Graph Execution**: ```python from typing import Optional, Dict, Any from falkordb import FalkorDB, Graph class MultiTenantGraphitiDriver: def __init__(self, client: FalkorDB, default_group: str = "default"): self.client = client self.default_group = default_group def get_graph(self, group_id: Optional[str] = None) -> Graph: """Stateless resolution: returns graph handle without mutating shared state.""" target_group = group_id or self.default_gro

Context:
GitHub issue getzep/graphiti#1651 (closed, 11 comments): ## Bug description On FalkorDB every `group_id` is a separate graph (multi-tenant), but the MCP server's `get_episodes` and `delete_episode` tools query whatever graph the shared driver happens to be bound to , `default_db` at startup, or the graph of the **last-written group** after any `add_episode` (which rebinds the driver via `self.driver = self.driver.clone(database=group_id)`). This is distinct from #1161 / #1325 (single-group routi
