Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions mcp_server/src/graphiti_mcp_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,18 @@ async def initialize(self) -> None:
# Re-raise other errors
raise

# Build indices
await self.client.build_indices_and_constraints()
# Build indices - wrap in try/except to handle Neo4j 5.x race condition
# with parallel IF NOT EXISTS index creation
try:
await self.client.build_indices_and_constraints()
except Exception as idx_error:
if 'EquivalentSchemaRuleAlreadyExists' in str(idx_error):
logger.warning(
'Index creation race condition detected (Neo4j 5.x issue). '
'Indexes likely already exist. Continuing...'
)
else:
raise

logger.info('Successfully initialized Graphiti client')

Expand Down