Overview
Theenkrypt_list_all_servers tool retrieves comprehensive information about all MCP servers configured in your gateway, including their tools, configuration status, and discovery requirements.
This is typically the first tool you’ll use when working with the gateway.
Tool Signature
Parameters
MCP context (automatically provided by the client)
Whether to automatically discover tools for servers that need it.
true: Discovers and caches tools for all serversfalse: Returns server list without tool discovery
Return Value
Returns a dictionary containing:Operation status:
"success" or "error"Dictionary of server configurations keyed by server name
List of server names that require tool discovery
List of server names where discovery failed (only when
discover_tools=true)List of server names where discovery succeeded (only when
discover_tools=true)Usage Examples
Basic Usage
Without Tool Discovery
If you want to list servers quickly without discovering their tools:enkrypt_list_all_servers with discover_tools=false, returning server information faster.
Response Structure
Success Response
Error Response
Server Object Structure
Each server inavailable_servers contains:
Unique identifier for the server
Human-readable description of the server
Server execution configuration
Dictionary of available tools (empty if not discovered yet)
Input guardrail configuration for this server
Output guardrail configuration for this server
Implementation Details
Service Location
Implemented in:src/secure_mcp_gateway/services/server/server_listing_service.py:38
Authentication
The tool automatically:- Extracts gateway credentials from the request context
- Validates credentials against the local or remote configuration
- Retrieves the MCP configuration for the authenticated user/project
Caching
Server information is cached to improve performance:- Cache Key: Based on gateway key, project ID, user ID, and config ID
- Cache Duration: 24 hours (gateway config) + 4 hours (tools)
- Cache Type: Local (in-memory) or External (Redis/KeyDB)
Parallel Processing
Whendiscover_tools=true, the gateway:
- Phase 1: Validates all servers in parallel
- Phase 2: Separates servers with pre-configured tools from those needing discovery
- Phase 3: Runs tool validation and discovery in parallel
Tool Annotations
Common Use Cases
Verify Server Configuration
Verify Server Configuration
Check Available Tools
Check Available Tools
Troubleshoot Discovery Issues
Troubleshoot Discovery Issues
Initial Setup Verification
Initial Setup Verification
After setting up the gateway, use this tool to confirm all servers are accessible:
Error Handling
Common errors and solutions:CONFIG_MISSING_REQUIRED
CONFIG_MISSING_REQUIRED
Error: No MCP config foundSolution: Verify that:
- Gateway key is correct in your MCP client config
~/.enkrypt/enkrypt_mcp_config.jsonexists- Project ID and User ID match the configuration
AUTH_INVALID_CREDENTIALS
AUTH_INVALID_CREDENTIALS
Error: Authentication failedSolution: Check your gateway credentials in the MCP client configuration
DISCOVERY_FAILED
DISCOVERY_FAILED
Error: Tool discovery failed for some serversSolution:
- Check server command and arguments
- Verify required dependencies are installed
- Review server logs for specific errors
- Try
discover_tools=falseto see which servers are accessible
Performance Tips
Use Caching
Tools are cached for 4 hours by default. Subsequent calls return cached results instantly.
Skip Discovery
Set
discover_tools=false for faster responses when you only need server names.Parallel Execution
The gateway automatically discovers tools from multiple servers in parallel.
Monitor Metrics
Use
enkrypt_get_timeout_metrics to identify slow servers.Related Tools
Get Server Info
Get detailed information about a specific server
Discover Tools
Force re-discovery of tools for a server
Cache Status
View cache status for discovered tools
Execute Tools
Run tools from discovered servers