Skip to main content

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)

Release files for mcp-gen 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcp-gen 0.1.0
File Size Uploaded
mcp_gen-0.1.0.tar.gz 12.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mcp-gen 0.1.0
File Interpreter ABI Platform
mcp_gen-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 23.0 kB

Release files / mcp_gen-0.1.0.tar.gz

Download URL mcp_gen-0.1.0.tar.gz
Size 12.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6f95cf16ee60990df1f77022b8c94f8cc2b6b30d487bf1e56380dffdaefaa5fe
BLAKE2b-256 checksum
How to use checksums
4a878c449da0db13d7c902f0cdf52505731143fb49f1f12bdce699c93f13fb17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.1

Release files / mcp_gen-0.1.0-py3-none-any.whl

Download URL mcp_gen-0.1.0-py3-none-any.whl
Size 10.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c14214d041ca36fc1a3e819de9f852561f02579ba68db49103f5ec72a0eaed60
BLAKE2b-256 checksum
How to use checksums
9a7877f7bf3c4c37f8ab6519eb8f6de4ce0b375fdecd28de6cc167577d76e9f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.1

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page