Skip to content
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
0d44997
feat: add structured content for response in mongodb tools connect an…
dudaschar Jun 15, 2026
519407e
feat: add structured content for response in mongodb tool aggregate
dudaschar Jun 15, 2026
547c185
feat: add structured content for response in mongodb tool aggregateDB
dudaschar Jun 15, 2026
f5956af
feat: add structured content for response in mongodb tool count
dudaschar Jun 15, 2026
023b305
feat: add structured content for response in mongodb tool export
dudaschar Jun 15, 2026
21552cf
feat: add structured content for response in mongodb tool find
dudaschar Jun 15, 2026
01d0b67
refactor: unify ToolResult structure across MongoDB tools and remove …
dudaschar Jun 15, 2026
17e0ba7
Merge branch 'main' into MCP-374-structuredContent
dudaschar Jun 16, 2026
b6bb107
feat: add BSON to JSON serialization helper functions and integrate i…
dudaschar Jun 16, 2026
122c2a5
refactor: update document serialization in MongoDB tools to use JSON.…
dudaschar Jun 16, 2026
ef07952
docs: update public api docs with new output schema for structuredCon…
dudaschar Jun 16, 2026
0f9592b
refactor: remove unused output type definitions from MongoDB tools an…
dudaschar Jun 16, 2026
329d5bf
feat: enhance ConnectDeploymentTool with structured output schema and…
dudaschar Jun 17, 2026
061ea01
feat: implement structured output for CreateDeploymentTool and update…
dudaschar Jun 17, 2026
166f144
feat: implement structured output for DeleteDeploymentTool and update…
dudaschar Jun 17, 2026
11da0b5
feat: implement structured output for ListDeploymentsTool and update …
dudaschar Jun 17, 2026
b9f4b86
docs: update public api docs after output changes
dudaschar Jun 17, 2026
273051c
refactor: remove unused ListDeploymentsOutput type and update related…
dudaschar Jun 17, 2026
92a54b1
refactor: replace serializeBsonToJsonObjects with bsonToJson in Mongo…
dudaschar Jun 25, 2026
17c4b2f
refactor: revert export tool to main version
dudaschar Jun 25, 2026
3cf728f
refactor: update CURSOR_LIMIT_KEYS to use zod enum for improved type …
dudaschar Jun 25, 2026
3b4a6f9
refactor: rename aggResultsCount to count in aggregation output schema
dudaschar Jun 25, 2026
d1ccd42
Merge branch 'main' into MCP-374-structuredContent
dudaschar Jun 25, 2026
3cd5e3d
refactor: simplify document serialization in aggregation output by di…
dudaschar Jun 25, 2026
b434f1c
refactor: update CountOutputSchema to make count a required field
dudaschar Jun 25, 2026
31e3119
test: enhance bsonToJson tests to cover additional BSON types and JSO…
dudaschar Jun 25, 2026
75d4895
refactor: export FindOutputSchema and enhance structured content vali…
dudaschar Jun 25, 2026
912bb62
refactor: streamline appliedLimits handling in find tool
dudaschar Jun 25, 2026
38ee72c
refactor: simplify expectAggregateStructuredContent function by remov…
dudaschar Jun 25, 2026
57d8a47
Merge branch 'MCP-374-structuredContent' into MCP-374-structuredConte…
dudaschar Jun 25, 2026
1e44697
refactor: update resolveTelemetryMetadata method to use CallToolResult
dudaschar Jun 25, 2026
53dad36
refactor: update AggregateOutputSchema to allow 'indeterminate' as a …
dudaschar Jun 25, 2026
d22db29
docs: update public api documentation
dudaschar Jun 25, 2026
bcb4199
Merge branch 'main' into MCP-374-structuredContent
dudaschar Jun 25, 2026
e52ba42
Merge branch 'main' into MCP-374-structuredContent
dudaschar Jun 26, 2026
6d5931e
Merge branch 'MCP-374-structuredContent' into MCP-374-structuredConte…
dudaschar Jun 26, 2026
e6a2aae
docs: update public api docs with new output format
dudaschar Jun 26, 2026
e2426b2
fix: resolve conflict in AggregateTool outputSchema count type
dudaschar Jun 26, 2026
dd3795a
chore: release mongodb-mcp-server v1.14.0-prerelease.0 (#1286)
mongodb-devtools-bot[bot] Jun 26, 2026
c07449e
docs(atlas): clarify atlas-list-alerts returns triggered alerts, not …
blva Jun 26, 2026
4233f97
Merge branch 'main' into MCP-374-structuredContent-atlas-local
dudaschar Jun 29, 2026
e2d5a69
fix: remove error handle override from connect tool
dudaschar Jun 29, 2026
efe9a60
fix: wait for connection string when creating a deployment (#1291)
nirinchev Jun 29, 2026
75804f1
fix: mongot healtcheck failures (#1292)
nirinchev Jun 29, 2026
c17770b
ci: Integrate Braintrust eval suite CLOUDP-367319 (#1274)
nima-taheri-mongodb Jun 30, 2026
5c33bc0
Merge branch 'main' into MCP-374-structuredContent-atlas-local
dudaschar Jun 30, 2026
793a2f1
Merge branch 'main' into MCP-374-structuredContent-atlas-local
dudaschar Jun 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 99 additions & 24 deletions api-extractor/reports/tools.public.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ import { z } from 'zod';
import { ZodDefault } from 'zod';
import { ZodOptional } from 'zod';
import type { ZodRawShape } from 'zod';
import { ZodRecord } from 'zod';
import { ZodString } from 'zod';
import { ZodUnknown } from 'zod';

// @public (undocumented)
export class AggregateDBTool extends MongoDBToolBase {
Expand All @@ -45,10 +43,20 @@ export class AggregateDBTool extends MongoDBToolBase {
// (undocumented)
description: string;
// (undocumented)
protected execute(input: ToolArgs<typeof AggregateDBTool.argsShape>, input2: ToolExecutionContext): Promise<CallToolResult>;
protected execute(input: ToolArgs<typeof AggregateDBTool.argsShape>, input2: ToolExecutionContext): Promise<ToolResult<typeof AggregateDBTool.outputSchema>>;
// (undocumented)
static operationType: OperationType;
// (undocumented)
outputSchema: {
documents: z.ZodArray<z.ZodUnknown>;
aggResultsCount: z.ZodOptional<z.ZodNumber>;
appliedLimits: z.ZodArray<z.ZodEnum<{
"config.maxDocumentsPerQuery": "config.maxDocumentsPerQuery";
"config.maxBytesPerQuery": "config.maxBytesPerQuery";
"tool.responseBytesLimit": "tool.responseBytesLimit";
}>>;
};
// (undocumented)
static toolName: string;
}

Expand Down Expand Up @@ -90,10 +98,20 @@ export class AggregateTool extends MongoDBToolBase {
// (undocumented)
description: string;
// (undocumented)
protected execute(input: ToolArgs<typeof AggregateTool.argsShape>, input2: ToolExecutionContext): Promise<CallToolResult>;
protected execute(input: ToolArgs<typeof AggregateTool.argsShape>, input2: ToolExecutionContext): Promise<ToolResult<typeof AggregateTool.outputSchema>>;
// (undocumented)
static operationType: OperationType;
// (undocumented)
outputSchema: {
documents: z.ZodArray<z.ZodUnknown>;
aggResultsCount: z.ZodOptional<z.ZodNumber>;
appliedLimits: z.ZodArray<z.ZodEnum<{
"config.maxDocumentsPerQuery": "config.maxDocumentsPerQuery";
"config.maxBytesPerQuery": "config.maxBytesPerQuery";
"tool.responseBytesLimit": "tool.responseBytesLimit";
}>>;
};
// (undocumented)
static toolName: string;
}

Expand Down Expand Up @@ -247,19 +265,24 @@ export class ConnectClusterTool extends AtlasToolBase {
export class ConnectDeploymentTool extends AtlasLocalToolBase {
// (undocumented)
argsShape: {
deploymentName: ZodString;
deploymentName: z.ZodString;
};
// (undocumented)
description: string;
// (undocumented)
protected executeWithAtlasLocalClient(input: ToolArgs<typeof ConnectDeploymentTool.argsShape>, input2: {
client: Client;
}): Promise<CallToolResult>;
}): Promise<ToolResult<typeof ConnectDeploymentOutputSchema> & Pick<CallToolResult, "_meta">>;
// (undocumented)
static operationType: OperationType;
// (undocumented)
protected resolveTelemetryMetadata(args: ToolArgs<typeof ConnectDeploymentTool.argsShape>, input: {
result: CallToolResult;
outputSchema: {
connected: z.ZodBoolean;
deploymentName: z.ZodString;
};
// (undocumented)
protected resolveTelemetryMetadata(_args: ToolArgs<typeof ConnectDeploymentTool.argsShape>, input: {
result: ToolResult<typeof ConnectDeploymentOutputSchema>;
}): ConnectionMetadata;
// (undocumented)
static toolName: string;
Expand All @@ -275,10 +298,16 @@ export class ConnectTool extends MongoDBToolBase {
// (undocumented)
description: string;
// (undocumented)
protected execute(input: ToolArgs<typeof ConnectTool.argsShape>): Promise<CallToolResult>;
protected execute(input: ToolArgs<typeof ConnectTool.argsShape>): Promise<ToolResult<typeof ConnectTool.outputSchema>>;
// (undocumented)
protected handleError(error: unknown, args: ToolArgs<typeof ConnectTool.argsShape>): Promise<CallToolResult>;
// (undocumented)
static operationType: OperationType;
// (undocumented)
outputSchema: {
connected: z.ZodBoolean;
};
// (undocumented)
register(server: Server): boolean;
// (undocumented)
static toolName: string;
Expand All @@ -288,17 +317,21 @@ export class ConnectTool extends MongoDBToolBase {
export class CountTool extends MongoDBToolBase {
// (undocumented)
argsShape: {
query: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
collection: ZodString;
database: ZodString;
query: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
collection: z.ZodString;
database: z.ZodString;
};
// (undocumented)
description: string;
// (undocumented)
protected execute(input: ToolArgs<typeof CountTool.argsShape>, input2: ToolExecutionContext): Promise<CallToolResult>;
protected execute(input: ToolArgs<typeof CountTool.argsShape>, input2: ToolExecutionContext): Promise<ToolResult<typeof CountTool.outputSchema>>;
// (undocumented)
static operationType: OperationType;
// (undocumented)
outputSchema: {
count: z.ZodOptional<z.ZodNumber>;
};
// (undocumented)
static toolName: string;
}

Expand Down Expand Up @@ -480,10 +513,17 @@ export class CreateDeploymentTool extends AtlasLocalToolBase {
// (undocumented)
protected executeWithAtlasLocalClient(input: ToolArgs<typeof CreateDeploymentTool.argsShape>, input2: {
client: Client;
}): Promise<CallToolResult>;
}): Promise<ToolResult<typeof CreateDeploymentOutputSchema> & Pick<CallToolResult, "_meta">>;
// (undocumented)
static operationType: OperationType;
// (undocumented)
outputSchema: {
deploymentName: z.ZodString;
containerId: z.ZodString;
loadSampleData: z.ZodBoolean;
imageTag: z.ZodString;
};
// (undocumented)
static toolName: string;
}

Expand Down Expand Up @@ -643,17 +683,22 @@ export class DbStatsTool extends MongoDBToolBase {
export class DeleteDeploymentTool extends AtlasLocalToolBase {
// (undocumented)
argsShape: {
deploymentName: ZodString;
deploymentName: z.ZodString;
};
// (undocumented)
description: string;
// (undocumented)
protected executeWithAtlasLocalClient(input: ToolArgs<typeof DeleteDeploymentTool.argsShape>, input2: {
client: Client;
}): Promise<CallToolResult>;
}): Promise<ToolResult<typeof DeleteDeploymentOutputSchema> & Pick<CallToolResult, "_meta">>;
// (undocumented)
static operationType: OperationType;
// (undocumented)
outputSchema: {
deleted: z.ZodBoolean;
deploymentName: z.ZodString;
};
// (undocumented)
static toolName: string;
}

Expand Down Expand Up @@ -919,10 +964,18 @@ export class ExportTool extends MongoDBToolBase {
// (undocumented)
description: string;
// (undocumented)
protected execute(input: ToolArgs<typeof ExportTool.argsShape>, input2: ToolExecutionContext): Promise<CallToolResult>;
protected execute(input: ToolArgs<typeof ExportTool.argsShape>, input2: ToolExecutionContext): Promise<ToolResult<typeof ExportTool.outputSchema>>;
// (undocumented)
static operationType: OperationType;
// (undocumented)
outputSchema: {
type: z.ZodLiteral<"resource_link">;
name: z.ZodString;
uri: z.ZodString;
description: z.ZodString;
mimeType: z.ZodString;
};
// (undocumented)
static toolName: string;
}

Expand All @@ -943,10 +996,20 @@ export class FindTool extends MongoDBToolBase {
// (undocumented)
description: string;
// (undocumented)
protected execute(input: ToolArgs<typeof FindTool.argsShape>, input2: ToolExecutionContext): Promise<CallToolResult>;
protected execute(input: ToolArgs<typeof FindTool.argsShape>, input2: ToolExecutionContext): Promise<ToolResult<typeof FindTool.outputSchema>>;
// (undocumented)
static operationType: OperationType;
// (undocumented)
outputSchema: {
documents: z.ZodArray<z.ZodUnknown>;
queryResultsCount: z.ZodOptional<z.ZodNumber>;
appliedLimits: z.ZodArray<z.ZodEnum<{
"config.maxDocumentsPerQuery": "config.maxDocumentsPerQuery";
"config.maxBytesPerQuery": "config.maxBytesPerQuery";
"tool.responseBytesLimit": "tool.responseBytesLimit";
}>>;
};
// (undocumented)
static toolName: string;
}

Expand Down Expand Up @@ -1155,10 +1218,19 @@ export class ListDeploymentsTool extends AtlasLocalToolBase {
// (undocumented)
protected executeWithAtlasLocalClient(_args: ToolArgs<typeof ListDeploymentsTool.argsShape>, input: {
client: Client;
}): Promise<CallToolResult>;
}): Promise<ToolResult<typeof ListDeploymentsOutputSchema>>;
// (undocumented)
static operationType: OperationType;
// (undocumented)
outputSchema: {
count: z.ZodNumber;
deployments: z.ZodArray<z.ZodObject<{
name: z.ZodOptional<z.ZodString>;
state: z.ZodString;
mongodbVersion: z.ZodString;
}, z.core.$strip>>;
};
// (undocumented)
static toolName: string;
}

Expand Down Expand Up @@ -1685,10 +1757,16 @@ export class SwitchConnectionTool extends MongoDBToolBase {
// (undocumented)
description: string;
// (undocumented)
protected execute(input: ToolArgs<typeof SwitchConnectionTool.argsShape>): Promise<CallToolResult>;
protected execute(input: ToolArgs<typeof SwitchConnectionTool.argsShape>): Promise<ToolResult<typeof SwitchConnectionTool.outputSchema>>;
// (undocumented)
protected handleError(error: unknown, args: ToolArgs<typeof SwitchConnectionTool.argsShape>): Promise<CallToolResult>;
// (undocumented)
static operationType: OperationType;
// (undocumented)
outputSchema: {
connected: z.ZodBoolean;
};
// (undocumented)
register(server: Server): boolean;
// (undocumented)
static toolName: string;
Expand Down Expand Up @@ -1778,10 +1856,7 @@ export interface ToolExecutionContext {

// @public (undocumented)
export type ToolResult<OutputSchema extends ZodRawShape | undefined = undefined> = OutputSchema extends ZodRawShape ? StructuredToolResult<OutputSchema> : {
content: {
type: "text";
text: string;
}[];
content: CallToolResult["content"];
isError?: boolean;
};

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@
"bson": "^7.2.0",
"chalk": "^5.6.2",
"express": "^5.2.1",
"hadron-document": "^8.11.5",
"jsonc-parser": "^3.3.1",
"lru-cache": "^11.2.6",
"mongodb": "^7.1.1",
Expand Down
39 changes: 37 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions src/helpers/bsonToJson.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { objectToIdiomaticEJSON } from "hadron-document";

/**
* Converts a BSON value into a JSON-safe object using Compass idiomatic Extended JSON.
*
* ObjectId becomes `{ "$oid": "..." }`, Long becomes `{ "$numberLong": "..." }`, etc.
*/
export function bsonToJson(value: Record<string, unknown>): Record<string, unknown>;
export function bsonToJson(value: unknown): unknown;
export function bsonToJson(value: unknown): unknown {
return JSON.parse(objectToIdiomaticEJSON(value));
}

/**
* Serializes an array of BSON objects.
*/
export function serializeBsonToJsonObjects(objects: unknown[]): unknown[] {
return objects.map((object) => bsonToJson(object));
}
Loading
Loading