Use symptom, cause, action, and safety guidance when OAuth, MCP discovery, or recall does not behave as expected.
Verify a connection without writing memory
Every troubleshooting path below ends in a verification step. Start with a read: it proves the credential and the transport without changing anything.
curl -s -o /dev/null -w '%{http_code}\n' \
-H 'X-API-Key: <your-assigned-api-key>' \
'https://xmemo.dev/v1/memories/search?query=connection%20check&limit=1'
Reading the status code
The status separates a credential problem from an empty memory store.
200 — authorized; an empty results array just means nothing matched.
401 — the credential is missing or not valid.
403 — the credential is valid but lacks the required scope.
Client connection errors
When an AI client or runner cannot reach the MCP server, isolate transport protocol negotiation and host routing before rotating tokens.
- Verify server health with a direct GET to /health or OPTIONS to /mcp.
- Check transport compatibility: hosted clients use Streamable HTTP (/mcp); local CLI tools use stdio.
- Ensure corporate proxies or firewalls permit streaming SSE responses without chunk truncation.
curl -I -s 'https://xmemo.dev/mcp'
Auth failures
Authentication failures distinguish missing credentials (401 Unauthorized) from insufficient permissions or tenant boundary violations (403 Forbidden).
- OAuth clients: Reconnect via host app and grant memory:read and memory:write.
- Direct MCP clients: Verify XMEMO_KEY is populated in the process environment without exposing secrets in git.
- 403 Forbidden: Confirm the token belongs to the active tenant and project scope.
curl -s -o /dev/null -w '%{http_code}\n' \
-H 'Authorization: Bearer <your-token>' \
'https://xmemo.dev/v1/memories/search?query=auth%20check&limit=1'
Empty recall results
Recall returning zero results indicates a boundary or query mismatch rather than an engine failure. Reads succeed with 200 OK when no memories match the criteria.
- Project scope mismatch: Verify the querying agent operates in the same project as the stored memory.
- Agent instance boundary: Direct clients filtering by XMEMO_AGENT_INSTANCE_ID cannot read memories saved under different instance identifiers.
- Status check: Verify the memory was committed and has status active, not soft-deleted or superseded.
curl -s -H 'Authorization: Bearer <your-token>' \
'https://xmemo.dev/v1/memories/search?query=test&limit=5&scope=project:demo'
Write lock timeouts
Concurrent writes from multiple runners or parallel tool executions can trigger write lock contention on shared memory paths.
- Implement exponential backoff with randomized jitter when write requests return lock contention.
- Supply a client-side idempotency key on write retries to prevent duplicate memory entries.
- Serialize memory mutations for high-frequency workflows using task queues or batch APIs.
curl -s -X POST 'https://xmemo.dev/v1/memories' \
-H 'Authorization: Bearer <your-token>' \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: <generate-a-uuid-v4>' \
-d '{"content":"Durable convention fact","path":"projects/demo/conventions"}'