Skip to main content

Overview

The enkrypt_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

Context
required
MCP context (automatically provided by the client)
bool
default:"true"
Whether to automatically discover tools for servers that need it.
  • true: Discovers and caches tools for all servers
  • false: Returns server list without tool discovery

Return Value

Returns a dictionary containing:
string
required
Operation status: "success" or "error"
object
required
Dictionary of server configurations keyed by server name
array
List of server names that require tool discovery
array
List of server names where discovery failed (only when discover_tools=true)
array
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:
This will call enkrypt_list_all_servers with discover_tools=false, returning server information faster.

Response Structure

Success Response

Error Response

Server Object Structure

Each server in available_servers contains:
string
Unique identifier for the server
string
Human-readable description of the server
object
Server execution configuration
object
Dictionary of available tools (empty if not discovered yet)
object
Input guardrail configuration for this server
object
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:
  1. Extracts gateway credentials from the request context
  2. Validates credentials against the local or remote configuration
  3. 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

When discover_tools=true, the gateway:
  1. Phase 1: Validates all servers in parallel
  2. Phase 2: Separates servers with pre-configured tools from those needing discovery
  3. Phase 3: Runs tool validation and discovery in parallel
This parallel approach significantly reduces response time for multiple servers.

Tool Annotations

Common Use Cases

Use this to verify that servers are properly configured and accessible.
Gets a comprehensive view of all capabilities.
Quickly check server connectivity without waiting for tool discovery.
After setting up the gateway, use this tool to confirm all servers are accessible:

Error Handling

Common errors and solutions:
Error: No MCP config foundSolution: Verify that:
  • Gateway key is correct in your MCP client config
  • ~/.enkrypt/enkrypt_mcp_config.json exists
  • Project ID and User ID match the configuration
Error: Authentication failedSolution: Check your gateway credentials in the MCP client configuration
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=false to 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.

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