Skip to content

Commit 520710e

Browse files
committed
fix: address comments
1 parent 696a5f9 commit 520710e

File tree

10 files changed

+14
-15
lines changed

10 files changed

+14
-15
lines changed

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,11 @@ The MongoDB MCP Server can be configured using multiple methods, with the follow
162162

163163
### Configuration Options
164164

165-
| Option | Description |
166-
| ------------------ | --------------------------------------------------------------------------- |
167-
| `apiClientId` | Atlas API client ID for authentication |
168-
| `apiClientSecret` | Atlas API client secret for authentication |
169-
| `stateFile` | Path to store application state (default ~/.mongodb/mongodb-mcp/state.json) |
170-
| `connectionString` | MongoDB connection string for direct database connections |
165+
| Option | Description |
166+
| ------------------ | --------------------------------------------------------------------------------------------------------------------- |
167+
| `apiClientId` | Atlas API client ID for authentication |
168+
| `apiClientSecret` | Atlas API client secret for authentication |
169+
| `connectionString` | MongoDB connection string for direct database connections (optional users may choose to inform it on every tool call) |
171170

172171
### Atlas API Access
173172

src/tools/atlas/atlasTool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export abstract class AtlasToolBase extends ToolBase {
1010
super(state);
1111
}
1212

13-
protected async ensureAuthenticated(): Promise<void> {
13+
protected ensureAuthenticated(): void {
1414
if (!this.apiClient) {
1515
throw new Error(
1616
"Not authenticated make sure to configure MCP server with MDB_MCP_API_CLIENT_ID and MDB_MCP_API_CLIENT_SECRET environment variables."

src/tools/atlas/createAccessList.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export class CreateAccessListTool extends AtlasToolBase {
2626
comment,
2727
currentIpAddress,
2828
}: ToolArgs<typeof this.argsShape>): Promise<CallToolResult> {
29-
await this.ensureAuthenticated();
29+
this.ensureAuthenticated();
3030

3131
if (!ipAddresses?.length && !cidrBlocks?.length && !currentIpAddress) {
3232
throw new Error("One of ipAddresses, cidrBlocks, currentIpAddress must be provided.");

src/tools/atlas/createDBUser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export class CreateDBUserTool extends AtlasToolBase {
3333
roles,
3434
clusters,
3535
}: ToolArgs<typeof this.argsShape>): Promise<CallToolResult> {
36-
await this.ensureAuthenticated();
36+
this.ensureAuthenticated();
3737

3838
const input = {
3939
groupId: projectId,

src/tools/atlas/createFreeCluster.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class CreateFreeClusterTool extends AtlasToolBase {
1414
};
1515

1616
protected async execute({ projectId, name, region }: ToolArgs<typeof this.argsShape>): Promise<CallToolResult> {
17-
await this.ensureAuthenticated();
17+
this.ensureAuthenticated();
1818

1919
const input = {
2020
groupId: projectId,

src/tools/atlas/inspectAccessList.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export class InspectAccessListTool extends AtlasToolBase {
1111
};
1212

1313
protected async execute({ projectId }: ToolArgs<typeof this.argsShape>): Promise<CallToolResult> {
14-
await this.ensureAuthenticated();
14+
this.ensureAuthenticated();
1515

1616
const accessList = await this.apiClient!.listProjectIpAccessLists({
1717
params: {

src/tools/atlas/inspectCluster.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export class InspectClusterTool extends AtlasToolBase {
1313
};
1414

1515
protected async execute({ projectId, clusterName }: ToolArgs<typeof this.argsShape>): Promise<CallToolResult> {
16-
await this.ensureAuthenticated();
16+
this.ensureAuthenticated();
1717

1818
const cluster = await this.apiClient!.getCluster({
1919
params: {

src/tools/atlas/listClusters.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export class ListClustersTool extends AtlasToolBase {
1212
};
1313

1414
protected async execute({ projectId }: ToolArgs<typeof this.argsShape>): Promise<CallToolResult> {
15-
await this.ensureAuthenticated();
15+
this.ensureAuthenticated();
1616

1717
if (!projectId) {
1818
const data = await this.apiClient!.listClustersForAllProjects();

src/tools/atlas/listDBUsers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export class ListDBUsersTool extends AtlasToolBase {
1212
};
1313

1414
protected async execute({ projectId }: ToolArgs<typeof this.argsShape>): Promise<CallToolResult> {
15-
await this.ensureAuthenticated();
15+
this.ensureAuthenticated();
1616

1717
const data = await this.apiClient!.listDatabaseUsers({
1818
params: {

src/tools/atlas/listProjects.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export class ListProjectsTool extends AtlasToolBase {
77
protected argsShape = {};
88

99
protected async execute(): Promise<CallToolResult> {
10-
await this.ensureAuthenticated();
10+
this.ensureAuthenticated();
1111

1212
const data = await this.apiClient!.listProjects();
1313

0 commit comments

Comments
 (0)