Obtain your MongoDB connection details
Gather your MongoDB URI. This will look like:
mongodb://<username>:<password>@<host>:<port>/<database>
<username>
: Your MongoDB username
<password>
: Your MongoDB password
<host>
: Hostname or IP address of your MongoDB server
<port>
: Port number (default is 27017
)
<database>
: Name of your MongoDB database
(Optional) Decide if you want read-only mode
- If you want to prevent all write operations, enable read-only mode by setting
MCP_MONGODB_READONLY
to "true"
.
- Leave this value unset or set to
"false"
if you need write access.
Go to the FastMCP connection interface
- Click the "Install Now" button for the MCP MongoDB Server integration.
- In the FastMCP connection setup interface, you will see fields for environment variables.
Fill in the required environment variables:
MCP_MONGODB_URI:
Paste your MongoDB URI in this field.
MCP_MONGODB_READONLY (optional):
Set to "true"
for read-only access, or leave blank/false to allow write operations.
Save and finish the configuration
- Click "Save" or "Connect" (button label may vary).
- The MCP MongoDB Server integration should now be ready to use with the provided credentials.
Example setup
- MCP_MONGODB_URI:
mongodb://muhammed:kilic@localhost:27017/database
- MCP_MONGODB_READONLY:
true
You are now ready to connect and use your MongoDB server through the MCP integration.