返回顶部
m

mcp-client

Model Context Protocol (MCP) client - connect to tools, data sources and services

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.3
安全检测
已通过
1,480
下载量
0
收藏
概述
安装方式
版本历史

mcp-client

# MCP Client Skill Implementation of the Model Context Protocol (MCP) client for connecting to tools and data sources. ## What it does - **Connect to MCP Servers** - Access tools and resources from MCP-enabled services - **Tool Invocation** - Call tools exposed by MCP servers - **Resource Access** - Read files, databases, APIs - **Prompt Templates** - Use structured prompts from MCP servers ## Installation ```powershell # Install Python dependencies (requests is the only required dependency) pip install requests ``` ## Usage ### Connect to MCP Server ```powershell .\mcp.ps1 -Action connect -ServerUrl "https://mcp-server.com" -ApiKey "your-key" ``` ### List Available Tools ```powershell .\mcp.ps1 -Action tools -ServerUrl "https://mcp-server.com" ``` ### Call a Tool ```powershell .\mcp.ps1 -Action call -ServerUrl "https://mcp-server.com" -ToolName "search" -Arguments '{"query": "AI agents"}' ``` ### List Resources ```powershell .\mcp.ps1 -Action resources -ServerUrl "https://mcp-server.com" ``` ### Read a Resource ```powershell .\mcp.ps1 -Action read -ServerUrl "https://mcp-server.com" -ResourceUri "file:///data/config.json" ``` ## MCP Concepts - **MCP Server**: Service that exposes tools, resources, and prompts - **Tools**: Functions the LLM/agent can call - **Resources**: Data sources (files, APIs, DBs) - **Prompts**: Pre-defined prompt templates ## API Reference ``` POST /mcp/connect - Connect to server GET /mcp/tools - List available tools POST /mcp/call - Invoke a tool GET /mcp/resources - List resources GET /mcp/read - Read resource GET /mcp/prompts - List prompt templates ``` ## Examples ### Python Usage ```python from mcp_client import MCPClient client = MCPClient("https://mcp-server.com", api_key="key") # List tools tools = client.list_tools() print(tools) # Call tool result = client.call_tool("search", {"query": "quantum"}) print(result) # Read resource data = client.read_resource("file:///config.json") print(data) ``` ## ⚠️ Security Warnings ### file:// URI Risk The MCP protocol allows `file:///path` URIs to read files from the server. **Only connect to trusted MCP servers.** A malicious server could exfiltrate sensitive files. ### Best Practices - Only use MCP servers you control or trust - Don't connect to random public MCP servers - Review what tools/resources are available before using ## Requirements - Review what tools/resources are available before using - Python 3.8+ - requests library ## License MIT

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 mcp-client-1775935723 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 mcp-client-1775935723 技能

通过命令行安装

skillhub install mcp-client-1775935723

下载 Zip 包

⬇ 下载 mcp-client v1.0.3

文件大小: 3.28 KB | 发布时间: 2026-4-12 10:32

v1.0.3 最新 2026-4-12 10:32
Force rescan - verified working

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部