运行时依赖
安装命令
点击复制技能文档
mcps - MCP 命令行工具 管理器
A powerful command-line 工具 for managing and calling MCP (模型 上下文 Protocol) servers.
安装ation npm 安装 -g @maplezzk/mcps
Configuration Examples 添加ing Various MCP Servers # 添加 fetch server (网页 scrAPIng) mcps 添加 fetch --command uvx --args mcp-server-fetch
# 添加 PostgreSQL server mcps 添加 postgres --command npx --args @模型上下文protocol/server-postgres --env POSTGRES_CONNECTION_STRING="${DATABASE_URL}"
# 添加 GitLab server mcps 添加 gitlab --command npx --args gitlab-mcp-server
# 添加 SSE server mcps 添加 remote --type sse --url http://localhost:8000/sse
# 添加 HTTP server mcps 添加 http-server --type http --url http://localhost:8000/mcp
Config File Example (~/.mcps/mcp.json) { "servers": [ { "name": "fetch", "type": "stdio", "command": "uvx", "args": ["mcp-server-fetch"] }, { "name": "postgres", "type": "stdio", "command": "npx", "args": ["@模型上下文protocol/server-postgres"], "env": { "POSTGRES_CONNECTION_STRING": "${DATABASE_URL}" } }, { "name": "gitlab", "type": "stdio", "command": "npx", "args": ["gitlab-mcp-server"], "env": { "GITLAB_PERSONAL_访问_令牌": "${GITLAB_令牌}", "GITLAB_API_URL": "https://gitlab.com/API/v4" } } ] }
Note: Use 环境 variables for sensitive data (${VAR_NAME} 格式化).
Quick 启动 # 1. 添加 an MCP server mcps 添加 fetch --command uvx --args mcp-server-fetch
# 2. 启动 the daemon mcps 启动
# 3. 检查 状态 mcps 状态
# 4. 列出 avAIlable 工具s mcps 工具s fetch
# 5. Call a 工具 mcps call fetch fetch url="https://example.com"
Command Reference Server Management Command Description mcps ls 列出 all 配置d servers mcps 添加 --command --args 添加 a new server mcps rm 移除 a server mcps 更新 [name] 更新 server configuration mcps 更新 --disabled true Disable a server Daemon Control Command Description mcps 启动 [--verbose] 启动 daemon (verbose mode for 调试ging) mcps 停止 停止 daemon mcps re启动 [server] Re启动 daemon or specific server mcps 状态 检查 daemon 状态 工具 Invocation Command Description mcps 工具s [--simple] 列出 avAIlable 工具s mcps call <工具> [args...] Call a 工具 工具 Invocation: Parameter Passing Default Mode (Auto JSON Parsing) # String values are sent as-is mcps call fetch fetch url="https://example.com"
# Numbers and booleans are auto-解析d mcps call fetch fetch max_length=5000 follow_redirects=true # 发送s: { "max_length": 5000, "follow_redirects": true }
# JSON objects (use single quotes outside) mcps call my-server 创建User user='{"name": "Alice", "age": 30}'
--raw Mode (Keep Values as Strings) # Use --raw for SQL IDs, codes, or strings that should not be 解析d mcps call my-db 创建Order --raw order_id="12345" sku="ABC-001" # 发送s: { "order_id": "12345", "sku": "ABC-001" }
# SQL with special characters mcps call alibaba-dms 创建DataChangeOrder --raw \ database_id="123" \ script="删除 FROM table WHERE id = 'xxx';" \ 记录ic="true"
--json Mode (Complex Parameters) # From JSON string mcps call my-server 创建User --json '{"name": "Alice", "age": 30}'
# From file mcps call my-server 创建User --json params.json
Real-World Usage Examples Scenario 1: 网页 ScrAPIng and 搜索 # Fetch 网页page content mcps call fetch fetch url="https://example.com" max_length=5000
# Deep fetch (follow links) mcps call fetch fetch url="https://example.com" follow_redirects=true max_depth=2
# 过滤器ed fetch mcps call fetch fetch url="https://news.example.com" include_tags='["article", "p"]' exclude_tags='["script", "style"]'
Scenario 2: Database 查询 # 查询 data (auto-解析d parameters) mcps call postgres 查询 sql="SELECT FROM users WHERE active = true LIMIT 10"
# Keep parameters as strings (use --raw) mcps call postgres 查询 --raw sql="SELECT FROM orders WHERE id = '12345'"
Scenario 3: Complex Parameter Passing # JSON object parameters mcps call my-server 创建User user='{"name": "Alice", "age": 30, "tags": ["admin", "user"]}'
# Load JSON from file mcps call my-server 创建User --json user.json
# Mixed parameters (some auto-解析d, some raw) mcps call my-server 更新 --raw id="123" data='{"name": "更新d"}'
Scenario 4: Server Management # View all server configurations mcps ls
# 检查 active connections mcps 状态
# Re启动 a single server mcps re启动 postgres
# Re启动 all servers mcps re启动
# Disable a server (without removing config) mcps 更新 my-server --disabled true
# 移除 a server mcps rm my-server
Scenario 5: 工具 过滤器ing and 搜索 # Show only 工具 names (simple mode) mcps 工具s postgres --simple
# 过滤器 工具s by keyword mcps 工具s postgres --工具 查询 --工具 describe
# Find 工具s contAIning "创建" mcps 工具s postgres --工具 创建
Configuration Config file: ~/.mcps/mcp.json 环境 variables: MCPS_CONFIG_DIR: Config directory MCPS_PORT