[Bug]: Date queries fail with Extended JSON format - requires JavaScript Date constructor
Opened this issue · 2 comments
Version
main
App
- Cursor
- Windsurf
- VSCode
- VSCode Insiders
- Claude Desktop
- Other
Affected Models (if applicable)
- Claude 3.5 Sonnet
- Claude 3.7 Sonnet
- GPT-4a
- o4-mini
- Other
Bug Description
When querying date fields using MongoDB's Extended JSON format, queries fail with an "unknown operator: $date" error. The server appears to expect native JavaScript Date objects instead.
Current Behavior (Doesn't Work):
javascript{
"$match": {
"created_at": {
"$gt": {"$date": "2025-10-20T01:02:50.000Z"}
}
}
}
This works:
{
"$match": {
"created_at": {
"$gt": new Date("2025-10-20T01:02:50.000Z")
}
}
}
Thanks for opening this issue. The ticket MCP-273 was created for internal tracking.
Hi @Rakesh-HR,
can you elaborate more on what the issue is? What agent are you using (or agentic framework) and how are you specifically communicating with the MCP Server?
Also, please provide any MCP Server logs related to the issue.