Skip to main content
Glama

MCP-NG

by Lotargo
generate_protos_python.sh1.62 kB
#!/bin/bash # # This script generates Python gRPC code from .proto files. # It should be executed from the root directory of the project. # Exit immediately if a command exits with a non-zero status. set -e echo "--- Step 1: Checking Python dependencies ---" # Check if grpcio-tools is installed if ! python -m grpc_tools.protoc --version &> /dev/null then echo "Error: 'grpcio-tools' package not found." echo "Please install it using: pip install grpcio-tools" exit 1 fi echo "Dependencies found." echo "--- Step 2: Defining paths ---" # Directory for third-party .proto files (e.g., from Google) THIRD_PARTY_DIR="third_party" # Directory with our main .proto file PROTO_DIR="MCP-NG/proto" # Output directory for the generated Python code # We will generate the code directly into the tool's folder OUTPUT_DIR="MCP-NG/tools/python/code_interpreter" # Ensure the dependencies directory exists (like in the Go script) if [ ! -d "$THIRD_PARTY_DIR/googleapis" ]; then echo "Google's proto files not found. Cloning repository..." git clone --depth 1 https://github.com/googleapis/googleapis "$THIRD_PARTY_DIR/googleapis" else echo "Google's proto files already exist." fi echo "--- Step 3: Generating Python code from .proto ---" # Execute the generation command python -m grpc_tools.protoc \ -I="$PROTO_DIR" \ -I="$THIRD_PARTY_DIR/googleapis" \ --python_out="$OUTPUT_DIR" \ --grpc_python_out="$OUTPUT_DIR" \ "$PROTO_DIR/mcp.proto" echo "Python code generation completed successfully." echo "Files 'mcp_pb2.py' and 'mcp_pb2_grpc.py' in '$OUTPUT_DIR' have been updated."

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/Lotargo/MCP-NG'

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