Skip to content

Complete toolkit for managing MCP (Model Context Protocol) server configurations Build template-based configs, manage servers interactively, and automate deployments - all from one unified toolset.

License

Notifications You must be signed in to change notification settings

starbased-co/buildmcp

Repository files navigation

buildmcp

Complete toolkit for managing MCP (Model Context Protocol) server configurations

Build template-based configs, manage servers interactively, and automate deployments - all from one unified toolset.


πŸš€ Quick Start

β†’ Get started in 5 minutes

# Install from PyPI
uv pip install buildmcp

# Choose your tool:
buildmcp --dry-run      # Template builder
metamcp                 # Interactive TUI
metamcp-cli server:list # Command-line interface

πŸ› οΈ Tool Suite

buildmcp - Configuration Builder

Template-based MCP server configuration builder with environment variable substitution and checksums.

Best for: Building configs from templates, deploying to multiple targets, managing environment-specific configs

# Preview build
uv run buildmcp --dry-run

# Deploy to targets
uv run buildmcp

# Print specific profile config (no write)
uv run buildmcp --profile default

# Force write (skip checksums)
uv run buildmcp --force

Features:

  • βœ… Template composition system
  • βœ… Environment variable substitution (${VAR_NAME})
  • βœ… SHA-256 checksum change detection
  • βœ… Lock file tracking
  • βœ… Multiple deployment targets
  • βœ… Profile-based configurations

πŸ“– Full buildmcp Documentation


Meta∞MCP TUI - Interactive Terminal Interface

Full-featured terminal UI for browsing and managing MCP servers and namespaces.

Best for: Visual exploration, interactive management, namespace organization, tool status management

# Launch TUI
export METAMCP_SESSION_TOKEN="your-token"
uv run metamcp

Features:

  • βœ… Server browsing and management
  • βœ… Namespace exploration with tools view
  • βœ… Interactive status toggling
  • βœ… Bulk import interface
  • βœ… Real-time updates
  • βœ… Keyboard-driven navigation

Keyboard Shortcuts:

  • q - Quit
  • r - Refresh
  • c - Create
  • d - Delete
  • i - Import
  • s - Toggle server status
  • t - Toggle tool status

πŸ“– Full TUI Documentation


metamcp-cli - Command-Line Interface

Scriptable CLI for all MetaMCP operations with full JSON input support.

Best for: Automation, CI/CD pipelines, shell scripts, batch operations

# List servers
metamcp-cli server:list

# Create from JSON (stdin)
echo '{"name": "test", "type": "STDIO", "command": "npx"}' | \
  metamcp-cli server:create --stdin

# Bulk import
cat servers.json | metamcp-cli server:bulk-import --stdin

# Update namespace tools
metamcp-cli namespace:update-tool-status \
  --namespace-uuid "..." \
  --tool-uuid "..." \
  --server-uuid "..." \
  --status "ACTIVE"

Features:

  • βœ… All server operations (list, create, delete, import)
  • βœ… Namespace management (list, get, tools, status)
  • βœ… JSON input (file, stdin, pipe)
  • βœ… Rich table output
  • βœ… Scriptable and pipeable
  • βœ… Error handling with exit codes

πŸ“– Full CLI Documentation


πŸ“‹ Features Comparison

Feature buildmcp TUI CLI
Template system βœ… ❌ ❌
Environment substitution βœ… ❌ ❌
Server management ❌ βœ… βœ…
Namespace management ❌ βœ… βœ…
Tool status control ❌ βœ… βœ…
Visual interface ❌ βœ… ❌
JSON input/output βœ… βœ… βœ…
Automation friendly βœ… ❌ βœ…
Real-time updates ❌ βœ… ❌
Bulk operations βœ… βœ… βœ…

πŸ“š Documentation


πŸ—οΈ Installation

Requirements

  • Python 3.12+
  • uv package manager

Install from PyPI

# Install with pip
pip install buildmcp

# Or with uv (recommended)
uv pip install buildmcp

# Verify installation
buildmcp --help
metamcp --help
metamcp-cli --help

Install from Source

# Clone repository
git clone https://github.com/starbased-co/buildmcp.git
cd buildmcp

# Install dependencies
uv sync

# Verify installation
uv run buildmcp --help
uv run metamcp --help
uv run metamcp-cli --help

Development Install

# Install in editable mode
uv pip install -e .

# Run tests
uv run pytest

# Run with verbose
uv run buildmcp --verbose --dry-run

🎯 Common Workflows

Workflow 1: Template-Based Deployment

# 1. Edit templates
vim ~/.config/nix/config/claude/mcp.json

# 2. Preview specific profile
uv run buildmcp --profile default

# 3. Preview all (dry-run)
uv run buildmcp --dry-run

# 4. Deploy
uv run buildmcp

# 5. Verify
cat ~/.claude/mcp.json

Workflow 2: Import to MetaMCP

# Import existing Claude config
cat ~/.claude/mcp.json | \
  jq '.mcpServers' | \
  metamcp-cli server:bulk-import --stdin

# Browse in TUI
uv run metamcp

Workflow 3: Namespace Management

# List namespaces
metamcp-cli namespace:list

# Get tools
metamcp-cli namespace:tools --uuid "ns-abc123..."

# Toggle tool status in TUI
uv run metamcp
# β†’ Navigate to namespace β†’ Tools β†’ Press 't'

Workflow 4: Automated Provisioning

#!/bin/bash
# Create servers from list
for name in $(cat servers.txt); do
  echo "{\"name\": \"$name\", \"type\": \"STDIO\"}" | \
    metamcp-cli server:create --stdin
done

πŸ”§ Configuration

buildmcp Config

Location: ~/.config/nix/config/claude/mcp.json (or custom with --mcp-json)

{
  "mcpServers": {
    "base-server": {
      "command": "npx",
      "args": ["-y", "@scope/package"]
    }
  },
  "templates": {
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_TOKEN": "${GITHUB_TOKEN}"
      }
    }
  },
  "profiles": {
    "default": ["github"],
    "minimal": []
  },
  "targets": {
    "default": "~/.claude/mcp.json",
    "custom": {
      "read": "cat ~/custom-mcp.json",
      "write": "cat > ~/custom-mcp.json"
    }
  }
}

Meta∞MCP Authentication

# Set session token (from browser DevTools)
export METAMCP_SESSION_TOKEN="your-session-token"

# Or use cookie file
echo "your-token" > ~/.metamcp
chmod 600 ~/.metamcp

uv run metamcp --cookie-file ~/.metamcp
metamcp-cli --cookie-file ~/.metamcp server:list

πŸ“– CLI Reference

buildmcp

buildmcp [OPTIONS]

Options:
  --mcp-json PATH     Config file (default: ~/.claude/mcp.json)
  --verbose          Show detailed output
  --dry-run          Preview without writing
  --profile NAME     Print built config for profile to stdout
  --force            Ignore checksums, redeploy all
  --no-check-env     Skip env var validation

metamcp (TUI)

metamcp [OPTIONS]

Options:
  --base-url URL        MetaMCP server URL (default: http://localhost:12008)
  --cookie-file PATH    Session token file

Keyboard:
  q     Quit
  r     Refresh
  c     Create
  d     Delete
  i     Import
  s     Toggle server status (in namespace view)
  t     Toggle tool status (in namespace view)

metamcp-cli

metamcp-cli <command-group>:<action> [OPTIONS]

Server Commands:
  server:list                          List all servers
  server:create [--name N --type T]    Create server
  server:delete --uuid UUID            Delete server
  server:bulk-import [-f FILE]         Bulk import

Namespace Commands:
  namespace:list                       List namespaces
  namespace:get --uuid UUID            Get details
  namespace:tools --uuid UUID          List tools
  namespace:update-tool-status         Update tool
  namespace:update-server-status       Update server

Options:
  -f, --file PATH    JSON file input
  --stdin            Read from stdin

πŸ§ͺ Testing

# Run all tests
uv run pytest

# Run with coverage
uv run pytest --cov=src/buildmcp

# Run specific test
uv run pytest tests/test_builder.py

πŸ”— Integrations

Claude Code

# Deploy to Claude Code
uv run buildmcp

# Restart Claude Code to load config

MCPNest

Deploy to mcpnest.dev using mcpnest-cli:

# Add mcpnest target
{
  "targets": {
    "mcpnest": {
      "read": "mcpnest config read",
      "write": "mcpnest config write"
    }
  },
  "profiles": {
    "mcpnest": ["linkup", "sequential-thinking"]
  }
}

# Deploy
uv run buildmcp

Shell Scripts

# Use in scripts
SERVERS=$(metamcp-cli server:list --format json)
echo "$SERVERS" | jq '.[] | select(.type == "STDIO")'

πŸ› Troubleshooting

Authentication Issues

# Error: HTTP 401 Unauthorized
# β†’ Get fresh token from browser DevTools
export METAMCP_SESSION_TOKEN="new-token"

Connection Issues

# Cannot connect to server
# β†’ Check server is running
curl http://localhost:12008/api/health

# β†’ Use correct URL
uv run metamcp --base-url http://your-server:12008

Build Issues

# Missing environment variables
# β†’ Set the variable
export GITHUB_TOKEN="your-token"

# β†’ Or skip validation
uv run buildmcp --no-check-env

πŸ“– Full Troubleshooting Guide


🀝 Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Add tests for new features
  4. Ensure tests pass: uv run pytest
  5. Submit a pull request

πŸ“„ License

MIT License - see LICENSE file


πŸ”— Links


Made with ❀️ by starbased

About

Complete toolkit for managing MCP (Model Context Protocol) server configurations Build template-based configs, manage servers interactively, and automate deployments - all from one unified toolset.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages