MCP

MCP

3.2

If you are the rightful owner of MCP and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

Personal MCP Servers and Clients for LLM

MCP

Personal MCP Servers and Clients for LLM

Setup

  1. init the project with uv
uv init --python=3.10 .
touch .gitignore .env
cat << EOF >> .gitignore
.env
.venv/
__pycache__/
EOF
  1. init python virtual environment
uv venv
source .venv/bin/activate
  1. install dependencies
uv add dashscope httpx mcp python-dotenv langchain langchain-core langchain-mcp-adapters langchain-community langgraph
  1. new a uv workspace as follows:
mkdir servers/sse_mcp

cd servers/sse_mcp

uv init --python=3.10 .

MCP Server

MCP Server Weather

This is the MCP server for the Weather service to get US weather data.

Project
# Create a new directory for our project
mkdir -p servers/weather-server-mcp

# Create virtual environment and activate it
uv venv
source .venv/bin/activate

# Create our server file
cd servers/weather-server-mcp
touch weather.py

MCP SSE Server

This is demo for running MCP server with SSE.

uv run sse --port 8000
Run
  1. Copy the server configuration file from the MCP Host, e.g. OpenCat
  2. Select the tool of this MCP server(weather)
  3. Chat in the Host, e.g. OpenCat

MCP Client

MCP Client for Weather Server

This is the MCP client for the Weather service to get US weather data.

Project
# Create project directory
mkdir -p clients/mcp-client

# Create virtual environment
uv venv
# Activate virtual environment
source .venv/bin/activate

# Create our main file
cd clients/mcp-client
touch clients/mcp-client/client.py

MCP SSE Client

This is demo for running MCP server with SSE.

# make sure the server is running, `uv run sse --port 8000`
uv run sse-client
Run
# to run the client which is connected to the weather mcp server
uv run ./clients/mcp-client/client.py ./servers/weather-server-mcp/weather.py

Inspect MCP Server

npx @modelcontextprotocol/inspector \
  uv \
  --directory servers/weather-server-mcp \
  run \
  weather.py