A beginner-friendly tutorial for building and using Model Context Protocol (MCP) servers with Python, LangChain, and Cerebras. Includes Stdio and SSE implementations for PDF interaction.
Model Context Protocol (MCP) Tutorial for Beginners 🚀
Welcome to the Ultimate Beginner's Guide to Model Context Protocol (MCP). This tutorial demonstrates how to build and connect MCP servers to chat with PDF documents using Python, LangChain, and Cerebras Cloud.
🏢 About HERE AND NOW AI
"AI is Good"
HERE AND NOW AI is dedicated to making artificial intelligence accessible and impactful. We specialize in cutting-edge AI research and development.
- Website: hereandnowai.com
- LinkedIn: hereandnowai
- Contact: info@hereandnowai.com | +91 996 296 1000
📘 Project Overview
This repository contains two types of MCP servers designed to serve a professional PDF profile:
- Stdio Server: For local usage (works with Claude Desktop).
- SSE Server: For remote usage via Web Browsers or Google Colab (using Server-Sent Events).
📁 Project Structure
stdio-server/: Local MCP server implementation (Line-by-line explanation).sse-server/: Web-capable MCP server implementation.mcp-client/: A Python client using LangChain and Cerebras (Line-by-line explanation).simple-bot/: A minimalist 8-line chatbot example.
🛠️ Setup Instructions
1. Prerequisites
- Python 3.10+
- A Cerebras Cloud API Key (Get it at cloud.cerebras.ai)
2. Installation
git clone https://github.com/hereandnowai/model-context-protocol-tutorial-for-beginners.git
cd model-context-protocol-tutorial-for-beginners
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
3. Environment Variables
Rename .env.example to .env and add your keys:
CEREBRAS_API_KEY=your_api_key_here
🚀 Running the Servers
Local Stdio Server
python stdio-server/main.py
Remote SSE Server
Start the server on port 3001:
python sse-server/main.py
To expose it to the internet (for Google Colab):
# Option: Localtunnel
lt --port 3001
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
📜 License
This project is licensed under the MIT License. See the LICENSE file for details.
© 2026 HERE AND NOW AI. All rights reserved.