About MCP Servers Learning Project
A collection of MCP server and client examples for learners, spanning introductory implementations and more involved server topics. Examples cover Python, TypeScript, documentation serving, and terminal command tools.
Key features
- 01Python and TypeScript client examples
- 02Weather information server examples
- 03Documentation retrieval and serving server
- 04Terminal command execution tool
- 05Examples of error handling and resource management
Use cases
- 01Learn how to connect to MCP servers
- 02Build a weather information MCP server
- 03Explore ways to serve documentation resources
- 04Practice implementing a terminal tool with input validation
MCP support
The project contains several MCP server and client examples. Its servers expose weather information, documentation resources, or terminal command execution tools to MCP clients.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEMCP Servers Learning Project
This repository contains examples and implementations of Model Context Protocol (MCP) servers and clients. MCP is a protocol that allows LLMs like Claude to interact with external tools and data sources in a standardized way.
Project Structure
The repository is organized into several modules, each focusing on different aspects of MCP:
1. Quickstart Resources
The 1_quickstart-resources directory contains sample implementations of MCP clients and servers to help you get started:
- mcp-client-python: A Python client implementation for connecting to MCP servers
- mcp-client-typescript: A TypeScript client implementation for connecting to MCP servers
- weather-server-python: A sample Python MCP server that provides weather information
- weather-server-typescript: A sample TypeScript MCP server that provides weather information
These examples demonstrate basic MCP concepts and provide starting points for your own implementations.
2. MCP Documentation Server
The 2_mcpdoc directory contains a specialized MCP server for serving documentation:
- Implements an MCP server that can retrieve and serve documentation from various sources
- Includes configuration examples and a robust project structure
- Demonstrates advanced MCP concepts like error handling and resource management
3. Terminal Server
The 3_building_securing_and_containerizing_mcp_server directory contains a custom MCP server implementation that:
- Exposes a terminal command execution tool allowing access to system commands
- Provides a resource for accessing MCP documentation
- Demonstrates proper error handling and input validation
- Shows how to implement both tools and resources in a single server
Getting Started
Prerequisites
- Python 3.10 or higher
- MCP SDK 1.2.0 or higher
- For TypeScript examples: Node.js and npm
Installation
# For Python dependencies
uv add "mcp[cli]" httpx
# Or with pip
pip install "mcp[cli]" httpx
Running MCP Servers
You can run any of the MCP servers using:
# With Python directly
python <path_to_server.py>
# Or with the MCP CLI
mcp dev <path_to_server.py>
For example, to run the terminal server:
python 3_building_securing_and_containerizing_mcp_server/server.py
# Or
mcp dev 3_building_securing_and_containerizing_mcp_server/server.py
Connecting to Claude Desktop
To connect an MCP server to Claude Desktop:
mcp install <path_to_server.py>
Key Concepts
- Tools: Functions that can be called by Claude to execute code or produce side effects
- Resources: Data exposed to Claude that can be read and referenced
- Prompts: Templates for structuring interactions with Claude
Contributing
Feel free to extend and modify these examples for your own use cases. If you develop a useful MCP server, consider sharing it with the community!
Resources
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.