The MongoDB MCP Server export tool outputs the results of a query or aggregation pipeline to an EJSON data file.
The exported results are saved to a file on the computer that runs the
MCP Server. You can also access the exported data through the
exported-data
resource using the AI client application.
Export Directory Path
The following table shows the default directory paths where the MCP Server temporarily stores the exported data files:
Operating System | Default Directory Path |
---|---|
Windows |
|
macOS and Linux |
|
To change the export directory path, set one of these:
exportsPath
option in a JSON configuration file or command lineMDB_MCP_EXPORTS_PATH
environment variable
To view the JSON configuration file options, see MongoDB MCP Server Configuration Options. To view JSON configuration file examples, see Get Started with the MongoDB MCP Server.
The exportTimeoutMs
configuration option specifies the time after
which the exported data is eligible for deletion.
The exportCleanupIntervalMs
configuration option specifies the time
interval between runs of the cleanup process that deletes expired
export files.
For an export example, see Export Output to File.