Token导航 LogoToken导航TokenDH.com
My CLI Prettier logo
开发工具未说明官方级别未说明来源级核验

My CLI Prettier

MCP Server

一个将MCP(Model Context Protocol)服务器暴露为本地命令行工具的工具,旨在为AI代理提供轻量级、可发现的外部系统交互方式。

工具数

0

提示词数

0

GitHub Stars

0

资源数

0
命令行工具TypeScriptAI代理服务器管理

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

PabloZaiden

提供方

PabloZaiden

最后核验

2026/5/17 20:20

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

我的cli更漂亮

一个CLI工具,将MCP(模型上下文协议)服务器作为本地命令行工具公开。

为什么?

MCP服务器允许AI代理与外部系统交互,但将许多服务器加载到代理的上下文中会降低性能。此工具提供了一种不同的方法:

  • 可发现的:代理可以通过以下方式探索可用的服务器和工具 --help
  • 轻量级:只加载您调用的工具,而不是整个MCP生态系统
  • 熟悉的:任何代理(或人类)都可以使用的标准CLI界面

快速开始

# Clone and install
git clone https://github.com/pablozaiden/my-cli-prettier.git
cd my-cli-prettier
bun install

# Initialize config with example servers
bun start -- config --action init

# List available servers
bun start -- server list

# Explore a server's tools
bun start -- everything help

# Call a tool
bun start -- everything echo --message "Hello MCP!"

安装

先决条件

从源代码运行

bun install
bun start -- 

编译为二进制

npm run compile
./out/mcp 

配置

配置存储在 ~/.my-cli-prettier/config.json:

{
  "servers": {
    "memory": {
      "transport": "stdio",
      "command": "bunx",
      "args": ["-y", "@modelcontextprotocol/server-memory"],
      "description": "Simple key-value memory store"
    },
    "fetch": {
      "transport": "stdio",
      "command": "bunx",
      "args": ["-y", "@modelcontextprotocol/server-fetch"],
      "description": "Fetch and convert web content"
    }
  },
  "settings": {
    "cacheEnabled": true,
    "cacheTtlMs": 14400000
  }
}

服务器类型

Stdio服务器 -本地流程:

{
  "transport": "stdio",
  "command": "bunx",
  "args": ["-y", "@modelcontextprotocol/server-memory"],
  "env": { "API_KEY": "$MY_API_KEY" },
  "description": "Optional description",
  "enabled": true
}

HTTP服务器 -远程端点:

{
  "transport": "http",
  "url": "https://example.com/mcp",
  "headers": { "Authorization": "Bearer $TOKEN" },
  "description": "Optional description"
}

格式中的环境变量 $VAR_NAME 自动解决。

用法

管理服务器

# List enabled servers
mcp server list

# List all servers including disabled
mcp server list --all

# Add a stdio-based server (local process)
mcp server add stdio --name memory --command bunx --args "-y @modelcontextprotocol/server-memory" --description "Memory store"

# Add an HTTP-based server (remote endpoint)
mcp server add http --name api --url "https://api.example.com/mcp" --description "Remote API"

# Disable a server (keeps configuration)
mcp server disable --name memory

# Enable a server
mcp server enable --name memory
# Remove a server completely
mcp server remove --name memory

# Open config file in your editor
mcp server edit

输出 server list:

Enabled servers: 5

✓ memory - Simple key-value memory store
  stdio: bunx -y @modelcontextprotocol/server-memory
✓ filesystem - File system operations
  stdio: bunx -y @modelcontextprotocol/server-filesystem /Users/me
✓ everything - Demo server with sample tools for testing
  stdio: bunx -y @modelcontextprotocol/server-everything
✓ fetch - Fetch and convert web content for LLM usage
  stdio: bunx -y @modelcontextprotocol/server-fetch
✓ time - Time and timezone conversion capabilities
  stdio: bunx -y @anthropic-ai/server-time

使用 --json 用于机器可读输出。

探索服务器工具

mcp  help

例子:

mcp everything help

调用工具

mcp   [options]

示例:

# Echo a message
mcp everything echo --message "Hello!"

# Sum two numbers
mcp everything get-sum --a 10 --b 20
# List files
mcp filesystem list_directory --path "/Users/me/projects"

# Fetch a web page
mcp fetch fetch --url "https://example.com"

# Get current time
mcp time get_current_time

获取工具帮助

mcp   help

管理配置

# Show current config
mcp config

# Initialize example config
mcp server init

# Clear tool cache
mcp config --action cache-clear

缓存

默认情况下,工具定义缓存4小时,以避免每次命令都重新连接到服务器。缓存存储在 ~/.my-cli-prettier/cache/.

要从服务器刷新工具,请清除缓存:

mcp config --action cache-clear

示例服务器

默认配置包括这些服务器(所有服务器仅与 bunx):

服务器描述
memory知识图谱/键值存储
filesystem文件系统操作
everything带有13个示例工具的演示服务器
fetchWeb内容获取和转换
time时间和时区转换

对于AI代理

该工具旨在让AI代理轻松发现:

# Agent discovers available servers
mcp server list

# Agent explores a server
mcp filesystem help

# Agent gets help on a specific tool
mcp filesystem read_text_file help

# Agent calls the tool
mcp filesystem read_text_file --path "/path/to/file.txt"

默认情况下,返回数据时所有输出都是JSON,这使得以编程方式解析变得容易。

构建于

许可证

麻省理工学院

目录标签

目录标签

命令行工具TypeScriptAI代理服务器管理本地部署MCP协议轻量级服务

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

token

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明token部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP