mcpField
M
MCP Server with MongoDB Integration

MCP Server with MongoDB Integration

Local
github.com/sven-oldingDatabases1Updated 78w ago

About MCP Server with MongoDB Integration

An MCP server for querying MongoDB databases. It offers collection listing and filtered queries, with connection settings configurable through environment variables.

Key features

  1. 01Query collections with filters
  2. 02Set a result limit
  3. 03List database collections
  4. 04Configure connection via environment variables

Use cases

  1. 01Inspect documents matching a MongoDB filter
  2. 02Check which collections exist in a database

MCP support

Exposes MongoDB collection listing and filtered queries as tools for MCP clients.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

MCP Server with MongoDB Integration

This is an MCP server that provides tools for querying MongoDB data.

Setup

  1. Install dependencies using uv:
uv pip install -e .
  1. Configure MongoDB connection:
    • The server will connect to MongoDB at mongodb://localhost:27017 by default
    • You can change the connection details by setting environment variables:
      • MONGODB_URI: MongoDB connection string
      • MONGODB_DATABASE: Database name

Running the Server

python main.py

Available Tools

1. query_mongodb

Query a MongoDB collection with a filter.

Parameters:

  • collection (string): Name of the collection to query
  • query (object): MongoDB query filter
  • limit (integer, optional): Maximum number of results to return (default: 10)

Example:

{
    "collection": "users",
    "query": {"age": {"$gt": 18}},
    "limit": 5
}
2. list_collections

List all collections in the database.

No parameters required.

Development

To add new dependencies:

uv pip install <package-name>

To update dependencies:

uv pip install --upgrade <package-name>

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.