Sandbox
@lirantal/ls-mcp

CLI for listing local MCP server configs

ls-mcp scans your machine for MCP configuration files across supported AI apps and agentic editors. It groups server definitions, shows runtime status, and can analyze configs for exposed secrets. You can also point it at specific files or export the results as JSON.

84 stars8 forksTypeScriptUpdated 10d ago
Who it's for

Builders who use MCP-enabled tools and want to see what local servers are configured.

What it delivers

You can inspect your MCP setup, spot running servers, and catch risky credentials without digging through files by hand.

What it does

MCP discovery

Finds MCP server configurations across supported local apps and editor setups.

Directory bubbling

Walks up nested folders to find project-scoped MCP config alongside global configs.

Process detection

Shows whether MCP servers are currently running.

Credential analysis

Checks environment variables and API keys for possible exposed credentials.

Custom file analysis

Analyzes only the config files you pass with `--files` instead of auto-discovering.

JSON output

Prints structured output for scripting and automation with `--json`.

How to get it

  1. 1Run
    npx ls-mcp
  2. 2To analyze specific MCP configuration files instead of using automatic discovery, use…
    # Single file
    npx ls-mcp --files ./mcp-config.json
    
    # Multiple files (comma-separated)
    npx ls-mcp --files ./config1.json,./config2.json
    
    # Multiple files (space-separated)
    npx ls-mcp --files ./config1.json ./config2.json
  3. 3By default, ls-mcp hides providers that have zero configured servers to reduce clutter.…
    # Show all providers including empty ones
    npx ls-mcp --all
    
    # Short form
    npx ls-mcp -a
    
    # Combine with JSON output
    npx ls-mcp --all --json
  4. 4To output results in JSON format (useful for programmatic consumption)
    npx ls-mcp --json
    
    # Combine with --files flag
    npx ls-mcp --files ./config.json --json
  5. 5To enable verbose debugging output, set the NODE_DEBUG environment variable
    # Enable debug logging for ls-mcp
    NODE_DEBUG=ls-mcp npx ls-mcp
    
    # Enable all debug logging
    NODE_DEBUG=* npx ls-mcp

README

ls-mcp

Detect Configured MCP (Model Context Protocol) in your local dev environment

npm version license downloads build codecov Responsible Disclosure Policy

ls-mcp logo

Features

  • 🔍 MCP Discovery: Automatically detect MCP servers across various AI applications and agentic IDEs
  • 📁 Directory Bubbling: Intelligent discovery of project-scoped MCP configs from nested directories, supporting project-scoped MCP Server configuration and global configurations
  • 🔄 Process Detection: Real-time status of running MCP servers
  • 🔒 Credential Analysis: Security analysis of environment variables and API keys for potentially exposed credentials in MCP Servers

Usage: CLI

npx ls-mcp

Analyze Specific Files

To analyze specific MCP configuration files instead of using automatic discovery, use the --files flag. This flag replaces automatic discovery and only analyzes the files you specify:

# Single file
npx ls-mcp --files ./mcp-config.json

# Multiple files (comma-separated)
npx ls-mcp --files ./config1.json,./config2.json

# Multiple files (space-separated)
npx ls-mcp --files ./config1.json ./config2.json

The --files flag automatically detects the configuration structure in your files, supporting various formats including:

  • servers - Standard MCP configuration key
  • mcpServers - Alternative MCP configuration key
  • mcp.servers - Nested configuration format
  • context_servers - Context-based configuration format

Show All Providers

By default, ls-mcp hides providers that have zero configured servers to reduce clutter. To show all providers including those with empty configurations, use the --all or -a flag:

# Show all providers including empty ones
npx ls-mcp --all

# Short form
npx ls-mcp -a

# Combine with JSON output
npx ls-mcp --all --json

Note: When using --files to analyze specific configuration files, the custom group is always shown even if it contains zero servers, as you explicitly requested to analyze those files.

JSON Output

To output results in JSON format (useful for programmatic consumption):

npx ls-mcp --json

# Combine with --files flag
npx ls-mcp --files ./config.json --json

This will return a structured JSON object containing:

  • mcpFiles: Complete MCP server configurations organized by provider (only includes providers with configured servers unless --all is specified)
  • summary: Statistics including total servers, running servers, credential warnings, and transport breakdown

Debug Mode

To enable verbose debugging output, set the NODE_DEBUG environment variable:

# Enable debug logging for ls-mcp
NODE_DEBUG=ls-mcp npx ls-mcp

# Enable all debug logging
NODE_DEBUG=* npx ls-mcp

Documentation

For detailed information about the project architecture and features:

Documentation

Contributing

Please consult CONTRIBUTING for guidelines on contributing to this project.

Author

ls-mcp © Liran Tal, Released under the Apache-2.0 License.

Files in the repo

Repository payload27 top-level entries
  • __tests__
  • .changeset
  • .cursor
  • .devcontainer
  • .github
  • .husky
  • .vscode
  • docs
  • src
  • .gitignore
  • .markdownlintignore
  • .npmrc
  • .prettierignore
  • .prettierrc.json
  • AGENTS.md
  • CHANGELOG.md
  • CONTRIBUTING.md
  • eslint.config.js
  • LICENSE
  • lychee.toml
  • package-lock.json
  • package.json
  • README.md
  • RELEASE.md
  • SECURITY.md
  • tsconfig.json
  • tsup.config.ts

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More tools

JuliusBrussee/
caveman

🪨 why use many token when few token do trick — Claude Code skill that cuts 65% of tokens by talking like caveman

105k
1 add
MemPalace/
mempalace

The best-benchmarked open-source AI memory system. And it's free.

59k
stablyai/
orca

Orca is the ADE for working with a fleet of parallel agents. Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

66k

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

132k

Never stop coding. Free MIT AI gateway: one endpoint, 352 providers (150+ free), 1200+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 550+ contributors

64k
headroomlabs-ai/
headroom

Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.

71k