file-importCLI: MCPs Export

This guide covers exporting MCP configurations using the CLI with secure authentication handling.

Overview

The aip mcps get command includes export functionality that creates import-ready configuration files with proper authentication handling.

Basic Usage

Export to JSON

aip mcps get <mcp-id> --export mcp.json

Export to YAML

aip mcps get <mcp-id> --export mcp.yaml

Format is automatically detected from the file extension (.json or .yaml/.yml).

Authentication Secret Handling

When exporting MCPs with authentication, the CLI provides secure handling for secrets:

Interactive Mode (Default)

In terminal environments (TTY), you'll be prompted to enter missing or redacted secrets:

Example prompt:

  • Press Enter without input to use the placeholder <INSERT VALUE>

  • Enter the actual secret to include it in the export (use with caution)

Non-Interactive Mode

For batch operations, CI/CD pipelines, or automated scripts, use --no-auth-prompt:

This automatically uses placeholders without prompting, preventing the command from hanging.

Custom Placeholders

Customize the placeholder text for team conventions or tracking:

Export Behavior

Schema Alignment

Exported files match the documented MCP schemaarrow-up-right:

  • No internal fields (e.g., framework, version, _client)

  • Clean structure ready for version control

  • Compatible with import operations

Secret Handling by Auth Type

Bearer Token (bearer-token):

API Key (api-key):

Custom Headers (custom-header):

Format Detection

  • .json → JSON format with 2-space indentation

  • .yaml or .yml → YAML format with proper structure

  • Multi-line strings (e.g., instructions) use literal block style (|)

Complete Examples

Example 1: Interactive Export

Example 2: CI/CD Pipeline

Example 3: Team Documentation

Example Exported MCP

JSON Format

YAML Format

Use Cases

1

Version Control

Export MCPs for GitOps workflows:

Pro tip: Always use --no-auth-prompt for files going into version control.

2

Backup & Disaster Recovery

3

Environment Migration

4

Documentation Generation

Security Best Practices

  1. Never commit actual secrets to version control

    • Always use --no-auth-prompt for files going into Git

    • Use placeholders and inject secrets at deployment time

  2. Interactive mode caution

    • Be careful when entering actual secrets in interactive mode

    • Consider if the exported file will be shared or committed

  3. Placeholder strategy

    • Use descriptive placeholders that guide users to the right secret source

    • Examples: ${ENV_VAR}, VAULT:path/to/secret, SEE_DOCS

  4. Secret injection

    • Use environment variables or secret managers in CI/CD

    • Replace placeholders programmatically before deployment

Troubleshooting

chevron-rightCommand hangs in CI/CDhashtag

Problem: Command waits indefinitely for input in non-interactive environment.

Solution: Add --no-auth-prompt flag:

chevron-rightWarning: Non-interactive mode detectedhashtag

This is informational — the CLI detected it's not running in a terminal and automatically used placeholders.

chevron-rightExported file missing authenticationhashtag

If no authentication is configured on the MCP, the authentication field will be omitted from the export (as expected).