A comprehensive Rust-based testing framework for validating Glean's MCP (Model Context Protocol) server functionality across all supported tools and instances.
The Glean MCP Testing Framework provides automated testing of all Glean MCP tools with comprehensive reporting, parallel execution, and detailed status analysis. Perfect for monitoring tool health, debugging issues, and ensuring production readiness.
Install directly from the GitHub repository:
# Install from main branch
cargo install --git https://github.com/your-username/glean-mcp-test.git
# Install from a specific branch
cargo install --git https://github.com/your-username/glean-mcp-test.git --branch main
# Install with custom binary name
cargo install --git https://github.com/your-username/glean-mcp-test.git --name glean-mcp-testAfter installation, you can use the tool directly:
glean-mcp-test test-all --instance scio-prod --parallelYou must set the GLEAN_AUTH_TOKEN environment variable before running any tests:
# Set your Glean authentication token
export GLEAN_AUTH_TOKEN=your_token_here
# Or set it for the current session only
GLEAN_AUTH_TOKEN=your_token_here glean-mcp-test test-all --instance scio-prodHow to get your token:
- Go to your Glean instance (e.g., https://scio-prod.glean.com)
- Click on the secret Glean debug menu 3. Create a new "Glean MCP" token
- Copy the token and set it as the
GLEAN_AUTH_TOKENenvironment variable
Note: The token must be valid for the instance you're testing (e.g., scio-prod token for scio-prod instance).
- Rust (latest stable)
- Node.js & npm
- Glean authentication token
-
Clone and build:
git clone https://github.com/your-username/glean-mcp-test.git cd glean-mcp-test cargo build --release -
Set authentication token:
export GLEAN_AUTH_TOKEN=your_token_here -
Verify setup:
cargo run -- prerequisites cargo run -- auth --instance scio-prod
-
Test tools (main feature):
# Test all available tools (including ChatGPT endpoint) cargo run -- test --instance scio-prod --all # Quick core tools test (default behavior) cargo run -- test --instance scio-prod
Test MCP tools with comprehensive reporting:
# If installed via cargo install:
glean-mcp-test test --instance scio-prod
# If building from source:
cargo run -- test --instance scio-prod
# Test all tools (including ChatGPT endpoint)
glean-mcp-test test --instance scio-prod --all
# Test specific tools
glean-mcp-test test --instance scio-prod --tools search,chat
glean-mcp-test test --instance scio-prod --tools core
# Performance and output options
glean-mcp-test test --instance scio-prod --parallel --timeout 60
glean-mcp-test test --instance scio-prod --json --output results.json
# Advanced options
glean-mcp-test test --instance scio-prod --parallel --max-concurrent 5 --verbose# System verification
glean-mcp-test prerequisites # Check system requirements
glean-mcp-test auth --instance scio-prod # Test authentication
# Server validation
glean-mcp-test inspect --instance scio-prod # Validate MCP server connection
glean-mcp-test list-tools --instance scio-prod # List available tools
# Individual tool testing
glean-mcp-test test --tools search --instance scio-prod
glean-mcp-test test --tools chat --instance scio-prod
# Configuration management
glean-mcp-test config # Show configuration
glean-mcp-test config --verbose # Show detailed YAML configAll commands support multiple output formats and return proper exit codes (0=success, 1=failure):
- Text (default): Human-readable with emojis and progress
- JSON (use
--json): Structured data for programmatic use
GLEAN_AUTH_TOKEN: Your Glean authentication token (required for all operations)
How to set:
# Permanent (add to your shell profile)
echo 'export GLEAN_AUTH_TOKEN=your_token_here' >> ~/.bashrc
source ~/.bashrc
# Temporary (current session only)
export GLEAN_AUTH_TOKEN=your_token_here
# Per-command (single use)
GLEAN_AUTH_TOKEN=your_token_here glean-mcp-test test-all --instance scio-prodToken Requirements:
- Must be valid for the target instance (e.g., scio-prod token for scio-prod instance)
- Must have appropriate API permissions
- Can be obtained from Glean Settings β API Tokens
The framework supports different tool selection modes:
Core Tools (default behavior):
glean-mcp-test test --instance scio-prod
# Tests core tools on both endpoints:
# - https://scio-prod-be.glean.com/mcp/default
# - https://scio-prod-be.glean.com/mcp/chatgptAll Tools (use --all flag):
glean-mcp-test test --instance scio-prod --all
# Tests all available tools on both endpointsSpecific Tools (use --tools flag):
glean-mcp-test test --instance scio-prod --tools search,chat
# Tests only specified toolsKey Features:
- Default behavior: Tests core tools on both endpoints for basic validation
- All tools: Complete endpoint coverage including enterprise tools
- Specific tools: Targeted testing for debugging or specific use cases
- search: Search Glean's content index
- chat: Interact with Glean's AI assistant
- read_document: Read documents by ID/URL
- code_search: Search code repositories
- employee_search: Search people directory
- gmail_search: Search Gmail messages
- outlook_search: Search Outlook messages
- meeting_lookup: Find meeting information
- web_browser: Web browsing capability
- gemini_web_search: Web search capability
- scio-prod: Production instance (recommended for testing)
- glean-dev: Development instance (limited token compatibility)
All commands return proper exit codes for scripting:
#!/bin/bash
# CI/CD health check script
# Check prerequisites
if ! glean-mcp-test prerequisites; then
echo "β Prerequisites failed"
exit 1
fi
# Test authentication
if ! glean-mcp-test auth --instance scio-prod; then
echo "β Authentication failed"
exit 1
fi
# Run comprehensive test
if glean-mcp-test test-all --instance scio-prod --parallel --json --output health-check.json; then
echo "β
All tools healthy"
else
echo "β Some tools failed - check health-check.json"
exit 1
fiNote: If building from source, replace glean-mcp-test with cargo run -- in the script above.
--parallel: Run tests concurrently (3-5x faster)--max-concurrent N: Limit concurrent tests (default: 3)--timeout N: Per-tool timeout in seconds (default: 60)
π§ͺ Glean MCP Tools Test Results
==================================================
π Overall Status: β
SUCCESS
π§ Tools Tested: 3/3 successful
π Success Rate: 100%
π Individual Tool Results:
------------------------------
β
search (0.39s)
β
chat (7.21s)
β
read_document (0.16s)
β±οΈ Execution Summary:
--------------------
Total time: 7.85s
Parallel: Yes
Timeout per tool: 60s- Authentication errors:
- Verify
GLEAN_AUTH_TOKENenvironment variable is set:echo $GLEAN_AUTH_TOKEN - Ensure token is valid for your target instance (e.g., scio-prod token for scio-prod)
- Check token permissions in Glean Settings β API Tokens
- Try regenerating the token if it's expired
- Verify
- Tool timeouts: Increase
--timeoutfor slower tools (especiallychat) - Connection issues: Check network connectivity and instance URL
- Missing tools: Tools vary by instance; use
list-toolsto see available tools - "Token not found" errors: Ensure
GLEAN_AUTH_TOKENis exported in your shell session
- Verify environment variable:
echo $GLEAN_AUTH_TOKEN(should show your token) - Run
glean-mcp-test prerequisitesto verify system setup - Run
glean-mcp-test auth --instance scio-prodto test authentication - Run
glean-mcp-test list-tools --instance scio-prodto see available tools - Use
--verboseflag for detailed output - Check
--format jsonoutput for structured error details
Note: If building from source, replace glean-mcp-test with cargo run -- in the commands above.