CLI工具执行器

MCP Launchpad是一个轻量级CLI工具,用于发现和执行来自多个MCP(Model Context Protocol)服务器的工具,适用于开发效率和自动化场景。

  • by kenneth-liao
  • Python
  • 本地部署
  • 206 星标
  • 更新于
在 GitHub 查看 kenneth-liao/mcp-launchpad

使用说明

MCP发射板

一个轻量级的CLI,用于从多个MCP(模型上下文协议)服务器中发现和执行工具。

安装

先决条件: 紫外线 -Python包和环境管理器

uv tool install https://github.com/kenneth-liao/mcp-launchpad.git

验证它是否有效:

mcpl --help

快速参考

# Find tools
mcpl search "<query>"                    # Search all tools (returns 5 by default)
mcpl search "<query>" --limit 10         # Get more results
mcpl list                                # List all MCP servers
mcpl list <server>                       # List tools for a server

# Get tool details
mcpl inspect <server> <tool>             # Full schema
mcpl inspect <server> <tool> --example   # Schema + example call

# Execute tools
mcpl call <server> <tool> '{}'                        # No arguments
mcpl call <server> <tool> '{"param": "value"}'        # With arguments

# Troubleshooting
mcpl verify                              # Test all server connections
mcpl session status                      # Check daemon status
mcpl session stop                        # Restart daemon (auto-restarts on next call)

配置

创建 mcp.json 在您的项目目录中(或 ~/.claude/mcp.json 全局配置):

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@anthropic/mcp-server-filesystem", "/path/to/allowed/dir"]
    }
  }
}

验证方式 mcpl list。如果看不到服务器,请重新启动终端并运行 mcpl list --refresh.

添加更多服务器

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@anthropic/mcp-server-filesystem", "/path/to/dir"]
    },
    "github": {
      "command": "uvx",
      "args": ["mcp-server-github"],
      "env": {
        "GITHUB_TOKEN": "${GITHUB_TOKEN}"
      }
    }
  }
}

环境变量使用 ${VAR} 语法和从加载 ~/.claude/.env 和 ./.env.

配置发现

MCP Launchpad按以下顺序搜索配置文件:

  1. ./mcp.json -项目级配置
  2. ./.claude/mcp.json -项目级Claude配置
  3. ~/.claude/mcp.json -用户级配置

当找到多个配置文件时,mcpl会提示您选择要使用的文件。您的偏好已保存,以后可以使用更改 mcpl config files --select.

代理集成

MCP Launchpad可与任何可以运行bash命令的AI代理(Claude Code、Cursor、Windsurf等)配合使用。

复制根目录 CLAUDE.md 内容变成你自己的 CLAUDE.md 或 AGENTS.md 教你的代理人如何使用 mcpl这可以在项目层面完成(./CLAUDE.md)或用户级别(~/.claude/CLAUDE.md).

重要提示:OAuth身份验证

代理无法完成OAuth流,因为它们需要浏览器交互。您必须对所有受OAuth保护的MCP服务器进行身份验证 之前 代理商可以使用它们:

mcpl auth login <server>    # Authenticate a specific server
mcpl list --refresh         # Prompts to authenticate each server that requires OAuth
mcpl auth status            # Verify all servers are authenticated

小贴士:将一个部分添加到您的 CLAUDE.md 列出您连接的MCP服务器,以便更好地发现工具。

这带来了什么

有了这些说明,您的代理人可以:

  • 搜索工具 跨所有MCP服务器
  • 执行工具 通过致电 mcpl 通过bash
  • 发现功能 在添加新的MCP服务器时动态
  • 处理错误 优雅地内置故障排除指南

目录

命令

mcpl search <query>

在所有已配置的服务器上搜索工具。默认情况下返回5个结果。

mcpl search "sentry errors"
mcpl search "issues" --limit 10   # Get more results

mcpl list [server]

列出特定服务器的已配置服务器或工具。

mcpl list           # List all servers
mcpl list github    # List tools for github server

mcpl call <server> <tool> [arguments]

在服务器上执行工具。

mcpl call github list_issues '{"owner": "acme", "repo": "api"}'

mcpl inspect <server> <tool>

获取特定工具的完整架构。

mcpl inspect github list_issues --example   # Include example call

mcpl session status|stop

管理会话守护进程。

mcpl session status   # Show daemon status and connected servers
mcpl session stop     # Stop the session daemon

mcpl auth login|logout|status

管理HTTP服务器的OAuth 2.1身份验证。

mcpl auth login notion    # Authenticate with an OAuth-protected server
mcpl auth logout notion   # Remove stored authentication
mcpl auth logout --all    # Clear all stored tokens
mcpl auth status          # Show authentication status for all servers

mcpl enable|disable <server>

在不修改配置文件的情况下启用或禁用服务器。

mcpl disable slow-server    # Temporarily disable a server
mcpl enable slow-server     # Re-enable it

mcpl config

显示当前配置和加载的服务器。

mcpl config

mcpl config files

当有多个配置文件可用时,管理哪些配置文件处于活动状态。

mcpl config files                    # View config files and their status
mcpl config files --select           # Interactive selection prompt
mcpl config files --activate 1       # Activate config by number
mcpl config files --deactivate 2     # Deactivate config by number
mcpl config files --all              # Activate all discovered configs
mcpl config files --reset            # Clear preferences (re-prompts on next run)

mcpl verify

测试所有配置的服务器是否可以连接并响应。

mcpl verify

JSON模式

添加 --json 对于机器可读输出:

mcpl --json search "github"
mcpl --json call github list_repos '{}'

会话守护进程

MCP Launchpad使用会话守护进程来维护与MCP服务器的持久连接,从而提高重复调用的性能。守护进程首先自动启动 mcpl call.

自动清理

环境 清理触发器
常规终端 父终端进程退出
VS代码/Claude代码 IDE会话结束(通过VS代码套接字检测到)
任何环境 空闲超时(默认值:1小时无活动)
手册 mcpl session stop 命令

故障排除

mcpl session status                         # Check daemon status
mcpl session stop                           # Stop the daemon manually
mcpl call github list_repos '{}' --no-daemon  # Bypass daemon for debugging

如果遇到持续存在的问题,停止并重新启动守护进程通常可以解决这些问题。

高级主题

HTTP服务器配置

HTTP服务器通过HTTP连接到远程MCP端点。

{
  "mcpServers": {
    "remote-api": {
      "type": "http",
      "url": "https://api.example.com/mcp",
      "headers": {
        "Authorization": "Bearer ${API_TOKEN}"
      }
    }
  }
}
字段 必填 描述
type 是 必须是 "http"
url 是 MCP端点的完整URL
headers 否 HTTP标头(支持 ${VAR} 语法)

有关OAuth保护的服务器,请参阅 OAuth身份验证.

SSE传输配置

一些传统的MCP服务器使用服务器发送事件(SSE),而不是较新的流式HTTP传输:

{
  "mcpServers": {
    "legacy-server": {
      "type": "sse",
      "url": "https://legacy.example.com/sse",
      "headers": {
        "Authorization": "Bearer ${API_TOKEN}"
      }
    }
  }
}

注: 提供SSE传输是为了与较旧的MCP服务器兼容。新服务器应使用标准HTTP传输。

OAuth身份验证

一些远程MCP服务器(如Notion、Figma和其他云服务)需要OAuth身份验证。MCP Launchpad使用OAuth 2.1和PKCE安全地处理了这一问题。

快速开始

当您连接到需要身份验证的服务器时,mcpl将提示您:

$ mcpl list notion --refresh
Server 'notion' requires OAuth authentication.
Would you like to authenticate now? [Y/n]

或者主动进行身份验证:

mcpl auth login notion

这将打开您的浏览器进行授权。批准后,令牌将安全存储。

命令

命令 描述
mcpl auth login <server> 使用OAuth保护的服务器进行身份验证
mcpl auth logout <server> 删除存储的身份验证
mcpl auth logout --all 清除所有存储的令牌
mcpl auth status [server] 显示身份验证状态

配置

对于需要预先注册OAuth凭据的服务器:

{
  "mcpServers": {
    "notion": {
      "type": "http",
      "url": "https://mcp.notion.com/mcp",
      "oauth_client_id": "${NOTION_CLIENT_ID}",
      "oauth_client_secret": "${NOTION_CLIENT_SECRET}",
      "oauth_scopes": ["read", "write"]
    }
  }
}

令牌被加密并存储在本地 ~/.cache/mcp-launchpad/oauth/ 使用系统的密钥环。

故障排除

问题 解决方案
“服务器需要OAuth身份验证” 运行 mcpl auth login <server>
令牌已过期 运行 mcpl auth login <server> --force
浏览器无法打开 从终端复制URL并手动打开
“无效客户端”错误 检查 oauth_client_id 和 oauth_client_secret
密钥环警告 使用回退加密(仍然安全)
“元数据获取失败” 在中手动配置凭据 mcp.json
Advanced: Login Options & Security Details

登录选项

mcpl auth login notion                     # Basic authentication
mcpl auth login figma --scope "read write" # Request specific scopes
mcpl auth login custom --force             # Re-authenticate (replace existing tokens)
mcpl auth login server --client-id "id"    # Specific client ID

# Secure secret input (recommended)
echo "secret" | mcpl auth login server --client-secret-stdin

# Or via environment variable
export MCPL_CLIENT_SECRET="secret"

选项:

  • --scope TEXT -要请求的其他OAuth范围
  • --force -即使已登录,也强制重新身份验证
  • --client-id TEXT -使用特定的OAuth客户端ID
  • --client-secret-stdin -从stdin读取客户端机密
  • --timeout INTEGER -浏览器回调超时(默认值:120秒)

客户注册策略

MCP Launchpad使用灵活的注册方法:

  1. 配置文件 -中的预配置凭据 mcp.json
  2. 动态条件响应 -动态客户端注册(如果服务器支持)
  3. 交互式 -手动输入作为回退

这种方法比需要DCR支持的Claude Code更灵活。

服务器兼容性

MCP Launchpad支持具有不同标准合规性级别的OAuth服务器:

  • RFC 9728 -MCP原生OAuth服务器 /.well-known/oauth-authorization-server 在MCP资源路径上
  • RFC 8414 -标准OAuth服务器 /.well-known/oauth-authorization-server 在服务器根目录
  • 不合规 -没有元数据发现的服务器(退回到手动配置)

安全特性

  • Fernet加密 (AES-128-CBC+HMAC)用于静态令牌
  • OS钥匙圈集成 (macOS上的Keychain,Linux上的libsecret,Windows上的DPAPI)
  • PKCE与S256 (RFC 7636)用于安全授权
  • 令牌撤销 注销时(RFC 7009)
  • HTTPS强制 适用于所有OAuth端点

注: 如果操作系统密钥环不可用,将显示警告,令牌将使用回退加密。

环境变量

您可能需要配置的常见设置:

变量 默认值 描述
MCPL_CONFIG_FILES (自动) 逗号分隔的配置文件列表(覆盖发现)
MCPL_CONNECTION_TIMEOUT 45 服务器连接超时(秒)
MCPL_IDLE_TIMEOUT 3600 守护进程空闲超时(0表示禁用)
All Environment Variables

连接设置

变量 默认值 描述
MCPL_CONNECTION_TIMEOUT 45 MCP服务器连接/初始化超时(秒)
MCPL_RECONNECT_DELAY 5 重试失败的服务器连接之前的延迟(秒)
MCPL_MAX_RECONNECT_ATTEMPTS 3 放弃前的最大重新连接尝试次数

守护程序设置

变量 默认值 描述
MCPL_DAEMON_START_TIMEOUT 30 等待守护进程启动的最长时间(秒)
MCPL_DAEMON_CONNECT_RETRY_DELAY 0.2 尝试连接守护进程之间的延迟(秒)
MCPL_PARENT_CHECK_INTERVAL 5 守护进程检查父进程是否处于活动状态的频率(秒)

IDE/会话设置

变量 默认值 描述
MCPL_IDLE_TIMEOUT 3600 在这几秒钟不活动后关闭守护进程(0表示禁用)
MCPL_IDE_ANCHOR_CHECK_INTERVAL 10 检查IDE会话是否仍处于活动状态的频率(秒)
MCPL_SESSION_ID (自动) 覆盖会话ID(用于测试或高级多会话设置)

平台说明

窗户(实验)

Windows支持使用命名管道进行IPC通信。虽然功能正常,但与macOS/Linux上的Unix套接字相比,它可能存在局限性。

如果您遇到问题:

  1. 使用 --no-daemon 标记以绕过会话守护进程
  2. 集 MCPL_SESSION_ID 明确表示会话检测是否不可靠
  3. 报告问题https://github.com/kenneth-liao/mcp-launchpad/issues

发展

需要Python 3.13+

git clone https://github.com/kenneth-liao/mcp-launchpad.git
cd mcp-launchpad
uv sync --all-extras

# Run tests
uv run pytest

# Run tests with coverage
uv run pytest --cov=mcp_launchpad

# Type checking
uv run mypy mcp_launchpad

特性

  • 统一工具发现 -使用BM25、正则表达式或精确匹配在所有配置的MCP服务器上搜索
  • 持久连接 -会话守护进程维护服务器连接,以实现更快的重复调用
  • HTTP和Stdio支持 -连接到本地基于进程的服务器和远程HTTP/Streamable MCP服务器
  • 苏格兰和南方能源公司运输支持 -使用服务器发送事件连接到旧版MCP服务器
  • 多配置管理 -通过交互式选择同时使用多个配置文件
  • OAuth 2.1身份验证 -OAuth保护的MCP服务器(Notion、Figma等)的安全身份验证
  • 自动配置 -阅读来源 ./mcp.json (项目层面)或 ~/.claude/mcp.json (用户级别)
  • 交叉平台的 -适用于macOS、Linux和Windows(实验)
  • JSON模式 -用于脚本编写和自动化的机器可读输出

许可证

麻省理工学院