Skill站外收录 @skilllib/skill-2014279376177672194
claude-skill
提供与模型上下文协议服务器的命令行交互能力,支持会话管理、工具调用、资源读取、提示获取及身份认证,可通过本地或远程服务端执行结构化操作,并兼容 JSON 输出与管道处理,适用于自动化集成与 AI 代理协作场景。
数据与分析 AI 技能
Skills.MD
# mcpc: MCP command-line client
Use `mcpc` to interact with MCP (Model Context Protocol) servers from the command line.
This is more efficient than function calling - generate shell commands instead.
## Quick reference
```bash
# List sessions and auth profiles
mcpc
# Show server info
mcpc <server>
mcpc @<session>
# Tools
mcpc <target> tools-list
mcpc <target> tools-get <tool-name>
mcpc <target> tools-call <tool-name> key:=value key2:="string value"
# Resources
mcpc <target> resources-list
mcpc <target> resources-read <uri>
# Prompts
mcpc <target> prompts-list
mcpc <target> prompts-get <prompt-name> arg1:=value1
# Sessions (persistent connections)
mcpc <server> connect @<name>
mcpc @<name> <command>
mcpc @<name> close
# Authentication
mcpc <server> login
mcpc <server> logout
```
## Target types
- `mcp.example.com` - Direct HTTPS connection to remote server
- `localhost:8080` or `127.0.0.1:8080` - Local HTTP server (http:// is default for localhost)
- `@session-name` - Named persistent session (faster, maintains state)
- `config-entry` - Entry from config file (with `--config`)
## Passing arguments
Arguments use `key:=value` syntax. Values are auto-parsed as JSON when valid:
```bash
# String values
mcpc @s tools-call search query:="hello world"
# Numbers, booleans, null (auto-parsed as JSON)
mcpc @s tools-call search query:="hello" limit:=10 enabled:=true
# Complex JSON values
mcpc @s tools-call search config:='{"nested":"value"}' items:='[1,2,3]'
# Force string type with JSON quotes
mcpc @s tools-call search id:='"123"'
# Inline JSON object (if first arg starts with { or [)
mcpc @s tools-call search '{"query":"hello","limit":10}'
# From stdin (auto-detected when piped)
echo '{"query":"hello"}' | mcpc @s tools-call search
```
## JSON output for scripting
Always use `--json` flag for machine-readable output:
```bash
# Get tools as JSON
mcpc --json @apify tools-list
# Call tool and parse result with jq
mcpc --json @apify tools-call search query:="test" | jq '.content[0].text'
# Chain commands
mcpc --json @server1 tools-call get-data | mcpc @server2 tools-call process
```
## Sessions for efficiency
Create sessions for repeated interactions:
```bash
# Create session (or reconnect if exists)
mcpc mcp.apify.com connect @apify
# Use session (faster - no reconnection overhead)
mcpc @apify tools-list
mcpc @apify tools-call search query:="test"
# Restart session (useful after server updates)
mcpc @apify restart
# Close when done
mcpc @apify close
```
**Session states:**
- 🟢 **live** - Bridge running, server might or might not be responding
- 🟡 **crashed** - Bridge crashed; auto-restarts on next use
- 🔴 **expired** - Server rejected session; needs `close` and reconnect
## Authentication
**OAuth (interactive login)**:
```bash
mcpc mcp.apify.com login
mcpc mcp.apify.com connect @apify
```
**Bearer token**:
```bash
mcpc -H "Authorization: Bearer $TOKEN" mcp.apify.com tools-list
mcpc -H "Authorization: Bearer $TOKEN" mcp.apify.com connect @myserver
```
## Proxy server for AI isolation
Create a proxy MCP server that hides authentication tokens:
```bash
# Human creates authenticated session with proxy
mcpc mcp.apify.com connect @ai-proxy --proxy 8080
# AI agent connects to proxy (no access to original tokens)
# Note: localhost defaults to http://
mcpc localhost:8080 tools-list
mcpc 127.0.0.1:8080 connect @sandboxed
```
## Common patterns
**List and inspect tools**:
```bash
mcpc @s tools-list
mcpc @s tools-get tool-name
```
**Call tool and extract text result**:
```bash
mcpc --json @s tools-call my-tool | jq -r '.content[0].text'
```
**Read resource content**:
```bash
mcpc @s resources-read "file:///path/to/file"
```
**Use config file for local servers**:
```bash
mcpc --config .vscode/mcp.json filesystem resources-list
```
## Exit codes
- `0` - Success
- `1` - Client error (invalid arguments)
- `2` - Server error (tool failed)
- `3` - Network error
- `4` - Authentication error
## Debugging
```bash
# Verbose output shows protocol details
mcpc --verbose @s tools-call my-tool
```
## Example script
See [`docs/examples/company-lookup.sh`](../examples/company-lookup.sh) for a complete example
of an AI-generated script that validates prerequisites and calls MCP tools.
评论 0
还没有评论,来抢沙发。
相关内容
同类或同场景的收录内容
building-with-kafka-strimzi
在 Kubernetes 上构建基于 Apache Kafka 的事件驱动系统,支持高可靠的消息传递、事务性处理与精确一次语义,结合 Strimzi 运营商实现集群自动化管理,利用 Schema Registry 保障事件模式演进,适用于微服务间解耦通信与实时数据流处理场景。
站外数据与分析
609 0.0
personal-tool-builder
专注于从个人真实痛点出发快速构建实用工具,涵盖命令行程序、本地优先应用和自动化脚本的开发与演进,强调先满足自身需求再逐步扩展,通过持续自用打磨功能,避免过度设计,确保工具简洁有效且长期可维护。
站外商业与营销
196 0.0
threejs-lighting
实现三维场景中的光照与阴影控制,支持多种光源类型及环境光照明,提供从基础布光到高级阴影优化的完整方案,适用于需要真实感渲染或性能平衡的可视化项目。
站外效率工具
442 0.0
aggregation-helper
提供数据聚合场景的自动化辅助能力,涵盖 SQL 查询编写、统计分析建模、可视化方案设计及商业智能配置,支持从需求理解到生产级代码生成的全流程指导。
站外效率工具数据与分析
217 0.0
举报「claude-skill」
举报信息仅审核团队可见,同一资产 24 小时内仅可举报一次