Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:1mcp app Agent searchCommand

From Leeroopedia
Knowledge Sources
Domains CLI, MCP_Protocol
Last Updated 2026-10-29 00:00 GMT

Overview

Concrete CLI command for searching the MCP server registry by query, status, package type, and transport with paginated, formatted output.

Description

The searchCommand function queries the MCP server registry for servers matching a search query. It supports filtering by status (active, archived, deprecated), package registry type (npm, pypi, docker), and transport type (stdio, sse, http). Results are paginated via cursor and output in table, list, or JSON format. The command delegates to `handleSearchMCPServers` for the actual registry API call and uses formatters for display.

Usage

Import this function when you need to:

  • Discover available MCP servers from the registry before installation
  • Filter servers by package type, transport, or lifecycle status
  • Paginate through large result sets with cursor-based pagination
  • Output search results in machine-readable (JSON) or human-readable (table/list) format

Code Reference

Source Location

  • Repository: 1MCP Agent
  • File: src/commands/registry/search.ts (L38-91)

Signature

export interface SearchCommandArgs extends Arguments, GlobalOptions, RegistryYargsOptions {
  query?: string;
  status?: 'active' | 'archived' | 'deprecated' | 'all';
  type?: 'npm' | 'pypi' | 'docker';
  transport?: 'stdio' | 'sse' | 'http';
  limit?: number;
  cursor?: string;
  format?: 'table' | 'list' | 'json';
}

export function buildSearchCommand(searchYargs: Argv): Argv;
export async function searchCommand(argv: SearchCommandArgs): Promise<void>;

Import

import { searchCommand, buildSearchCommand, SearchCommandArgs } from '@src/commands/registry/search.js';

I/O Contract

Inputs

Name Type Required Description
query string No Search query matching server names and descriptions
status 'archived' | 'deprecated' | 'all' No Filter by status (default: active)
type 'pypi' | 'docker' No Filter by package registry
transport 'sse' | 'http' No Filter by transport method
limit number No Max results (default: 20)
cursor string No Pagination cursor
format 'list' | 'json' No Output format (default: table)

Outputs

Name Type Description
stdout formatted text Search results printed to stdout

Usage Examples

Basic Search

import { searchCommand } from '@src/commands/registry/search.js';

await searchCommand({
  query: 'file system',
  status: 'active',
  format: 'table',
  // ...global options
});

JSON Output for Scripting

1mcp registry search "database" --format=json --limit=10

Related Pages

Implements Principle

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment