Skip to main content
Glama

NIX MCP Server

init.sh2.33 kB
#!/usr/bin/env bash set -e echo "🚀 NIX MCP Server - Initialization Script" echo "=========================================" # Colors for output RED='\033[0;31m' GREEN='\033[0;32m' YELLOW='\033[1;33m' NC='\033[0m' # No Color # Check if uv is installed if ! command -v uv &> /dev/null; then echo -e "${YELLOW}📦 Installing UV package manager...${NC}" curl -LsSf https://astral.sh/uv/install.sh | sh export PATH="$HOME/.local/bin:$PATH" fi # Update git submodules echo -e "${YELLOW}📥 Updating git submodules...${NC}" git submodule update --init --recursive || echo "Warning: Could not update submodules" # Install dependencies echo -e "${YELLOW}📦 Installing Python dependencies...${NC}" uv sync uv add --dev grpcio-tools # Set proto path from submodule PROTO_PATH="proto-common/src/main/proto" echo -e "${GREEN}✓ Using proto files from submodule${NC}" # Create output directory mkdir -p src/nix_mcp/protobuf touch src/nix_mcp/protobuf/__init__.py # Compile proto files echo -e "${YELLOW}🔧 Compiling protobuf files...${NC}" # Find and compile proto files for proto_type in native_indexer common zpp ctrl_signing; do if [ -d "$PROTO_PATH/$proto_type" ]; then echo " Compiling $proto_type..." uv run python -m grpc_tools.protoc \ --proto_path="$PROTO_PATH" \ --python_out=src/nix_mcp/protobuf \ "$PROTO_PATH/$proto_type"/*.proto 2>/dev/null || true fi done # Create .env file if it doesn't exist if [ ! -f .env ]; then echo -e "${YELLOW}📝 Creating .env file from template...${NC}" cp .env.example .env echo -e "${GREEN}✓ Created .env file - please edit it with your configuration${NC}" fi # Test basic imports echo -e "${YELLOW}🧪 Testing basic setup...${NC}" if python -c "import sys; sys.path.insert(0, 'src'); from nix_mcp.server_fastmcp import mcp; print('✓ Server imports working')" 2>/dev/null; then echo -e "${GREEN}✓ Basic imports successful${NC}" else echo -e "${RED}✗ Import test failed - please check the installation${NC}" exit 1 fi echo "" echo -e "${GREEN}✅ Initialization complete!${NC}" echo "" echo "Next steps:" echo " 1. Edit .env file with your configuration" echo " 2. Run 'make run' or './run.sh' to start the server" echo " 3. Run 'make test' to verify everything is working"

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/haiqiubullish/nix-mcp'

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