Kamwebdev/Mcp-simple-client-server
3.2
If you are the rightful owner of Mcp-simple-client-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
mcp-simple-client-server is a minimal working example of the Model Context Protocol (MCP).
Mcp-simple-client-server
Overview
mcp-simple-client-server is a minimal working example of the Model Context Protocol (MCP) — showing how to:
- register tools on an MCP server,
- expose them to an LLM (Ollama, OpenAI-compatible),
- let the model call these tools dynamically,
- return results back into the conversation loop.
The project is intentionally simple and clean, making it an ideal starting point for building your own MCP-powered automations, assistants and local AI integrations.
Tutorial [PL]
All code and content are authored by me.
Available Parts
-
Part 1: Tworzenie serwera MCP
-
Part 2: Połączenie Ollamy z MCP
Install:
python -m venv .venv
.venv\Scripts\activate.bat
pip3 install -r requirements.txt
Run:
MCP Server
To start the mcp server, execute:
cd server
python mcp_server.py
How It Works
- The server starts a FastMCP instance and registers all available tools.
- FastMCP automatically exposes the tools over HTTP at /mcp.
- The client (or LLM) can now remotely execute these tools through function calling.
Sample output:
Client
To run our mcp server client, execute in the second terminal
cd client
cp .env_dist .env
python client.py
Sample outputs:
How It Works
- The client connects to the MCP server.
- It fetches registered tools.
- Tools are forwarded to the LLM (via Ollama function calling).
- The LLM may: answer normally or request tool execution.
- The tool runs on the MCP server.
- The result is returned to the LLM.
- Loop continues until the model stops calling tools.