mcp_server_and_client

mcp_server_and_client

3.3

This project provides a minimal working example of the Model Context Protocol (MCP), demonstrating how to set up a FastMCP server with basic tools and interact with it using an MCP client.

The MCP Server and Client project is designed to offer a straightforward example of how the Model Context Protocol can be implemented to facilitate communication between agents and tools. By setting up a FastMCP server, users can define various agent tools such as text summarization and code execution. The client, using the official MCP SDK, connects to the server to utilize these tools. This project serves as a reference for developers looking to understand and implement MCP-based communication in their applications. The setup involves initializing the project, installing necessary dependencies, and running both server and client scripts to demonstrate the interaction.

Features

  • Minimal working example of MCP setup
  • FastMCP server implementation
  • Client interaction using MCP SDK
  • Agent tools like text summarization and code execution
  • Reference for MCP-based communication

Usage with Different Platforms

mcp_server_setup

bash
python -m pip install uv
uv init mcp_server_for_llm_agents
uv venv
source .venv/bin/activate
uv pip install -r requirements.txt
uv run mcp dev server.py

mcp_client_usage

bash
python client.py