Skip to main content

YAML-based Model Context Protocol MCP configuration generator with template interpolation and secret management

Project description

MCP Configuration Generator

Standalone YAML-based MCP configuration generator with template interpolation and secret management.

Why This Tool Exists

Problem: MCP configurations contain hardcoded paths and secrets, making them impossible to version control or share across teams/environments.

Solution: Separate configuration structure from secrets and environment-specific values:

  • Version control YAML configs without exposing secrets
  • Team sharing of standardized MCP server setups
  • Environment portability via template variables
  • Secret isolation in git-ignored files

Transform this unmaintainable config:

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/alice/dev/project"]
    },
    "github": {
      "command": "docker",
      "args": ["run", "-e", "GITHUB_TOKEN=ghp_actual_secret123", "github-server"]
    }
  }
}

Into maintainable, shareable YAML:

variables:
  project_root: "/Users/alice/dev/project"

servers:
  filesystem:
    command: "npx"
    args: ["-y", "@modelcontextprotocol/server-filesystem", "{{ variables.project_root }}"]
  github:
    command: "docker" 
    args: ["run", "-e", "GITHUB_TOKEN={{ secrets.GITHUB_TOKEN }}", "github-server"]

Installation

pip install -e .

Quick Start

Using the Examples

  1. Navigate to project root:
cd /path/to/mcp-gen
  1. Generate MCP JSON from example configuration:
python -m mcp_gen.cli generate \
  --config examples/mcp.config.yaml \
  --secrets examples/mcp.secrets.yaml
  1. View the generated files (automatically written to configured outputs):
cat .amazonq/mcp.json
cat claude-desktop/mcp.json

CLI Commands

Generate configuration:

python -m mcp_gen.cli generate --config config.yaml --secrets secrets.yaml --output mcp.json

Generate to configured outputs (no --output needed):

python -m mcp_gen.cli generate --config config.yaml --secrets secrets.yaml

Validate configuration:

python -m mcp_gen.cli validate --config config.yaml

Configuration Format

mcp.config.yaml:

version: "1.0"

outputs:
  - "{{ variables.project_root }}/.amazonq/mcp.json"
  - "{{ variables.project_root }}/claude-desktop/mcp.json"

variables:
  project_root: "/path/to/project"

servers:
  filesystem:
    command: "npx"
    args: ["-y", "@modelcontextprotocol/server-filesystem", "{{ variables.project_root }}"]

mcp.secrets.yaml:

secrets:
  API_TOKEN: "your_secret_token"

Features

  • Template interpolation with Jinja2 (variables, secrets, environment)
  • Multiple output paths with variable support
  • Secret management (git-ignored files)
  • JSON Schema validation
  • Optional outputs configuration (CLI --output overrides)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_gen-0.1.0.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_gen-0.1.0-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file mcp_gen-0.1.0.tar.gz.

File metadata

  • Download URL: mcp_gen-0.1.0.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for mcp_gen-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6f95cf16ee60990df1f77022b8c94f8cc2b6b30d487bf1e56380dffdaefaa5fe
MD5 bde3c434d54b45345e4ad383638005d4
BLAKE2b-256 4a878c449da0db13d7c902f0cdf52505731143fb49f1f12bdce699c93f13fb17

See more details on using hashes here.

File details

Details for the file mcp_gen-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mcp_gen-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for mcp_gen-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c14214d041ca36fc1a3e819de9f852561f02579ba68db49103f5ec72a0eaed60
MD5 c30a3788d635ffc954a6255e94e19739
BLAKE2b-256 9a7877f7bf3c4c37f8ab6519eb8f6de4ce0b375fdecd28de6cc167577d76e9f7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page