Skip to main content
Glama

MongoDB MCP Server

Official
by mongodb-js
keychain.test.ts1.23 kB
import { Keychain, registerGlobalSecretToRedact } from "../../../src/common/keychain.js"; import { describe, beforeEach, afterEach, it, expect } from "vitest"; describe("Keychain", () => { let keychain: Keychain; beforeEach(() => { keychain = Keychain.root; keychain.clearAllSecrets(); }); afterEach(() => { keychain.clearAllSecrets(); }); it("should register a new secret", () => { keychain.register("123456", "password"); expect(keychain.allSecrets).toEqual([{ value: "123456", kind: "password" }]); }); it("should remove cleared secrets", () => { keychain.register("123456", "password"); expect(keychain.allSecrets).toEqual([{ value: "123456", kind: "password" }]); keychain.clearAllSecrets(); keychain.register("654321", "user"); expect(keychain.allSecrets).toEqual([{ value: "654321", kind: "user" }]); }); describe("registerGlobalSecretToRedact", () => { it("registers the secret in the root keychain", () => { registerGlobalSecretToRedact("123456", "password"); expect(keychain.allSecrets).toEqual([{ value: "123456", kind: "password" }]); }); }); });

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mongodb-js/mongodb-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server