Skip to main content
Glama

strapi_list_servers

Retrieve all configured Strapi CMS servers from the MCP server's settings for content management operations.

Instructions

List all available Strapi servers from the configuration.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler logic for the 'strapi_list_servers' tool within the CallToolRequestSchema handler. It validates input, checks configuration, lists available Strapi servers with version details, or provides setup instructions if no servers are configured.
    if (name === "strapi_list_servers") {
        // Validate input using Zod
        const validatedArgs = validateToolInput("strapi_list_servers", args, requestId);
        if (Object.keys(config).length === 0) {
            const exampleConfig = {
                "myserver": {
                    "api_url": "http://localhost:1337",
                    "api_key": "your-jwt-token-from-strapi-admin",
                    "version": "5.*"
                }
            };
    
            result = {
                content: [
                    {
                        type: "text",
                        text: JSON.stringify({
                            error: "No servers configured",
                            help: {
                                message: "No server configuration found. Please create a configuration file.",
                                config_path: CONFIG_PATH,
                                example_config: exampleConfig,
                                setup_steps: [
                                    "Create the .mcp directory: mkdir -p ~/.mcp",
                                    "Create the config file: touch ~/.mcp/strapi-mcp-server.config.json",
                                    "Add your server configuration using the example above",
                                    "Get your JWT token from Strapi Admin Panel > Settings > API Tokens",
                                    "Make sure the file permissions are secure: chmod 600 ~/.mcp/strapi-mcp-server.config.json"
                                ]
                            }
                        }, null, 2),
                    },
                ],
            };
        }
    
        const servers = Object.keys(config).map(serverName => {
            const serverConfig = config[serverName];
            const version = serverConfig.version || "v4"; // Default to v4 if not specified
    
            // Extract major version from different formats: "5.*", "4.1.5", "v4", "4.*"
            let majorVersion: keyof StrapiVersionDifferences;
            if (version.includes('*')) {
                // Handle "5.*" or "4.*" format
                majorVersion = version.split('.')[0] as keyof StrapiVersionDifferences;
            } else if (version.startsWith('v')) {
                // Handle "v4" or "v5" format
                majorVersion = version.substring(1) as keyof StrapiVersionDifferences;
            } else {
                // Handle "4.1.5" or plain "4" format
                majorVersion = version.split('.')[0] as keyof StrapiVersionDifferences;
            }
    
            return {
                name: serverName,
                api_url: serverConfig.api_url,
                version: serverConfig.version,
                version_details: STRAPI_VERSION_DIFFERENCES[majorVersion]
            };
        });
    
        result = {
            content: [
                {
                    type: "text",
                    text: JSON.stringify({
                        servers,
                        config_path: CONFIG_PATH,
                        help: "To add more servers, edit the configuration file at the path shown above.",
                        version_differences: STRAPI_VERSION_DIFFERENCES,
                        user_action_required: {
                            message: "Please specify which server you want to work with by providing the server name in your next command.",
                            example: "For example: 'I want to work with the server \"myserver\"' or 'Use server \"myserver\" for the next operations'",
                            available_servers: servers.map(s => s.name),
                            warning: "Only use servers that are listed in available_servers. Do not attempt to access servers that are not properly configured."
                        },
                        security: {
                            note: "For security reasons, only servers listed in the configuration file can be accessed.",
                            requirement: "Each server must be properly configured with valid credentials before use."
                        }
                    }, null, 2),
                },
            ],
        };
    } else if (name === "strapi_get_content_types") {
  • The ToolSchemas object that maps 'strapi_list_servers' to its Zod input schema (ListServersSchema, which is an empty object since no parameters are required).
    const ToolSchemas = {
        strapi_list_servers: ListServersSchema,
        strapi_get_content_types: GetContentTypesSchema,
        strapi_get_components: GetComponentsSchema,
        strapi_rest: RestSchema,
        strapi_upload_media: UploadMediaSchema
    } as const;
  • src/index.ts:1245-1248 (registration)
    Registration of the 'strapi_list_servers' tool in the ListToolsRequestSchema handler, providing name, description, and input schema.
        name: "strapi_list_servers",
        description: "List all available Strapi servers from the configuration.",
        inputSchema: zodToJsonSchema(ToolSchemas.strapi_list_servers),
    },
  • Zod schema definition for 'strapi_list_servers' tool input validation. It expects no parameters.
    // Schema for strapi_list_servers tool (no parameters)
    const ListServersSchema = z.object({}).strict();
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states it's a list operation, implying read-only behavior, but doesn't address potential side effects, authentication needs, rate limits, or what the output format looks like. This is a significant gap for a tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence that directly states the tool's purpose without any unnecessary words. It's front-loaded and efficiently communicates the core functionality, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 0 parameters and no output schema, the description adequately covers the basic purpose. However, without annotations or output details, it lacks information about behavioral traits like what 'available Strapi servers' means in practice or how the data is returned, leaving some contextual gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and the schema description coverage is 100%, so there's no need for parameter documentation in the description. The baseline for this scenario is 4, as the description appropriately doesn't waste space on non-existent parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('List') and resource ('all available Strapi servers from the configuration'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like strapi_get_components or strapi_get_content_types, which also retrieve information but about different resources.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, context for usage, or comparisons with sibling tools like strapi_rest or strapi_upload_media, leaving the agent to infer usage scenarios.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

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/misterboe/strapi-mcp-server'

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