Skip to main content
Glama

MCP Server Hero

by namnd00
Makefile6.18 kB
# MCP Server Hero - Professional MCP Server Framework .PHONY: help install-uv install install-prod test test-cov test-inspector test-basic test-advanced test-enterprise test-client-basic test-client-advanced test-client-enterprise lint format typecheck check .PHONY: run-server run-stdio run-debug run-basic run-advanced run-enterprise run-gitlab .PHONY: docker-build docker-run docker-down .PHONY: examples stats clean # Default target help: @echo "🚀 MCP Server Hero - Professional MCP Server Framework" @echo "" @echo "Available commands:" @echo "" @echo "Setup & Installation:" @echo " install-uv Install uv package manager" @echo " install Install all dependencies (dev + prod)" @echo " install-prod Install production dependencies only" @echo "" @echo "Development:" @echo " test Run all tests with pytest" @echo " test-cov Run tests with coverage report" @echo " test-inspector Show MCP Inspector commands for testing servers" @echo " test-basic Test basic server with MCP Inspector" @echo " test-advanced Test advanced server with MCP Inspector" @echo " test-enterprise Test enterprise server with MCP Inspector" @echo " test-client-basic Test basic server with Python client" @echo " test-client-advanced Test advanced server with Python client" @echo " test-client-enterprise Test enterprise server with Python client" @echo " lint Run code linting with ruff" @echo " format Format code with ruff" @echo " typecheck Run type checking with pyright" @echo " check Run all code quality checks (lint + format + typecheck)" @echo "" @echo "Server Operations:" @echo " run-server Run server with SSE transport" @echo " run-stdio Run server with stdio transport" @echo " run-debug Run server in debug mode" @echo " run-basic Run basic example server" @echo " run-advanced Run advanced example server" @echo " run-enterprise Run enterprise example server" @echo " run-gitlab Run GitLab code review server" @echo "" @echo "Docker:" @echo " docker-build Build Docker image (tag: mcp-server-hero)" @echo " docker-run Run Docker container mapping port 8000" @echo " docker-down Stop and remove Docker Compose services" @echo "" @echo "Examples & Documentation:" @echo " examples List all example servers" @echo " stats Show project statistics" @echo " clean Clean cache and build artifacts" @echo "" @echo "Use 'make <command>' to run any of these targets." # Setup & Installation install-uv: curl -LsSf https://astral.sh/uv/install.sh | sh install: uv sync --dev install-prod: uv sync # Development test: uv run pytest test-cov: uv run pytest --cov=mcp_server_hero --cov-report=html --cov-report=term test-inspector: @echo "🔍 Testing with MCP Inspector..." @echo "Choose a server to test:" @echo " 1) Basic Server: npx @modelcontextprotocol/inspector uv run python src/mcp_server_hero/examples/basic_server.py" @echo " 2) Advanced Server: npx @modelcontextprotocol/inspector uv run python src/mcp_server_hero/examples/advanced_server.py" @echo " 3) Enterprise Server: npx @modelcontextprotocol/inspector uv run python src/mcp_server_hero/examples/enterprise_server.py" test-basic: npx @modelcontextprotocol/inspector uv run python src/mcp_server_hero/examples/basic_server.py test-advanced: npx @modelcontextprotocol/inspector uv run python src/mcp_server_hero/examples/advanced_server.py test-enterprise: npx @modelcontextprotocol/inspector uv run python src/mcp_server_hero/examples/enterprise_server.py test-client-basic: uv run python scripts/test_client.py basic test-client-advanced: uv run python scripts/test_client.py advanced test-client-enterprise: uv run python scripts/test_client.py enterprise lint: uv run ruff check . format: uv run ruff format . typecheck: uv run pyright check: lint format typecheck @echo "✅ All code quality checks passed" # Server Operations run-server: uv run python -m mcp_server_hero --transport sse --port 8000 run-stdio: uv run python -m mcp_server_hero --transport stdio run-debug: uv run python -m mcp_server_hero --transport sse --debug --port 8000 run-basic: uv run python src/mcp_server_hero/examples/basic_server.py run-advanced: uv run python src/mcp_server_hero/examples/advanced_server.py run-enterprise: uv run python src/mcp_server_hero/examples/enterprise_server.py run-gitlab: uv run python src/mcp_server_hero/examples/gitlab_server.py # Docker IMAGE_NAME ?= mcp-server-hero docker-build: docker build -t $(IMAGE_NAME) . docker-run: docker run --rm -p 8000:8000 --name $(IMAGE_NAME) $(IMAGE_NAME) docker-down: docker compose down || true # Examples & Documentation examples: @echo "📖 Available Example Servers:" @echo " basic_server.py - Simple function-based MCP server" @echo " advanced_server.py - Class-based MCP server with custom components" @echo " enterprise_server.py - Full-featured enterprise server with all advanced features" @echo " gitlab_server.py - GitLab code review server with API integration" @echo "" @echo "Run examples with:" @echo " make run-basic - Basic example" @echo " make run-advanced - Advanced example" @echo " make run-enterprise - Enterprise example" @echo " make run-gitlab - GitLab code review example" stats: @echo "📊 MCP Server Hero Project Statistics:" @echo "Lines of code:" @find src/ -name "*.py" -exec wc -l {} + | tail -1 @echo "Python files:" @find src/ -name "*.py" | wc -l @echo "Test files:" @find tests/ -name "*.py" 2>/dev/null | wc -l || echo "0" @echo "Example files:" @find src/mcp_server_hero/examples/ -name "*.py" | wc -l clean: @echo "🧹 Cleaning cache and build artifacts..." @rm -rf __pycache__/ @rm -rf .pytest_cache/ @rm -rf .coverage @rm -rf htmlcov/ @rm -rf dist/ @rm -rf build/ @rm -rf *.egg-info/ @find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true @find . -type f -name "*.pyc" -delete 2>/dev/null || true @echo "✅ Cleanup complete"

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/namnd00/mcp-server-hero'

If you have feedback or need assistance with the MCP directory API, please join our Discord server