Skip to main content
Glama

MongoDB MCP Server

Official
by mongodb-js
keychain.ts1.24 kB
import type { Secret } from "mongodb-redact"; export type { Secret } from "mongodb-redact"; /** * This class holds the secrets of a single server. Ideally, we might want to have a keychain * per session, but right now the loggers are set up by server and are not aware of the concept * of session and this would require a bigger refactor. * * Whenever we identify or create a secret (for example, Atlas login, CLI arguments...) we * should register them in the root Keychain (`Keychain.root.register`) or preferably * on the session keychain if available `this.session.keychain`. **/ export class Keychain { private secrets: Secret[]; private static rootKeychain: Keychain = new Keychain(); constructor() { this.secrets = []; } static get root(): Keychain { return Keychain.rootKeychain; } register(value: Secret["value"], kind: Secret["kind"]): void { this.secrets.push({ value, kind }); } clearAllSecrets(): void { this.secrets = []; } get allSecrets(): Secret[] { return [...this.secrets]; } } export function registerGlobalSecretToRedact(value: Secret["value"], kind: Secret["kind"]): void { Keychain.root.register(value, kind); }

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