1. Registry
  2. Packages
  3. Mongodbatlas Provider
  4. API Docs
  5. getProjectMcpConfigSecret
Viewing docs for MongoDB Atlas v4.16.0
published on Thursday, Sep 17, 2026 by Pulumi
mongodbatlas logo mongodbatlas logo
Viewing docs for MongoDB Atlas v4.16.0
published on Thursday, Sep 17, 2026 by Pulumi

    mongodbatlas.ProjectMcpConfigSecret describes an ingress secret for a Project Remote MCP Configuration. Secret values are never returned. Only masked metadata is available.

    IMPORTANT: Managing MCP Config Secrets with Terraform exposes sensitive organizational secrets in Terraform’s state. We suggest following Terraform’s best practices.

    Example Usage

    S

    import * as pulumi from "@pulumi/pulumi";
    import * as mongodbatlas from "@pulumi/mongodbatlas";
    
    const _this = mongodbatlas.getProjectMcpConfigSecret({
        projectId: projectId,
        mcpConfigId: thisMongodbatlasProjectMcpConfig.mcpConfigId,
        secretId: thisMongodbatlasProjectMcpConfigSecret.secretId,
    });
    export const secretExpiresAt = _this.then(_this => _this.expiresAt);
    
    import pulumi
    import pulumi_mongodbatlas as mongodbatlas
    
    this = mongodbatlas.get_project_mcp_config_secret(project_id=project_id,
        mcp_config_id=this_mongodbatlas_project_mcp_config["mcpConfigId"],
        secret_id=this_mongodbatlas_project_mcp_config_secret["secretId"])
    pulumi.export("secretExpiresAt", this.expires_at)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-mongodbatlas/sdk/v4/go/mongodbatlas"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		this, err := mongodbatlas.GetProjectMcpConfigSecret(ctx, &mongodbatlas.LookupProjectMcpConfigSecretArgs{
    			ProjectId:   projectId,
    			McpConfigId: thisMongodbatlasProjectMcpConfig.McpConfigId,
    			SecretId:    thisMongodbatlasProjectMcpConfigSecret.SecretId,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("secretExpiresAt", this.ExpiresAt)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Mongodbatlas = Pulumi.Mongodbatlas;
    
    return await Deployment.RunAsync(() => 
    {
        var @this = Mongodbatlas.GetProjectMcpConfigSecret.Invoke(new()
        {
            ProjectId = projectId,
            McpConfigId = thisMongodbatlasProjectMcpConfig.McpConfigId,
            SecretId = thisMongodbatlasProjectMcpConfigSecret.SecretId,
        });
    
        return new Dictionary<string, object?>
        {
            ["secretExpiresAt"] = @this.Apply(@this => @this.Apply(getProjectMcpConfigSecretResult => getProjectMcpConfigSecretResult.ExpiresAt)),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.mongodbatlas.MongodbatlasFunctions;
    import com.pulumi.mongodbatlas.inputs.GetProjectMcpConfigSecretArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var this = MongodbatlasFunctions.getProjectMcpConfigSecret(GetProjectMcpConfigSecretArgs.builder()
                .projectId(projectId)
                .mcpConfigId(thisMongodbatlasProjectMcpConfig.mcpConfigId())
                .secretId(thisMongodbatlasProjectMcpConfigSecret.secretId())
                .build());
    
            ctx.export("secretExpiresAt", this_.expiresAt());
        }
    }
    
    variables:
      this:
        fn::invoke:
          function: mongodbatlas:getProjectMcpConfigSecret
          arguments:
            projectId: ${projectId}
            mcpConfigId: ${thisMongodbatlasProjectMcpConfig.mcpConfigId}
            secretId: ${thisMongodbatlasProjectMcpConfigSecret.secretId}
    outputs:
      secretExpiresAt: ${this.expiresAt}
    
    pulumi {
      required_providers {
        mongodbatlas = {
          source = "pulumi/mongodbatlas"
        }
      }
    }
    
    data "mongodbatlas_getprojectmcpconfigsecret" "this" {
      project_id    = projectId
      mcp_config_id = thisMongodbatlasProjectMcpConfig.mcpConfigId
      secret_id     = thisMongodbatlasProjectMcpConfigSecret.secretId
    }
    
    output "secretExpiresAt" {
      value = data.mongodbatlas_getprojectmcpconfigsecret.this.expires_at
    }
    

    Using getProjectMcpConfigSecret

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getProjectMcpConfigSecret(args: GetProjectMcpConfigSecretArgs, opts?: InvokeOptions): Promise<GetProjectMcpConfigSecretResult>
    function getProjectMcpConfigSecretOutput(args: GetProjectMcpConfigSecretOutputArgs, opts?: InvokeOutputOptions): Output<GetProjectMcpConfigSecretResult>
    def get_project_mcp_config_secret(mcp_config_id: Optional[str] = None,
                                      project_id: Optional[str] = None,
                                      secret_id: Optional[str] = None,
                                      opts: Optional[InvokeOptions] = None) -> GetProjectMcpConfigSecretResult
    def get_project_mcp_config_secret_output(mcp_config_id: pulumi.Input[Optional[str]] = None,
                                      project_id: pulumi.Input[Optional[str]] = None,
                                      secret_id: pulumi.Input[Optional[str]] = None,
                                      opts: Optional[InvokeOutputOptions] = None) -> Output[GetProjectMcpConfigSecretResult]
    func LookupProjectMcpConfigSecret(ctx *Context, args *LookupProjectMcpConfigSecretArgs, opts ...InvokeOption) (*LookupProjectMcpConfigSecretResult, error)
    func LookupProjectMcpConfigSecretOutput(ctx *Context, args *LookupProjectMcpConfigSecretOutputArgs, opts ...InvokeOption) LookupProjectMcpConfigSecretResultOutput

    > Note: This function is named LookupProjectMcpConfigSecret in the Go SDK.

    public static class GetProjectMcpConfigSecret 
    {
        public static Task<GetProjectMcpConfigSecretResult> InvokeAsync(GetProjectMcpConfigSecretArgs args, InvokeOptions? opts = null)
        public static Output<GetProjectMcpConfigSecretResult> Invoke(GetProjectMcpConfigSecretInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetProjectMcpConfigSecretResult> Invoke(GetProjectMcpConfigSecretInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetProjectMcpConfigSecretResult> getProjectMcpConfigSecret(GetProjectMcpConfigSecretArgs args, InvokeOptions options)
    public static Output<GetProjectMcpConfigSecretResult> getProjectMcpConfigSecret(GetProjectMcpConfigSecretArgs args, InvokeOptions options)
    public static Output<GetProjectMcpConfigSecretResult> getProjectMcpConfigSecret(GetProjectMcpConfigSecretArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: mongodbatlas:index/getProjectMcpConfigSecret:getProjectMcpConfigSecret
      arguments:
        # arguments dictionary
    data "mongodbatlas_get_project_mcp_config_secret" "name" {
        # arguments
    }

    The following arguments are supported:

    McpConfigId string
    Unique identifier of the MCP configuration.
    ProjectId string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    SecretId string
    Unique 24-hexadecimal digit string that identifies the secret.
    McpConfigId string
    Unique identifier of the MCP configuration.
    ProjectId string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    SecretId string
    Unique 24-hexadecimal digit string that identifies the secret.
    mcp_config_id string
    Unique identifier of the MCP configuration.
    project_id string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    secret_id string
    Unique 24-hexadecimal digit string that identifies the secret.
    mcpConfigId String
    Unique identifier of the MCP configuration.
    projectId String
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    secretId String
    Unique 24-hexadecimal digit string that identifies the secret.
    mcpConfigId string
    Unique identifier of the MCP configuration.
    projectId string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    secretId string
    Unique 24-hexadecimal digit string that identifies the secret.
    mcp_config_id str
    Unique identifier of the MCP configuration.
    project_id str
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    secret_id str
    Unique 24-hexadecimal digit string that identifies the secret.
    mcpConfigId String
    Unique identifier of the MCP configuration.
    projectId String
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    secretId String
    Unique 24-hexadecimal digit string that identifies the secret.

    getProjectMcpConfigSecret Result

    The following output properties are available:

    CreatedAt string
    The date that the secret was created on. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    ExpiresAt string
    The date for the expiration of the secret. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    LastUsedAt string
    The last time the secret was used. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    MaskedSecretValue string
    The masked Service Account secret.
    McpConfigId string
    Unique identifier of the MCP configuration.
    ProjectId string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    SecretId string
    Unique 24-hexadecimal digit string that identifies the secret.
    CreatedAt string
    The date that the secret was created on. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    ExpiresAt string
    The date for the expiration of the secret. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    LastUsedAt string
    The last time the secret was used. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    MaskedSecretValue string
    The masked Service Account secret.
    McpConfigId string
    Unique identifier of the MCP configuration.
    ProjectId string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    SecretId string
    Unique 24-hexadecimal digit string that identifies the secret.
    created_at string
    The date that the secret was created on. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    expires_at string
    The date for the expiration of the secret. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    last_used_at string
    The last time the secret was used. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    masked_secret_value string
    The masked Service Account secret.
    mcp_config_id string
    Unique identifier of the MCP configuration.
    project_id string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    secret_id string
    Unique 24-hexadecimal digit string that identifies the secret.
    createdAt String
    The date that the secret was created on. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    expiresAt String
    The date for the expiration of the secret. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    lastUsedAt String
    The last time the secret was used. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    maskedSecretValue String
    The masked Service Account secret.
    mcpConfigId String
    Unique identifier of the MCP configuration.
    projectId String
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    secretId String
    Unique 24-hexadecimal digit string that identifies the secret.
    createdAt string
    The date that the secret was created on. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    expiresAt string
    The date for the expiration of the secret. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    lastUsedAt string
    The last time the secret was used. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    maskedSecretValue string
    The masked Service Account secret.
    mcpConfigId string
    Unique identifier of the MCP configuration.
    projectId string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    secretId string
    Unique 24-hexadecimal digit string that identifies the secret.
    created_at str
    The date that the secret was created on. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    expires_at str
    The date for the expiration of the secret. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    last_used_at str
    The last time the secret was used. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    masked_secret_value str
    The masked Service Account secret.
    mcp_config_id str
    Unique identifier of the MCP configuration.
    project_id str
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    secret_id str
    Unique 24-hexadecimal digit string that identifies the secret.
    createdAt String
    The date that the secret was created on. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    expiresAt String
    The date for the expiration of the secret. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    lastUsedAt String
    The last time the secret was used. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    maskedSecretValue String
    The masked Service Account secret.
    mcpConfigId String
    Unique identifier of the MCP configuration.
    projectId String
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    secretId String
    Unique 24-hexadecimal digit string that identifies the secret.

    Package Details

    Repository
    MongoDB Atlas pulumi/pulumi-mongodbatlas
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the mongodbatlas Terraform Provider.
    mongodbatlas logo mongodbatlas logo
    Viewing docs for MongoDB Atlas v4.16.0
    published on Thursday, Sep 17, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial