Get the FREE Ultimate OpenClaw Setup Guide →

mcp-client

Simplest example of MCP client-server architecture over HTTP using Python & Golang

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio duaraghav8-mcp-client-server python server.py

How to use

This MCP server is a Python-based remote MCP server that exposes its tools over HTTP. The example shows a simple client-server pair where the server runs a basic MCP endpoint and the client can call a tool on the server via HTTP. You can start the server in development mode to experiment with tools, then run the client to invoke server-side tools and receive results. By default, the server listens on port 8000 and serves the MCP API at /mcp, allowing you to interact with available commands and tools from the client.

How to install

Prerequisites:

  • Python 3.8+ installed on your system
  • Virtual environment support (venv)
  • Basic network access to run HTTP requests

Step-by-step:

  1. Create and activate a virtual environment: python3 -m venv venv source venv/bin/activate

  2. Install dependencies using uv (as shown in the project README): uv install

  3. Run the server in development mode to test tools: mcp dev server.py

  4. Start the MCP server: python server.py Access the MCP API at http://0.0.0.0:8000/mcp by default

  5. In another terminal, run the MCP client to call a server tool: python client.py

Additional notes

Tips and common issues:

  • Ensure the virtual environment is activated before running any commands.
  • The server defaults to port 8000 and binds to 0.0.0.0; adjust firewall rules if needed.
  • If you modify dependencies, run uv install again to refresh the environment.
  • When troubleshooting, check server.py logs for any errors related to tool registration or HTTP endpoints.
  • The MCP client communicates with the server over HTTP; ensure network access between client and server hosts.

Related MCP Servers

Sponsor this space

Reach thousands of developers