mcpproxy 0.2.1

MCP proxy server for remote HTTP endpoints supporting JSON and Server-Sent Events
# MCP Proxy Makefile

.PHONY: help build test clean install npm-test npm-install sync-versions release setup-auth

# Default target
help:
	@echo "MCP Proxy Build Commands:"
	@echo ""
	@echo "  build          Build the Rust binary (release mode)"
	@echo "  test           Run Rust tests"
	@echo "  clean          Clean build artifacts"
	@echo "  install        Install binary to /usr/local/bin"
	@echo ""
	@echo "  npm-install    Install npm package dependencies"
	@echo "  npm-test       Test the npm package"
	@echo ""
	@echo "  sync-versions  Synchronize Rust and npm package versions"
	@echo "  setup-auth     Setup cargo authentication for crates.io"
	@echo "  release        Prepare for release (sync versions + test)"
	@echo ""
	@echo "  all            Build both Rust binary and test npm package"

# Rust targets
build:
	cargo build --release

test:
	cargo test

clean:
	cargo clean
	rm -rf ../mcpproxy-npm/bin/mcpproxy*
	rm -rf ../mcpproxy-npm/node_modules

install: build
	sudo cp target/release/mcpproxy /usr/local/bin/

# npm targets
npm-install:
	cd ../mcpproxy-npm && npm install

npm-test: build npm-install
	cd ../mcpproxy-npm && npm test

# Version management
sync-versions:
	./sync-versions.sh

setup-auth:
	./setup-cargo-auth.sh

# Release preparation
release: sync-versions build npm-test
	@echo "✓ Ready for release!"
	@echo ""
	@echo "Next steps:"
	@echo "1. git add ."
	@echo "2. git commit -m 'Bump mcpproxy version to X.Y.Z'"
	@echo "3. git push origin main"

# Build everything
all: build npm-test

# Development helpers
dev-test: build
	@echo "Testing with a simple request..."
	@echo '{"jsonrpc":"2.0","method":"ping","id":1}' | timeout 5 ./target/release/mcpproxy --url https://httpbin.org/post || echo "Test completed (timeout expected)"

check-deps:
	@echo "Checking dependencies..."
	@command -v cargo >/dev/null 2>&1 || { echo "cargo is required but not installed"; exit 1; }
	@command -v npm >/dev/null 2>&1 || { echo "npm is required but not installed"; exit 1; }
	@echo "✓ All dependencies available"