Skip to content

Add MongoDB Native Query Support + FastMCP 3.1.0 Upgrade#13

Open
lepikj wants to merge 5 commits intohluaguo:mainfrom
lepikj:main
Open

Add MongoDB Native Query Support + FastMCP 3.1.0 Upgrade#13
lepikj wants to merge 5 commits intohluaguo:mainfrom
lepikj:main

Conversation

@lepikj
Copy link

@lepikj lepikj commented Mar 4, 2026

Add MongoDB Native Query Support + FastMCP 3.1.0 Upgrade

Adds MongoDB database support to Metabase MCP server, enabling AI assistants to query MongoDB alongside SQL databases.

New Tools

  • execute_mongodb_query: Execute native MongoDB queries with automatic JSON conversion for aggregation pipelines
  • create_mongodb_card: Create MongoDB question cards

Key Changes

  • MongoDB collection parameter support in query payload
  • Automatic JSON conversion for aggregation pipeline arrays
  • Upgraded FastMCP 2.12.4 → 3.1.0 with API compatibility fixes
  • Updated documentation with MongoDB examples
  • Fully backward compatible with existing SQL functionality

Commits

  1. Add MongoDB native query support
  2. Fix FastMCP 3.1.0 API compatibility
  3. Document MongoDB support in README
  4. Upgrade to FastMCP 3.1.0 and dependencies
  5. Update FastMCP badge to v3.1.0

Testing

  • ✅ Server starts successfully with FastMCP 3.1.0
  • ✅ MongoDB operations verified manually

Janek Lepik added 5 commits February 28, 2026 20:59
- Add execute_mongodb_query() tool with automatic JSON conversion for aggregation pipelines
- Add create_mongodb_card() tool for MongoDB-specific question cards
- Use Context parameter for proper logging and error handling
- Follow upstream's ToolError and middleware patterns
- Supports MongoDB collections with native query execution

These changes enable proper MongoDB querying via MCP while maintaining
compatibility with upstream's FastMCP 2.12.0 architecture improvements.
- Change on_duplicate_tools/resources/prompts to unified on_duplicate parameter
- FastMCP 3.1.0 simplified duplicate handling API
- Server now starts successfully with latest FastMCP version
- Add execute_mongodb_query to Query Operations section
- Add create_mongodb_card to Card Management section
- Highlight MongoDB support in Key Features
- Update Natural Language Queries to mention MongoDB
- Upgrade fastmcp from 2.12.4 to 3.1.0
- Update all related dependencies (mcp 1.26.0, cyclopts 4.6.0, etc.)
- Add new dependencies required by FastMCP 3.1.0 (keyring, py-key-value-aio)
- Remove deprecated dependencies (openapi-core, werkzeug, etc.)
- Tested and verified with updated API compatibility
Reflect the upgrade from FastMCP 2.12.4 to 3.1.0 in README badge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant