- What is MCP?
- File Structure
- Installation
- Setting Up Your Environment
- Installing Required Libraries
- Creating an MCP Server
- Contributing
The Model Context Protocol (MCP) is a standardized framework designed to securely expose data and functionality to LLM applications. It functions similarly to a web API but is specifically tailored for interactions with large language models (LLMs). MCP servers provide three key capabilities:
- Resources: These act like GET endpoints, allowing the LLM to retrieve and load relevant data into its context.
- Tools: Comparable to POST endpoints, tools enable the execution of code or actions that produce side effects.
- Prompts: Reusable templates that define structured interaction patterns for the LLM.
The repository follows this structure:
Getting-Started-with-MCP/
│── .gitignore # Specifies untracked files to ignore
│── .python-version # Indicates the Python version used
│── README.md # Main project documentation
│── pyproject.toml # Project configuration and dependencies
│── requirements.txt # List of required Python packages
│── server.py # Main script to run the MCP server
│── uv.lock # Lock file for dependency management
To get started with MCP, first, install uv, an extremely fast Python package and project manager written in Rust:
pip install uvCreate a virtual environment using uv:
uv venvInitialize the project structure:
uv initAdd MCP CLI to your project:
uv add "mcp[cli]"Install all necessary libraries by running:
uv installLet's create a simple MCP server that exposes a tool for printing "Hello, World!".
Create a file server.py and install the MCP server:
mcp install server.pyYou can install this server in Claude Desktop and interact with it immediately by running:
mcp dev server.pyAlternatively, you can test it with the MCP Inspector for debugging and validation.
Using the Inspector Mode to test the code.
If you'd like to contribute to this project, follow these steps:
- Fork the Repository: Click the 'Fork' button at the top right of this repository.
- Clone the Repository: Clone your forked repo to your local machine.
git clone https://github.com/your-username/mcp-project.git
- Create a Branch: Create a new branch for your feature or bug fix.
git checkout -b feature-branch-name
- Make Changes: Implement your changes and commit them.
git commit -m "Description of changes" - Push to GitHub: Push your changes to your forked repository.
git push origin feature-branch-name
- Create a Pull Request: Open a pull request on the original repository.