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

  • 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.

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

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

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

  • apappascs
  • Descubra la colección más completa y actualizada de servidores MCP en el mercado. Este repositorio sirve como un centro centralizado, que ofrece un extenso catálogo de servidores MCP de código abierto y propietarios, completos con características, enlaces de documentación y colaboradores.

  • modelcontextprotocol
  • Servidores de protocolo de contexto modelo

  • Mintplex-Labs
  • La aplicación AI de escritorio todo en uno y Docker con trapo incorporado, agentes de IA, creador de agentes sin código, compatibilidad de MCP y más.

  • ShrimpingIt
  • Manipulación basada en Micrypthon I2C del expansor GPIO de la serie MCP, derivada de AdaFruit_MCP230xx

  • n8n-io
  • Plataforma de automatización de flujo de trabajo de código justo con capacidades de IA nativas. Combine el edificio visual con código personalizado, auto-anfitrión o nube, más de 400 integraciones.

  • open-webui
  • Interfaz de IA fácil de usar (admite Ollama, Operai API, ...)

  • WangRongsheng
  • 🧑‍🚀 全世界最好的 llM 资料总结(数据处理、模型训练、模型部署、 O1 模型、 MCP 、小语言模型、视觉语言模型) | Resumen de los mejores recursos del mundo.

    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).