MCP cover image
See in Github
2025-04-03

1

Github Watches

0

Github Forks

0

Github Stars

Simple MCP Client / Server

https://modelcontextprotocol.io/quickstart/server

Install uv, on macOS and Linux.

$ curl -LsSf https://astral.sh/uv/install.sh | sh

Then git clone the repo.

MCP Server (stdio)

uv init mcp_server
cd mcp_server/
uv run main.py                        # just to create the .venv, then rm the main.py

uv add "mcp[cli]" httpx               # MCP server Python lib

touch weather_stdio.py                # STDIO server implementation

Start the server

mcp_server$ uv run weather_stdio.py

Test with VSCode + Cline

Add MCP server to Cline.

Cline -> MCP Servers (icon close to '+') -> Installed -> Add

You get a json template "mcpServers": {} and you add the new server. Here is the cline_mcp_settings.json:

{
  "mcpServers": {
    "weather": {
            "command": "uv",
            "args": [
                "--directory",
                "/home/users/tikoehle/mcp_server",
                "run",
                "weather_stdio.py"
            ]
        }
  }
}

=> Cline shows the 2 get_* Tools functions. Click 'Done' to return to Cline Task input trying the new server.

Test

Type a task calling the two tools: "Can you tell me the weather forecast for San Francisco, CA" "Can you tell me the weather alerts for San Francisco, CA"

=> uses my two new MCP 'weather' server tools.

Note: Local MCP servers should not log messages to stdout because this will interfere with protocol operation.

MCP Client

https://modelcontextprotocol.io/quickstart/client

uv init mcp_client
cd mcp_client/
uv run main.py                     # create venv

uv add mcp

touch client_stdio.py              # MCP client impl.

Run the client

uv run client.py path/to/server.py

mcp_client$ uv run client_stdio.py ../mcp_server/weather_stdio.py

MCP Inspector

Installation Node.js

On the MCP server compute, get Node.js (Current) for Linux using nvm with npm. https://nodejs.org/en/download

cd $HOME

# Download and install nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.2/install.sh | bash

# in lieu of restarting the shell
\. "$HOME/.nvm/nvm.sh"

# Download and install Node.js:
nvm install 23

# Verify the Node.js version:
node -v # Should print "v23.10.0".
nvm current # Should print "v23.10.0".

# Verify npm version:
npm -v # Should print "10.9.2".

Inspecting a locally developed server

mcp_server$ uv run mcp dev ./weather_stdio.py
Starting MCP inspector...
Proxy server listening on port 3000

🔍 MCP Inspector is up and running at http://localhost:5173 🚀

Note:

Another method to install the latest version and start the Inspector.

mcp_server$ npx @modelcontextprotocol/inspector@latest

Open the MCP Inspector client UI in the Browser

http://comp9:5173   --> Connect

Note:

If the MCP dev server runs on a remote compute, for example comp9, then the MCP Inspector Client UI needs to connect to this machine.

Transport Type, Command and Arguments appeared with the correct parameters when launching the UI in the browser.

Transport Type: STDIO
Command: uv
Arguments: run --with mcp mcp run ./weather_stdio.py

or

Transport Type: SSE
URL: http://comp9:8001/sse

Note:

MCP development tools

mcp_server$ uv run mcp

SSE Client / Server

Server

mcp_server$ uv run weather_sse.py      # port 8001

Client

mcp_client$ uv run client_sse.py http://comp9:8001/sse

Python-SDK

https://github.com/modelcontextprotocol/python-sdk/

SSE Issues:

https://github.com/modelcontextprotocol/python-sdk/issues/398

相关推荐

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Contraband Interactive
  • Emulating Dr. Jordan B. Peterson's style in providing life advice and insights.

  • rustassistant.com
  • Your go-to expert in the Rust ecosystem, specializing in precise code interpretation, up-to-date crate version checking, and in-depth source code analysis. I offer accurate, context-aware insights for all your Rust programming questions.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • Mintplex-Labs
  • 带有内置抹布,AI代理,无代理构建器,MCP兼容性等的多合一桌面和Docker AI应用程序。

  • modelcontextprotocol
  • 模型上下文协议服务器

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • n8n-io
  • 具有本机AI功能的公平代码工作流程自动化平台。将视觉构建与自定义代码,自宿主或云相结合,400+集成。

  • WangRongsheng
  • 🧑‍🚀 llm 资料总结(数据处理、模型训练、模型部署、 o1 模型、mcp 、小语言模型、视觉语言模型)|摘要世界上最好的LLM资源。

  • metorial
  • 数百个MCP服务器的容器化版本📡📡

  • open-webui
  • 用户友好的AI接口(支持Ollama,OpenAi API,...)

    Reviews

    1 (1)
    Avatar
    user_RMc3s2tW
    2025-04-18

    As an avid user of mcp_server, I am thoroughly impressed by its robustness and ease of use. Developed by tikoehle, this server application is a must-have for anyone needing a reliable solution for server management. Its seamless integration and user-friendly interface have significantly enhanced my efficiency. Highly recommended! For more details, visit the [mcp_server GitHub page](https://github.com/tikoehle/mcp_server).