JSON Export Tool for Query Results

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 0.3.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Needed
    • Hide

      In short:

      • We need to update the Tools page to include the new tool export and little info on what it does
      • We need to add a Resources page, where there will be an "exported-data" resource that helps in retrieving the data exported by the export tool.
      • We need to update the config page to include the new export related config parameters, also mentioned below.

      export tool:

      There is a new tool called export, capable for exporting a `find` results and  `aggregate` results. The tool supports the currently supported parameters of the `find` tool and the same for `aggregate` tool. When called, with the correct parameters, the export tool will start the export process and return immediately (without waiting for export to finish) the export handle which contains:

      • exportName: The unique name of export generated by export tool
      • exportURI: The resource URI at which the exported data will be made available
      • exportPath (optionally): Only when the server and clients are running on the same machine, we return the local path of the exported data to make it easier for clients to access the exported data right away.

      exported-data Resource:

      There is a new template resource called exported-data which takes the following URI:

      exported-data://{exportName}

      where exportName is the unique name of the export generated by the export tool, its a MongoDB ObjectId.

      User can access the exported-data resource with the correct exportName and attach it to the LLM context to perform further analysis or have it written to their local path.

      Flow:

      • LLM calls find tool passing the required parameters either for generating a `find` cursor or an `aggregate` cursor.
      • The MCP server generates the export and dumps it on the configured exports directory (defaults to $HOME/.mongodb/mongodb-mcp/exports). The exported data is marked with an expiry using the configured timeout in ms (defaults to 
        300000 or 5 minutes)
      • A clean up interval runs in the background attempting to clean up expired exports, in the configured interval (defaults to 
        120000 or 2 minutes)
      • Once the export is generated, a resource list changed notification is published by the MCP server which notifies clients that new resources are available.
      • Clients updates their knowledge of available resources and eventually are made aware of the new exported-data resource.
      • User, through client, then can make use of the exported-data resource to retrieve the exported data while it is not expired. Once the data is expired, we throw an error for resource not found.
      Show
      In short: We need to update the Tools page to include the new tool export and little info on what it does We need to add a Resources page, where there will be an "exported-data" resource that helps in retrieving the data exported by the export tool. We need to update the config page to include the new export related config parameters, also mentioned below. export tool: There is a new tool called export, capable for exporting a `find` results and  `aggregate` results. The tool supports the currently supported parameters of the `find` tool and the same for `aggregate` tool. When called, with the correct parameters, the export tool will start the export process and return immediately (without waiting for export to finish) the export handle which contains: exportName: The unique name of export generated by export tool exportURI: The resource URI at which the exported data will be made available exportPath (optionally): Only when the server and clients are running on the same machine, we return the local path of the exported data to make it easier for clients to access the exported data right away. exported-data Resource: There is a new template resource called exported-data which takes the following URI: exported-data://{exportName} where exportName is the unique name of the export generated by the export tool, its a MongoDB ObjectId. User can access the exported-data resource with the correct exportName and attach it to the LLM context to perform further analysis or have it written to their local path. Flow: LLM calls find tool passing the required parameters either for generating a `find` cursor or an `aggregate` cursor. The MCP server generates the export and dumps it on the configured exports directory (defaults to $HOME/.mongodb/mongodb-mcp/exports). The exported data is marked with an expiry using the configured timeout in ms (defaults to  300000 or 5 minutes) A clean up interval runs in the background attempting to clean up expired exports, in the configured interval (defaults to  120000 or 2 minutes) Once the export is generated, a resource list changed notification is published by the MCP server which notifies clients that new resources are available. Clients updates their knowledge of available resources and eventually are made aware of the new exported-data resource. User, through client, then can make use of the exported-data resource to retrieve the exported data while it is not expired. Once the data is expired, we throw an error for resource not found.

          Assignee:
          Himanshu Singh
          Reporter:
          Gaurab Aryal
          Votes:
          0 Vote for this issue
          Watchers:
          1 Start watching this issue

            Created:
            Updated:
            Resolved: