About MCP Server and Client
This project is a minimal Python example for developers learning how MCP servers and clients work together. It pairs a FastMCP server with an MCP SDK client that connects and calls tools, with results shown in the terminal.
Key features
- 01Minimal FastMCP server example
- 02MCP SDK client example
- 03Tool calls from client to server
- 04Terminal output for results
Use cases
- 01Learning the basic MCP communication flow
- 02Trying server tools from a Python client
MCP support
Demonstrates MCP communication: a client connects to a FastMCP server and calls its tools.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEMCP Server and Client
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. It serves as a simple reference for understanding how MCP-based communication between agents and tools can be implemented.
Setup Instructions
1. Install uv
python -m pip install uv
2. Initialize the Project and activate the env
uv init mcp_server_for_llm_agents
uv venv
source .venv/bin/activate
3. Install dependencies
uv pip install -r requirements.txt
Server
Agent tools (e.g., summarize_text, code executin, etc.) should be implemented in server.py Run the server with:
uv run mcp dev server.py
Or directly:
python server.py
Client
A client using the official MCP SDK is defined in client.py
Run using:
python client.py
It connects to the MCP server and calls tools like: summarize_text, cat_fact, execute_code present from server.py
After running we can see results in terminal for now
References:
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.