Skip to content

Latest commit

 

History

History
176 lines (144 loc) · 6.7 KB

File metadata and controls

176 lines (144 loc) · 6.7 KB

🚀 Model-Context-Protocol-101

Python License Build Status Dependencies

A step-by-step tutorial exploring the Model Context Protocol (MCP). This repository serves as a structured learning guide for AI/ML practitioners, consultants, and developers interested in practical MCP implementation.

Notebook demo


📌 Overview

This repository covers: ✔️ Setting up a Python virtual environment for isolated development.
✔️ Installing required dependencies using pip install -r requirements.txt.
✔️ Understanding MCP concepts with practical code examples.
✔️ Running Jupyter Notebooks for interactive experimentation.


🛠️ Getting Started

1️⃣ Clone the Repository

git clone https://github.com/itprodirect/Model-Context-Protocol-101.git
cd Model-Context-Protocol-101
Time Saver: Having the repo locally lets independent insurance agents run examples without repeated downloads.

2️⃣ Create a Virtual Environment

python -m venv venv
# On Mac/Linux
source venv/bin/activate
# On Windows
venv\Scripts\activate
Time Saver: Isolating dependencies avoids conflicts so independent agents spend less time troubleshooting setups.

3️⃣ Install Dependencies

pip install -r requirements.txt

This installs both third-party libraries and the local mcp101 package, so the CLI and utilities can be imported from anywhere in the project.

Time Saver: A single command installs everything needed so independent agents can start experimenting right away.

4️⃣ Run Jupyter Notebook

jupyter notebook notebooks/Model-Context-Protocol-101.ipynb
Time Saver: Interactive notebooks showcase MCP features without extra scripting, letting independent agents focus on results.

5️⃣ Run Tests

pytest
Time Saver: Quick tests confirm everything works so independent agents can iterate confidently.

🔑 Key Features

  • 🚀 MCP Server Setup: Learn how to initialize and expand an MCP tool.
  • 🔧 Function Expansion: Add custom tools and test them interactively.
  • 📂 CSV File Handling: Automate CSV file reading and data extraction.
  • 🎯 Practical Exercises: Hands-on coding exercises for better understanding.

🌟 Real-world Use Cases

Here are quick examples of how an independent insurance agent might apply MCP:

  • Automated Quotes – load policy data from a CSV and generate quotes in seconds.
  • Lead Tracking – triage new leads automatically using simple prompts.
  • Commission Insights – compute profits and commissions with a single command.

To explore these datasets yourself, open the notebook notebooks/Model-Context-Protocol-101.ipynb. It demonstrates how to load data/insurance_sales.csv and calculate totals. Commission screenshot You can also inspect the CSV quickly from the command line:

python - <<'EOF'
import pandas as pd
df = pd.read_csv('data/insurance_sales.csv')
print(df.head())
EOF

Architecture overview


📖 Usage Guide

This tutorial walks through how to: ✅ Initialize the MCP Server
Test MCP tools locally
Expand MCP with custom functions
Read and process CSV files
Deploy and use MCP tools efficiently

🔄 Workflow

Use the command-line interface to run common tasks directly from the terminal.

# Calculate profit from revenue and cost
mcp101-cli profit 1000 600

# Total commission from the sample dataset
mcp101-cli commission data/insurance_sales.csv

📂 Project Structure

Model-Context-Protocol-101/
├── src/                # Python utilities
├── notebooks/          # Jupyter notebooks
├── data/               # Sample datasets
├── docs/img/           # Diagrams and screenshots
├── tests/              # Unit tests
├── README.md           # Documentation
├── requirements.txt    # Dependencies
├── LICENSE             # Project License
└── AGENTS.md           # Contribution guide

📚 Glossary

Term Meaning
MCP Model Context Protocol, our tooling API
Lead Potential client for an insurance policy
Premium Amount a customer pays for coverage

📝 License

This project is licensed under the MIT License.


🤝 Contributing

Contributions are welcome! Feel free to fork the repo, submit pull requests, or suggest improvements.


📬 Contact

For questions or collaborations, connect with me on LinkedIn or open an Issue in this repository.


❓ Common Issues

Virtual environment won't activate Make sure you run python -m venv venv and then activate it with source venv/bin/activate on Mac/Linux or venv\Scripts\activate on Windows. Verify Python 3.10+ is installed.

Missing packages Run pip install -r requirements.txt from the project root while your virtual environment is active. This installs all dependencies, including Jupyter.

Notebook won't launch Activate your virtual environment and run jupyter notebook notebooks/Model-Context-Protocol-101.ipynb. If the command is not found, install Jupyter using pip install jupyter.


🔥 This README is designed for clarity, readability, and ease of navigation! 🚀