Skip to main content
Glama
formulahendry

MCP Registry Server

list_mcp_servers

Retrieve available MCP servers from the registry with pagination support for semantic analysis and tool discovery.

Instructions

List MCP servers from the MCP Registry with optional pagination. Returns raw server data for semantic analysis.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of servers to return (1-100, default: 50)
cursorNoPagination cursor for retrieving next set of results
registry_urlNoBase URL of the MCP Registry API (defaults to official registry - https://registry.modelcontextprotocol.io/v0/servers)

Implementation Reference

  • The core handler function that fetches MCP servers from the specified registry URL (default official), applies pagination via limit and cursor, fetches JSON data, adds pagination hints and count info, and returns formatted text content with the servers data for semantic analysis.
    async ({ limit = 50, cursor, registry_url = DEFAULT_REGISTRY_URL }) => {
        const url = new URL(registry_url);
        
        if (cursor) {
            url.searchParams.set("cursor", cursor);
        }
        
        if (limit) {
            url.searchParams.set("limit", limit.toString());
        }
    
        const response = await fetch(url.toString());
        
        if (!response.ok) {
            throw new Error(`HTTP ${response.status}: ${response.statusText}`);
        }
    
        const data = await response.json();
        
        // Return all servers without filtering - let semantic search handle matching
        const hasMoreData = data.metadata && data.metadata.next_cursor;
        const paginationHint = hasMoreData 
            ? `Note: This is a paginated result. There are more MCP servers available. Use cursor "${data.metadata.next_cursor}" to retrieve the next page.\n\n`
            : '';
        
        const totalCount = data.servers ? data.servers.length : 0;
        const countInfo = `Total MCP servers in this response: ${totalCount}\n\n`;
        
        return {
            content: [
                {
                    type: "text",
                    text: `${countInfo}${paginationHint}${JSON.stringify({
                        servers: data.servers,
                        metadata: data.metadata
                    }, null, 2)}`
                }
            ]
        };
    }
  • Zod schema defining the input parameters for the list_mcp_servers tool: optional limit (1-100), cursor for pagination, and optional registry_url.
    {
        limit: z.number().min(1).max(100).optional().describe("Maximum number of servers to return (1-100, default: 50)"),
        cursor: z.string().optional().describe("Pagination cursor for retrieving next set of results"),
        registry_url: z.string().url().optional().describe("Base URL of the MCP Registry API (defaults to official registry - https://registry.modelcontextprotocol.io/v0/servers)")
    },
  • The registration function that adds the 'list_mcp_servers' tool to the MCP server instance, specifying name, description, input schema, and handler.
    export function registerListMcpServers(server: McpServer) {
        server.tool(
            "list_mcp_servers",
            "List MCP servers from the MCP Registry with optional pagination. Returns raw server data for semantic analysis.",
            {
                limit: z.number().min(1).max(100).optional().describe("Maximum number of servers to return (1-100, default: 50)"),
                cursor: z.string().optional().describe("Pagination cursor for retrieving next set of results"),
                registry_url: z.string().url().optional().describe("Base URL of the MCP Registry API (defaults to official registry - https://registry.modelcontextprotocol.io/v0/servers)")
            },
            async ({ limit = 50, cursor, registry_url = DEFAULT_REGISTRY_URL }) => {
                const url = new URL(registry_url);
                
                if (cursor) {
                    url.searchParams.set("cursor", cursor);
                }
                
                if (limit) {
                    url.searchParams.set("limit", limit.toString());
                }
    
                const response = await fetch(url.toString());
                
                if (!response.ok) {
                    throw new Error(`HTTP ${response.status}: ${response.statusText}`);
                }
    
                const data = await response.json();
                
                // Return all servers without filtering - let semantic search handle matching
                const hasMoreData = data.metadata && data.metadata.next_cursor;
                const paginationHint = hasMoreData 
                    ? `Note: This is a paginated result. There are more MCP servers available. Use cursor "${data.metadata.next_cursor}" to retrieve the next page.\n\n`
                    : '';
                
                const totalCount = data.servers ? data.servers.length : 0;
                const countInfo = `Total MCP servers in this response: ${totalCount}\n\n`;
                
                return {
                    content: [
                        {
                            type: "text",
                            text: `${countInfo}${paginationHint}${JSON.stringify({
                                servers: data.servers,
                                metadata: data.metadata
                            }, null, 2)}`
                        }
                    ]
                };
            }
        );
    }
  • src/server.ts:2-10 (registration)
    Imports and calls registerListMcpServers during server creation to register the tool with the MCP server.
    import { registerListMcpServers } from "./tools/listMcpServers.js";
    
    export function createServer(): McpServer {
      const server = new McpServer({
        name: "MCP Server for MCP Registry",
        version: "0.1.0",
      });
    
      registerListMcpServers(server);
  • Default URL for the official MCP Registry API used in the tool handler.
    const DEFAULT_REGISTRY_URL = "https://registry.modelcontextprotocol.io/v0/servers";
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 mentions 'Returns raw server data for semantic analysis' which hints at the output format, but lacks critical details like rate limits, authentication requirements, error conditions, or what 'raw server data' specifically entails.

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

Conciseness4/5

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

The description is efficiently structured in two sentences that directly address the tool's function and output. It avoids unnecessary verbiage, though it could be slightly more front-loaded by explicitly stating it's a read-only operation.

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?

For a read operation with 3 well-documented parameters but no output schema or annotations, the description is minimally adequate. It covers the basic purpose and output type but lacks details about response format, error handling, and practical usage scenarios that would make it more complete.

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

Parameters3/5

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

The input schema has 100% description coverage, providing clear documentation for all 3 parameters. The description adds no additional parameter semantics beyond what's in the schema, so it meets the baseline score of 3 for adequate but not enhanced coverage.

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 MCP servers') and resource ('from the MCP Registry'), and specifies the optional pagination feature. It distinguishes the tool's purpose well, though without sibling tools to differentiate from, it cannot achieve a perfect score of 5.

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, prerequisites, or specific contexts. It mentions 'optional pagination' but doesn't explain when pagination is needed or how to handle large result sets.

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/formulahendry/mcp-server-mcp-registry'

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