MCP.so
登录

MCP Client Example

@RGGH

基本信息

分类

其他

传输方式

stdio

作者

RGGH

关于 MCP Client Example

Python MCP client + server example

MCP Client Example 配置

使用下面的配置,将此服务器添加到你的 MCP 客户端。

{
  "mcpServers": {
    "mcp-client-x": {
      "command": "uv",
      "args": [
        "run",
        "src/client/mcp_client.py"
      ]
    }
  }
}

MCP Client Example 工具

工具列表暂未提供

当前收录暂时没有可展示的工具列表,不代表服务没有工具。请查阅项目文档了解支持的能力。

工具是从 README 中自动提取的。维护者可以在 ## Tools 标题下列出工具,即可填充这部分内容。

概览

What is MCP Client Example ☀️?

MCP Client Example ☀️ is a demonstrative client-server implementation using the Model Context Protocol (MCP). It shows how to connect a large language model with custom tools and data, intended for developers learning MCP.

How to use MCP Client Example ☀️?

Install dependencies with uv install -e ., then run the client with uv run src/client/mcp_client.py. The client automatically starts the server over stdio, lists available tools, and calls them with sample data.

Key features of MCP Client Example ☀️

  • Exposes two tools: calculate_bmi and fetch_weather
  • Client connects to server via stdio transport
  • Demonstrates synchronous and asynchronous tool calls
  • Can be tested with the MCP Inspector
  • Built with Python 3.9+ and the MCP Python SDK

Use cases of MCP Client Example ☀️

  • Learning how to implement MCP servers and clients
  • Prototyping custom tools for LLM integration
  • Testing MCP tool definitions and responses
  • Building a reference for async tool patterns

常见问题

1

What is MCP?

Model Context Protocol is a standardized way to connect large language models with tools and data.

2

What are the prerequisites to run the example?

Python 3.9+ and the `uv` Python package manager are required.

3

How do I start the client and server?

Run `uv run src/client/mcp_client.py` from the project root; the client launches the server automatically.

4

What tools does the server provide?

The server exposes `calculate_bmi` (computes Body Mass Index) and `fetch_weather` (retrieves weather data from an external API).

5

How can I test the server with MCP Inspector?

Run `mcp dev src/server/example_server.py` and visit `http://localhost:5173` in a browser.

评论

其他 分类下的更多 MCP 服务器