back arrow Blog
DreamFactory 7.4.5 Release: MCP Aggregate Data Tool, Cursor IDE Support, and Production Stability

DreamFactory 7.4.5 Release: MCP Aggregate Data Tool, Cursor IDE Support, and Production Stability

RECOMMENDED ARTICLES

Executive Summary: DreamFactory 7.4.5 ships the aggregate_data MCP tool — a purpose-built tool that lets AI agents compute SUM, COUNT, AVG , MIN, and MAX directly on the database server in a single call. This release also adds Cursor IDE OAuth compatibility, a desktop OAuth success page for smoother onboardin g, server-side aggregate expression support across all SQL connectors, and critical MCP daemon stability improvements including request timeout guards and global error han dlers.

Why Server-Side Aggregation Changes Everything for AI Agents

Before 7.4.5, an AI agent connected to a DreamFactory MCP server that needed to answer "What is our total revenue by region?" had one option: fetch every row from the o rders table, paginate through potentially millions of records, and compute the totals itself. This was slow, token-expensive, and error-prone for large datasets. As a secu re, self-hosted enterprise data access platform that provides governed API access to any data source, connecting enterprise applications and on-prem LLMs with role-based a ccess and identity passthrough, DreamFactory is uniquely positioned to solve this — the platform already sits between the AI agent and the database, and it already speaks SQL. The missing piece was a dedicated MCP tool that pushes aggregation logic down to the database engine where it belongs.

That missing piece is now in place. The new aggregate_data tool accepts a table name, a list of aggregate functions, optional grouping columns, and an opti onal filter — and returns computed results in a single response. No pagination. No row-level data transfer. No client-side math. The database does what databases are built to do.

New Feature: The aggregate_data MCP Tool

The aggregate_data tool is available on every database service connected to the DreamFactory MCP server. It supports five standard SQL aggregate functions:

  • SUM — Total a numeric column (e.g., total order value, total hours logged)
  • COUNT — Count rows or non-null values (use * for row counts)
  • AVG — Compute averages (e.g., average transaction size, average response time)
  • MIN — Find the smallest value (e.g., earliest date, lowest price)
  • MAX — Find the largest value (e.g., most recent login, highest salary)

How It Works

Each tool call accepts four parameters:

  • tableName — The table to aggregate (required)
  • aggregates — An array of aggregate operations, each specifying a function, field, and optional alias (required)
  • groupBy — An array of column names to group results by (optional)
  • filter — A filter expression using the same syntax as get_table_data to narrow rows before aggregating (optional)

For example, an AI agent can compute total revenue by country with a single call:

aggregate_data({
  tableName: "orders",
  aggregates: [
    { function: "SUM", field: "totalamount", alias: "revenue" }
  ],
  groupBy: ["country"],
  filter: "order_date >= '2025-01-01'"
})

The database computes the grouped sums and returns only the aggregated results — not the underlying rows. For a table with 10 million orders across 50 countries, this r eturns 50 rows instead of 10 million.

Smarter Tool Descriptions

DreamFactory 7.4.5 also updates the MCP tool descriptions to actively steer AI agents toward aggregate_data when they need analytical answers. The ge t_table_data tool description now explicitly states that it should not be used for aggregation. The aggregate_data description includes concrete exampl es showing the correct syntax for common analytical patterns (revenue by region, counts by category, averages by status). This guidance helps AI agents select the right to ol on the first attempt, reducing unnecessary API calls and improving response quality.

New Feature: Server-Side Aggregate Expressions in the SQL Fields Parameter

Independent of the MCP tool, DreamFactory's REST API now supports aggregate expressions directly in the fields query parameter for all SQL database connect ors. This means any API consumer — not just MCP agents — can request aggregated results:

GET /api/v2/db/_table/orders?fields=country,SUM(totalamount)&group=country

This applies to every SQL database connector in DreamFactory: MySQL, PostgreSQL, SQL Server, Oracle, Snowflake, SQLite, Firebird, IBM Db2, and others. The GROUP and FIELDS option descriptions have been updated across the API documentation to reflect this new capability.

MCP Desktop Client Improvements

Cursor IDE OAuth Support

DreamFactory 7.4.5 resolves OAuth compatibility issues that prevented Cursor IDE from connecting to DreamFactory MCP servers. The fix addresses duplicate scope keys in OAuth authorization code requests and corrects the OAuth flow for Cursor's specific client implementation. Teams using Cursor as their development environment can now connect to DreamFactory MCP servers alongside teams already using Claude Desktop.

OAuth Success Page

After completing the OAuth flow in a desktop MCP client, users previously saw a blank browser tab — leaving them uncertain whether authentication succeeded. DreamFactor y 7.4.5 adds a post-redirect success page that confirms the connection was established. This is a small but meaningful improvement for the onboarding experience across Cla ude Desktop, Cursor, and any future MCP desktop clients that use browser-based OAuth.

MCP Server Stability and Reliability

This release includes three changes that harden the MCP daemon for production deployments where uptime matters:

Request Timeout Guards

MCP daemon requests to the DreamFactory backend now have explicit timeout guards. Previously, if a backend request hung (due to a slow query, network issue, or unrespon sive service), the PHP worker handling that MCP session would lock up indefinitely. With timeout guards in place, hung requests are terminated after a configurable thresho ld, freeing the worker to handle new requests and preventing cascading resource exhaustion.

Global Error Handlers

The MCP daemon now includes process-level error handlers that catch unhandled exceptions before they crash the Node.js process. In previous versions, an unexpected erro r in any code path — a malformed response, a network hiccup, a race condition — could terminate the entire daemon, disconnecting all active MCP sessions. Global error hand lers ensure the daemon stays running and logs the error for investigation.

Custom Tool Auth Header Injection

When admins define custom MCP tools that call DreamFactory-hosted services, the daemon now automatically injects the authenticated user's DreamFactory session headers i nto the outbound request. This means custom tools targeting internal DreamFactory APIs no longer require separate authentication configuration — they inherit the caller's session context, respecting the same role-based access controls that govern all other DreamFactory API access.

Admin UI and Platform Fixes

Non-Sysadmin Database Filtering

DreamFactory 7.4.5 fixes edge cases in how the admin UI filters visible database services for non-sysadmin users. Previously, certain database services could be incorre ctly shown or hidden depending on the user's assigned role configuration. The filtering logic now correctly evaluates all role-based service access rules, ensuring non-adm in users see exactly the services their role permits — no more, no less.

OAuth Redirect State Fix

Resolved an issue where a stale OAuth redirect URL stored in the browser could cause the admin login screen to become stuck between states, rendering the UI unresponsiv e after an OAuth redirect. The admin UI now detects and cleans up stale redirect URLs, preventing the stuck-state condition.

Monolog v3 Log Level Compatibility

Fixed a compatibility issue with Monolog v3 where log levels were passed as strings instead of the integer values that Monolog v3 expects. This resolves logging failure s and ensures all DreamFactory log entries are correctly recorded in environments running Monolog v3.

Upgrade Notes

DreamFactory 7.4.5 is a drop-in upgrade from 7.4.4:

  • The aggregate_data MCP tool is automatically available on all database services connected to your MCP server. No configuration changes are required.
  • The server-side aggregate expression support in the REST API fields parameter is fully backward-compatible — existing queries are unaffected.
  • Cursor IDE users can now connect to DreamFactory MCP servers using the standard OAuth flow. No special configuration is needed.
  • For Docker deployments, update your image tag to 7.4.5 and restart. For manual installations, pull the latest code and run composer install.
  • No new database migrations are required for this release.

Frequently Asked Questions

What is the aggregate_data MCP tool and why does it matter?

The aggregate_data tool lets AI agents connected to DreamFactory's MCP server compute SUM, COUNT, AVG, MIN, and MAX directly on the database server. Before this tool, an agent answering "What is the total revenue by region?" had to fetch every row via get_table_data, paginate through the full result set, and com pute the aggregation itself. With aggregate_data, the database performs the computation and returns only the grouped results — turning a multi-call, high-late ncy operation into a single, sub-second tool call. This is particularly important for enterprise databases where tables contain millions of rows.

Does the aggregate tool work with all database types?

The aggregate_data MCP tool works with every SQL database connector in DreamFactory, including MySQL, PostgreSQL, SQL Server, Oracle, Snowflake, SQLite, Fi rebird, IBM Db2, SAP HANA, and others. The tool translates aggregate requests into the appropriate SQL syntax for each database engine. For NoSQL databases like MongoDB, a ggregation support depends on the connector's capabilities.

Can I use DreamFactory's MCP server with Cursor IDE now?

Yes. DreamFactory 7.4.5 resolves the OAuth compatibility issues that previously prevented Cursor from completing the MCP authentication flow. You can now connect Cursor to your DreamFactory MCP server using the same OAuth-based setup used for Claude Desktop. After authentication completes, you will see a new success confirmation page in your browser instead of the previous blank tab.

What is DreamFactory?

DreamFactory is a self-hosted platform providing governed API access to any data source for enterprise apps and local LLMs. It automatically generates REST APIs for dat abases — including MySQL, PostgreSQL, SQL Server, Oracle, MongoDB, Snowflake, and dozens more — and exposes them through REST, OpenAPI, and the Model Context Protocol (MCP ). DreamFactory applies role-based access controls, rate limiting, and audit logging to every API call, giving enterprises a governed data access layer between their appli cations (or AI agents) and their databases.

What MCP stability improvements are in this release?

DreamFactory 7.4.5 adds request timeout guards that prevent PHP worker lockups when backend requests hang, global error handlers that keep the MCP daemon running throug h unexpected exceptions, and automatic auth header injection for custom tools calling DreamFactory-hosted APIs. Together, these changes make the MCP daemon significantly m ore resilient for production deployments where continuous uptime is required.

How do I upgrade to DreamFactory 7.4.5?

For Docker deployments, update your image tag to 7.4.5 and restart the container. For manual installations, pull the latest code and run composer ins tall. No database migrations are required for this release. The new aggregate_data tool, Cursor IDE support, and all stability improvements are availab le immediately after upgrading.